Merge pull request #721 from Nekokabu/master

Support Dezaemon 3D saves (SRAM 96KB)
This commit is contained in:
zilmar 2015-10-31 06:34:44 +11:00
commit c44ecf09fa
4 changed files with 13 additions and 3 deletions

View File

@ -1430,6 +1430,7 @@ Plugin Note=[video] unsupported
Good Name=Dezaemon 3D (J)
Internal Name=DEZAEMON3D
Status=Compatible
Save Type=Sram
[FD73F775-9724755A-C:50]
Good Name=Diddy Kong Racing (E) (M3) (V1.0)

View File

@ -315,7 +315,7 @@ void CLanguage::LoadDefaultStrings (void)
DEF_STR(SAVE_FIRST_USED, L"Use first-used save type");
DEF_STR(SAVE_4K_EEPROM, L"4-kbit EEPROM");
DEF_STR(SAVE_16K_EEPROM, L"16-kbit EEPROM");
DEF_STR(SAVE_SRAM, L"32-kbyte SRAM");
DEF_STR(SAVE_SRAM, L"SRAM");
DEF_STR(SAVE_FLASHRAM, L"Flash RAM");
//Shell Integration Tab

View File

@ -101,7 +101,7 @@ void CDMA::PI_DMA_READ()
return;
}
if ( g_Reg->PI_CART_ADDR_REG >= 0x08000000 && g_Reg->PI_CART_ADDR_REG <= 0x08010000)
if ( g_Reg->PI_CART_ADDR_REG >= 0x08000000 && g_Reg->PI_CART_ADDR_REG <= 0x08088000)
{
if (g_System->m_SaveUsing == SaveChip_Auto)
{
@ -169,7 +169,7 @@ void CDMA::PI_DMA_WRITE()
return;
}
if ( g_Reg->PI_CART_ADDR_REG >= 0x08000000 && g_Reg->PI_CART_ADDR_REG <= 0x08010000)
if ( g_Reg->PI_CART_ADDR_REG >= 0x08000000 && g_Reg->PI_CART_ADDR_REG <= 0x08088000)
{
if (g_System->m_SaveUsing == SaveChip_Auto)
{

View File

@ -63,6 +63,10 @@ void CSram::DmaFromSram(BYTE * dest, int StartOffset, int len)
return;
}
}
// Fix Dezaemon 3D saves
StartOffset = ((StartOffset >> 3) & 0xFFFF8000) | (StartOffset & 0x7FFF);
DWORD Offset = StartOffset & 3;
if (Offset == 0)
@ -145,7 +149,12 @@ void CSram::DmaToSram(BYTE * Source, int StartOffset, int len)
return;
}
}
// Fix Dezaemon 3D saves
StartOffset = ((StartOffset >> 3) & 0xFFFF8000) | (StartOffset & 0x7FFF);
DWORD Offset = StartOffset & 3;
if (Offset == 0)
{
SetFilePointer(m_hFile, StartOffset, NULL, FILE_BEGIN);