From 49beaca57cbde7583b0751d6a39fcd572b99ed02 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 14 Feb 2009 13:05:52 +0100 Subject: [PATCH] o add mem dump --- poc/poc_mmc/main.c | 86 +++++++++++++++----------------------- poc/poc_mmc/uart.c | 2 +- snes/simpletest/header.inc | 4 +- 3 files changed, 37 insertions(+), 55 deletions(-) diff --git a/poc/poc_mmc/main.c b/poc/poc_mmc/main.c index dbdab26..78718cf 100644 --- a/poc/poc_mmc/main.c +++ b/poc/poc_mmc/main.c @@ -108,10 +108,11 @@ int main(void) { uint8_t read, buf[10], i=0; uint8_t Buffer[512]; + uint8_t rbuf[24]; uint16_t Clustervar; - uint8_t Dir_Attrib = 0; - uint32_t Size = 0; + uint8_t Dir_Attrib = 0; + uint32_t Size = 0; DDRD=0x00; @@ -132,6 +133,10 @@ int main(void) SRAM_Write(0x00000001,0x42); SRAM_Write(0x00000003,0xee); + for(uint8_t a=0; a<250;a++){ + SRAM_Write(a,0x00); + } + //Initialisierung der MMC/SD-Karte ANFANG: while ( mmc_init() !=0) //ist der Rückgabewert ungleich NULL ist ein Fehler aufgetreten @@ -169,60 +174,37 @@ int main(void) } } - for (uint8_t b=0;b<1;b++) + for (uint16_t b=0;b<65535;b++) { - for(uint8_t a=0; a<50;a++) + + uart_puts("\r\n0x"); + ltoa(b*24,buf,16); + uart_puts(buf); + uart_putc(' '); + uart_putc(' '); + for(uint8_t a=0; a<24;a++) { - uart_puts("\r\nRead RAM Addr 0x"); - ltoa(0x00023420+a,buf,16); - uart_puts(buf); - uart_puts(": "); - uart_putc(SRAM_Read(0x00023420+a)); + rbuf[a]=SRAM_Read(b*24+a); } - } - - uart_puts("\r\n\r\n"); - while(1){ - i++; - - uart_puts("\r\nDump RAM Addr 0x00000-0x00004: "); - - read = SRAM_Read(0x00000000); - itoa(read,buf,16); - uart_puts(buf); - uart_putc(0x20); - - read = SRAM_Read(0x00000001); - itoa(read,buf,16); - uart_puts(buf); - uart_putc(0x20); - - read = SRAM_Read(0x00000002); - itoa(read,buf,16); - uart_puts(buf); - uart_putc(0x20); - - read = SRAM_Read(0x00000003); - itoa(read,buf,16); - uart_puts(buf); - uart_putc(0x20); - - read = SRAM_Read(0x00000004); - itoa(read,buf,16); - uart_puts(buf); - uart_putc(0x20); - - if(i==2){ - uart_puts("\r\nWriting 0xBE,0xEF to 0x00002-0x00003.."); - SRAM_Write(0x00000002,0xBE); - SRAM_Write(0x00000003,0xEF); - } - if(i==3){ - while(1); - } - - } + for(uint8_t a=0; a<24;a++) + { + itoa(rbuf[a],buf,16); + uart_putc(' '); + if(rbuf[a]<0x10) + uart_putc('0'); + uart_puts(buf); + } + uart_puts(" | "); + for(uint8_t a=0; a<24;a++) + { + if(0x20 <= rbuf[a] && rbuf[a] <= 0x7e) + uart_putc(rbuf[a]); + else + uart_putc('.'); + } + } + while(1); return(0); } diff --git a/poc/poc_mmc/uart.c b/poc/poc_mmc/uart.c index 2c88bbe..73e1e30 100644 --- a/poc/poc_mmc/uart.c +++ b/poc/poc_mmc/uart.c @@ -10,7 +10,7 @@ // Folgende Zeile einkommentieren, falls FIFO verwendet werden soll // #include "fifo.h" -#define BAUDRATE 9600 +#define BAUDRATE 38400 #define F_CPU 8000000 #define nop() __asm volatile ("nop") diff --git a/snes/simpletest/header.inc b/snes/simpletest/header.inc index 0ff000f..5e2c655 100644 --- a/snes/simpletest/header.inc +++ b/snes/simpletest/header.inc @@ -26,7 +26,7 @@ LOROM CARTRIDGETYPE $00 ; $00 = ROM only, see WLA documentation for others - ROMSIZE $08 ; $08 = 2 Mbits, see WLA doc for more.. + ROMSIZE $08 ; $0 = 0.5 Mbits, see WLA doc for more.. SRAMSIZE $00 ; No SRAM see WLA doc for more.. COUNTRY $01 ; $01 = U.S. $00 = Japan, that's all I know LICENSEECODE $00 ; Just use $00 @@ -58,4 +58,4 @@ EmptyHandler: .ENDS -.EMPTYFILL $00 \ No newline at end of file +.EMPTYFILL $00