Skip to content

Commit

Permalink
Merge pull request #163 from dshadoff/Fix_pcfx_controller_scan
Browse files Browse the repository at this point in the history
Correct PC-FX controller control port behaviour ( #119 )
  • Loading branch information
pceDev16 authored Jul 9, 2024
2 parents eac48de + c9b2804 commit 0f1fb7e
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 0f1fb7e

Please sign in to comment.