* nymashock wbx

* shit

* lagflag stuff

* saveram stuff

* debugging how this works

* lets see if this works better

* fuck strings

* ok let's do this right i think

* probably have this all working

* get repo in

* add nymashock to build scripts

* also update this readme

* get rid of this default, seems to break internally anyways?

* ""fix"" dualshock (wtf to do with rumble???), make override defaults actually default, add hack to allow for overriding default controllers

* hide useless rtc settings

* hack fix override defaults for controllers, get something going for nyma psx schema

* oops dont forget this

* make fucking default controllers hack work (what the fuck is this code???) also complete schema and mnemonics

* FUCKING FIX THIS BULLSHIT DEFAULT

* let's make this a little nicer

* add mnemonics for □/△/○, fixes weirdness with input display

* fix weird overscan issues when multiwidth + no-interlacing happens at the same time

* do this "properly"

* analog mnemonics

* default controls for dualshock/gamepad filled

* set nymashock as preferred core

* apparently this didnt get committed?

* update README too

* control name fix

* Revert "control name fix"

This reverts commit a3cae89b18.

Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
This commit is contained in:
CasualPokePlayer 2022-01-30 08:52:49 -08:00 committed by GitHub
parent dcccb4e2b6
commit d6b33fbec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 579 additions and 40 deletions

View File

@ -866,22 +866,37 @@
},
"PSX Front Panel": {
"P1 Up": "X1 DpadUp, Up",
"P1 D-Pad Up": "X1 DpadUp, Up",
"P1 Thumbstick Up": "X1 DpadUp, Up",
"P1 Down": "X1 DpadDown, Down",
"P1 D-Pad Down": "X1 DpadDown, Down",
"P1 Thumbstick Down": "X1 DpadDown, Down",
"P1 Left": "X1 DpadLeft, Left",
"P1 D-Pad Left": "X1 DpadLeft, Left",
"P1 Thumbstick Left": "X1 DpadLeft, Left",
"P1 Right": "X1 DpadRight, Right",
"P1 D-Pad Right": "X1 DpadRight, Right",
"P1 Thumbstick Right": "X1 DpadRight, Right",
"P1 Select": "X1 Back, Space",
"P1 Start": "X1 Start, Enter",
"P1 Square": "X1 X, A",
"P1 □": "X1 X, A",
"P1 Triangle": "X1 Y, S",
"P1 △": "X1 Y, S",
"P1 Circle": "X1 B, X",
"P1 ○": "X1 B, X",
"P1 Cross": "X1 A, Z",
"P1 X": "X1 A, Z",
"P1 L1": "X1 LeftShoulder, Q",
"P1 R1": "X1 RightShoulder, W",
"P1 L2": "X1 LeftTrigger, E",
"P1 R2": "X1 RightTrigger, R",
"P1 L3": "X1 LeftThumb, T",
"P1 Left Stick, Button": "X1 LeftThumb, T",
"P1 R3": "X1 RightThumb, Y",
"P1 MODE": "D"
"P1 Right Stick, Button": "X1 RightThumb, Y",
"P1 MODE": "D",
"P1 Analog": "D",
},
"Lynx Controller": {
"Up": "Up",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Assets/dll/shock.wbx.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -305,7 +305,7 @@ Neo Geo Pocket | **NeoPop**
NES | **NesHawk**, QuickNes
Odyssey² | **O2Hawk**
PC-FX | **T.S.T.**
Playstation (PSX) | **Octoshock**
Playstation (PSX) | **Nymashock**, **Octoshock**
Sega 32X | **PicoDrive**
Sega Game Gear | **SMSHawk**
Sega Genesis | **Genplus-gx**

View File

@ -34,6 +34,8 @@ namespace BizHawk.Client.Common
new[] { CoreNames.GambatteLink, CoreNames.GBHawkLink, CoreNames.GBHawkLink3x, CoreNames.GBHawkLink4x }),
(new[] { VSystemID.Raw.PCE, VSystemID.Raw.PCECD, VSystemID.Raw.SGX },
new[] { CoreNames.TurboNyma, CoreNames.HyperNyma, CoreNames.PceHawk }),
(new[] { VSystemID.Raw.PSX },
new[] { CoreNames.Octoshock, CoreNames.Nymashock}),
(new[] { VSystemID.Raw.TI83 },
new[] { CoreNames.TI83Hawk, CoreNames.Emu83 }),
};
@ -313,7 +315,7 @@ namespace BizHawk.Client.Common
public bool GbAsSgb { get; set; }
public string LibretroCore { get; set; }
public Dictionary<string, string> PreferredCores = new Dictionary<string, string>
public Dictionary<string, string> PreferredCores = new()
{
[VSystemID.Raw.NES] = CoreNames.QuickNes,
[VSystemID.Raw.SNES] = CoreNames.Snes9X,
@ -324,6 +326,7 @@ namespace BizHawk.Client.Common
[VSystemID.Raw.PCE] = CoreNames.TurboNyma,
[VSystemID.Raw.PCECD] = CoreNames.TurboNyma,
[VSystemID.Raw.SGX] = CoreNames.TurboNyma,
[VSystemID.Raw.PSX] = CoreNames.Nymashock,
[VSystemID.Raw.TI83] = CoreNames.Emu83,
};

