浏览代码

reduce compilter warnings

david 15 年之前
父节点
当前提交
483c89c337

+ 0 - 1
snes/fatfstest/Makefile

@@ -65,7 +65,6 @@ hook.obj: hook.asm
 	$(CC)  -wl -wp -sop -ML -I $(INC) $?
 
 $(APP): $(OBJS) 
-	echo "test"
 	$(LD) -B -HB -M21 -V -T -Pff \
         -C3e8000,1f0000 -U000000,000000 \
         -Avectors=FFE4,7FE4 \

+ 1 - 1
snes/fatfstest/config.h

@@ -20,4 +20,4 @@
 #define SHARED_ADDR     0x3d0000
 
 
-#undef MMIO_DEBUG
+#define MMIO_DEBUG

+ 3 - 2
snes/fatfstest/debug.c

@@ -1,5 +1,6 @@
 #include <string.h>
 #include <stdarg.h>
+#include <stdio.h>
 #include <fcntl.h>
 
 #include "debug.h"
@@ -93,7 +94,7 @@ void _print_console(const char *buffer){
 
 
 
-void printfc(char *fmt,...){
+void printfc(const char *fmt,...){
   va_list ap;
   va_start(ap,fmt);
   vsprintf(debug_buffer,fmt,ap);
@@ -103,7 +104,7 @@ void printfc(char *fmt,...){
 
 }
 
-void printfs(word y,char *fmt,...){
+void printfs(word y,const char *fmt,...){
   va_list ap;
   va_start(ap,fmt);
   vsprintf(screen_buffer,fmt,ap);

+ 2 - 2
snes/fatfstest/debug.h

@@ -2,7 +2,7 @@
 
 void debug_init(void);
 void debug_enable(void);
-void printfs(word y, char *fmt, ...);
-void printfc(char *fmt, ...);
+void printfs(word y, const char *fmt, ...);
+void printfc(const char *fmt, ...);
 void clears(void);
 void printc_packet(unsigned long addr, unsigned int len, byte * packet);

+ 3 - 3
snes/fatfstest/diskio.c

@@ -116,13 +116,13 @@ DRESULT disk_read (
     
     
     #ifdef MMIO_DEBUG
-    printfc("SNES::disk_read copy buffer to %06lx\n",SHARED_ADDR);
+    printfc("SNES::disk_read copy buffer to %lx\n",SHARED_ADDR);
     #endif
     for (i=0;i<(count*512);i++){
         buff[i]  = *(byte*)(SHARED_ADDR+i);
         #ifdef MMIO_DEBUG
-        if ( i < 8)
-          printfc("0x%02x ",buff[i]);
+        if ( i < 4)
+          printfc("0x%x ",buff[i]);
         #endif
     }
     #ifdef MMIO_DEBUG

+ 59 - 0
snes/fatfstest/dump_mrdo.txt

@@ -1,3 +1,7 @@
+#
+# Rom Dump
+#
+
 00000000  18 fb 78 c2 10 e2 20 a2  ff 01 9a a9 00 48 ab a9  |..x... ......H..|
 00000010  8f 8d 00 21 a9 03 9c 00  42 8d 01 21 9c 02 21 9c  |...!....B..!..!.|
 00000020  03 21 a9 09 8d 05 21 9c  06 21 9c 07 21 9c 08 21  |.!....!..!..!..!|
@@ -9,6 +13,9 @@
 00000080  1b 21 9c 1c 21 9c 1c 21  9c 1d 21 9c 1d 21 9c 1e  |.!..!..!..!..!..|
 00000090  21 8d 1e 21 9c 1f 21 9c  1f 21 9c 20 21 9c 20 21  |!..!..!..!. !. !|
 
+#
+# CRC Check
+#
 
 Bank: 0x01 Addr: 0x008000 Block: 0x0040 CRC 0xb8ec
 Bank: 0x02 Addr: 0x010000 Block: 0x0080 CRC 0x9b9b
@@ -18,3 +25,55 @@ Bank: 0x05 Addr: 0x028000 Block: 0x0140 CRC 0x9d0c
 Bank: 0x06 Addr: 0x030000 Block: 0x0180 CRC 0xf960
 Bank: 0x07 Addr: 0x038000 Block: 0x01c0 CRC 0x20ed
 Bank: 0x08 Addr: 0x040000 Block: 0x0200 CRC 0xe5a3
+
+#
+# Load
+#
+
+
+>fo mrdo.smc
+disk_read: sector=127 count=1 addr=0xb5fa1e00 off=65024 size=512
+disk_read: 41 61 00 6e
+disk_read: sector=128 count=1 addr=0xb5fa2000 off=65536 size=512
+disk_read: 41 62 00 61
+disk_read: sector=129 count=1 addr=0xb5fa2200 off=66048 size=512
+disk_read: 41 6b 00 69
+rc=0 FR_OK
+>fr 512
+disk_read: sector=13795 count=1 addr=0xb664e600 off=7063040 size=512
+disk_read: 18 fb 78 c2
+512 bytes read with 51200 bytes/sec.
+>bd
+00000000  18 FB 78 C2 10 E2 20 A2 FF 01 9A A9 00 48 AB A9 ..x... ......H..
+00000010  8F 8D 00 21 A9 03 9C 00 42 8D 01 21 9C 02 21 9C ...!....B..!..!.
+00000020  03 21 A9 09 8D 05 21 9C 06 21 9C 07 21 9C 08 21 .!....!..!..!..!
+00000030  9C 09 21 9C 0A 21 9C 0B 21 9C 0C 21 9C 0D 21 9C ..!..!..!..!..!.
+00000040  0D 21 9C 0E 21 9C 0E 21 9C 0F 21 9C 0F 21 9C 10 .!..!..!..!..!..
+00000050  21 9C 10 21 9C 11 21 9C 11 21 9C 12 21 9C 12 21 !..!..!..!..!..!
+00000060  9C 13 21 9C 13 21 9C 14 21 9C 14 21 A9 80 8D 15 ..!..!..!..!....
+00000070  21 9C 16 21 9C 17 21 9C 1A 21 9C 1B 21 A9 01 8D !..!..!..!..!...
+00000080  1B 21 9C 1C 21 9C 1C 21 9C 1D 21 9C 1D 21 9C 1E .!..!..!..!..!..
+00000090  21 8D 1E 21 9C 1F 21 9C 1F 21 9C 20 21 9C 20 21 !..!..!..!. !. !
+000000A0  9C 21 21 9C 23 21 9C 24 21 9C 25 21 9C 26 21 9C .!!.#!.$!.%!.&!.
+000000B0  27 21 9C 28 21 9C 29 21 9C 2A 21 9C 2B 21 9C 2C '!.(!.)!.*!.+!.,
+000000C0  21 9C 2D 21 9C 2E 21 9C 2F 21 A9 30 8D 30 21 9C !.-!..!./!.0.0!.
+000000D0  31 21 A9 E0 8D 32 21 9C 33 21 9C 00 42 A9 FF 8D 1!...2!.3!..B...
+000000E0  01 42 9C 02 42 9C 03 42 9C 04 42 9C 05 42 9C 06 .B..B..B..B..B..
+000000F0  42 9C 07 42 9C 08 42 9C 09 42 9C 0A 42 9C 0B 42 B..B..B..B..B..B
+00000100  9C 0C 42 A9 01 8D 0D 42 A2 00 00 74 00 E8 E0 1A ..B....B...t....
+00000110  01 D0 F8 9C 81 21 A9 20 8D 82 21 9C 83 21 A0 00 .....!. ..!..!..
+00000120  00 9C 80 21 C8 C0 00 E0 D0 F7 C2 30 A9 00 00 22 ...!.......0..."
+00000130  00 A0 80 A9 01 00 22 00 80 06 A0 00 00 A9 13 00 ......".........
+00000140  22 00 80 06 58 A2 00 00 E2 20 86 6C A9 8F 8D 00 "...X.... .l....
+00000150  21 A9 01 8D 00 42 A9 03 8D 01 21 9C 0C 42 9C 16 !....B....!..B..
+00000160  40 9C 17 40 9C 33 21 A9 80 8D 15 21 A9 17 8D 06 @..@.3!....!....
+00000170  01 9C 07 01 9C 08 01 9C 09 01 64 68 64 69 9C 0C ..........dhdi..
+00000180  01 9C 0A 01 9C 0B 01 C2 20 A9 08 10 85 72 64 5E ........ ....rd^
+00000190  64 5A 64 5C 64 8E 64 74 64 4A 64 4C 64 4E 64 50 dZd\d.dtdJdLdNdP
+000001A0  64 52 64 54 64 8C BF B9 81 00 85 00 BF BA 81 00 dRdTd...........
+000001B0  85 01 A2 FF 01 9A DC 00 00 4F 80 01 18 A2 01 56 .........O.....V
+000001C0  80 02 42 80 02 00 80 02 96 E7 01 08 C4 01 89 EE ..B.............
+000001D0  01 74 EF 01 00 80 01 22 57 82 00 E6 56 A5 5C 09 .t....."W...V.\.
+000001E0  01 00 85 5C A5 5A E6 38 E6 3A E6 3C C5 5A F0 F6 ...\.Z.8.:.<.Z..
+
+

+ 4 - 3
snes/fatfstest/main.c

@@ -250,18 +250,19 @@ void boot(void)
         }
         printfs(1 + bank, "BANK %X  ADDR %LX", bank, addr);
 
-        printfc("SNES::main: mem  %x %x %x %x %x\n",
+        printfc("SNES::main: mem  %x %x %x %x\n",
                 *(byte *) (addr + 0), *(byte *) (addr + 1),
                 *(byte *) (addr + 2), *(byte *) (addr + 3));
 
-#if 0
+#if 1
         printc_packet(addr, 512, (byte *) (addr));
+        wait();
 #endif
+        
         addr += s2;
         if (addr % 0x10000 == 0) {
             crc = crc_update_mem(crc_addr,0x8000);
             printfc("addr=%lx crc=%x\n",crc_addr,crc);
-            wait();
             printfs(1 + bank,"BANK %X ADDR %LX CRC %X",bank,addr,crc);
             addr += 0x8000;
             crc_addr+=0x8000;

+ 3 - 1
tools/ffsample/linux/diskio.c

@@ -94,8 +94,10 @@ DRESULT disk_read (
 
     DWORD offset = sector  * 512;
     int size = count * 512;
-    printf("disk_read: sector=%li count=%i addr=%p off=%li size=%i\n",sector,count,image_addr + offset,offset,size);
+
     memcpy(buff,image_addr + offset,size);
+    printf("disk_read: sector=%li count=%i addr=%p off=%li size=%i\n",sector,count,image_addr + offset,offset,size);
+    printf("disk_read: %02x %02x %02x %02x\n",buff[0],buff[1],buff[2],buff[3]);
     return RES_OK;
 }
 

二进制
tools/ffsample/linux/fftest