Jump to content
IGNORED

Display List Help


Recommended Posts

Ok, it turns out my problem with Cypher was in my display list. I guess I calculated some wrong memory addresses when I first made it, but for some reason it worked with VSS, but not with a real 5200. Here's my display list for my screen:

 

dlist

.byte $70,$70,$70

.byte $42,$00,$18,$02

.byte $4D,$50,$18,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$70,$42,$48,$1B,$70,$4D,$70,$1B

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$70

.byte $42,$18,$23,$41,$00,$10

 

 

I have two lines of Antic 2 text, 19 lines of Antic D, another line of Antic 2, then 49 lines of Antic D, and finally a line of Antic 2.

 

I've tried and tried to recalculate the address on my own, but I keep getting some serious glitches. I guess I just don't remember this as well as I thought. Can someone give me a hand or at least tell me where I went wrong?

 

I'm going to put my new prototype page on the side for a bit and try and get a playable demo of Cypher working for Philly. I can't believe I'm being done in by a stupid Display List...

 

Tempest

Link to comment
Share on other sites

This is my first guesss at it, but I'd say that mixing modes 2 and D are causing the problem. Your method is sound, though I haven't looked at it closely yet. But you should not need to force a reset to the memory scan counter each time a different Antic mode is called (the $42's/$4D's in your list). Keep the one at the top, and change the others to $02/$0D (and you can drop the memory address after each one). Both Antic 2 and D use 40 bytes per line...so Antic couldn't care less.

If you were mixing modes that differ in bytes-per-line, I'd say the other method might be necessary...but not here.

 

[ 03-01-2002: Message edited by: Nukey Shay ]

Link to comment
Share on other sites

dlist

.byte $70,$70,$70

.byte $42,$00,$18,$02 =16 lines

.byte $4D,$50,$18,$0D,$0D,$0D,$0D,$0D =12 lines

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D =20 lines

.byte $0D,$0D,$0D,$70,$42,$48,$1B,$70,$4D,$70,$1B =32 lines

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D =20 lines

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D =20 lines

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D =20 lines

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D =20 lines

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$70 =24 lines

.byte $42,$18,$23,$41,$00,$10 =8 lines

 

Total = 192 scanlines following the top

 

Try this...

 

dlist

.byte $70,$70,$70

.byte $42,$00,$18,$02

.byte $0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$20,$20,$20,$20,$02,$20,$20

.byte $20,$20,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$20,$20

.byte $20,$20,$02,$41,$00,$10

 

[ 03-01-2002: Message edited by: Nukey Shay ]

Link to comment
Share on other sites

You are crossing a 4K boundary with your screen memory. Antic is not capable of doing that. If you subtract $400 from each of your LMS instructions and move where you are storing your screen in memory also it should be ok.

 

For more information, take a quick look at chapter 1 of 'De Re Atari'

Link to comment
Share on other sites

Oops...the $70's will cause problems too.

(Bit 4 forces the LMS).

Change each to 4 $20's instead.

Editing the list above...

 

Alan-

Good eye...I didn't spot that. The screen uses 2880 bytes. It would need to be 2048 bytes or less if you want the screen to start at $1800. Unless you want to add another LMS at the point where it crosses the boundry (which will cause the screen memory to be non-linier).

And that would be at...uh...do the math yourself, my head hurts

 

[ 03-01-2002: Message edited by: Nukey Shay ]

Link to comment
Share on other sites

Yeah you must be right about the 4K boundary since it gets about 3/4 of the way down the the screen then gets garbled. I'll look up De Re Atari, but can you explain about the subtracting $400 from the LMS instructions? Looks like Nukey Shay removed most of them from my display list anyway (it works the same BTW).

 

