It's like archaeology. We're the first ones to use this ancient Mayan super scope code
This commit is contained in:
parent
99d70a1c7f
commit
a46acca981
|
@ -37,10 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
LimitAnalogChangeSensitivity = ss.LimitAnalogChangeSensitivity
|
||||
};
|
||||
case ControllerType.SuperScope:
|
||||
return new SnesSuperScopeController
|
||||
{
|
||||
LimitAnalogChangeSensitivity = ss.LimitAnalogChangeSensitivity
|
||||
};
|
||||
return new SnesSuperScopeController();
|
||||
default:
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
@ -342,15 +339,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
},
|
||||
FloatRanges =
|
||||
{
|
||||
new[] { -10, 0f, 10f },
|
||||
new[] { -10f, 0f, 10f }
|
||||
// problem: when you're in 240 line mode, the limit on Y needs to be 240.
|
||||
// when you're in 224 mode, it needs to be 224. perhaps the deck needs to account for this...
|
||||
new[] { 0f, 128f, 256f },
|
||||
new[] { 0f, 0f, 240f }
|
||||
}
|
||||
};
|
||||
|
||||
public ControllerDefinition Definition => _definition;
|
||||
|
||||
public bool LimitAnalogChangeSensitivity { get; set; } = true;
|
||||
|
||||
public short GetState(IController controller, int index, int id)
|
||||
{
|
||||
switch (id)
|
||||
|
@ -359,19 +356,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
return 0;
|
||||
case 0:
|
||||
var x = (int)controller.GetFloat("0X");
|
||||
if (LimitAnalogChangeSensitivity)
|
||||
{
|
||||
x = x.Clamp(-10, 10);
|
||||
}
|
||||
|
||||
return (short)x;
|
||||
case 1:
|
||||
var y = (int)controller.GetFloat("0Y");
|
||||
if (LimitAnalogChangeSensitivity)
|
||||
{
|
||||
y = y.Clamp(-10, 10);
|
||||
}
|
||||
|
||||
return (short)y;
|
||||
case 2:
|
||||
return (short)(controller.IsPressed("0Trigger") ? 1 : 0);
|
||||
|
|
|
@ -30,8 +30,6 @@ void SuperScope::enter() {
|
|||
//Vcounter wrapped back to zero; update cursor coordinates for start of new frame
|
||||
int nx = interface()->inputPoll(port, Input::Device::SuperScope, 0, (unsigned)Input::SuperScopeID::X);
|
||||
int ny = interface()->inputPoll(port, Input::Device::SuperScope, 0, (unsigned)Input::SuperScopeID::Y);
|
||||
nx += x;
|
||||
ny += y;
|
||||
x = max(-16, min(256 + 16, nx));
|
||||
y = max(-16, min(240 + 16, ny));
|
||||
offscreen = (x < 0 || y < 0 || x >= 256 || y >= (ppu.overscan() ? 240 : 225));
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue