Posted Sun Oct 9, 2011 8:03 PM
Well, I thought I was on the right track, *until* I started drawing to the screen. Here is my current version:
DLIST .BYTE $70,$70,$70,$4D,$00,$5D,$0D,$0D,$0D,$0D,$0D,$0D
.BYTE $0D,$0D,$0D,$0D,$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,$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 ; 95 ANTIC D Mode lines
.BYTE $41; Jump to beginning of Display List
.WORD DLIST ; This should automatically calculate where DLIST begins
INITDL ; first load in colors
LDA #0
STA $02C8 ; Color4 background black
LDA #4
STA $02C4 ; Color0 medium gray
LDA #10
STA $02C5 ; Color1 light gray
LDA #148
STA $02C6 ; Color2 blue
LDA #0 ; Now run the display list
STA $022F ; Turn off ANTIC
LDA #DLIST&255
STA $0230 ;Store starting address of custom Display List - low byte
LDA #DLIST/256 ; High byte
STA $0231 ; Storing High byte
LDA #$22
STA $022F ; Turn ANTIC back on
RTS
Now I planned on clearing out about 2 Antic D screens of memory with:
CLRSCR ; Clear the screen RAM, 30 pages, about 2 ANTIC D screens
MEMTOCLR = $B0 ; Page Zero address to index - Lo Byte
LDA #$00
STA MEMTOCLR ; Lo Byte of start of Screen RAM
LDA #$5D
STA MEMTOCLR+1 ; Hi Byte of start of Screen RAM
LDA #0 ;RAM will be cleared with zeros
LDX #30 ;# of pages to clear
LOOP2 LDY #0 ;Countdown timer
LOOP1 STA (MEMTOCLR),Y ; Indexing $5D00 + Y
DEY ;Countdown starts at 255
BNE LOOP1 ;when we fall through to here we have cleared one page
INC MEMTOCLR+1 ;prepare to clear the next page
DEX ;decrease page counter
BNE LOOP2 ;if not zero, jump back and clear another page
RTS
Ok, no errors, but then here's the problem: If I draw to the screen using LDA #102 (or something similar) instead of LDA #0 above, I only draw 18 mode lines and then nothing else. It's as if my Antic D screen is only 18 modes total or so and then vanishes. So something must be off with my display list. Did I miss an instruction somewhere? I think my loops are counting correctly, it's the screen memory that's messed up somehow.