Monday, February 20, 2012

Don't Mask Me, Bro!

Another milestone has been reached this morning... the NMI (non-maskable interrupt) has been verified to work.  Rybags (from AtariAge.com) kindly posted some code which uses the NMI to increment a counter which is then fed into the graphics and sound hardware.  The result is a nice rolling curtain of color bars with a rapidly descending tonal effect.

I had some initial trouble getting it to work, which turned out to be something quite simple.  The counter variable was in ROM instead of RAM, so incrementing it had no effect.  Doh!  After realizing that faux pas, I relocated the variable, and all is working!

One thing I did learn... the 6502's NMI only pushes PC and the condition code register to the stack, while the 6809's NMI pushes all registers to the stack.  This behavior doesn't affect the demo, but it's interesting to note.
video

No comments:

Post a Comment