Jump to content
IGNORED

DLI timing


Avram

Recommended Posts

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!

Link to comment
Share on other sites

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 by Rybags
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...