add reset via usb and usb triggered avr/snes mode switching

This commit is contained in:
David Voswinkel
2009-07-09 00:54:02 +02:00
parent d7b82e2503
commit 0f9ebb146e
7 changed files with 97 additions and 53 deletions

View File

@@ -141,6 +141,11 @@ snesram_write_rom (const char *filename)
printf ("Press q to abort\n\n");
starttime = time (NULL);
cnt = usb_control_msg(handle,
USB_TYPE_VENDOR | USB_RECIP_DEVICE |
USB_ENDPOINT_OUT, USB_MODE_AVR, 0, 0, NULL,
0, 5000);
cnt = usb_control_msg(handle,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT,
@@ -197,7 +202,7 @@ snesram_write_rom (const char *filename)
#endif
cnt = usb_control_msg(handle,
USB_TYPE_VENDOR | USB_RECIP_DEVICE |
USB_ENDPOINT_OUT, USB_SNES_BOOT, 0, 0, NULL,
USB_ENDPOINT_OUT, USB_MODE_SNES, 0, 0, NULL,
0, 5000);

View File

@@ -34,7 +34,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#define USB_BULK_UPLOAD_ADDR 7
#define USB_BULK_UPLOAD_NEXT 8
#define USB_BULK_UPLOAD_END 9
#define USB_SNES_BOOT 10
#define USB_MODE_SNES 10
#define USB_MODE_AVR 11
#define USB_AVR_RESET 12
/* -------------------------- Device Description --------------------------- */