wonderswan: rework how controls are handled for rotated situation. all savestates are invalid. you should probably delete the wonderswan portion of your control configuration.
This commit is contained in:
parent
8334c17615
commit
5bb38cb1c2
|
@ -76,7 +76,7 @@ namespace BizHawk.Client.Common
|
|||
case "SAT":
|
||||
return "|.|.............|.............|";
|
||||
case "WSWAN":
|
||||
return "|....|....|.....|";
|
||||
return "|...........|...........|..|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,19 +197,30 @@ namespace BizHawk.Client.Common
|
|||
public static Tuple<string, char>[] WSMnemonic = new[]
|
||||
{
|
||||
new Tuple<string, char>(null, '|'),
|
||||
new Tuple<string, char>("Up X", 'U'),
|
||||
new Tuple<string, char>("Down X", 'D'),
|
||||
new Tuple<string, char>("Left X", 'L'),
|
||||
new Tuple<string, char>("Right X", 'R'),
|
||||
new Tuple<string, char>("P1 Up X", 'U'),
|
||||
new Tuple<string, char>("P1 Down X", 'D'),
|
||||
new Tuple<string, char>("P1 Left X", 'L'),
|
||||
new Tuple<string, char>("P1 Right X", 'R'),
|
||||
new Tuple<string, char>("P1 Up Y", 'U'),
|
||||
new Tuple<string, char>("P1 Down Y", 'D'),
|
||||
new Tuple<string, char>("P1 Left Y", 'L'),
|
||||
new Tuple<string, char>("P1 Right Y", 'R'),
|
||||
new Tuple<string, char>("P1 Start", 'S'),
|
||||
new Tuple<string, char>("P1 B", 'B'),
|
||||
new Tuple<string, char>("P1 A", 'A'),
|
||||
new Tuple<string, char>(null, '|'),
|
||||
new Tuple<string, char>("Up Y", 'U'),
|
||||
new Tuple<string, char>("Down Y", 'D'),
|
||||
new Tuple<string, char>("Left Y", 'L'),
|
||||
new Tuple<string, char>("Right Y", 'R'),
|
||||
new Tuple<string, char>("P2 Up X", 'U'),
|
||||
new Tuple<string, char>("P2 Down X", 'D'),
|
||||
new Tuple<string, char>("P2 Left X", 'L'),
|
||||
new Tuple<string, char>("P2 Right X", 'R'),
|
||||
new Tuple<string, char>("P2 Up Y", 'U'),
|
||||
new Tuple<string, char>("P2 Down Y", 'D'),
|
||||
new Tuple<string, char>("P2 Left Y", 'L'),
|
||||
new Tuple<string, char>("P2 Right Y", 'R'),
|
||||
new Tuple<string, char>("P2 Start", 'S'),
|
||||
new Tuple<string, char>("P2 B", 'B'),
|
||||
new Tuple<string, char>("P2 A", 'A'),
|
||||
new Tuple<string, char>(null, '|'),
|
||||
new Tuple<string, char>("Start", 'S'),
|
||||
new Tuple<string, char>("B", 'B'),
|
||||
new Tuple<string, char>("A", 'A'),
|
||||
new Tuple<string, char>("Power", 'P'),
|
||||
new Tuple<string, char>("Rotate", 'R'),
|
||||
new Tuple<string, char>(null, '|'),
|
||||
|
|
|
@ -129,7 +129,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (buckets[i].Count > 0)
|
||||
{
|
||||
tt.TabPages.Add("Player " + i);
|
||||
string tabname = Global.Emulator.SystemId == "WSWAN" ? i == 1 ? "Normal" : "Rotated" : "Player " + i; // hack
|
||||
tt.TabPages.Add(tabname);
|
||||
tt.TabPages[pageidx].Controls.Add(createpanel(settings, buckets[i], tt.Size));
|
||||
pageidx++;
|
||||
}
|
||||
|
@ -137,7 +138,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (buckets[0].Count > 0)
|
||||
{
|
||||
tt.TabPages.Add(Global.Emulator.SystemId == "C64" ? "Keyboard" : "Console");
|
||||
string tabname = Global.Emulator.SystemId == "C64" ? "Keyboard" : "Console"; // hack
|
||||
tt.TabPages.Add(tabname);
|
||||
tt.TabPages[pageidx].Controls.Add(createpanel(settings, buckets[0], tt.Size));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,20 +158,33 @@ namespace BizHawk.Emulation.Cores.WonderSwan
|
|||
};
|
||||
|
||||
[Flags]
|
||||
public enum Buttons : ushort
|
||||
public enum Buttons : uint
|
||||
{
|
||||
UpX = 0x0001,
|
||||
RightX = 0x0002,
|
||||
DownX = 0x0004,
|
||||
LeftX = 0x0008,
|
||||
UpY = 0x0010,
|
||||
RightY = 0x0020,
|
||||
DownY = 0x0040,
|
||||
LeftY = 0x0080,
|
||||
Start = 0x0100,
|
||||
A = 0x0200,
|
||||
B = 0x0400,
|
||||
Rotate = 0x8000,
|
||||
UpX = 0x00000001,
|
||||
RightX = 0x00000002,
|
||||
DownX = 0x00000004,
|
||||
LeftX = 0x00000008,
|
||||
UpY = 0x00000010,
|
||||
RightY = 0x00000020,
|
||||
DownY = 0x00000040,
|
||||
LeftY = 0x00000080,
|
||||
Start = 0x00000100,
|
||||
A = 0x00000200,
|
||||
B = 0x00000400,
|
||||
|
||||
R_UpX = 0x00010000,
|
||||
R_RightX = 0x00020000,
|
||||
R_DownX = 0x00040000,
|
||||
R_LeftX = 0x00080000,
|
||||
R_UpY = 0x00100000,
|
||||
R_RightY = 0x00200000,
|
||||
R_DownY = 0x00400000,
|
||||
R_LeftY = 0x00800000,
|
||||
R_Start = 0x01000000,
|
||||
R_A = 0x02000000,
|
||||
R_B = 0x04000000,
|
||||
|
||||
Rotate = 0x80000000,
|
||||
}
|
||||
|
||||
public enum Language : uint
|
||||
|
|
|
@ -19,7 +19,35 @@ namespace BizHawk.Emulation.Cores.WonderSwan
|
|||
public static readonly ControllerDefinition WonderSwanController = new ControllerDefinition
|
||||
{
|
||||
Name = "WonderSwan Controller",
|
||||
BoolButtons = { "Up X", "Down X", "Left X", "Right X", "Up Y", "Down Y", "Left Y", "Right Y", "Start", "B", "A", "Power", "Rotate" }
|
||||
BoolButtons =
|
||||
{
|
||||
"P1 Up X",
|
||||
"P1 Down X",
|
||||
"P1 Left X",
|
||||
"P1 Right X",
|
||||
"P1 Up Y",
|
||||
"P1 Down Y",
|
||||
"P1 Left Y",
|
||||
"P1 Right Y",
|
||||
"P1 Start",
|
||||
"P1 B",
|
||||
"P1 A",
|
||||
|
||||
"P2 Up X",
|
||||
"P2 Down X",
|
||||
"P2 Left X",
|
||||
"P2 Right X",
|
||||
"P2 Up Y",
|
||||
"P2 Down Y",
|
||||
"P2 Left Y",
|
||||
"P2 Right Y",
|
||||
"P2 Start",
|
||||
"P2 B",
|
||||
"P2 A",
|
||||
|
||||
"Power",
|
||||
"Rotate"
|
||||
}
|
||||
};
|
||||
public ControllerDefinition ControllerDefinition { get { return WonderSwanController; } }
|
||||
public IController Controller { get; set; }
|
||||
|
@ -27,17 +55,30 @@ namespace BizHawk.Emulation.Cores.WonderSwan
|
|||
BizSwan.Buttons GetButtons()
|
||||
{
|
||||
BizSwan.Buttons ret = 0;
|
||||
if (Controller["Up X"]) ret |= BizSwan.Buttons.UpX;
|
||||
if (Controller["Down X"]) ret |= BizSwan.Buttons.DownX;
|
||||
if (Controller["Left X"]) ret |= BizSwan.Buttons.LeftX;
|
||||
if (Controller["Right X"]) ret |= BizSwan.Buttons.RightX;
|
||||
if (Controller["Up Y"]) ret |= BizSwan.Buttons.UpY;
|
||||
if (Controller["Down Y"]) ret |= BizSwan.Buttons.DownY;
|
||||
if (Controller["Left Y"]) ret |= BizSwan.Buttons.LeftY;
|
||||
if (Controller["Right Y"]) ret |= BizSwan.Buttons.RightY;
|
||||
if (Controller["Start"]) ret |= BizSwan.Buttons.Start;
|
||||
if (Controller["B"]) ret |= BizSwan.Buttons.B;
|
||||
if (Controller["A"]) ret |= BizSwan.Buttons.A;
|
||||
if (Controller["P1 Up X"]) ret |= BizSwan.Buttons.UpX;
|
||||
if (Controller["P1 Down X"]) ret |= BizSwan.Buttons.DownX;
|
||||
if (Controller["P1 Left X"]) ret |= BizSwan.Buttons.LeftX;
|
||||
if (Controller["P1 Right X"]) ret |= BizSwan.Buttons.RightX;
|
||||
if (Controller["P1 Up Y"]) ret |= BizSwan.Buttons.UpY;
|
||||
if (Controller["P1 Down Y"]) ret |= BizSwan.Buttons.DownY;
|
||||
if (Controller["P1 Left Y"]) ret |= BizSwan.Buttons.LeftY;
|
||||
if (Controller["P1 Right Y"]) ret |= BizSwan.Buttons.RightY;
|
||||
if (Controller["P1 Start"]) ret |= BizSwan.Buttons.Start;
|
||||
if (Controller["P1 B"]) ret |= BizSwan.Buttons.B;
|
||||
if (Controller["P1 A"]) ret |= BizSwan.Buttons.A;
|
||||
|
||||
if (Controller["P2 Up X"]) ret |= BizSwan.Buttons.R_UpX;
|
||||
if (Controller["P2 Down X"]) ret |= BizSwan.Buttons.R_DownX;
|
||||
if (Controller["P2 Left X"]) ret |= BizSwan.Buttons.R_LeftX;
|
||||
if (Controller["P2 Right X"]) ret |= BizSwan.Buttons.R_RightX;
|
||||
if (Controller["P2 Up Y"]) ret |= BizSwan.Buttons.R_UpY;
|
||||
if (Controller["P2 Down Y"]) ret |= BizSwan.Buttons.R_DownY;
|
||||
if (Controller["P2 Left Y"]) ret |= BizSwan.Buttons.R_LeftY;
|
||||
if (Controller["P2 Right Y"]) ret |= BizSwan.Buttons.R_RightY;
|
||||
if (Controller["P2 Start"]) ret |= BizSwan.Buttons.R_Start;
|
||||
if (Controller["P2 B"]) ret |= BizSwan.Buttons.R_B;
|
||||
if (Controller["P2 A"]) ret |= BizSwan.Buttons.R_A;
|
||||
|
||||
if (Controller["Rotate"]) ret |= BizSwan.Buttons.Rotate;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -558,17 +558,30 @@
|
|||
"Reset": ""
|
||||
},
|
||||
"WonderSwan Controller": {
|
||||
"Up X": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
|
||||
"Down X": "DownArrow, J1 POV1D, X1 DpadDown, X1 LStickDown",
|
||||
"Left X": "LeftArrow, J1 POV1L, X1 DpadLeft, X1 LStickLeft",
|
||||
"Right X": "RightArrow, J1 POV1R, X1 DpadRight, X1 LStickRight",
|
||||
"Up Y": "NumberPad8, J1 RotationZ-, X1 RStickUp",
|
||||
"Down Y": "NumberPad2, J1 RotationZ+, X1 RStickDown",
|
||||
"Left Y": "NumberPad4, J1 Z-, X1 RStickLeft",
|
||||
"Right Y": "NumberPad6, J1 Z+, X1 RStickRight",
|
||||
"Start": "Return, J1 B10, X1 Start",
|
||||
"B": "Z, J1 B1, X1 X",
|
||||
"A": "X, J1 B2, X1 A",
|
||||
"P1 Up X": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
|
||||
"P1 Down X": "DownArrow, J1 POV1D, X1 DpadDown, X1 LStickDown",
|
||||
"P1 Left X": "LeftArrow, J1 POV1L, X1 DpadLeft, X1 LStickLeft",
|
||||
"P1 Right X": "RightArrow, J1 POV1R, X1 DpadRight, X1 LStickRight",
|
||||
"P1 Up Y": "NumberPad8, J1 RotationZ-, X1 RStickUp",
|
||||
"P1 Down Y": "NumberPad2, J1 RotationZ+, X1 RStickDown",
|
||||
"P1 Left Y": "NumberPad4, J1 Z-, X1 RStickLeft",
|
||||
"P1 Right Y": "NumberPad6, J1 Z+, X1 RStickRight",
|
||||
"P1 Start": "Return, J1 B10, X1 Start",
|
||||
"P1 B": "Z, J1 B1, X1 X",
|
||||
"P1 A": "X, J1 B2, X1 A",
|
||||
|
||||
"P2 Up X": "",
|
||||
"P2 Down X": "X, J1 B2, X1 A",
|
||||
"P2 Left X": "Z, J1 B1, X1 X",
|
||||
"P2 Right X": "",
|
||||
"P2 Up Y": "LeftArrow, J1 POV1L, X1 DpadLeft, X1 LStickLeft",
|
||||
"P2 Down Y": "RightArrow, J1 POV1R, X1 DpadRight, X1 LStickRight",
|
||||
"P2 Left Y": "DownArrow, J1 POV1D, X1 DpadDown, X1 LStickDown",
|
||||
"P2 Right Y": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
|
||||
"P2 Start": "Return, J1 B10, X1 Start",
|
||||
"P2 B": "",
|
||||
"P2 A": "",
|
||||
|
||||
"Power": ""
|
||||
}
|
||||
},
|
||||
|
@ -736,17 +749,10 @@
|
|||
"Power": ""
|
||||
},
|
||||
"WonderSwan Controller": {
|
||||
"Up X": "",
|
||||
"Down X": "",
|
||||
"Left X": "",
|
||||
"Right X": "",
|
||||
"Up Y": "",
|
||||
"Down Y": "",
|
||||
"Left Y": "",
|
||||
"Right Y": "",
|
||||
"Start": "",
|
||||
"B": "A, J1 B4, X1 Y",
|
||||
"A": "S, J1 B3, X1 B",
|
||||
"P1 B": "A, J1 B4, X1 Y",
|
||||
"P1 A": "S, J1 B3, X1 B",
|
||||
"P2 Left X": "A, J1 B4, X1 Y",
|
||||
"P2 Down X": "S, J1 B3, X1 B",
|
||||
"Power": ""
|
||||
}
|
||||
},
|
||||
|
|
Binary file not shown.
|
@ -64,27 +64,14 @@ namespace MDFN_IEN_WSWAN
|
|||
cpu.set_reg(NEC_SS,0);
|
||||
cpu.set_reg(NEC_SP,0x2000);
|
||||
}
|
||||
|
||||
static uint16 RotateButtons(uint16 input)
|
||||
{
|
||||
int groupx = input & 0xf;
|
||||
groupx <<= 1;
|
||||
groupx |= groupx >> 4;
|
||||
groupx &= 0x0f;
|
||||
int groupy = input & 0xf0;
|
||||
groupy <<= 1;
|
||||
groupy |= groupy >> 4;
|
||||
groupy &= 0xf0;
|
||||
return input & 0xff00 | groupx | groupy;
|
||||
}
|
||||
|
||||
bool System::Advance(uint16 buttons, bool novideo, uint32 *surface, int16 *soundbuff, int &soundbuffsize)
|
||||
bool System::Advance(uint32 buttons, bool novideo, uint32 *surface, int16 *soundbuff, int &soundbuffsize)
|
||||
{
|
||||
// we hijack the top bit of the buttons input and use it as a positive edge sensitive toggle to the rotate input
|
||||
rotate ^= (buttons & 0x8000) > (oldbuttons & 0x8000);
|
||||
rotate ^= (buttons & 0x80000000) > (oldbuttons & 0x80000000);
|
||||
oldbuttons = buttons;
|
||||
|
||||
memory.WSButtonStatus = rotate ? RotateButtons(buttons) : buttons;
|
||||
memory.WSButtonStatus = rotate ? buttons >> 16 : buttons;
|
||||
memory.WSButtonStatus &= 0x7ff; // mask out "rotate" bit and other unused bits
|
||||
memory.Lagged = true;
|
||||
while (!gfx.ExecuteLine(surface, novideo))
|
||||
|
@ -336,7 +323,7 @@ namespace MDFN_IEN_WSWAN
|
|||
s->Reset();
|
||||
}
|
||||
|
||||
EXPORT int bizswan_advance(System *s, uint16 buttons, bool novideo, uint32 *surface, int16 *soundbuff, int *soundbuffsize, int *IsRotated)
|
||||
EXPORT int bizswan_advance(System *s, uint32 buttons, bool novideo, uint32 *surface, int16 *soundbuff, int *soundbuffsize, int *IsRotated)
|
||||
{
|
||||
int ret = s->Advance(buttons, novideo, surface, soundbuff, *soundbuffsize);
|
||||
*IsRotated = s->rotate;
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
static void* operator new(std::size_t size);
|
||||
|
||||
void Reset();
|
||||
bool Advance(uint16 buttons, bool novideo, uint32 *surface, int16 *soundbuff, int &soundbuffsize);
|
||||
bool Advance(uint32 buttons, bool novideo, uint32 *surface, int16 *soundbuff, int &soundbuffsize);
|
||||
bool Load(const uint8 *data, int length, const SyncSettings &s);
|
||||
void PutSettings(const Settings &s);
|
||||
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
Interrupt interrupt;
|
||||
|
||||
bool rotate; // rotate screen and controls left 90
|
||||
uint16 oldbuttons;
|
||||
uint32 oldbuttons;
|
||||
|
||||
template<bool isReader>void SyncState(NewState *ns);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue