diff --git a/Config/Project64.rdb b/Config/Project64.rdb index ce2dbb1d9..5966b07e6 100644 --- a/Config/Project64.rdb +++ b/Config/Project64.rdb @@ -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) diff --git a/Source/Project64/Multilanguage/Language Class.cpp b/Source/Project64/Multilanguage/Language Class.cpp index d9ba7ca31..dab71accb 100644 --- a/Source/Project64/Multilanguage/Language Class.cpp +++ b/Source/Project64/Multilanguage/Language Class.cpp @@ -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 diff --git a/Source/Project64/N64 System/Mips/Dma.cpp b/Source/Project64/N64 System/Mips/Dma.cpp index 2ecf4e835..d1a4e71af 100644 --- a/Source/Project64/N64 System/Mips/Dma.cpp +++ b/Source/Project64/N64 System/Mips/Dma.cpp @@ -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) { diff --git a/Source/Project64/N64 System/Mips/Sram.cpp b/Source/Project64/N64 System/Mips/Sram.cpp index fc70b7f96..d1f588691 100644 --- a/Source/Project64/N64 System/Mips/Sram.cpp +++ b/Source/Project64/N64 System/Mips/Sram.cpp @@ -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);