- [Solved] Can't enable timer 1.
- 23 Feb 2020 06:15:14 pm
- Last edited by Midnightas on 26 Feb 2020 11:07:10 am; edited 1 time in total
Code:
TMStart:
ld IX, mpTmrRange
ld (IX + 0), 0
ld (IX + 5), $0C ;3277, ~0.1 second.
ld (IX + 4), $CD
ld A, (IX + 31)
res 1, A ;Count down.
ld (IX + 31), A
ld A, (IX + 30)
set 1, A ;Crystal mode.
set 2, A ;Generate interrupt on 0.
set 0, A ;Enable.
ld (IX + 30), A
ret
The above code seems to set all the values correctly, looking at the memory view on CEmu, although F20000 seems to be always zero (as that's what I set it to) and unmoving. It's been a slow day, sorry if this is obvious.