First public commit.
This commit is contained in:
parent
2a48f52979
commit
4bac9d83ed
288 changed files with 18417 additions and 1076 deletions
47
lenser/a7800/viewer/viewer.s
Normal file
47
lenser/a7800/viewer/viewer.s
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
; Atari 7800 image viewer -- programs MARIA, then holds.
|
||||
;
|
||||
; MARIA DMAs the display-list list (DLL), the per-line display lists (DLs) and the
|
||||
; bitmap straight out of cartridge ROM, so the viewer only loads MARIA's colour
|
||||
; registers, points it at the DLL, turns DMA on, and loops. MARIA registers live
|
||||
; in zero page ($20-$3F).
|
||||
;
|
||||
; #defines from viewer/assemble.py --
|
||||
; SCRIPT address of the colour register script -- (reg, value) byte pairs
|
||||
; written as $0000+reg = value, terminated by $FF
|
||||
; DLL address of the display-list list
|
||||
|
||||
* = $4000
|
||||
|
||||
reset:
|
||||
sei
|
||||
cld
|
||||
ldx #$ff
|
||||
txs
|
||||
lda #$00
|
||||
sta $3c ; CTRL = 0 -- DMA off while we set up
|
||||
|
||||
; ---- load MARIA colour registers from the script ----
|
||||
ldx #$00
|
||||
sloop:
|
||||
lda SCRIPT,x
|
||||
cmp #$ff
|
||||
beq sdone
|
||||
tay ; Y = MARIA register ($20..$3F)
|
||||
inx
|
||||
lda SCRIPT,x
|
||||
sta $0000,y
|
||||
inx
|
||||
jmp sloop
|
||||
sdone:
|
||||
; ---- point MARIA at the display-list list ----
|
||||
lda #>DLL
|
||||
sta $2c ; DPPH
|
||||
lda #<DLL
|
||||
sta $30 ; DPPL
|
||||
|
||||
; ---- enable DMA (160A, no DLI) ----
|
||||
lda #$40
|
||||
sta $3c ; CTRL
|
||||
|
||||
loop:
|
||||
jmp loop ; the packer fills the reset vectors at $FFFA
|
||||
Loading…
Add table
Add a link
Reference in a new issue