From 170ef9f5c69f484d3762d53f0a74bd2f090b6d63 Mon Sep 17 00:00:00 2001 From: David Voswinkel Date: Mon, 27 Jul 2009 16:55:48 +0200 Subject: [PATCH] cleanup code --- avr/usbload/main.c | 42 +++++++++++++++++++++--------------------- avr/usbload/sram.c | 3 +-- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/avr/usbload/main.c b/avr/usbload/main.c index 5913d24..ceaa44a 100644 --- a/avr/usbload/main.c +++ b/avr/usbload/main.c @@ -395,6 +395,10 @@ void boot_startup_rom(){ snes_irq_lo(); snes_irq_off(); + snes_lorom(); + printf("Set Snes lowrom \n"); + +/* printf("Set Snes hirom\n"); snes_hirom(); @@ -404,26 +408,25 @@ void boot_startup_rom(){ printf("IRQ off\n"); snes_irq_lo(); snes_irq_off(); - - decompress_rle(); - //dump_memory(0x00000, 0x000100); - //dump_memory(0x10000 - 0x100, 0x10000); +*/ decompress_rle(); - dump_memory(0x00000, 0x000100); dump_memory(0x10000 - 0x100, 0x10000); //crc_check_bulk_memory(0x00000, 0x10000, 0x8000); - - snes_bus_active(); - printf("Activate Snes bus\n"); - - _delay_ms(100); - printf("Reset Snes\n"); - snes_reset_on(); - snes_reset_lo(); - _delay_ms(2); + snes_reset_hi(); snes_reset_off(); + snes_irq_lo(); + snes_irq_off(); + printf("IRQ off\n"); + snes_hirom(); + snes_wr_disable(); + printf("Disable snes WR\n"); + snes_bus_active(); + printf("Activate Snes bus\n"); + _delay_ms(100); + printf("Reset Snes\n"); + send_reset(); i = 20; printf("Wait"); while (--i){ @@ -488,15 +491,9 @@ int main(void) uart_init(); stdout = &uart_stdout; + printf("Sytem start\n"); system_init(); - printf("Boot startup rom\n"); - boot_startup_rom(); - -#if 0 - wdt_init(); - printf("Watchdog init\n"); -#endif #if 0 test_read_write(); @@ -505,6 +502,9 @@ int main(void) while(1); #endif + printf("Boot startup rom\n"); + boot_startup_rom(); + usbInit(); usb_connect(); diff --git a/avr/usbload/sram.c b/avr/usbload/sram.c index 2bdb9d2..6d0678b 100644 --- a/avr/usbload/sram.c +++ b/avr/usbload/sram.c @@ -224,8 +224,7 @@ inline void sram_bulk_write_next(void) inline void sram_bulk_write( uint8_t data) { AVR_DATA_PORT = data; - -} + } void sram_bulk_write_end(void) {