Skip to content

Commit

Permalink
don't init gpgx trace buffer when not emulating genesis, more proper …
Browse files Browse the repository at this point in the history
…genesis bootrom firmware handling
  • Loading branch information
CasualPokePlayer committed May 1, 2024
1 parent 7d9483e commit f0a2ea1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void AddPatchAndMaybeReverse(FirmwarePatchOption fpo)
var jp_mcd_beta = File("F30D109D1C2F7C9FEAF38600C65834261DB73D1F", 131072, "MCD_jp_beta.bin", "Mega CD JP (Beta)");
var eu_mcd_221 = File("9DE4EDA59F544DB2D5FD7E6514601F7B648D8EB4", 131072, "MCD_eu_221.bin", "Mega CD EU (v2.21)");

FirmwareAndOption("1C470A9A8D0B211C5FEEA1C1C2376AA1F7934B16", 4096, "GEN", "TMSS", "TMSS.md", "Mega Drive TMSS Boot Rom (Japan)");
FirmwareAndOption("3F50B76B0529DB7F79C396B5E808CC0786FFC311", 2048, "GEN", "Boot", "GEN_boot.md", "Genesis Boot Rom (World)");

Firmware("GEN", "CD_BIOS_EU", "Mega CD Bios (Europe)");
Firmware("GEN", "CD_BIOS_JP", "Mega CD Bios (Japan)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private unsafe void SetMemoryDomains()
var name = Marshal.PtrToStringAnsi(pName)!;

// typically Genesis domains will be 2 bytes large (and thus big endian and byteswapped)
var oneByteWidth = name is "Z80 RAM" or "Main RAM" or "ROM" or "Cart (Volatile) RAM" or "SRAM";
var oneByteWidth = name is "Z80 RAM" or "Main RAM" or "ROM" or "BOOT ROM" or "Cart (Volatile) RAM" or "SRAM";

var endian = oneByteWidth
? MemoryDomain.Endian.Little
Expand Down
9 changes: 6 additions & 3 deletions src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,11 @@ public GPGX(CoreLoadParameters<GPGXSettings, GPGXSyncSettings> lp)

KillMemCallbacks();

_tracer = new GPGXTraceBuffer(this, _memoryDomains, this);
((BasicServiceProvider)ServiceProvider).Register(_tracer);
if (SystemId == VSystemID.Raw.GEN)
{
_tracer = new GPGXTraceBuffer(this, _memoryDomains, this);
((BasicServiceProvider)ServiceProvider).Register(_tracer);
}
}

_romfile = null;
Expand Down Expand Up @@ -261,7 +264,7 @@ private int load_archive(string filename, IntPtr buffer, int maxsize)

FirmwareID? firmwareID = filename switch
{
"MD_BIOS" => new(system: VSystemID.Raw.GEN, firmware: "TMSS"),
"MD_BIOS" => new(system: VSystemID.Raw.GEN, firmware: "Boot"),
"CD_BIOS_EU" => new(system: VSystemID.Raw.GEN, firmware: "CD_BIOS_EU"),
"CD_BIOS_JP" => new(system: VSystemID.Raw.GEN, firmware: "CD_BIOS_JP"),
"CD_BIOS_US" => new(system: VSystemID.Raw.GEN, firmware: "CD_BIOS_US"),
Expand Down

0 comments on commit f0a2ea1

Please sign in to comment.