From 69182c85b0ffba9434e7715ceb317f9224261806 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 4 Jun 2009 16:52:45 +0200 Subject: [PATCH] worked on relocation --- snes/fatfstest/Makefile | 9 +++++++-- snes/fatfstest/main.c | 17 ++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/snes/fatfstest/Makefile b/snes/fatfstest/Makefile index 345aaab..a1c780c 100644 --- a/snes/fatfstest/Makefile +++ b/snes/fatfstest/Makefile @@ -28,7 +28,7 @@ LIBS=-L$(SDK)/lib/cc #-L$(SDK)/lib/c134 -OBJS=StartupSnes.obj main.obj pad.obj PPU.obj debug.obj ressource.obj diskio.obj ff.obj +OBJS=hook.obj StartupSnes.obj main.obj pad.obj PPU.obj debug.obj ressource.obj diskio.obj ff.obj APP=fatfs.smc GFX=debugfont @@ -56,12 +56,17 @@ StartupSnes.obj: StartupSnes.asm ressource.obj: ressource.asm $(AS) -V $? +hook.obj: hook.asm + $(AS) -V $? + + + %.obj: %.c $(CC) -wl -wp -sop -MC -I $(INC) $? $(APP): $(OBJS) $(LD) -HB -M21 -V -T -Pff \ - -C008000,0000 -U0000,0000 \ + -C008000,000000 -U000000,000000 \ -Avectors=FFE4,7FE4 \ -Aregistration_data=FFB0,7FB0 \ -Aressource=3f8000,8000 \ diff --git a/snes/fatfstest/main.c b/snes/fatfstest/main.c index b22d37a..172d4e0 100644 --- a/snes/fatfstest/main.c +++ b/snes/fatfstest/main.c @@ -1,9 +1,9 @@ +#include "ff.h" #include #include #include -#include "ff.h" #include "data.h"; #include "pad.h"; #include "event.h"; @@ -22,9 +22,13 @@ o relocate main code o exec loaded file */ +//#pragma section CODE=BANK2,offset $2:0000 +#define ROM_NAME "SUPER02.SMC" +#define BLOCK_SIZE 512 + padStatus pad1; -unsigned long addr; + DWORD acc_size; /* Work register for fs command */ WORD acc_files, acc_dirs; @@ -39,13 +43,9 @@ UINT s1, s2, cnt; FATFS *fs; DIR dir; /* Directory object */ -FIL file1; +FIL file1,file2; -#define ROM_NAME "BANK01.SMC" -#define BLOCK_SIZE 512 - -//#pragma section CODE=BANK2,offset $2:0000 void initInternalRegisters(void) { @@ -232,8 +232,7 @@ void main(void) { put_rc(f_open(&file1, ROM_NAME, FA_READ)); - addr = 0x020000; - p1 = 1024 * 31; + p1 = 1024 * 16; p2 = 0; while (p1) { cnt = BLOCK_SIZE;