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.
Well, that was.. really dumb. `$F20000 + 30` sure as hell ain't `$F20000 + $30`.
spasm:
Code:
TMStart:
   ld IX, mpTmrRange
   ld (IX + tmr1Counter), 0
   ld (IX + tmr1Load+1), $0C ;3277, ~0.1 second.
   ld (IX + tmr1Load), $CD

   res bTmr1CountUp-8,(IX + tmrCtrl+1)
   
   ld A, (IX + tmrCtrl)
   set bTmr1Crystal, A
   set bTmr1Overflow, A
   set bTmr1Enable, A
   ld (IX + tmrCtrl), A

   ret

fasmg:

Code:
TMStart:
   ld IX, mpTmrRange
   ld (IX + tmr1Counter), 0
   ld (IX + tmr1Load+1), ((1 shl 15) / 10) shr 8
   ld (IX + tmr1Load), ((1 shl 15) / 10) and $FF

   res bTmr1CountUp, (IX + tmrCtrl)
   
   ld A, (IX + tmrCtrl)
   set bTmr1Crystal, A
   set bTmr1Overflow, A
   set bTmr1Enable, A
   ld (IX + tmrCtrl), A

   ret
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement