Jump to content
IGNORED

Total noob with noob questions about Display Lists


Recommended Posts

I'm fairly new to programming for the Atari 8-bit but I'm also horribly enthusiastic about it, so for the past two months or so I've been massing a collection of books to educate myself on how to program. I've snagged over a dozen books, including some of the more important ones (Mapping the Atari, De Re Atari, Your Atari Computer, Atari Graphics & Arcade Game Design, etc.). So I've basically been reading like a maniac in my spare time trying to figure everything out. I'm progressing well, but I have some questions.

 

I understand the concept of display lists, and I already realize that building my own is a goal I want to accomplish. I think I have a grasp on how it works, but it's hard to be sure using the books I have as references.

 

So let's say I'm programming a game, and I want a display with 2 (2 x 8 scanlines) lines of Antic mode 2 for a title bar/score display, then the rest of the screen in Antic D (11 lines x 16 scanlines) for graphics. So that's 16 scanlines of mode 2 + 176 scanlines of mode D = 192 scanlines. I think I got that part right.

 

So now can I put this display list in any free RAM I may have, say for example, in page 6? I would think that I could simply start the list at 1536 and poke each instruction in, then poke the new location of the list to PEEK(560) and PEEK(561), then everything should work correctly.

 

I haven't actually implemented any of this yet, it's all on paper and in my head so far, but I wanted to ask about it first to see if I'm on the right track.

 

Sorry in advance if I sound ignorant of the subject, it's probably because I am. :P But the worst questions are the ones left unasked.

 

TIA

Link to comment
Share on other sites

That sounds right. You will need to remember to flip the bytes around so that the LSB comes first...but if you load the word at 560 with the address of a valid dlist, it ought to take. You might need to hit wtsync or something to make sure the switch happens during VBI. It's been a while so I don't remember exactly but what you are saying sounds right.

Link to comment
Share on other sites

Don't forget to put some blank scanlines at the top of the screen. Most games put 24 blank lines at the start to be sure the top of the display does not get cut off. Also don't forget the Jump and Wait for Sync instruction at the end of the display list.

 

If I remeber right, there is an address you should Poke to stop the ANTIC chip from doing DMA before you change the display list pointer. The you can Poke again to restart Antic once the addres is set.

 

Dan

Link to comment
Share on other sites

I understand the concept of display lists, and I already realize that building my own is a goal I want to accomplish. I think I have a grasp on how it works, but it's hard to be sure using the books I have as references.

 

So let's say I'm programming a game, and I want a display with 2 (2 x 8 scanlines) lines of Antic mode 2 for a title bar/score display, then the rest of the screen in Antic D (11 lines x 16 scanlines) for graphics. So that's 16 scanlines of mode 2 + 176 scanlines of mode D = 192 scanlines. I think I got that part right.

 

So now can I put this display list in any free RAM I may have, say for example, in page 6? I would think that I could simply start the list at 1536 and poke each instruction in, then poke the new location of the list to PEEK(560) and PEEK(561), then everything should work correctly.

 

One thing to consider is the language you are working in. If you are writing in assembly, it is usually easiest to lay out the entire display list as you mentioned above.

 

As an example:

       *=$4000
       lda #0         ; clear screen
       ldx #200
clr     sta bot+20,x
       dex
       bpl clr

       sta 710         ; set some colors
       lda #190
       sta 708

       lda #<DLIST     ; set new display
       sta 560
       lda #>DLIST
       sta 561
j1      jmp j1          ; wait

DLIST
       .byte 112,112,112                       ; blank lines
       .byte 66,<top,>top,2                    ; 2 lines of ANTIC 2
       .byte 71,<bot,>bot,7,7,7,7,7,7,7,7,7,7  ; 11 lines of ANTIC 7
       .byte 65,<DLIST,>DLIST                  ; Jump to top

top     .sbyte "        Antic 2 at the top              "
       .sbyte "         of the screen...               "

bot     .sbyte "   ANTIC 7 HERE    "
       .ds 20*10

 

You can do something similar in BASC by storing the dlist somewhere as you mentioned. However, it can often be just as easy to modify the existing display list in place. I used to do this for quick and dirty title screens:

 

For example:

10 GR.18:DL=PEEK(560)+PEEK(561)*256
20 POKE 710,0:poke 708,200
30 POKE DL+3,66:POKE DL+6,2
40 POS.10,0:?#6;"ANTIC 2 TEXT":POS.10,2:?#6;"HERE":POS.3,4:?#6;"ANTIC 7 TEXT HERE"
50 GOTO 50

 

Notice that in the above example, the OS does not know about the changes that were made. Therefore, even though the display looks like ANTIC 2, the OS will write to it as if it were ANTIC 7. Also, the display list is now short scanlines. This doesn't actually matter for some applications (like a title screen), but can for a main game screen. If it does matter, then you can carefully move the dlist around as shown in Atari Graphics and Arcade Game Design, Chaper 2 section "Moving the Text Window around" (Chapter 2); They give some code to do this here.

 

It is not really necessary to turn off the screen before changing the display list, but if you are performing complicated manipulations in BASIC, it may be less alarming to the user!

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