; lenser -- hires bitmap viewer (self-contained) ; ; The picture data is appended to this program by the exporter and loads in one ; pass. Fixed memory layout after load: ; $0801 this program (BASIC stub + ML, padded up to $2000) ; $2000 bitmap 8000 (VIC reads here directly) ; $3F40 screen 1000 (copied to $0400) ; ; assembled by viewer/assemble.py via xa ; BASIC autostart, SYS 2061 * = $0801 .word basicend .word 10 .byte $9e .byte "2061" .byte 0 basicend: .word 0 ; ML begins at $080D SRC = $fb DST = $fd start: #include "loaddata.i" lda #$0b sta $d011 ; blank during setup ; copy screen RAM $3F40 -> $0400 lda #$40 sta SRC lda #$3f sta SRC+1 lda #$00 sta DST lda #$04 sta DST+1 jsr copy1024 lda $dd00 ora #$03 sta $dd00 ; VIC bank 0 lda #$00 sta $d020 lda #$18 sta $d018 ; screen $0400, bitmap $2000 lda #$c8 sta $d016 ; hires (multicolor off) lda #$3b sta $d011 ; bitmap mode, display on lda #$ff sta $cc #include "wait.i" lda #$1b sta $d011 lda #$c8 sta $d016 lda #$15 sta $d018 lda #$0e sta $d020 ; restore default border (light blue) lda #$06 sta $d021 ; and background (blue) for a clean BASIC screen lda #$00 sta $cc jsr $e544 rts copy1024: ldx #4 ldy #0 cploop: lda (SRC),y sta (DST),y iny bne cploop inc SRC+1 inc DST+1 dex bne cploop rts