Work on VERA init

This commit is contained in:
Kyle J Cardoza 2024-06-15 17:36:31 -04:00
parent 6285792ad2
commit f22e797a7e
4 changed files with 83 additions and 4 deletions

View File

@ -172,3 +172,75 @@ vera_address_decr .macro decrement
pla
.endmacro
; Copies up to 64KB of two-byte data to VERA memory, beginning at
; the provided address in VERA's address space.
;
; Arguments:
; target: The address in VERA memory at which the
; copied data will begin
; source: The address in CPU memory at which the data
; to be copied begins
; length: The number of bytes to copy to VERA memory. Must
; be a multiple of 2.
vera_write .macro target, source, length
.save_registers
; Set up the address/data VERA registers for 16-bit copying.
.vera_address_select 0
.vera_address_set \{target}
.vera_address_incr AUTO_INC_2
.vera_address_select 1
.vera_address_set \{target} + 1
.vera_address_incr AUTO_INC_2
.long_a
ldx #0
copy_loop:
lda \{source},X
sta VERA_DATA0
inx
inx
cpx #\{length}
beq copy_loop
.restore_registers
.endmacro
; Copies up to 64KB of two-byte data to CPU memory from VERA
; memory.
;
; Arguments:
; target: The address in CPU memory at which the
; copied data will begin
; source: The address in VERA memory at which the data
; to be copied begins
; length: The number of bytes to copy from VERA memory. Must
; be a multiple of 2.
vera_read .macro target, source, length
.save_registers
; Set up the address/data VERA registers for 16-bit copying.
.vera_address_select 0
.vera_address_set \{source}
.vera_address_incr AUTO_INC_2
.vera_address_select 1
.vera_address_set \{source} + 1
.vera_address_incr AUTO_INC_2
.long_a
ldx #0
copy_loop:
lda VERA_DATA0
sta \{target},X
inx
inx
cpx #\{length}
beq copy_loop
.restore_registers
.endmacro

View File

@ -31,6 +31,12 @@
.fill $C08100 - *, $EA
.dsection data
.section data
.dsection font_0
.dsection font_1
.dsection font_2
.dsection font_3
.endsection data
.cerror * > $C0FE00
.fill $C0FE00 - *, $EA

View File

@ -5,7 +5,8 @@ vera_init .proc
jsl vera_reset
; Load the VERA font.
; Load the VERA font. FIXME: target address is what?
;.vera_memcpy $000000, vera_font_0, size(data.font_0)
.restore_registers
rtl

View File

@ -1,6 +1,6 @@
.section data
vera_font
.section font_0
vera_font_0
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
.byte $00, $00, $7e, $81, $a5, $81, $81, $bd, $99, $81, $81, $7e, $00, $00, $00, $00
.byte $00, $00, $7e, $ff, $db, $ff, $ff, $c3, $e7, $ff, $ff, $7e, $00, $00, $00, $00
@ -257,5 +257,5 @@ vera_font
.byte $00, $00, $70, $88, $10, $20, $40, $f8, $00, $00, $00, $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $00, $7c, $7c, $7c, $7c, $7c, $7c, $7c, $00, $00, $00, $00
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
.endsection font_0
.endsection data