mirror of
https://github.com/irmen/prog8.git
synced 2024-10-19 07:23:56 +00:00
added CX16 VERA registers, made txt.fill_screen work on CX16
This commit is contained in:
parent
438f3ee8d2
commit
f45eabdd9e
@ -79,6 +79,49 @@ cx16 {
|
|||||||
&uword r14 = $1e
|
&uword r14 = $1e
|
||||||
&uword r15 = $20
|
&uword r15 = $20
|
||||||
|
|
||||||
|
; VERA registers
|
||||||
|
|
||||||
|
const uword VERA_BASE = $9F20
|
||||||
|
&uword VERA_ADDR_L = VERA_BASE + $00
|
||||||
|
&uword VERA_ADDR_M = VERA_BASE + $01
|
||||||
|
&uword VERA_ADDR_H = VERA_BASE + $02
|
||||||
|
&uword VERA_DATA0 = VERA_BASE + $03
|
||||||
|
&uword VERA_DATA1 = VERA_BASE + $04
|
||||||
|
&uword VERA_CTRL = VERA_BASE + $05
|
||||||
|
&uword VERA_IEN = VERA_BASE + $06
|
||||||
|
&uword VERA_ISR = VERA_BASE + $07
|
||||||
|
&uword VERA_IRQ_LINE_L = VERA_BASE + $08
|
||||||
|
&uword VERA_DC_VIDEO = VERA_BASE + $09
|
||||||
|
&uword VERA_DC_HSCALE = VERA_BASE + $0A
|
||||||
|
&uword VERA_DC_VSCALE = VERA_BASE + $0B
|
||||||
|
&uword VERA_DC_BORDER = VERA_BASE + $0C
|
||||||
|
&uword VERA_DC_HSTART = VERA_BASE + $09
|
||||||
|
&uword VERA_DC_HSTOP = VERA_BASE + $0A
|
||||||
|
&uword VERA_DC_VSTART = VERA_BASE + $0B
|
||||||
|
&uword VERA_DC_VSTOP = VERA_BASE + $0C
|
||||||
|
&uword VERA_L0_CONFIG = VERA_BASE + $0D
|
||||||
|
&uword VERA_L0_MAPBASE = VERA_BASE + $0E
|
||||||
|
&uword VERA_L0_TILEBASE = VERA_BASE + $0F
|
||||||
|
&uword VERA_L0_HSCROLL_L = VERA_BASE + $10
|
||||||
|
&uword VERA_L0_HSCROLL_H = VERA_BASE + $11
|
||||||
|
&uword VERA_L0_VSCROLL_L = VERA_BASE + $12
|
||||||
|
&uword VERA_L0_VSCROLL_H = VERA_BASE + $13
|
||||||
|
&uword VERA_L1_CONFIG = VERA_BASE + $14
|
||||||
|
&uword VERA_L1_MAPBASE = VERA_BASE + $15
|
||||||
|
&uword VERA_L1_TILEBASE = VERA_BASE + $16
|
||||||
|
&uword VERA_L1_HSCROLL_L = VERA_BASE + $17
|
||||||
|
&uword VERA_L1_HSCROLL_H = VERA_BASE + $18
|
||||||
|
&uword VERA_L1_VSCROLL_L = VERA_BASE + $19
|
||||||
|
&uword VERA_L1_VSCROLL_H = VERA_BASE + $1A
|
||||||
|
&uword VERA_AUDIO_CTRL = VERA_BASE + $1B
|
||||||
|
&uword VERA_AUDIO_RATE = VERA_BASE + $1C
|
||||||
|
&uword VERA_AUDIO_DATA = VERA_BASE + $1D
|
||||||
|
&uword VERA_SPI_DATA = VERA_BASE + $1E
|
||||||
|
&uword VERA_SPI_CTRL = VERA_BASE + $1F
|
||||||
|
; VERA_PSG_BASE = $1F9C0
|
||||||
|
; VERA_PALETTE_BASE = $1FA00
|
||||||
|
; VERA_SPRITES_BASE = $1FC00
|
||||||
|
|
||||||
|
|
||||||
; supported C128 additions
|
; supported C128 additions
|
||||||
romsub $ff4a = close_all()
|
romsub $ff4a = close_all()
|
||||||
|
@ -17,20 +17,38 @@ sub clear_screen() {
|
|||||||
|
|
||||||
|
|
||||||
asmsub fill_screen (ubyte char @ A, ubyte txtcolor @ Y) clobbers(A) {
|
asmsub fill_screen (ubyte char @ A, ubyte txtcolor @ Y) clobbers(A) {
|
||||||
; ---- clear the character screen with the given fill character and character color.
|
; ---- fill the character screen with the given fill character and character color.
|
||||||
|
|
||||||
%asm {{
|
%asm {{
|
||||||
pha
|
sta P8ZP_SCRATCH_W1 ; fillchar
|
||||||
tya
|
sty P8ZP_SCRATCH_W1+1 ; textcolor
|
||||||
and #$0f
|
phx
|
||||||
lda txt.color_to_charcode,y
|
jsr c64.SCREEN ; get dimensions in X/Y
|
||||||
jsr c64.CHROUT
|
dex
|
||||||
pla
|
dey
|
||||||
cmp #' '
|
txa
|
||||||
bne +
|
asl a
|
||||||
lda #147 ; clear screen
|
adc #1
|
||||||
jmp c64.CHROUT
|
sta P8ZP_SCRATCH_B1
|
||||||
+ ; TODO fill the screen with a different fillchar (not space) - not yet supported
|
- ldx P8ZP_SCRATCH_B1
|
||||||
|
- stz cx16.VERA_ADDR_H
|
||||||
|
stx cx16.VERA_ADDR_L
|
||||||
|
sty cx16.VERA_ADDR_M
|
||||||
|
lda cx16.VERA_DATA0
|
||||||
|
and #$f0
|
||||||
|
ora P8ZP_SCRATCH_W1+1
|
||||||
|
sta cx16.VERA_DATA0
|
||||||
|
dex
|
||||||
|
stz cx16.VERA_ADDR_H
|
||||||
|
stx cx16.VERA_ADDR_L
|
||||||
|
sty cx16.VERA_ADDR_M
|
||||||
|
lda P8ZP_SCRATCH_W1
|
||||||
|
sta cx16.VERA_DATA0
|
||||||
|
dex
|
||||||
|
cpx #255
|
||||||
|
bne -
|
||||||
|
dey
|
||||||
|
bpl --
|
||||||
|
plx
|
||||||
rts
|
rts
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user