devkitPro / libgba

C Library for Nintendo GBA
http://devkitpro.org/viewforum.php?f=5
Other
192 stars 26 forks source link

Set(Clear) TIMER_IRQ of REG_TMxCNT_H with irqEnable() and irqDisable() #3

Closed shumon84 closed 10 months ago

fincs commented 5 years ago

I don't think this is always desirable when programming timers. Users might want to (for example) temporarily disable the timer IRQ without actually disabling/resetting the timer control registers.

shumon84 commented 5 years ago

So why is REG_DISPSTAT treated specially? In particular, HBlank IRQ is often enable/disable temporarily

fincs commented 5 years ago

Timers, as opposed to HBlank/VBlank, have more state. In HBL/VBL there's just an enable/disable bit.

shumon84 commented 5 years ago

I don't understand the difference. The other states of timers are not affected by irqEnable()/irqDisabel(), and this problem is not related with REG_TMxCNT_H have many state.