View File

@ -591,7 +591,33 @@ namespace BizHawk.Client.Common
["L Gear Shift"] = 'L',
["R Gear Shift"] = 'R',
["Offscreen Shot"] = 'O'
}
},
[VSystemID.Raw.PSX] = new()
{
["D-Pad Up"] = 'U',
["D-Pad Down"] = 'D',
["D-Pad Left"] = 'L',
["D-Pad Right"] = 'R',
["Thumbstick Up"] = 'U',
["Thumbstick Down"] = 'D',
["Thumbstick Left"] = 'L',
["Thumbstick Right"] = 'R',
["□"] = 'Q',
["△"] = 'T',
["○"] = 'O',
["Left Stick, Button"] = '<',
["Right Stick, Button"] = '>',
["Left Stick, L-Thumb"] = 'L',
["Right Stick, L-Thumb"] = 'l',
["Left Stick, R-Thumb"] = 'R',
["Right Stick, R-Thumb"] = 'r',
["Left Stick, Trigger"] = 'T',
["Right Stick, Trigger"] = 't',
["Left Stick, Pinky"] = 'P',
["Right Stick, Pinky"] = 'p',
["Analog"] = 'M',
["Offscreen Shot"] = 'o',
},
};
private static readonly Dictionary<string, string> BaseAxisLookupTable = new Dictionary<string, string>
@ -619,7 +645,21 @@ namespace BizHawk.Client.Common
{
["VPos"] = "X",
["HPos"] = "Y"
}
},
[VSystemID.Raw.PSX] = new()
{
["Left Stick Left / Right"] = "lsX",
["Left Stick Up / Down"] = "lsY",
["Right Stick Left / Right"] = "rsX",
["Right Stick Up / Down"] = "rsY",
["Left Stick, Left / Right"] = "lsX",
["Left Stick, Fore / Back"] = "lsZ",
["Right Stick, Left / Right"] = "rsX",
["Right Stick, Fore / Back"] = "rsZ",
["Motion Left / Right"] = "mX",
["Motion Up / Down"] = "mY",
["Twist | / |"] = "Twist",
},
};
}
}

View File

@ -35,6 +35,7 @@ using BizHawk.Emulation.Cores.Nintendo.N64;
using BizHawk.Emulation.Cores.Nintendo.NES;
using BizHawk.Emulation.Cores.Nintendo.SNES;
using BizHawk.Emulation.Cores.Nintendo.SNES9X;
using BizHawk.Emulation.Cores.Sony.PSX;
using BizHawk.Client.EmuHawk.ToolExtensions;
using BizHawk.Client.EmuHawk.CoreExtensions;
@ -1983,7 +1984,7 @@ namespace BizHawk.Client.EmuHawk
case VSystemID.Raw.NES:
NESSubMenu.Visible = true;
break;
case VSystemID.Raw.PSX:
case VSystemID.Raw.PSX when Emulator is Octoshock:
PSXSubMenu.Visible = true;
break;
case VSystemID.Raw.TI83:

View File