Thanks for the help Nukey, I was trying to remember if the blank line skips took up any screen memory (I honestly couldn't remember). It's nice to know I can still do a display list, now I need to figure out how to handle that 4K barrier.

 

Tempest

Link to comment
Share on other sites

Well your screen memory starts st $1800 and runs to $2340. If you jump back $400 your screen memory will run from $1400 to $1F40 and therefore should keep it from crossing a 4K boundary. You would just need to change all your LMS instructions thru the list and then start storing your screen at $1400 so everything matches up. Or if it makes it easier move everything up to start at $2000 so you have a full 4K to play with. Hope that helps,

Alan

Link to comment
Share on other sites

Oops...I was editing and missed the response.

Anyway...the gist of it is if you really need to start at $1800, you can add the LMS instruction on the 51st display line (51 x 40 bytes per line = 2040 bytes). This will put you just above the barrier, with 8 bytes to spare (that means the screen memory will no longer be a single span of memory). The LMS will allow you to jump the fence over to $2000 for the next line. If you want to eliminate the 8-byte gap...start screen memory at $1808 instead.

I think I've got it sorted here...

$70 displays 8 blank scanlines, but forces a LMS...each $30 will display 4 blanks without forcing LMS...(I think)...since bit 4 is not set in $30. So you shouldn't need to state addresses after using them.

 

This one works...and keeps screen memory in one piece after crossing the boundry:

 

dlist

.byte $70,$70,$70

.byte $42,$08,$18,$02 <-Skip the extra 8 bytes from the start

.byte $0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$30,$30,$02,$30,$30,0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D <-your 2k is used up

.byte $4D,$00,$20 <-Jump and start at $2000

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D

.byte $0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$30,$30

.byte $02,$41,$00,$10

 

But yeah, I'd take Alan's advice and just begin at $1000 instead. You'll never have any problems until you want to use modes E or F (in which case you would need to insert an extra LMS where the boundry exists...as described above). Those extra bytes will always be a problem there though...especially if you really want to start at a nice round number like $1000 (you would need to start at $1010 if your screen runs through the entire 4k). To make matters worse, P/M and character graphics also have their own boundry problems (2k and 4k for P/M...depending on the resolution, .5k and 1k for characters...depending on text mode used).

Flexibility is not without it's price.

 

[ 03-02-2002: Message edited AGAIN by: Nukey Shay ]

 

[ 03-02-2002: Message edited by: Nukey Shay ]

Link to comment
Share on other sites

The 4K boundary...I forgot about that. That would explain why my change to your display list worked. The LMS I placed in the list jumped it past the boundary.

 

A 4K boundary would be $1000, $2000, $3000, etc. Starting your list at $1800 would get you there very quickly. Your display list would have to be 512 bytes or lower before it needed a LMS, right?

 

I also see I was wrong in my byte calculations...sorry ANTIC 2 is 40 bytes per line and not 40 bytes per scan line as I originally thought.

 

See, you are not the only one that's been away from this for a while and got a little confused

Link to comment
Share on other sites

No no...the display list itself cannot cross a 1k boundry because the counter is not a full 16-bit register (it uses 10). The 4k problem is in regards to the screen memory itself. Since his dlist begins at $1000 in the above example, it would need to fill memory past $1400 to cause a problem (that's a heck of a long list!).

The 4k problem is reached much quicker...since nearly every other scanline is using 40 bytes of his 2k pie (he's only 2k from the boundry because screen memory begins at $1800). By starting screen memory at $1000 instead, and moving the dlist someplace else...it would put him the full 4k from the boundry. How about starting the screen at $1000 and the dlist at $1B40 (where the screen ends)? This would make the dlist begin nearly 200 bytes from it's own boundry...with free memory from $1C00 on.

 

[ 03-01-2002: Message edited by: Nukey Shay ]

Link to comment
Share on other sites

Nope... the $ signifies that we're working in Hex. $100 = 256 bytes, and $1A00 follows $19FF in hex (not $2000).

Starting screen ram at $1800 gives him $800 (2048 bytes) before encountering the screen boundry problem at $2000.

 

Where's that asprin....

 

[ 03-01-2002: Message edited by: Nukey Shay ]

Link to comment
Share on other sites

Wow, lots of action tonight that I missed. FYI Tempest, I ran into the 4K boundary problem last fall and it took a while before I figured out what was going on. Here's Koffi's Display List:

code:


dlist1 .byte $70,$70,$70 ;24 blank scanlines

.byte $4E,$00,$20 ;Mode E and Load memory scan $2000

.byte $0E,$0E ; scanlines 2 and 3

; note -- this one antic 2 mode line = 8 scanlines:

.byte $82 ; 11 lines (9 bytes

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 20

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 28

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 38 (36 bytes

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 48 (46 bytes

.byte $0E,$0E ; 50 (48 bytes

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$8E ; 60 (2nd DLI on 60

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 70

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 80

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 90

.byte $0E,$0E,$0E,$0E,$0E,$0e,$0e,$0e,$0e,$8e ; 100 (3rd DLI on 100)

.byte $0e,$0e ; 102 jump next

;

; Scanline 103 starts at $3000. New LMS needed due to crossing a 4K boundary:

;

.byte $4e,$00,$30 ; 103 LMS jump

.byte $0e,$0e,$0e,$0e,$0e,$0e,$0e ; 110 lines

.byte $0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e ; 120

.byte $0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e ; 130

.byte $0e,$0e,$0e,$0e,$0e ; 135

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$8E ; 145 (4th DLI on 145)

.byte $0e,$0e,$0e,$0e,$0e,$0e,$0e,$8e ; 153 (5th DLI on 153)

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 163

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 173

.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 183

.byte $0E,$8E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ; 192 (6th DLI on 185)

.byte $41,$00,$10 ;Jump back to start at $1000

; total bytes in dlist1= 195

 


Link to comment
Share on other sites

Jeez, I just realised something else. The text in the mode 2 lines may not be visible when using certian color combinations for the graphics unless you are using interrupts to change them (you can only alter the luminesence of the text, and the background will be color 2 instead of matching the rest of the background). I'd use Antic mode 4 instead (multicolor text). You'll need a custom character set, but I usually put mine in the unused PM area above the missiles. Mode 6 is also an option, but that one might require a little more work as each line uses only 20 bytes per line.

Just tried the last one I edited above on Atari hardware, and it does work.

Link to comment
Share on other sites

Sorry, I've been at the hospital all day with my mother, so I didn't get a chance to absorb all of this coding wisdom. Is there any reason to start the display list at $1800? I only did this because that's where Dan Boris's example started it it.

 

So if I were to start it at $1000 instead and keep the list the same (with the proper memory location changes of course), it will work because it won't cross the 4K barrier right?

 

Tempest

Link to comment
Share on other sites

That is correct...you should be able to start the screen and display list wherever you want (provided that area is not being used by the OS).

The screen memory address should be written to the 5th & 6th byte of the display list, and the display list address should be written to $230/$231 and at the end of the display list.

As stated, beginning your screen memory at the start of a 4k block will save you some headaches until you get to the hires modes E/F. Most people place the dlist data below the screen memory (as you did), but it really doesn't matter. Actually, it might make more sense the other way around...since there is usually a good portion of the block left over.

Link to comment
Share on other sites

Starting at $1000 is fine.. I tested a full screen Antic F mode on the 5200 (was experimenting with drawing a 320x200 image with 8 "colors" using R/G/B page flipping.. it works, but 20Hz flicker is hard on the eyes). I only had to jump once in the middle of the DL.

 

calamari

Link to comment
Share on other sites

hi guys!

 

this is what i like... real atari coding questions...

 

when i 1st read the topic (before reading your answers) my idea was 4k-boundary problem... when i started 10 years ago coding and tweaking with antic this was most of the time the reason for crap on screen...

 

so beware even with the 4k boundary when starting to Hscroll or Vscroll... then it really gets complicated...

 

is antic not a wonderful chip? mixing 15 different gfx modes like you want... excellent...

 

hve

http://www.s-direktnet.de/homepages/k_nadj/main.html

Link to comment
Share on other sites

I was just looking thorugh my code when I noticed something.

 

ldx #$5B ;Number of bytes in list

 

dlloop ;Copy display list to RAM

lda dlist,x ;Get byte

sta $1000,x ;Copy to RAM

dex ;next byte

bpl dlloop

ldy #$00

 

And now I'm all confused again. This means I was storing my Display List at $1000 already. So how can I start my Display List at $1000? I guess I'm getting confused between the terms starting and storing the display list.

 

My source code is here: Cypher Source

 

if you need a better look.

 

Tempest

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