all repos — mgba @ 44175d9381936c0445f30a611e034a9c23103649

mGBA Game Boy Advance Emulator

GBA e-Reader: Use LED duration register
Vicki Pfau vi@endrift.com
Sun, 23 Feb 2020 16:22:58 -0800
commit

44175d9381936c0445f30a611e034a9c23103649

parent

1cf4bbb52d2e9ff1fc2b17a47f86777f7d21b099

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M src/gba/ereader.csrc/gba/ereader.c

@@ -572,7 +572,10 @@ }

} hw->eReaderRegisterControl1 = EReaderControl1FillScanline(hw->eReaderRegisterControl1); if (EReaderControl0IsLedEnable(hw->eReaderRegisterControl0)) { - uint16_t led = 2754; // TODO: Figure out why this breaks if using the LED register + uint16_t led = hw->eReaderRegisterLed * 2; + if (led > 0x4000) { + led = 0x4000; + } GBARaiseIRQ(hw->p, IRQ_GAMEPAK, -led); } }