@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Waterbox;
namespace BizHawk.Emulation.Cores.Sony.PSX
{
[PortedCore(CoreNames.Nymashock, "Mednafen Team", "1.27.1", "https://mednafen.github.io/releases/")]
public class Nymashock : NymaCore, IRegionable
{
[CoreConstructor(VSystemID.Raw.PSX)]
public Nymashock(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp)
: base(lp.Comm, VSystemID.Raw.PSX, "PSX Front Panel", lp.Settings, lp.SyncSettings)
{
if (lp.Roms.Count > 0)
throw new InvalidOperationException("To load a PSX game, please load the CUE file and not the BIN file.");
var firmwares = new Dictionary<string, FirmwareID>
{
{ "FIRMWARE:$J", new("PSX", "J") },
{ "FIRMWARE:$U", new("PSX", "U") },
{ "FIRMWARE:$E", new("PSX", "E") },
};
DoInit<LibNymaCore>(lp, "shock.wbx", firmwares);
}
protected override IDictionary<string, SettingOverride> SettingOverrides { get; } = new Dictionary<string, SettingOverride>
{
{ "psx.bios_jp", new() { Hide = true , Default = "$J" } }, // FIRMWARE:
{ "psx.bios_na", new() { Hide = true , Default = "$U" } }, // FIRMWARE:
{ "psx.bios_eu", new() { Hide = true , Default = "$E" } }, // FIRMWARE:
{ "psx.input.analog_mode_ct", new() { Hide = true } }, // probably don't want this
{ "psx.input.analog_mode_ct.compare", new() { Hide = true } },
{ "Virtual Port 1", new() { Default = "dualshock" } },
{ "Virtual Port 2", new() { Default = "none" } },
{ "Virtual Port 3", new() { Default = "none" } },
{ "Virtual Port 4", new() { Default = "none" } },
{ "Virtual Port 5", new() { Default = "none" } },
{ "Virtual Port 6", new() { Default = "none" } },
{ "Virtual Port 7", new() { Default = "none" } },
{ "Virtual Port 8", new() { Default = "none" } },
{ "psx.input.port2.memcard", new() { Default = "0" } },
{ "psx.input.port3.memcard", new() { Default = "0" } },
{ "psx.input.port4.memcard", new() { Default = "0" } },
{ "psx.input.port5.memcard", new() { Default = "0" } },
{ "psx.input.port6.memcard", new() { Default = "0" } },
{ "psx.input.port7.memcard", new() { Default = "0" } },
{ "psx.input.port8.memcard", new() { Default = "0" } },
{ "psx.input.port1.gun_chairs", new() { NonSync = true } },
{ "psx.input.port2.gun_chairs", new() { NonSync = true } },
{ "psx.input.port3.gun_chairs", new() { NonSync = true } },
{ "psx.input.port4.gun_chairs", new() { NonSync = true } },
{ "psx.input.port5.gun_chairs", new() { NonSync = true } },
{ "psx.input.port6.gun_chairs", new() { NonSync = true } },
{ "psx.input.port7.gun_chairs", new() { NonSync = true } },
{ "psx.input.port8.gun_chairs", new() { NonSync = true } },
{ "psx.dbg_exe_cdpath", new() { Hide = true } },
{ "psx.spu.resamp_quality", new() { NonSync = true } },
{ "psx.input.mouse_sensitivity", new() { Hide = true } },
{ "psx.slstart", new() { NonSync = true } },
{ "psx.slend", new() { NonSync = true } },
{ "psx.h_overscan", new() { NonSync = true } },
{ "psx.correct_aspect", new() { NonSync = true } },
{ "psx.slstartp", new() { NonSync = true } },
{ "psx.slendp", new() { NonSync = true } },
{ "nyma.rtcinitialtime", new() { Hide = true } },
{ "nyma.rtcrealtime", new() { Hide = true } },
};
}
}

View File

@ -40,6 +40,7 @@ namespace BizHawk.Emulation.Cores
public const string Mupen64Plus = "Mupen64Plus";
public const string NesHawk = "NesHawk";
public const string NeoPop = "NeoPop";
public const string Nymashock = "Nymashock";
public const string O2Hawk = "O2Hawk";
public const string Octoshock = "Octoshock";
public const string PceHawk = "PCEHawk";

View File

