Skip to content

Commit

Permalink
fix #3917
Browse files Browse the repository at this point in the history
 [genesisplusgx] "VDP mode" option (for eliminate region lockups / megakey behavior) #3917
  • Loading branch information
vadosnaprimer committed May 27, 2024
1 parent 0f20bff commit c65a11e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Binary file modified Assets/dll/gpgx.wbx.zst
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ public class GPGXSyncSettings
[DefaultValue(LibGPGX.Region.Autodetect)]
public LibGPGX.Region Region { get; set; }

[DisplayName("Force VDP Mode")]
[Description("Overrides the VDP mode to force it to run at either 60Hz (NTSC) or 50Hz (PAL), regardless of system region.")]
[DefaultValue(LibGPGX.ForceVDP.Disabled)]
public LibGPGX.ForceVDP ForceVDP { get; set; }

[DisplayName("Load BIOS")]
[Description("Indicates whether to load the system BIOS rom.")]
[DefaultValue(false)]
Expand Down Expand Up @@ -349,6 +354,7 @@ public LibGPGX.InitSettings GetNativeSettings(GameInfo game)
InputSystemA = SystemForSystem(ControlTypeLeft),
InputSystemB = SystemForSystem(ControlTypeRight),
Region = Region,
ForceVDP = ForceVDP,
LoadBIOS = LoadBIOS,
ForceSram = game["sram"],
SMSFMSoundChip = SMSFMSoundChip,
Expand Down
8 changes: 8 additions & 0 deletions src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ public enum Region : int
Japan_PAL = 4
}

public enum ForceVDP : int
{
Disabled = 0,
NTSC = 1,
PAL = 2
}

[StructLayout(LayoutKind.Sequential)]
public struct InitSettings
{
public uint BackdropColor;
public Region Region;
public ForceVDP ForceVDP;
public ushort LowPassRange;
public short LowFreq;
public short HighFreq;
Expand Down
5 changes: 3 additions & 2 deletions waterbox/gpgx/cinterface/cinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ struct InitSettings
{
uint32_t BackdropColor;
int32_t Region;
int32_t ForceVDP;
uint16_t LowPassRange;
int16_t LowFreq;
int16_t HighFreq;
Expand Down Expand Up @@ -917,8 +918,8 @@ GPGX_EX int gpgx_init(const char* feromextension,

/* system options */
config.system = 0; /* = AUTO (or SYSTEM_SG, SYSTEM_SGII, SYSTEM_SGII_RAM_EXT, SYSTEM_MARKIII, SYSTEM_SMS, SYSTEM_SMS2, SYSTEM_GG, SYSTEM_MD) */
config.region_detect = settings->Region; /* = AUTO (1 = USA, 2 = EUROPE, 3 = JAPAN/NTSC, 4 = JAPAN/PAL) */
config.vdp_mode = 0; /* = AUTO (1 = NTSC, 2 = PAL) */
config.region_detect = settings->Region; /* 0 = AUTO, 1 = USA, 2 = EUROPE, 3 = JAPAN/NTSC, 4 = JAPAN/PAL */
config.vdp_mode = settings->ForceVDP; /* 0 = AUTO, 1 = NTSC, 2 = PAL */
config.master_clock = 0; /* = AUTO (1 = NTSC, 2 = PAL) */
config.force_dtack = 0;
config.addr_error = 1;
Expand Down

0 comments on commit c65a11e

Please sign in to comment.