100 lines
2.1 KiB
ArmAsm
100 lines
2.1 KiB
ArmAsm
; lenser -- Atari GR.15 + DLI viewer, self-booting
|
|
; 160x192, 4 colours rewritten every 2 scanlines by a display-list interrupt.
|
|
; Appended data from $4000 ...
|
|
; $4000/$5000 bitmap (2 bits per pixel, 4K split)
|
|
; $6000 colour table, 96 bands x 4 register values
|
|
; $6400 display list (DLI bit on the last line of each 2-line band)
|
|
;
|
|
; assembled by atari/viewer/assemble.py via xa
|
|
|
|
CP = $cb ; zero-page pointer into the colour table
|
|
|
|
* = $2000
|
|
boot:
|
|
.byte 0
|
|
.byte 0 ; sector count (patched)
|
|
.word $2000
|
|
.word binit
|
|
|
|
cont:
|
|
sei
|
|
lda #$22
|
|
sta $22f ; SDMCTL
|
|
lda #$00
|
|
sta $26f ; GPRIOR = 0
|
|
lda #$00
|
|
sta $230 ; SDLSTL = $6400 (DL shipped in the data)
|
|
lda #$64
|
|
sta $231
|
|
; DLI vector
|
|
lda #<dli
|
|
sta $200
|
|
lda #>dli
|
|
sta $201
|
|
; colour pointer starts at band 1 (band 0 set by the VBI)
|
|
lda #$04
|
|
sta CP
|
|
lda #$60
|
|
sta CP+1
|
|
lda $6000
|
|
sta $2c8
|
|
lda $6001
|
|
sta $2c4
|
|
lda $6002
|
|
sta $2c5
|
|
lda $6003
|
|
sta $2c6
|
|
ldy #<vbi
|
|
ldx #>vbi
|
|
lda #$07
|
|
jsr $e45c ; SETVBV (deferred)
|
|
lda #$c0
|
|
sta $d40e ; NMIEN = DLI + VBI
|
|
cli
|
|
#include "awyt.i"
|
|
binit:
|
|
rts
|
|
|
|
vbi:
|
|
lda #$04
|
|
sta CP
|
|
lda #$60
|
|
sta CP+1
|
|
lda $6000
|
|
sta $d01a
|
|
lda $6001
|
|
sta $d016
|
|
lda $6002
|
|
sta $d017
|
|
lda $6003
|
|
sta $d018
|
|
jmp $e462 ; XITVBV
|
|
|
|
dli:
|
|
pha
|
|
tya
|
|
pha
|
|
ldy #$00
|
|
sta $d40a ; WSYNC
|
|
lda (CP),y
|
|
sta $d01a
|
|
iny
|
|
lda (CP),y
|
|
sta $d016
|
|
iny
|
|
lda (CP),y
|
|
sta $d017
|
|
iny
|
|
lda (CP),y
|
|
sta $d018
|
|
lda CP
|
|
clc
|
|
adc #$04
|
|
sta CP
|
|
bcc nocarry
|
|
inc CP+1
|
|
nocarry:
|
|
pla
|
|
tay
|
|
pla
|
|
rti
|