First public commit.
This commit is contained in:
parent
2a48f52979
commit
4bac9d83ed
288 changed files with 18417 additions and 1076 deletions
97
lenser/bbc/viewer/bbc.s
Normal file
97
lenser/bbc/viewer/bbc.s
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
; lenser -- BBC Micro viewer (6502), loaded at PAGE (&1900) and *RUN.
|
||||
;
|
||||
; Sets the screen MODE, programmes the logical->physical palette, then *LOADs the
|
||||
; image file "IMG" straight into screen memory, and holds it per the display
|
||||
; option. Parameters come from a fixed block the packager fills in (so the code
|
||||
; is constant); see build_viewer() in assemble.py.
|
||||
;
|
||||
; #defines from the wrapper -- WAITMODE (0 forever, 1 key, 2 seconds), WAITSECS, RATE.
|
||||
;
|
||||
; assembled by bbc/viewer/assemble.py via xa
|
||||
|
||||
OSWRCH = $FFEE
|
||||
OSRDCH = $FFE0
|
||||
OSBYTE = $FFF4
|
||||
OSCLI = $FFF7
|
||||
|
||||
* = $1900
|
||||
start:
|
||||
; ---- VDU 22, mode ----
|
||||
lda #22
|
||||
jsr OSWRCH
|
||||
lda p_mode
|
||||
jsr OSWRCH
|
||||
|
||||
; ---- palette via VDU 19, logical, physical, 0,0,0 for each logical ----
|
||||
ldx #0
|
||||
palloop:
|
||||
cpx p_ncol
|
||||
beq paldone
|
||||
lda #19
|
||||
jsr OSWRCH
|
||||
txa
|
||||
jsr OSWRCH ; logical colour = X
|
||||
lda p_pal,x
|
||||
jsr OSWRCH ; physical
|
||||
lda #0
|
||||
jsr OSWRCH
|
||||
jsr OSWRCH
|
||||
jsr OSWRCH
|
||||
inx
|
||||
bne palloop
|
||||
paldone:
|
||||
|
||||
; ---- hide the text cursor (VDU 23,1,0;0;0;0;) ----
|
||||
lda #23
|
||||
jsr OSWRCH
|
||||
lda #1
|
||||
jsr OSWRCH
|
||||
ldx #8
|
||||
curz:
|
||||
lda #0
|
||||
jsr OSWRCH
|
||||
dex
|
||||
bne curz
|
||||
|
||||
; ---- *LOAD the image straight into screen memory ----
|
||||
ldx #<cmd
|
||||
ldy #>cmd
|
||||
jsr OSCLI
|
||||
|
||||
; ---- hold the picture ----
|
||||
#if WAITMODE == 0
|
||||
hang:
|
||||
jmp hang
|
||||
#endif
|
||||
#if WAITMODE == 1
|
||||
jsr OSRDCH ; block until a key
|
||||
rts ; back to BASIC
|
||||
#endif
|
||||
#if WAITMODE == 2
|
||||
lda #<(WAITSECS*RATE)
|
||||
sta cnt
|
||||
lda #>(WAITSECS*RATE)
|
||||
sta cnt+1
|
||||
swait:
|
||||
lda #19
|
||||
jsr OSBYTE ; OSBYTE 19 = wait for vertical sync
|
||||
lda cnt
|
||||
bne sdec
|
||||
dec cnt+1
|
||||
sdec:
|
||||
dec cnt
|
||||
lda cnt
|
||||
ora cnt+1
|
||||
bne swait
|
||||
rts ; back to BASIC
|
||||
#endif
|
||||
|
||||
cnt: .byte 0,0
|
||||
|
||||
; OSCLI string -- the packager patches in the right screen-base hex
|
||||
cmd: .byte "LOAD IMG ", "0000", 13
|
||||
|
||||
; parameter block -- the packager fills these in
|
||||
p_mode: .byte 0
|
||||
p_ncol: .byte 0
|
||||
p_pal: .byte 0,0,0,0,0,0,0,0
|
||||
Loading…
Add table
Add a link
Reference in a new issue