Skip to content

Commit

Permalink
Correct PC-FX controller control port behaviour ( #119 )
Browse files Browse the repository at this point in the history
  • Loading branch information
dshadoff committed Jul 7, 2024
1 parent eac48de commit c9b2804
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mednafen/src/pcfx/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,12 @@ uint16 FXINPUT_Read16(uint32 A, const v810_timestamp_t timestamp)
if(A == 0x00 || A == 0x80)
{
int w = (A & 0x80) >> 7;
int scanning = (LatchPending[w] > 0) ? 1 : 0;

if(latched[w])
ret = 0x8;
ret = 0x8 | scanning;
else
ret = 0x0;
ret = 0x0 | scanning;
}
else
{
Expand Down Expand Up @@ -287,6 +288,7 @@ void FXINPUT_Write16(uint32 A, uint16 V, const v810_timestamp_t timestamp)
TapCounter[w] = 0;
}
LatchPending[w] = 1536;
latched[w] = false;
PCFX_SetEvent(PCFX_EVENT_PAD, CalcNextEventTS(timestamp));
}
control[w] = V & 0x7;
Expand Down

0 comments on commit c9b2804

Please sign in to comment.