Jump to content
IGNORED

DLIs... Again


Recommended Posts

Hi all,

 

I'm back to messing around with DLIs again, and trying to figure out how to change colour on every scanline.

 

Say for a graphics 1 screen you can set each line of text to be a different colour, but not every scanline *within* that line of text - I'm thinking something like the "tiger attack" title screen.

 

I guess one way would be to have a graphics mode where you can change every scanline and draw the characters in but is there a simpler way I'm missing?

 

I hope this makes sense!

 

Link to comment
Share on other sites

Graphics mode just puts constraints on how often a DLI can occur. In some cases it's not desirable for a DLI every line anyway because the overhead is such that you're not left with much time left to do stuff.

 

In Gr. 1 it's easy enough - just use a store to WSYNC to skip ahead to the end of the visible display. So for striped text you'd just setup a table with the colour values then read them in a loop.

 

e.g.

 

dli  pha
  tya
  pha
  ldy #7
docolour  lda ctable,y
  sta wsync 
  sta colpf1
  dey
  bpl docolour
  pla
  tay
  pla
  rti
ctable .byte $a4,$a6,$a8,$aa,$aa,$a8,$a6,$a4

 

Note in this case the colours should be stored in reverse order that they appear.

This should work OK - you have to be careful with the amount of stuff that goes on before the first WSYNC otherwise you miss a line.

  • Like 1
Link to comment
Share on other sites

Thanks Rybags - I'd almost had it after all.

 

I'd done the sta wsync before the lda ctable,y which seems to be ok, but the bpl i'd screwed up when I hand-assembled the routine and it was jumping to the wrong place, but not crashing!

 

I think I understand now - Thanks a million :)

 

-Peter.

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...