Skip to content

Commit

Permalink
puae: support region changes
Browse files Browse the repository at this point in the history
by user at the start and by the game on the fly
todo: ntsc par (pal par is 1:1)
  • Loading branch information
vadosnaprimer committed Oct 24, 2024
1 parent 703955f commit 90287b3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
Binary file modified Assets/dll/puae.wbx.zst
Binary file not shown.
17 changes: 17 additions & 0 deletions src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.ISettable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public enum Chipset
Auto
}

public enum VideoStandard
{
PAL,
NTSC
}

public enum ChipMemory
{
[Display(Name = "512KB")]
Expand Down Expand Up @@ -224,6 +230,12 @@ private void CreateArguments(PUAESyncSettings settings)
AppendSetting("fastmem_size=" + settings.FastMemory);
}

if (settings.Region == VideoStandard.NTSC)
{
AppendSetting("ntsc=true");
VsyncNumerator = 60;
}

AppendSetting("input.mouse_speed=" + settings.MouseSpeed);
AppendSetting("sound_stereo_separation=" + settings.StereoSeparation / 10);
}
Expand Down Expand Up @@ -335,6 +347,11 @@ public class PUAESyncSettings
[TypeConverter(typeof(ConstrainedIntConverter))]
public int FloppyDrives { get; set; }

[DisplayName("Video standard")]
[Description("Determines resolution and framerate.")]
[DefaultValue(VideoStandard.PAL)]
public VideoStandard Region { get; set; }

public PUAESyncSettings()
=> SettingsUtil.SetDefaultValues(this);

Expand Down
5 changes: 5 additions & 0 deletions src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ protected override LibWaterboxCore.FrameInfo FrameAdvancePrep(IController contro
return fi;
}

protected override void FrameAdvancePost()
{
VsyncNumerator = BufferHeight == LibPUAE.NTSC_HEIGHT ? 60 : 50;
}

protected override void SaveStateBinaryInternal(BinaryWriter writer)
{
writer.Write(_ejectPressed);
Expand Down
5 changes: 3 additions & 2 deletions waterbox/uae/bizhawk.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ ECL_EXPORT bool Init(int argc, char **argv)

ECL_EXPORT void FrameAdvance(MyFrameInfo* f)
{
f->base.Width = 720;
f->base.Height = 576;
bool is_ntsc = minfirstline == VBLANK_ENDLINE_NTSC;
f->base.Width = PUAE_VIDEO_WIDTH;
f->base.Height = is_ntsc ? PUAE_VIDEO_HEIGHT_NTSC : PUAE_VIDEO_HEIGHT_PAL;
sound_buffer = f->base.SoundBuffer;
thisframe_y_adjust = minfirstline;
visible_left_border = retro_max_diwlastword - retrow;
Expand Down

0 comments on commit 90287b3

Please sign in to comment.