@ -246,6 +246,9 @@ namespace BizHawk.Emulation.Cores.Waterbox
case InputType.Status:
// TODO: wire up statuses to something (not controller, of course)
break;
case InputType.Rumble:
// TODO: wtf do we do here???
break;
default:
{
throw new NotImplementedException($"Unimplemented button type {input.Type}");

View File

@ -48,8 +48,16 @@ namespace BizHawk.Emulation.Cores.Waterbox
.Select((p, i) => new PortPropertyDescriptor(p, i))
.Cast<PropertyDescriptor>();
var s2 = SettingsInfo.AllSettings
.Where(s => { var o = SettingsInfo.AllOverrides[s.SettingsKey]; return !o.Hide && !o.NonSync; })
.Select(m => MednaPropertyDescriptor.Create(m, true));
.Where(s =>
{
var o = SettingsInfo.AllOverrides[s.SettingsKey];
return !o.Hide && !o.NonSync;
})
.Select(m =>
{
m.DefaultValue = SettingsInfo.AllOverrides[m.SettingsKey].Default ?? m.DefaultValue;
return MednaPropertyDescriptor.Create(m, true);
});
return new PropertyDescriptorCollection(s1.Concat(s2).ToArray());
}
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) => GetProperties();
@ -70,8 +78,16 @@ namespace BizHawk.Emulation.Cores.Waterbox
var s1 = SettingsInfo.LayerNames.Select(l => new LayerPropertyDescriptor(l))
.Cast<PropertyDescriptor>();
var s2 = SettingsInfo.AllSettings
.Where(s => { var o = SettingsInfo.AllOverrides[s.SettingsKey]; return !o.Hide && o.NonSync; })
.Select(m => MednaPropertyDescriptor.Create(m, true));
.Where(s =>
{
var o = SettingsInfo.AllOverrides[s.SettingsKey];
return !o.Hide && o.NonSync;
})
.Select(m =>
{
m.DefaultValue = SettingsInfo.AllOverrides[m.SettingsKey].Default ?? m.DefaultValue;
return MednaPropertyDescriptor.Create(m, false);
});
return new PropertyDescriptorCollection(s1.Concat(s2).ToArray());
}
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) => GetProperties();

View File

