Skip to content

Commit

Permalink
Import 56c5b42
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Dec 13, 2024
1 parent 5f7d336 commit 75c00cd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ using UNFLoader.

#define ED_REGKEY 0xAA55

#define ED25_VERSION 0xED640007
#define ED3_VERSION 0xED640008
#define ED7_VERSION 0xED640013
#define ED25_VERSION 0xED640007 // V2.5
#define ED3_VERSION 0xED640008 // V3
#define EDX_VERSION 0xED640013 // X7, X5


/*********************************
Expand Down Expand Up @@ -518,11 +518,16 @@ static void usb_findcart(void)
return;

// Check if we have an EverDrive
if (buff == ED7_VERSION || buff == ED3_VERSION)
if (buff == EDX_VERSION || buff == ED3_VERSION)
{
// Set the USB mode
usb_io_write(ED_REG_SYSCFG, 0);
usb_io_write(ED_REG_USBCFG, ED_USBMODE_RDNOP);

// If the USB unit is powered off, it means that this is a
// X variant without USB support (X5).
if ((usb_io_read(ED_REG_USBCFG) & ED_USBSTAT_POWER) == 0)
return;

// Set the cart to EverDrive
usb_cart = CART_EVERDRIVE;
Expand Down

0 comments on commit 75c00cd

Please sign in to comment.