Skip to content

Commit

Permalink
rename puae to uae
Browse files Browse the repository at this point in the history
while libretro initially ported original puae (which is long dead), they switched to just pulling updates from winuae every once in a while (and renamed to libretro-uae), because it's still active and is kinda considered golden standard these days
  • Loading branch information
vadosnaprimer committed Dec 14, 2024
1 parent 4274b75 commit 18078c8
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 107 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static Bitmap Icon(this IEmulator core)
MAME => Properties.Resources.Mame,
MGBAHawk => Properties.Resources.Mgba,
NDS => Properties.Resources.MelonDS,
PUAE => Properties.Resources.Amiga,
UAE => Properties.Resources.Amiga,
_ => null
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/BizHawk.Client.EmuHawk/MainForm.VSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1332,8 +1332,8 @@ ToolStripMenuItemEx CreateCoreSubmenu(VSystemCategory cat, string coreName, para
// PicoDrive
items.Add(CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.PicoDrive, CreateGenericCoreConfigItem<PicoDrive>(CoreNames.PicoDrive)));

// PUAE
items.Add(CreateCoreSubmenu(VSystemCategory.PCs, CoreNames.PUAE, CreateGenericCoreConfigItem<PUAE>(CoreNames.PUAE)));
// UAE
items.Add(CreateCoreSubmenu(VSystemCategory.PCs, CoreNames.UAE, CreateGenericCoreConfigItem<UAE>(CoreNames.UAE)));