@ -268,8 +268,16 @@ namespace BizHawk.Emulation.Cores.Waterbox
{
var s = new NymaSettingsInfo();
foreach (var kvp in ExtraOverrides.Concat(SettingOverrides))
{
s.AllOverrides[kvp.Key] = kvp.Value;
}
foreach (var portInfo in allPorts)
{
if (s.AllOverrides.ContainsKey(portInfo.FullName) && s.AllOverrides[portInfo.FullName].Default != null)
portInfo.DefaultDeviceShortName = s.AllOverrides[portInfo.FullName].Default;
s.Ports.Add(new NymaSettingsInfo.Port
{
Name = portInfo.FullName,
@ -283,10 +291,6 @@ namespace BizHawk.Emulation.Cores.Waterbox
});
}
foreach (var kvp in ExtraOverrides.Concat(SettingOverrides))
{
s.AllOverrides[kvp.Key] = kvp.Value;
}
var originalSettings = GetSettingsData();
foreach (var setting in originalSettings.Concat(ExtraSettings))
{

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using BizHawk.Common;
using BizHawk.Emulation.Common;
@ -14,8 +15,9 @@ namespace BizHawk.Emulation.Cores
{
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core, Action<string> showMessageBox)
{
var psx = (Octoshock)core;
var settings = psx.GetSyncSettings();
if (core is Octoshock octo)
{
var settings = octo.GetSyncSettings();
var fioConfig = settings.FIOConfig.ToLogical();
for (int i = 0; i < fioConfig.DevicesPlayer.Length; i++)
@ -42,7 +44,31 @@ namespace BizHawk.Emulation.Cores
}
}
yield return ConsoleButtons(psx);
yield return ConsoleButtons(octo);
}
else if (core is Nymashock nyma)
{
foreach (var result in nyma.ActualPortData)
{
var num = int.Parse(result.Port.ShortName.Last().ToString());
var device = result.Device.ShortName;
if (device is "none") continue;
yield return device switch
{
"gamepad" => NymaGamePadController(num),
"dualshock" or "dualanalog" => NymaDualShockController(num),
"analogjoy" => NymaAnalogJoystick(num),
"mouse" => NymaMouse(num),
"negcon" => NymaNeGcon(num),
"guncon" => NymaGunCon(num),
"justifier" => NymaKonamiJustifier(num),
"dancepad" => NymaDancePad(num),
_ => throw new NotSupportedException($"device {device} is not supported"),
};
}
yield return NymaConsoleButtons();
}
}
private static PadSchema DualShockController(int controller)
@ -84,6 +110,47 @@ namespace BizHawk.Emulation.Cores
};
}
private static PadSchema NymaDualShockController(int controller)
{
var stickRanges = new[] { new AxisSpec(0.RangeTo(0xFFFF), 0x8000), new AxisSpec(0.RangeTo(0xFFFF), 0x8000, isReversed: true) };
return new PadSchema
{
Size = new Size(500, 290),
DisplayName = $"DualShock Player{controller}",
Buttons = new PadSchemaControl[]
{
ButtonSchema.Up(32, 50, $"P{controller} D-Pad Up"),
ButtonSchema.Down(32, 71, $"P{controller} D-Pad Down"),
ButtonSchema.Left(11, 62, $"P{controller} D-Pad Left"),
ButtonSchema.Right(53, 62, $"P{controller} D-Pad Right"),
new ButtonSchema(3, 32, controller, "L1"),
new ButtonSchema(191, 32, controller, "R1"),
new ButtonSchema(3, 10, controller, "L2"),
new ButtonSchema(191, 10, controller, "R2"),
new ButtonSchema(72, 90, controller, "Left Stick, Button", "L3"),
new ButtonSchema(130, 90, controller, "Right Stick, Button", "R3"),
new ButtonSchema(148, 62, controller, "□") { Icon = VGamepadButtonImage.Square },
new ButtonSchema(169, 50, controller, "△") { Icon = VGamepadButtonImage.Triangle },
new ButtonSchema(190, 62, controller, "○") { Icon = VGamepadButtonImage.Circle },
new ButtonSchema(169, 71, controller, "X") { Icon = VGamepadButtonImage.Cross },
new ButtonSchema(112, 62, controller, "Start", "S"),
new ButtonSchema(90, 62, controller, "Select", "s"),
new AnalogSchema(3, 120, $"P{controller} Left Stick Left / Right")
{
SecondaryName = $"P{controller} Left Stick Up / Down",
Spec = stickRanges[0],
SecondarySpec = stickRanges[1]
},
new AnalogSchema(260, 120, $"P{controller} Right Stick Left / Right")
{
SecondaryName = $"P{controller} Right Stick Up / Down",
Spec = stickRanges[0],
SecondarySpec = stickRanges[1]
}
}
};
}
private static PadSchema GamePadController(int controller)
{
return new PadSchema
@ -110,6 +177,90 @@ namespace BizHawk.Emulation.Cores
};
}
private static PadSchema NymaGamePadController(int controller)
{
return new PadSchema
{
Size = new Size(240, 115),
DisplayName = $"Gamepad Player{controller}",
Buttons = new[]
{
ButtonSchema.Up(37, 55, controller),
ButtonSchema.Down(37, 76, controller),
ButtonSchema.Left(16, 67, controller),
ButtonSchema.Right(58, 67, controller),
new ButtonSchema(8, 37, controller, "L1"),
new ButtonSchema(196, 37, controller, "R1"),
new ButtonSchema(8, 15, controller, "L2"),
new ButtonSchema(196, 15, controller, "R2"),
new ButtonSchema(153, 67, controller, "□") { Icon = VGamepadButtonImage.Square },
new ButtonSchema(174, 55, controller, "△") { Icon = VGamepadButtonImage.Triangle },
new ButtonSchema(195, 67, controller, "○") { Icon = VGamepadButtonImage.Circle },
new ButtonSchema(174, 76, controller, "X") { Icon = VGamepadButtonImage.Cross },
new ButtonSchema(112, 67, controller, "Start", "S"),
new ButtonSchema(90, 67, controller, "Select", "s")
}
};
}
private static PadSchema NymaAnalogJoystick(int controller)
{
var stickRanges = new[] { new AxisSpec(0.RangeTo(0xFFFF), 0x8000), new AxisSpec(0.RangeTo(0xFFFF), 0x8000, isReversed: true) };
return new PadSchema
{
Size = new Size(500, 290),
DisplayName = $"Analog Joystick Player{controller}",
Buttons = new PadSchemaControl[]
{
ButtonSchema.Up(32 + 130, 50, $"P{controller} Thumbstick Up"),
ButtonSchema.Down(32 + 130, 71, $"P{controller} Thumbstick Down"),
ButtonSchema.Left(11 + 130, 62, $"P{controller} Thumbstick Left"),
ButtonSchema.Right(53 + 130, 62, $"P{controller} Thumbstick Right"),
new ButtonSchema(3, 90, controller, "Left Stick, L-Thumb", "LL"),
new ButtonSchema(3 + 150 + 120, 90, controller, "Right Stick, L-Thumb", "RL"),
new ButtonSchema(3 + 30, 90, controller, "Left Stick, R-Thumb", "LR"),
new ButtonSchema(3 + 150 + 150, 90, controller, "Right Stick, R-Thumb", "RR"),
new ButtonSchema(3 + 60, 90, controller, "Left Stick, Trigger", "LT"),
new ButtonSchema(3 + 150 + 180, 90, controller, "Right Stick, Trigger", "RT"),
new ButtonSchema(3 + 90, 90, controller, "Left Stick, Pinky", "LP"),
new ButtonSchema(3 + 150 + 210, 90, controller, "Right Stick, Pinky", "RP"),
new ButtonSchema(112 + 140, 62, controller, "Start", "S"),
new ButtonSchema(90 + 140, 62, controller, "Select", "s"),
new AnalogSchema(3, 120, $"P{controller} Left Stick, Left / Right")
{
SecondaryName = $"P{controller} Left Stick, Fore / Back",
Spec = stickRanges[0],
SecondarySpec = stickRanges[1]
},
new AnalogSchema(260, 120, $"P{controller} Right Stick, Left / Right")
{
SecondaryName = $"P{controller} Right Stick, Fore / Back",
Spec = stickRanges[0],
SecondarySpec = stickRanges[1]
}
}
};
}
private static PadSchema NymaMouse(int controller)
{
return new PadSchema
{
DisplayName = $"Mouse Player{controller}",
Size = new Size(375, 320),
Buttons = new PadSchemaControl[]
{
new TargetedPairSchema(14, 17, $"P{controller} Motion Left / Right", 0xFFFF, 0xFFFF)
{
SecondaryName = $"P{controller} Motion Up / Down",
TargetSize = new Size(256, 256)
},
new ButtonSchema(300, 17, controller, "Left Button", "Left"),
new ButtonSchema(300, 77, controller, "Right Button", "Right"),
}
};
}
private static PadSchema NeGcon(int controller)
{
return new PadSchema
@ -156,7 +307,116 @@ namespace BizHawk.Emulation.Cores
};
}
private static PadSchema ConsoleButtons(Octoshock psx)
private static PadSchema NymaNeGcon(int controller)
{
return new PadSchema
{
Size = new Size(343, 195),
DisplayName = $"NeGcon Player{controller}",
Buttons = new PadSchemaControl[]
{
ButtonSchema.Up(36, 83, $"P{controller} D-Pad Up"),
ButtonSchema.Down(36, 104, $"P{controller} D-Pad Down"),
ButtonSchema.Left(15, 95, $"P{controller} D-Pad Left"),
ButtonSchema.Right(57, 95, $"P{controller} D-Pad Right"),
new ButtonSchema(78, 118, controller, "Start", "S"),
new ButtonSchema(278, 38, controller, "B"),
new ButtonSchema(308, 55, controller, "A"),
new ButtonSchema(308, 15, controller, "R"),
new SingleAxisSchema(5, 15, controller, "L")
{
TargetSize = new Size(128, 55),
MinValue = 0,
MaxValue = 65535
},
new SingleAxisSchema(125, 15, controller, "Twist | / |", isVertical: true)
{
DisplayName = "Twist",
TargetSize = new Size(64, 178),
MinValue = 0,
MaxValue = 65535
},
new SingleAxisSchema(180, 60, controller, "II")
{
TargetSize = new Size(128, 55),
MinValue = 0,
MaxValue = 65535
},
new SingleAxisSchema(220, 120, controller, "I")
{
TargetSize = new Size(128, 55),
MinValue = 0,
MaxValue = 65535
}
}
};
}
private static PadSchema NymaGunCon(int controller)
{
return new PadSchema
{
DisplayName = $"GunCon Player{controller}",
Size = new Size(375, 320),
Buttons = new PadSchemaControl[]
{
new TargetedPairSchema(14, 17, $"P{controller} X Axis", 0xFFFF, 0xFFFF)
{
SecondaryName = $"P{controller} Y Axis",
TargetSize = new Size(256, 256)
},
new ButtonSchema(300, 17, controller, "Trigger"),
new ButtonSchema(300, 57, controller, "A"),
new ButtonSchema(300, 87, controller, "B"),
new ButtonSchema(300, 290, controller, "Offscreen Shot", "Offscreen")
}
};
}
private static PadSchema NymaKonamiJustifier(int controller)
{
return new PadSchema
{
DisplayName = $"Konami Justifier Player{controller}",
Size = new Size(375, 320),
Buttons = new PadSchemaControl[]
{
new TargetedPairSchema(14, 17, $"P{controller} X Axis", 0xFFFF, 0xFFFF)
{
SecondaryName = $"P{controller} Y Axis",
TargetSize = new Size(256, 256)
},
new ButtonSchema(300, 17, controller, "Trigger"),
new ButtonSchema(300, 57, controller, "O"),
new ButtonSchema(300, 87, controller, "Start", "S"),
new ButtonSchema(300, 290, controller, "Offscreen Shot", "Offscreen")
}
};
}
private static PadSchema NymaDancePad(int controller)
{
return new PadSchema
{
Size = new Size(240, 115),
DisplayName = $"Dance Pad Player{controller}",
Buttons = new[]
{
ButtonSchema.Up(37, 55, controller),
ButtonSchema.Down(37, 76, controller),
ButtonSchema.Left(16, 67, controller),
ButtonSchema.Right(58, 67, controller),
new ButtonSchema(153, 67, controller, "□") { Icon = VGamepadButtonImage.Square },
new ButtonSchema(174, 55, controller, "△") { Icon = VGamepadButtonImage.Triangle },
new ButtonSchema(195, 67, controller, "○") { Icon = VGamepadButtonImage.Circle },
new ButtonSchema(174, 76, controller, "X") { Icon = VGamepadButtonImage.Cross },
new ButtonSchema(112, 67, controller, "Start", "S"),
new ButtonSchema(90, 67, controller, "Select", "s")
}
};
}
private static PadSchema ConsoleButtons(Octoshock octo)
{
return new ConsoleSchema
{
@ -164,7 +424,28 @@ namespace BizHawk.Emulation.Cores
Buttons = new PadSchemaControl[]
{
new ButtonSchema(10, 15, "Reset"),
new DiscManagerSchema(10, 54, new Size(300, 300), psx, new[] { "Open", "Close", "Disc Select" })
new DiscManagerSchema(10, 54, new Size(300, 300), octo, new[] { "Open", "Close", "Disc Select" })
}
};
}
private static PadSchema NymaConsoleButtons()
{
return new ConsoleSchema
{
Size = new Size(327, 50),
Buttons = new[]
{
new ButtonSchema(10, 15, "Reset"),
new ButtonSchema(58, 15, "Power"),
new ButtonSchema(108, 15, "Previous Disk")
{
DisplayName = "Prev Disc"
},
new ButtonSchema(175, 15, "Next Disk")
{
DisplayName = "Next Disc"
},
}
};
}

