all repos — mgba @ f2dadbd8b1e577c379de5a583b223f257ad8e8bb

mGBA Game Boy Advance Emulator

GBA Hardware: Improve Game Boy Player rumble behavior
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Sep 2016 22:02:45 -0700
commit

f2dadbd8b1e577c379de5a583b223f257ad8e8bb

parent

8345e29798f8e22ce0e0053ff62d08d61dce36fa

2 files changed, 9 insertions(+), 5 deletions(-)

jump to
M CHANGESCHANGES

@@ -18,6 +18,7 @@ - Util: Fix PNG identification on files too small to be a PNG

- GB: Fix invalid STOP behavior on Game Boy Color - GB, GBA: Fix emulator hardlocking when halting with IRQs off - SDL: Attach rumble in SDL frontend + - GBA Hardware: Improve Game Boy Player rumble behavior Misc: - All: Only update version info if needed - FFmpeg: Encoding cleanup
M src/gba/hardware.csrc/gba/hardware.c

@@ -563,12 +563,15 @@ struct GBAGBPSIODriver* gbp = (struct GBAGBPSIODriver*) driver;

gbp->p->gbpNextEvent -= cycles; if (gbp->p->gbpNextEvent <= 0) { uint32_t tx = 0; - if (gbp->p->gbpTxPosition <= 12) { - tx = _gbpTxData[gbp->p->gbpTxPosition]; - if (gbp->p->gbpTxPosition < 12) { - ++gbp->p->gbpTxPosition; - } + int txPosition = gbp->p->gbpTxPosition; + if (txPosition > 16) { + gbp->p->gbpTxPosition = 0; + txPosition = 0; + } else if (txPosition > 12) { + txPosition = 12; } + tx = _gbpTxData[txPosition]; + ++gbp->p->gbpTxPosition; gbp->p->p->memory.io[REG_SIODATA32_LO >> 1] = tx; gbp->p->p->memory.io[REG_SIODATA32_HI >> 1] = tx >> 16; if (gbp->d.p->normalControl.irq) {