// QuickNes
var quickNesGamepadSettingsItem = CreateSettingsItem("Controller Settings...", (_, _) => OpenQuickNesGamepadSettingsDialog(GetSettingsAdapterFor<QuickNES>()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

namespace BizHawk.Emulation.Cores.Computers.Amiga
{
public abstract class LibPUAE : LibWaterboxCore
public abstract class LibUAE : LibWaterboxCore
{
public const int PAL_WIDTH = 720;
public const int NTSC_WIDTH = PAL_WIDTH;
// the core renders 576 which is what libretro displays
// but default window height is 568 in original PUAE and WinUAE
// but default window height is 568 in original UAE and WinUAE
// this lets us hide a black line and a weird artifact that our A600 config has there
public const int PAL_HEIGHT = 568;
// WinUAE displays 484 lines for NTSC
// but libretro port only renders 482 and then only displays 480
public const int NTSC_HEIGHT = 482;
// libretro defines PUAE_VIDEO_HZ_PAL as 49.9204101562500000f
public const int PUAE_VIDEO_NUMERATOR_PAL = 102237;
public const int PUAE_VIDEO_DENOMINATOR_PAL = 2048;
// libretro defines PUAE_VIDEO_HZ_NTSC as 59.8260993957519531f
public const int PUAE_VIDEO_NUMERATOR_NTSC = 299130497;
public const int PUAE_VIDEO_DENOMINATOR_NTSC = 5000000;
// libretro defines UAE_VIDEO_HZ_PAL as 49.9204101562500000f
public const int UAE_VIDEO_NUMERATOR_PAL = 102237;
public const int UAE_VIDEO_DENOMINATOR_PAL = 2048;
// libretro defines UAE_VIDEO_HZ_NTSC as 59.8260993957519531f
public const int UAE_VIDEO_NUMERATOR_NTSC = 299130497;
public const int UAE_VIDEO_DENOMINATOR_NTSC = 5000000;

public const int FASTMEM_AUTO = -1;
public const int MAX_FLOPPIES = 4;
Expand Down Expand Up @@ -123,7 +123,7 @@ public enum AllButtons : short
}

// https://wiki.amigaos.net/wiki/Keymap_Library
public enum PUAEKeyboard : int
public enum UAEKeyboard : int
{
Key_Backquote = 0x00,
Key_1 = 0x01,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,85 +6,85 @@

namespace BizHawk.Emulation.Cores.Computers.Amiga
{
public partial class PUAE
public partial class UAE
{
private LibPUAE.ControllerType[] _ports { get; set; }
private static readonly (string Name, LibPUAE.AllButtons Button)[] _joystickMap = CreateJoystickMap();
private static readonly (string Name, LibPUAE.AllButtons Button)[] _cd32padMap = CreateCd32padMap();
private static readonly (string Name, LibPUAE.PUAEKeyboard Key)[] _keyboardMap = CreateKeyboardMap();
private LibUAE.ControllerType[] _ports { get; set; }
private static readonly (string Name, LibUAE.AllButtons Button)[] _joystickMap = CreateJoystickMap();
private static readonly (string Name, LibUAE.AllButtons Button)[] _cd32padMap = CreateCd32padMap();
private static readonly (string Name, LibUAE.UAEKeyboard Key)[] _keyboardMap = CreateKeyboardMap();

private static (string Name, LibPUAE.AllButtons Value)[] CreateJoystickMap()
private static (string Name, LibUAE.AllButtons Value)[] CreateJoystickMap()
{
var joystickMap = new List<(string, LibPUAE.AllButtons)>();
var joystickMap = new List<(string, LibUAE.AllButtons)>();
// ReSharper disable once LoopCanBeConvertedToQuery
foreach (var b in Enum.GetValues(typeof(LibPUAE.AllButtons)))
foreach (var b in Enum.GetValues(typeof(LibUAE.AllButtons)))
{
if (((short)b & LibPUAE.JoystickMask) == 0)
if (((short)b & LibUAE.JoystickMask) == 0)
continue;

var name = Enum.GetName(typeof(LibPUAE.AllButtons), b)!.Replace('_', ' ');
joystickMap.Add((name, (LibPUAE.AllButtons)b));
var name = Enum.GetName(typeof(LibUAE.AllButtons), b)!.Replace('_', ' ');
joystickMap.Add((name, (LibUAE.AllButtons)b));
}
return joystickMap.ToArray();
}

private static (string Name, LibPUAE.AllButtons Value)[] CreateCd32padMap()
private static (string Name, LibUAE.AllButtons Value)[] CreateCd32padMap()
{
var joystickMap = new List<(string, LibPUAE.AllButtons)>();
var joystickMap = new List<(string, LibUAE.AllButtons)>();
// ReSharper disable once LoopCanBeConvertedToQuery
foreach (var b in Enum.GetValues(typeof(LibPUAE.AllButtons)))
foreach (var b in Enum.GetValues(typeof(LibUAE.AllButtons)))
{
if (((short)b & LibPUAE.Cd32padMask) == 0)
if (((short)b & LibUAE.Cd32padMask) == 0)
continue;

var name = Enum.GetName(typeof(LibPUAE.AllButtons), b)!.Replace('_', ' ');
joystickMap.Add((name, (LibPUAE.AllButtons)b));
var name = Enum.GetName(typeof(LibUAE.AllButtons), b)!.Replace('_', ' ');
joystickMap.Add((name, (LibUAE.AllButtons)b));
}
return joystickMap.ToArray();
}

private static (string Name, LibPUAE.PUAEKeyboard Value)[] CreateKeyboardMap()
private static (string Name, LibUAE.UAEKeyboard Value)[] CreateKeyboardMap()
{
var keyboardMap = new List<(string, LibPUAE.PUAEKeyboard)>();
var keyboardMap = new List<(string, LibUAE.UAEKeyboard)>();
// ReSharper disable once LoopCanBeConvertedToQuery
foreach (var k in Enum.GetValues(typeof(LibPUAE.PUAEKeyboard)))
foreach (var k in Enum.GetValues(typeof(LibUAE.UAEKeyboard)))
{
var name = Enum.GetName(typeof(LibPUAE.PUAEKeyboard), k)!.Replace('_', ' ');
keyboardMap.Add((name, (LibPUAE.PUAEKeyboard)k));
var name = Enum.GetName(typeof(LibUAE.UAEKeyboard), k)!.Replace('_', ' ');
keyboardMap.Add((name, (LibUAE.UAEKeyboard)k));
}

return keyboardMap.ToArray();
}

private static ControllerDefinition CreateControllerDefinition(PUAESyncSettings settings)
private static ControllerDefinition CreateControllerDefinition(UAESyncSettings settings)
{
var controller = new ControllerDefinition("Amiga Controller");

for (int port = 1; port <= 2; port++)
{
LibPUAE.ControllerType type = port == 1
LibUAE.ControllerType type = port == 1
? settings.ControllerPort1
: settings.ControllerPort2;

switch (type)
{
case LibPUAE.ControllerType.Joystick:
case LibUAE.ControllerType.Joystick:
{
foreach (var (name, _) in _joystickMap)
{
controller.BoolButtons.Add($"P{port} {Inputs.Joystick} {name}");
}
break;
}
case LibPUAE.ControllerType.CD32_pad:
case LibUAE.ControllerType.CD32_pad:
{
foreach (var (name, _) in _cd32padMap)
{
controller.BoolButtons.Add($"P{port} {Inputs.Cd32Pad} {name}");
}
break;
}
case LibPUAE.ControllerType.Mouse:
case LibUAE.ControllerType.Mouse:
{
controller.BoolButtons.AddRange(
[
Expand All @@ -93,8 +93,8 @@ private static ControllerDefinition CreateControllerDefinition(PUAESyncSettings
$"P{port} {Inputs.MouseRightButton}"
]);
controller
.AddAxis($"P{port} {Inputs.MouseX}", 0.RangeTo(LibPUAE.PAL_WIDTH), LibPUAE.PAL_WIDTH / 2)
.AddAxis($"P{port} {Inputs.MouseY}", 0.RangeTo(LibPUAE.PAL_HEIGHT), LibPUAE.PAL_HEIGHT / 2);
.AddAxis($"P{port} {Inputs.MouseX}", 0.RangeTo(LibUAE.PAL_WIDTH), LibUAE.PAL_WIDTH / 2)
.AddAxis($"P{port} {Inputs.MouseY}", 0.RangeTo(LibUAE.PAL_HEIGHT), LibUAE.PAL_HEIGHT / 2);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace BizHawk.Emulation.Cores.Computers.Amiga
{
public partial class PUAE : IDriveLight
public partial class UAE : IDriveLight
{
public bool DriveLightEnabled { get; }
public bool DriveLightOn { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace BizHawk.Emulation.Cores.Computers.Amiga
{
public partial class PUAE : ISettable<object, PUAE.PUAESyncSettings>
public partial class UAE : ISettable<object, UAE.UAESyncSettings>
{
public enum MachineConfig
{
Expand Down Expand Up @@ -143,11 +143,11 @@ public enum FloppySpeed
Turbo = 0
}

private void CreateArguments(PUAESyncSettings settings)
private void CreateArguments(UAESyncSettings settings)
{
_args = new List<string>
{
"puae",
"uae",
};

switch(settings.MachineConfig)
Expand Down Expand Up @@ -238,7 +238,7 @@ private void CreateArguments(PUAESyncSettings settings)
AppendSetting("bogomem_size=" + (int)settings.SlowMemory);
}

if (settings.FastMemory != LibPUAE.FASTMEM_AUTO)
if (settings.FastMemory != LibUAE.FASTMEM_AUTO)
{
AppendSetting("fastmem_size=" + settings.FastMemory);
}
Expand All @@ -258,19 +258,19 @@ private void CreateArguments(PUAESyncSettings settings)

for (int port = 0; port <= 1; port++)
{
LibPUAE.ControllerType type = port == 0
LibUAE.ControllerType type = port == 0
? settings.ControllerPort1
: settings.ControllerPort2;

switch (type)
{
case LibPUAE.ControllerType.Joystick:
case LibUAE.ControllerType.Joystick:
AppendSetting($"joyport{port}mode=djoy");
break;
case LibPUAE.ControllerType.CD32_pad:
case LibUAE.ControllerType.CD32_pad:
AppendSetting($"joyport{port}mode=cd32joy");
break;
case LibPUAE.ControllerType.Mouse:
case LibUAE.ControllerType.Mouse:
AppendSetting($"joyport{port}mode=mouse");
break;
}
Expand Down Expand Up @@ -307,19 +307,19 @@ private void AppendSetting(string setting)
public object GetSettings() => null;
public PutSettingsDirtyBits PutSettings(object o) => PutSettingsDirtyBits.None;

private PUAESyncSettings _syncSettings;
public PUAESyncSettings GetSyncSettings()
private UAESyncSettings _syncSettings;
public UAESyncSettings GetSyncSettings()
=> _syncSettings.Clone();

public PutSettingsDirtyBits PutSyncSettings(PUAESyncSettings o)
public PutSettingsDirtyBits PutSyncSettings(UAESyncSettings o)
{
var ret = PUAESyncSettings.NeedsReboot(_syncSettings, o);
var ret = UAESyncSettings.NeedsReboot(_syncSettings, o);
_syncSettings = o;
return ret ? PutSettingsDirtyBits.RebootCore : PutSettingsDirtyBits.None;
}

[CoreSettings]
public class PUAESyncSettings
public class UAESyncSettings
{
[DisplayName("Machine configuration")]
[Description("")]
Expand Down Expand Up @@ -358,22 +358,22 @@ public class PUAESyncSettings

[DisplayName("Fast memory")]
[Description("Size in megabytes of fast-memory. -1 means Auto. Overrides machine configuration.")]
[Range(LibPUAE.FASTMEM_AUTO, 512)]
[DefaultValue(LibPUAE.FASTMEM_AUTO)]
[Range(LibUAE.FASTMEM_AUTO, 512)]
[DefaultValue(LibUAE.FASTMEM_AUTO)]
[TypeConverter(typeof(ConstrainedIntConverter))]
public int FastMemory { get; set; }

[DisplayName("Controller port 1")]
[Description("")]
[DefaultValue(LibPUAE.ControllerType.Mouse)]
[DefaultValue(LibUAE.ControllerType.Mouse)]
[TypeConverter(typeof(DescribableEnumConverter))]
public LibPUAE.ControllerType ControllerPort1 { get; set; }
public LibUAE.ControllerType ControllerPort1 { get; set; }

[DisplayName("Controller port 2")]
[Description("")]
[DefaultValue(LibPUAE.ControllerType.Joystick)]
[DefaultValue(LibUAE.ControllerType.Joystick)]
[TypeConverter(typeof(DescribableEnumConverter))]
public LibPUAE.ControllerType ControllerPort2 { get; set; }
public LibUAE.ControllerType ControllerPort2 { get; set; }

[DisplayName("Mouse speed")]
[Description("Mouse speed in percents (1% - 1000%). Adjust if there's mismatch between emulated and host mouse movement. Note that maximum mouse movement is still 127 pixels due to Amiga hardware limitations.")]
Expand Down Expand Up @@ -407,13 +407,13 @@ public class PUAESyncSettings
[TypeConverter(typeof(DescribableEnumConverter))]
public FloppySpeed FloppySpeed { get; set; }

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

public PUAESyncSettings Clone()
=> (PUAESyncSettings)MemberwiseClone();
public UAESyncSettings Clone()
=> (UAESyncSettings)MemberwiseClone();

public static bool NeedsReboot(PUAESyncSettings x, PUAESyncSettings y)
public static bool NeedsReboot(UAESyncSettings x, UAESyncSettings y)
=> !DeepEquality.DeepEquals(x, y);
}
}
Expand Down
Loading

0 comments on commit 18078c8

Please sign in to comment.