Add Dreamcast 32MB RAM Mod (#1198)

This commit is contained in:
Colton Pawielski 2023-09-22 02:10:44 -07:00 committed by GitHub
parent 2445739c0e
commit a7dbbbe578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 3 deletions

View File

@ -121,6 +121,7 @@ Option<int> GDBPort("Debug.GDBPort", debugger::DEFAULT_PORT);
Option<bool> GDBWaitForConnection("Debug.GDBWaitForConnection");
Option<bool> UseReios("UseReios");
Option<bool> FastGDRomLoad("FastGDRomLoad", false);
Option<bool> RamMod32MB("Dreamcast.RamMod32MB", false);
Option<bool> OpenGlChecks("OpenGlChecks", false, "validate");

View File

@ -480,6 +480,7 @@ extern Option<int> GDBPort;
extern Option<bool> GDBWaitForConnection;
extern Option<bool> UseReios;
extern Option<bool> FastGDRomLoad;
extern Option<bool> RamMod32MB;
extern Option<bool> OpenGlChecks;

View File

@ -420,7 +420,7 @@ static void setPlatform(int platform)
switch (platform)
{
case DC_PLATFORM_DREAMCAST:
settings.platform.ram_size = 16_MB;
settings.platform.ram_size = config::RamMod32MB ? 32_MB : 16_MB;
settings.platform.vram_size = 8_MB;
settings.platform.aram_size = 2_MB;
settings.platform.bios_size = 2_MB;

View File

@ -2423,6 +2423,11 @@ static void gui_display_settings()
OptionCheckbox("Serial Console", config::SerialConsole,
"Dump the Dreamcast serial console to stdout");
#endif
{
DisabledScope scope(game_started);
OptionCheckbox("Dreamcast 32MB RAM Mod", config::RamMod32MB,
"Enables 32MB RAM Mod for Dreamcast. May affect compatibility");
}
OptionCheckbox("Dump Textures", config::DumpTextures,
"Dump all textures into data/texdump/<game id>");

View File

@ -67,7 +67,8 @@ public:
V39,
V40,
V41,
Current = V41,
V42,
Current = V42,
Next = Current + 1,
};
@ -101,6 +102,15 @@ public:
throw Exception("Unsupported version");
if (_version > Current)
throw Exception("Version too recent");
if(_version >= V42 && settings.platform.isConsole())
{
u32 ramSize;
deserialize(ramSize);
if (ramSize != settings.platform.ram_size) {
throw Exception("Selected RAM Size doesn't match Save State");
}
}
}
template<typename T>
@ -162,6 +172,8 @@ public:
{
Version v = Current;
serialize(v);
if (settings.platform.isConsole())
serialize(settings.platform.ram_size);
}
template<typename T>

View File

@ -689,6 +689,20 @@ struct retro_core_option_v2_definition option_defs_us[] = {
"disabled",
#endif
},
{
CORE_OPTION_NAME "_dc_32mb_mod",
"Dreamcast 32MB RAM Mod",
NULL,
"Enables 32MB RAM Mod for Dreamcast. May affect compatibility",
NULL,
"hacks",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled",
},
{
CORE_OPTION_NAME "_sh4clock",
"SH4 CPU under/overclock",

View File

@ -101,6 +101,7 @@ Option<bool> UseReios(CORE_OPTION_NAME "_hle_bios");
Option<bool> OpenGlChecks("", false);
Option<bool> FastGDRomLoad(CORE_OPTION_NAME "_gdrom_fast_loading", false);
Option<bool> RamMod32MB(CORE_OPTION_NAME "_dc_32mb_mod", false);
//Option<std::vector<std::string>, false> ContentPath("");
//Option<bool, false> HideLegacyNaomiRoms("", true);

View File

@ -32,7 +32,7 @@ TEST_F(SerializeTest, SizeTest)
std::vector<char> data(30000000);
Serializer ser(data.data(), data.size());
dc_serialize(ser);
ASSERT_EQ(28191378u, ser.size());
ASSERT_EQ(28191382u, ser.size());
}