瀏覽代碼

worked on relocation

david 15 年之前
父節點
當前提交
69182c85b0
共有 2 個文件被更改,包括 15 次插入11 次删除
  1. 7 2
      snes/fatfstest/Makefile
  2. 8 9
      snes/fatfstest/main.c

+ 7 - 2
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 \

+ 8 - 9
snes/fatfstest/main.c

@@ -1,9 +1,9 @@
+#include "ff.h"
 
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
-#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;