diff --git a/avr/usbload/Makefile b/avr/usbload/Makefile index 99ce99a..8fe7997 100644 --- a/avr/usbload/Makefile +++ b/avr/usbload/Makefile @@ -31,7 +31,7 @@ CONVERT_ZIP = ../../scripts/conv_zip.py ifeq ($(DEBUG),1) - LDFLAGS =-Wl,-u,vfprintf -lprintf_flt + LDFLAGS =-Wl,-u,vfprintf CFLAGS =-Iusbdrv -I. -DDEBUG_LEVEL=0 OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o \ main.o usb_bulk.o uart.o fifo.o sram.o crc.o debug.o \ diff --git a/avr/usbload/command.c b/avr/usbload/command.c index d67ffdf..bd4fff2 100644 --- a/avr/usbload/command.c +++ b/avr/usbload/command.c @@ -66,8 +66,8 @@ void boot_startup_rom(uint16_t init_delay) info_P(PSTR("Fetch loader rom\n")); system_set_bus_avr(); - snes_irq_lo(); - system_snes_irq_off(); + //snes_irq_lo(); + //system_snes_irq_off(); system_set_rom_lorom(); //info_P(PSTR("Activate AVR bus\n")); @@ -107,7 +107,12 @@ void boot_startup_rom(uint16_t init_delay) system_send_snes_reset(); - _delay_ms(init_delay); + info_P(PSTR("Move Loader to wram")); + for (i=0;i<30;i++){ + _delay_ms(20); + info_P(PSTR(".")); + } + info_P(PSTR("\n")); } void banner(){ diff --git a/avr/usbload/config.h b/avr/usbload/config.h index 318f29c..d51bf05 100644 --- a/avr/usbload/config.h +++ b/avr/usbload/config.h @@ -51,8 +51,8 @@ #define DO_CRC_CHECK_LOADER 0 #define DO_CRC_CHECK 0 #define DO_SHM_SCRATCHPAD 1 -#define DO_SHM 1 -#define DO_TIMER 1 -#define DO_SHELL 0 +#define DO_SHM 0 +#define DO_TIMER 0 +#define DO_SHELL 1 #endif diff --git a/avr/usbload/main.c b/avr/usbload/main.c index 35d66ae..50491cc 100644 --- a/avr/usbload/main.c +++ b/avr/usbload/main.c @@ -58,7 +58,6 @@ extern system_t system; uint8_t debug_level = (DEBUG | DEBUG_USB | DEBUG_CRC); - usb_transaction_t usb_trans; usbMsgLen_t usbFunctionSetup(uchar data[8]) @@ -259,16 +258,8 @@ int main(void) usb_connect(); sei(); while (1) { - system_set_bus_avr(); system_set_wr_disable(); -/* - avr_bus_active(); - info_P(PSTR("Activate AVR bus\n")); - info_P(PSTR("Disable SNES WR\n")); - snes_wr_disable(); -*/ - info_P(PSTR("USB poll\n")); while (usb_trans.req_state != REQ_STATUS_SNES) { usbPoll(); #if DO_SHELL @@ -297,17 +288,6 @@ int main(void) system_set_bus_snes(); system_send_snes_reset(); irq_stop(); -/* - info_P(PSTR("-->Switch TO SNES\n")); - set_rom_mode(); - snes_wr_disable(); - info_P(PSTR("Disable SNES WR\n")); - snes_bus_active(); - info_P(PSTR("Activate SNES bus\n")); - irq_stop(); - send_reset(); -*/ - info_P(PSTR("Poll USB\n")); while ((usb_trans.req_state != REQ_STATUS_AVR)) { usbPoll(); #if DO_SHELL @@ -316,18 +296,16 @@ int main(void) #endif #endif } - //info_P(PSTR("-->Switch TO AVR\n")); + info_P(PSTR("-->Switch TO AVR\n")); shared_memory_init(); + irq_init(); if(usb_trans.loader_enabled) { - boot_startup_rom(500); + boot_startup_rom(50); } else { system_set_bus_avr(); system_send_snes_reset(); - //avr_bus_active(); - //send_reset(); - } - irq_init(); + globals_init(); } return 0; }