Skip to content

Commit

Permalink
DEV9: Fix HDD Response when no HDD is connected
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Feb 3, 2024
1 parent 72bc826 commit 2e95e59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions pcsx2/DEV9/ATA/ATA_State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,10 @@ u16 ATA::Read16(u32 addr)
[[fallthrough]];
case ATA_R_ALT_STATUS:
//DevCon.WriteLn("DEV9: *ATA_R_ALT_STATUS 16bit read at address % x, value % x, Active %s", addr, regStatus, (GetSelectedDevice() == 0) ? " True " : " False ");

if (!EmuConfig.DEV9.HddEnable)
return 0xff7f; // PS2 confirmed response when no HDD is actually connected. The Expansion bay always says HDD support is connected.

//raise IRQ?
if (GetSelectedDevice() != 0)
return 0;
Expand Down
11 changes: 7 additions & 4 deletions pcsx2/DEV9/DEV9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ u16 DEV9read16(u32 addr)
{
return dev9.ata->Read16(addr);
}

if (addr >= SMAP_REGBASE && addr < FLASH_REGBASE)
{
//smap
Expand Down Expand Up @@ -419,16 +420,18 @@ u16 DEV9read16(u32 addr)
return hard;

case SPD_R_REV_3:
if (EmuConfig.DEV9.HddEnable)
hard |= SPD_CAPS_ATA;
// The Expansion bay always says HDD and Ethernet are supported, we need to keep HDD enabled and we handle it elsewhere.
// Ethernet we will turn off as not sure on what that would do right now, but no known game cares if it's off.
if (EmuConfig.DEV9.EthEnable)
hard |= SPD_CAPS_SMAP;
hard |= SPD_CAPS_FLASH;

// TODO: Do we need flash? my 50003 model doesn't report this, but it does report DVR capable aka (1<<4), was that intended?
hard |= SPD_CAPS_ATA | SPD_CAPS_FLASH;
//DevCon.WriteLn("DEV9: SPD_R_REV_3 16bit read %x", hard);
return hard;

case SPD_R_0e:
hard = 0x0002; //Have HDD inserted
hard = 0x0002; //Have HDD module inserted
DevCon.WriteLn("DEV9: SPD_R_0e 16bit read %x", hard);
return hard;
case SPD_R_XFR_CTRL:
Expand Down

0 comments on commit 2e95e59

Please sign in to comment.