mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
make invalid SPI memory commands return 0xFF. fixes #1366 (Dementium II checks the results of RDSR, RDID and cmd 00 to determine what kind of backup memory is present)
This commit is contained in:
parent
5415f8a746
commit
3756f3cb1f
@ -529,17 +529,17 @@ u8 CartRetail::SPIWrite(u8 val, u32 pos, bool last)
|
|||||||
{
|
{
|
||||||
case 0x04: // write disable
|
case 0x04: // write disable
|
||||||
SRAMStatus &= ~(1<<1);
|
SRAMStatus &= ~(1<<1);
|
||||||
break;
|
return 0;
|
||||||
case 0x06: // write enable
|
case 0x06: // write enable
|
||||||
SRAMStatus |= (1<<1);
|
SRAMStatus |= (1<<1);
|
||||||
break;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
SRAMCmd = val;
|
SRAMCmd = val;
|
||||||
SRAMAddr = 0;
|
SRAMAddr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (SRAMType)
|
switch (SRAMType)
|
||||||
@ -547,7 +547,7 @@ u8 CartRetail::SPIWrite(u8 val, u32 pos, bool last)
|
|||||||
case 1: return SRAMWrite_EEPROMTiny(val, pos, last);
|
case 1: return SRAMWrite_EEPROMTiny(val, pos, last);
|
||||||
case 2: return SRAMWrite_EEPROM(val, pos, last);
|
case 2: return SRAMWrite_EEPROM(val, pos, last);
|
||||||
case 3: return SRAMWrite_FLASH(val, pos, last);
|
case 3: return SRAMWrite_FLASH(val, pos, last);
|
||||||
default: return 0;
|
default: return 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -628,7 +628,7 @@ u8 CartRetail::SRAMWrite_EEPROMTiny(u8 val, u32 pos, bool last)
|
|||||||
default:
|
default:
|
||||||
if (pos == 1)
|
if (pos == 1)
|
||||||
printf("unknown tiny EEPROM save command %02X\n", SRAMCmd);
|
printf("unknown tiny EEPROM save command %02X\n", SRAMCmd);
|
||||||
return 0;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -694,7 +694,7 @@ u8 CartRetail::SRAMWrite_EEPROM(u8 val, u32 pos, bool last)
|
|||||||
default:
|
default:
|
||||||
if (pos == 1)
|
if (pos == 1)
|
||||||
printf("unknown EEPROM save command %02X\n", SRAMCmd);
|
printf("unknown EEPROM save command %02X\n", SRAMCmd);
|
||||||
return 0;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -838,7 +838,7 @@ u8 CartRetail::SRAMWrite_FLASH(u8 val, u32 pos, bool last)
|
|||||||
default:
|
default:
|
||||||
if (pos == 1)
|
if (pos == 1)
|
||||||
printf("unknown FLASH save command %02X\n", SRAMCmd);
|
printf("unknown FLASH save command %02X\n", SRAMCmd);
|
||||||
return 0;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,6 +564,7 @@ void Write(u8 val, u32 hold)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
printf("unknown firmware SPI command %02X\n", CurCmd);
|
printf("unknown firmware SPI command %02X\n", CurCmd);
|
||||||
|
Data = 0xFF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user