View File

@ -187,6 +187,10 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo& frame)
if (MDFN_LIKELY(lw > 0))
{
memcpy(dst, src, lw * sizeof(uint32_t));
if (!EES->InterlaceOn && lw < w)
{
memset(dst + lw, 0, (w - lw) * sizeof(uint32_t));
}
src += srcp;
dst += dstp;
}

View File

@ -7,6 +7,7 @@ make -f ngp.mak $1 -j
make -f faust.mak $1 -j
make -f pcfx.mak $1 -j
make -f ss.mak $1 -j
make -f shock.mak $1 -j
# make -f lynx.mak $1 -j
# make -f vb.mak $1 -j
# make -f wswan.mak $1 -j

@ -1 +1 @@
Subproject commit da0946da80e00fae0f1d2d086d67f64df6a7e3e0
Subproject commit 52c06fc2cfc1f7f0c9d3a5fcbcac3216e40384ca

80
waterbox/nyma/shock.cpp Normal file
View File

@ -0,0 +1,80 @@
#include <src/types.h>
#include <src/mednafen.h>
#include <src/psx/psx.h>
#include <src/psx/spu.h>
#include <src/psx/frontio.h>
#include "nyma.h"
#include <emulibc.h>
#include <waterboxcore.h>
using namespace MDFN_IEN_PSX;
extern Mednafen::MDFNGI EmulatedPSX;
void SetupMDFNGameInfo()
{
EmulatedPSX.LayerNames = NULL; // SetLayerEnableMask is null but not this for w/e reason so this is useless
Mednafen::MDFNGameInfo = &EmulatedPSX;
}
namespace MDFN_IEN_PSX
{
extern MultiAccessSizeMem<2048 * 1024, false> MainRAM;
extern PS_GPU GPU;
extern PS_SPU *SPU;
extern PS_CPU *CPU;
extern FrontIO *FIO;
extern MultiAccessSizeMem<512 * 1024, false> *BIOSROM;
extern MultiAccessSizeMem<65536, false> *PIOMem;
}
static void AccessSystemBus(uint8_t* buffer, int64_t address, int64_t count, bool write)
{
if (write)
{
while (count--)
PSX_MemPoke8(address++, *buffer++);
}
else
{
while (count--)
*buffer++ = PSX_MemPeek8(address++);
}
}
ECL_EXPORT void GetMemoryAreas(MemoryArea* m)
{
int i = 0;
#define AddMemoryDomain(name,data,size,flags) do\
{\
m[i].Data = data;\
m[i].Name = name;\
m[i].Size = size;\
m[i].Flags = flags;\
i++;\
}\
while (0)
AddMemoryDomain("MainRAM", MainRAM.data8, 2048*1024, MEMORYAREA_FLAGS_WRITABLE | MEMORYAREA_FLAGS_WORDSIZE4 | MEMORYAREA_FLAGS_PRIMARY);
AddMemoryDomain("GPURAM", GPU.GPURAM, 2*512*1024, MEMORYAREA_FLAGS_WRITABLE | MEMORYAREA_FLAGS_WORDSIZE4);
AddMemoryDomain("SPURAM", SPU->SPURAM, 512*1024, MEMORYAREA_FLAGS_WRITABLE | MEMORYAREA_FLAGS_WORDSIZE4);
AddMemoryDomain("BiosROM", BIOSROM->data8, 512*1024, MEMORYAREA_FLAGS_WRITABLE | MEMORYAREA_FLAGS_WORDSIZE4);
AddMemoryDomain("PIOMem", PIOMem ? PIOMem->data8 : NULL, 64*1024, MEMORYAREA_FLAGS_WRITABLE | MEMORYAREA_FLAGS_WORDSIZE4);
AddMemoryDomain("DCache", CPU->ScratchRAM.data8, 1024, MEMORYAREA_FLAGS_WRITABLE | MEMORYAREA_FLAGS_WORDSIZE4);
#define AddMemcardDomain(which) do\
{\
if (FIO->MCDevices[which-1]->GetNVSize())\
{\
AddMemoryDomain("Memcard " #which, (void*)FIO->MCDevices[which-1]->ReadNV(), FIO->MCDevices[which-1]->GetNVSize(), MEMORYAREA_FLAGS_WRITABLE | MEMORYAREA_FLAGS_WORDSIZE4 | MEMORYAREA_FLAGS_SAVERAMMABLE);\
}\
}\
while (0)
AddMemcardDomain(1);
AddMemcardDomain(2);
AddMemcardDomain(3);
AddMemcardDomain(4);
AddMemcardDomain(5);
AddMemcardDomain(6);
AddMemcardDomain(7);
AddMemcardDomain(8);
AddMemoryDomain("System Bus", (void*)AccessSystemBus, 1ull << 32, MEMORYAREA_FLAGS_WRITABLE | MEMORYAREA_FLAGS_WORDSIZE4 | MEMORYAREA_FLAGS_FUNCTIONHOOK);
}

11
waterbox/nyma/shock.mak Normal file
View File

@ -0,0 +1,11 @@
include common.mak
SRCS += \
$(filter-out %debug.cpp,$(call cppdir,psx)) \
mednafen/src/cheat_formats/psx.cpp \
mednafen/src/resampler/resample.c \
$(CD_SRCS) \
mednafen/src/PSFLoader.cpp \
shock.cpp
include ../common.mak

0
waterbox/nyma/zlib/configure vendored Normal file → Executable file
View File

View File

@ -56,6 +56,7 @@ It consists of a modified musl libc, and build scripts to tie it all together.
cd nyma && make -f hyper.mak install
cd nyma && make -f pcfx.mak install
cd nyma && make -f ss.mak install
cd nyma && make -f shock.mak install
cd picodrive && make install
cd snes9x && make install
cd uzem && make install