Avram Posted January 20, 2012 Share Posted January 20, 2012 How much can I do in a DLI on an antic #4 screen? Currently I have an interrupt on every line where I use a lookup table to change two playfield colors (the table counter also increments each line). I'd like to animate 2-4 bytes of the same character on each line, in addition to the color changes. Is that possible? Oh, and I'm also planning on using all the pm graphics too. Thanks! Quote Link to comment Share on other sites More sharing options...
Avram Posted January 20, 2012 Author Share Posted January 20, 2012 Ad to specify, I'm looking to have each line's character that I'm changing to look different. So the "A" on line 0 will look different from the "A" on line 1 etc. Quote Link to comment Share on other sites More sharing options...
Rybags Posted January 20, 2012 Share Posted January 20, 2012 (edited) The Altirra hardware reference has some good info there. When your DLI starts, there's not a great deal of time to do stuff before the end of normal display. Normally you can push 2 registers and STA WSYNC safely, fairly sure trying to push a third risks overrun. But you can get creative and just leave the WSYNC out altogether. Just ensure any relevant changes like colour and character stuff occurs offscreen. Pushing 3 registers and preloading 2 registers e.g. for the colour change should be about enough to ensure you're offscreen. If not, padding out with a NOP or 2 should ensure it. The "offscreen" amount of cycles you have available will vary depending on DMA width, whether H-Scrolling is active and whether PMG DMA is enabled. Actual cycles are 34, but you lose 1 for DList fetch, another 5 if PMG DMA is enabled, even more if HScrolling is enabled. When HScrol is enabled, the cycle loss will be variable. Time saving tips for DLIs - use zero page, use immediate mode if possible for colour/character changes although this will typically mean multiple DLI routines will be needed rather than just one. You can also save time by not pushing registers to the stack, but storing them in LDA/LDX immediate instructions before the RTI. e.g. sta save_a stx save_x ; dli stuff ; save_a=*+1 lda #$ff ; this gets modified save_x=*+1 ldx #$ff ; so does this rti Edited January 20, 2012 by Rybags Quote Link to comment Share on other sites More sharing options...
Avram Posted January 20, 2012 Author Share Posted January 20, 2012 Thanks for the super fast reply Rybags! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.