Working Python version for Commodore.
This commit is contained in:
commit
2a48f52979
51 changed files with 3095 additions and 0 deletions
98
c64view/viewer/multicolor.s
Normal file
98
c64view/viewer/multicolor.s
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
; c64view -- multicolor (Koala) bitmap viewer (self-contained)
|
||||
;
|
||||
; The picture data is appended to this program by the exporter and loads in one
|
||||
; pass, so no second disk access is needed. 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)
|
||||
; $4328 colram 1000 (copied to $D800)
|
||||
; $4710 background 1
|
||||
;
|
||||
; 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:
|
||||
lda #$0b
|
||||
sta $d011 ; blank screen 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
|
||||
|
||||
; copy colour RAM $4328 -> $D800
|
||||
lda #$28
|
||||
sta SRC
|
||||
lda #$43
|
||||
sta SRC+1
|
||||
lda #$00
|
||||
sta DST
|
||||
lda #$d8
|
||||
sta DST+1
|
||||
jsr copy1024
|
||||
|
||||
; program the VIC-II
|
||||
lda $dd00
|
||||
ora #$03
|
||||
sta $dd00 ; VIC bank 0 ($0000-$3FFF)
|
||||
lda $4710
|
||||
sta $d021 ; background colour
|
||||
lda #$00
|
||||
sta $d020 ; border black
|
||||
lda #$18
|
||||
sta $d018 ; screen $0400, bitmap $2000
|
||||
lda #$d8
|
||||
sta $d016 ; multicolor mode on
|
||||
lda #$3b
|
||||
sta $d011 ; bitmap mode, display on
|
||||
lda #$ff
|
||||
sta $cc ; disable cursor blink
|
||||
|
||||
waitkey:
|
||||
jsr $ffe4 ; GETIN
|
||||
beq waitkey
|
||||
|
||||
; restore text mode and return to BASIC
|
||||
lda #$1b
|
||||
sta $d011
|
||||
lda #$c8
|
||||
sta $d016
|
||||
lda #$15
|
||||
sta $d018
|
||||
lda #$00
|
||||
sta $cc
|
||||
jsr $e544 ; clear screen
|
||||
rts
|
||||
|
||||
; copy 1024 bytes from (SRC) to (DST)
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue