puae: fix something

This commit is contained in:
feos 2024-11-08 20:28:53 +03:00
parent e501d10804
commit 4c3b59c39c
3 changed files with 8 additions and 7 deletions

Binary file not shown.

View File

@ -328,13 +328,13 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga
[DisplayName("Controller port 1")]
[Description("")]
[DefaultValue(LibPUAE.ControllerType.Joystick)]
[DefaultValue(LibPUAE.ControllerType.Mouse)]
[TypeConverter(typeof(DescribableEnumConverter))]
public LibPUAE.ControllerType ControllerPort1 { get; set; }
[DisplayName("Controller port 2")]
[Description("")]
[DefaultValue(LibPUAE.ControllerType.Mouse)]
[DefaultValue(LibPUAE.ControllerType.Joystick)]
[TypeConverter(typeof(DescribableEnumConverter))]
public LibPUAE.ControllerType ControllerPort2 { get; set; }

View File

@ -45,11 +45,6 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo* f)
Controller *controller = (port == 0) ? &f->Port1 : &f->Port2;
cd32_pad_enabled[port] = 0;
// shared between mouse and joystick
setjoybuttonstate(port, JOYBUTTON_1, controller->Buttons.b1);
setjoybuttonstate(port, JOYBUTTON_2, controller->Buttons.b2);
setjoybuttonstate(port, JOYBUTTON_3, controller->Buttons.b3);
switch (controller->Type)
{
case CONTROLLER_JOYSTICK:
@ -57,6 +52,9 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo* f)
controller->Buttons.down ? JOY_MAX : JOY_MID, 1);
setjoystickstate(port, AXIS_HORIZONTAL, controller->Buttons.left ? JOY_MIN :
controller->Buttons.right ? JOY_MAX : JOY_MID, 1);
setjoybuttonstate(port, JOYBUTTON_1, controller->Buttons.b1);
setjoybuttonstate(port, JOYBUTTON_2, controller->Buttons.b2);
setjoybuttonstate(port, JOYBUTTON_3, controller->Buttons.b3);
break;
case CONTROLLER_CD32PAD:
cd32_pad_enabled[port] = 1;
@ -71,6 +69,9 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo* f)
case CONTROLLER_MOUSE:
setmousestate(port, AXIS_HORIZONTAL, controller->MouseX - last_mouse_x[port], MOUSE_RELATIVE);
setmousestate(port, AXIS_VERTICAL, controller->MouseY - last_mouse_y[port], MOUSE_RELATIVE);
setmousebuttonstate(port, MOUSE_LEFT, controller->Buttons.b1);
setmousebuttonstate(port, MOUSE_RIGHT, controller->Buttons.b2);
setmousebuttonstate(port, MOUSE_MIDDLE, controller->Buttons.b3);
break;
}
}