mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-28 01:29:18 +00:00
LR35902: Whoops: correct broken timer (when it begins at zero!)
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
fa7e1480d3
commit
eb761bc62f
@ -153,7 +153,7 @@ void EightBit::GameBoy::IoRegisters::incrementTimers() {
|
||||
|
||||
void EightBit::GameBoy::IoRegisters::incrementTimer() {
|
||||
if (timerEnabled()) {
|
||||
if (--m_timerCounter == 0) {
|
||||
if (--m_timerCounter <= 0) {
|
||||
m_timerCounter += m_timerRate;
|
||||
incrementTIMA();
|
||||
}
|
||||
|
@ -340,6 +340,7 @@ int EightBit::GameBoy::LR35902::step() {
|
||||
}
|
||||
}
|
||||
ExecutedInstruction.fire(*this);
|
||||
assert(cycles() % 4 == 0);
|
||||
return cycles();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user