›; DISLST.ACT››;************************************›;* *›;* Sample display list program, *›;* showing how to set up a display *›;* list with two static lines at *›;* the top of the screen, and the *›;* other 22 lines scrolling like *›;* mad. Really nice for screens *›;* with headings over scrolling data*›;* printed from a file, for example.*›;* *›;* The display list presented here *›;* is very short, so no precautions *›;* have been taken for crossing 1K *›;* or 4K boundarys! Beware! *›;* See chapter 9 (Advanced Graphics)*›;* in a classic Atari book titled: *›;* "Your Atari Computer" *›;* by Lon Poole with McNiff & Cook *›;* for more about the dreaded 1K *›;* and 4K boundary limitations in *›;* display lists. (It's not easy to *›;* deal with unless you are a real *›;* bit-head, so you are well advised*›;* to keep your display lists as *›;* short as you can.) This book is *›;* also an EXCELLENT source for more*›;* about the display list commands *›;* in general. There is a nice *›;* table of them in the same *›;* chapter. *›;* *›;* In addition, I must extend my *›;* thanks to Keith Ledbetter, a *›;* Sysop on CIS and author of the *›;* Express! terminal programs, for *›;* his help on this project. I *›;* never would have figured this out*›;* without his assistance. *›;* *›;* Enjoy!! *›;* *›;* William T. Colburn [72337,322] *›;************************************››PROC dsply_list()› CARD savmsc=$58, ;contains low address of screen display› dlist_vector=$230, ; points to the display list› old_savmsc=[0], ; save the savmsc here.› temp_card=[0] ; temporary variable!› BYTE mode=$57, ; address for graphics mode indicator› dma=559, ; antic chip on/off address› crsinh=752, ; turn off cursor here› loop=[0] ; loop counter› BYTE ARRAY dlist(32)=$680 ;put byte array on page six.›; this array will hold the display list.› BYTE POINTER dlist_ptr ; pointer to display list array.› dlist_ptr=dlist› Graphics(6) ; use graphics 6 to reserve plenty of memory› old_savmsc=savmsc ; save start of screen adress› FOR loop=1 TO 3 ; put in 24 overscan lines› DO› dlist_ptr^=$70› dlist_ptr==+1› OD›;›; Antic mode 2+64 for LMS (load memory scan!)›; Actually, this is Graphics(0)›;› dlist_ptr^=$42 ; $42=decimal 66!› dlist_ptr==+1›;›; Next, I save the starting address›; for the screen in the display list›;› dlist_ptr^=old_savmsc-((old_savmsc RSH 8) LSH 8)› dlist_ptr==+1› dlist_ptr^=old_savmsc RSH 8 ;divide by 256!› dlist_ptr==+1› dlist_ptr^=$06 ; one line of antic mode 6› dlist_ptr==+1› dlist_ptr^=$42 ; antic mode 2+64 for LMS again!› dlist_ptr==+1›;›; Note that this time, I use savmsc›; plus 140!! This leaves the first›; 60 bytes of the screen, displayed›; above, alone when scrolling occurs›; on the bottom 22 lines of the›; screen! (60= 40 bytes for 1 line of ›; Graphics(0) plus 20 bytes for 1 line›; of Graphics(1). Simple, eh?)›;› temp_card=old_savmsc+140› dlist_ptr^=temp_card-((temp_card RSH 8) LSH 8)› dlist_ptr==+1› dlist_ptr^=temp_card RSH 8› dlist_ptr==+1›;›; Now, store the remaining 21 lines of ›; antic mode 2 (Graphics(0)) in the›; display list.›;› FOR loop=1 TO 21 ; 21 lines of antic mode 2› DO› dlist_ptr^=$02› dlist_ptr==+1› OD›;›; finally, put a machine code JMP›; ($41 or decimal 65) to tell the›; display list where it starts.›;› dlist_ptr^=$41› dlist_ptr==+1›;›; In my case with this program, it›; starts at location $680 on page six.›; (Don't forget, it must be in LSB,›; MSB format!!)›;› dlist_ptr^=$80› dlist_ptr==+1› dlist_ptr^=$06› dma=0 ; turn off the antic chip› dlist_vector=$680 ; install the dlist vector› savmsc=old_savmsc ; reset the screen starting address› dma=34 ; turn on the antic chip› mode=0 ; fake out Graphics(0)› crsinh=1 ; kill the cursor› Position(0,0)› PrintD(6,"An example of mode 0")› mode=1 ; fake out Graphics(1)› Position(0,2)› PrintD(6,"Mode 1 here!")› savmsc=old_savmsc+60 ; Add 60 to screen starting address› mode=0 ; fake out Graphics(0) again!› Position(0,2) ;lines 0 and 1 are invisible!› PrintDE(6,"Back to graphics 0 here")› FOR loop=1 TO 20 ; prove that scrolling works!› DO› PrintDE(6,"scrolling...")› PrintDE(6,".scrolling..")› PrintDE(6,"..scrolling.")› PrintDE(6,"...scrolling")› PrintDE(6,"..scrolling.")› PrintDE(6,".scrolling..")› OD› PrintD(6,"Press RESET to restore display list.")› DO OD ; infinite loop ›RETURN›;›;************************************›;* In closing, let me say that this *›;* is a very inefficient program. *›;* It is deliberately so, because I *›;* wanted to demonstrate the tech- *›;* nique with as few shortcuts as *›;* possible. This way, many more *›;* people will UNDERSTAND the *›;* example, I hope. You can shorten*›;* the whole thing considerably by *›;* initializing the display list in *›;* the array when you define it as *›;* a BYTE ARRAY. Then, all you *›;* have to do is plug in the *›;* addresses you need for each LMS *›;* (Load Memory Scan) and for the *›;* starting address of the display *›;* list at the end. In fact, there *›;* is no REAL requirement that the *›;* display list reside on Page six *›;* at all! Why not make the array *›;* a global variable that is never *›;* touched once initialized? *›;* *›;* PLEASE experiment, and upload *›;* your successes to us so we can *›;* see how smart you are! *›;* *›;************************************›;››MODULE ; for user programs.›››