Skip to content

Commit

Permalink
puae: fix something
Browse files Browse the repository at this point in the history
  • Loading branch information
vadosnaprimer committed Nov 8, 2024
1 parent e501d10 commit 4c3b59c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Binary file modified Assets/dll/puae.wbx.zst
Binary file not shown.
4 changes: 2 additions & 2 deletions src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.ISettable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ public class PUAESyncSettings

[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; }

Expand Down
11 changes: 6 additions & 5 deletions waterbox/uae/bizhawk.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,16 @@ 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:
setjoystickstate(port, AXIS_VERTICAL, controller->Buttons.up ? JOY_MIN :
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;
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 4c3b59c

Please sign in to comment.