preparation for using DMAgic in the screen editor
This commit is contained in:
1 parent
6507a1f74b
commit
34a7759804
7 files changed
+87
-4
No files matched your search
@@ -0,0 +1,63 @@
|
||||
// #LAYOUT# M65 KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
// Helper routines for DMAgic usage
|
||||
|
||||
// See:
|
||||
// - https://c65gs.blogspot.com/2019/03/auto-detecting-required-revision-of.html
|
||||
// - https://c65gs.blogspot.com/2018/01/improving-dmagic-controller-interface.html
|
||||
|
||||
|
||||
// XXX: finish the implementation, use in screen editor
|
||||
|
||||
|
||||
m65_dmagic_oper_copy:
|
||||
|
||||
// To configure parameters, use:
|
||||
// - M65_DMAJOB_SIZE_*
|
||||
// - M65_DMAJOB_SRC_*
|
||||
// - M65_DMAJOB_DST_*
|
||||
|
||||
lda #$00
|
||||
sta M65_DMAGIC_LIST+6 // operation: copy
|
||||
|
||||
jmp_8 m65_dmagic_common
|
||||
|
||||
m65_dmagic_oper_fill:
|
||||
|
||||
// XXX provide implementation
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
m65_dmagic_common:
|
||||
|
||||
lda #$0A
|
||||
sta M65_DMAGIC_LIST+0 // <- $0A = use F018A list format (it is shorter by 1 byte)
|
||||
lda #$80
|
||||
sta M65_DMAGIC_LIST+1 // <- $80 = next byte is highest 8 bits of source address
|
||||
inc_a
|
||||
sta M65_DMAGIC_LIST+3 // <- $80 = next byte is highest 8 bits of destination address
|
||||
|
||||
lda #$00
|
||||
sta M65_DMAGIC_LIST+5 // <- end of options
|
||||
|
||||
sta M65_DMAGIC_LIST+15 // <- set modulo to 0
|
||||
sta M65_DMAGIC_LIST+16
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
m65_dmagic_launch:
|
||||
|
||||
// Launch the DMA list
|
||||
|
||||
lda #$00
|
||||
sta DMA_ADDRBANK // $D702
|
||||
sta DMA_ADDRMB // $D704
|
||||
|
||||
lda #>M65_DMAGIC_LIST
|
||||
sta DMA_ADDRMSB // $D701
|
||||
|
||||
lda #<M65_DMAGIC_LIST
|
||||
sta DMA_ETRIG // $D705
|
||||
|
||||
rts
|
||||
@@ -38,6 +38,8 @@
|
||||
.label viciv_unhide = KERNAL_0.viciv_unhide
|
||||
.label viciv_init = KERNAL_0.viciv_init
|
||||
.label viciv_shutdown = KERNAL_0.viciv_shutdown
|
||||
.label m65_dmagic_oper_copy = KERNAL_0.m65_dmagic_oper_copy
|
||||
.label m65_dmagic_oper_fill = KERNAL_0.m65_dmagic_oper_fill
|
||||
|
||||
.label m65_scrtab_txtwidth = KERNAL_0.m65_scrtab_txtwidth
|
||||
.label m65_scrtab_txtheight = KERNAL_0.m65_scrtab_txtheight
|
||||
|
||||
@@ -42,8 +42,6 @@ m65_chrout_screen_RETURN:
|
||||
sta INSRT
|
||||
sta RVS
|
||||
|
||||
// XXX should we clear special colour attributes too?
|
||||
|
||||
// Move cursor to the beginning of the next line
|
||||
|
||||
bit M65_SCRWINMODE
|
||||
|
||||
@@ -31,6 +31,7 @@ m65_clrscr_takeover: // .A has to be 0
|
||||
sta M65_TXTROW_OFF+1
|
||||
|
||||
// Clear the whole screen+color memory
|
||||
// XXX consider using DMAgic for this - FILL command
|
||||
|
||||
phz
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
// XXX deduplicate pointer manipulation, see M65_CLRSCR
|
||||
// XXX consider using DMAgic for this - FILL command
|
||||
|
||||
M65_CLRWIN:
|
||||
|
||||
|
||||
Reference in new issue
Block a user