David Voswinkel пре 15 година
родитељ
комит
170ef9f5c6
2 измењених фајлова са 20 додато и 21 уклоњено
  1. 19 19
      avr/usbload/main.c
  2. 1 2
      avr/usbload/sram.c

+ 19 - 19
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_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");
-    snes_reset_on();
-    snes_reset_lo();
-    _delay_ms(2);
-    snes_reset_hi();
-    snes_reset_off();
+    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();
     

+ 1 - 2
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)
 {