preparation for using DMAgic in the screen editor

This commit is contained in:
FeralChild64 committed 2020-08-30 19:27:48 +02:00
1 parent 6507a1f74b
commit 34a7759804
7 files changed
+87 -4

No files matched your search

+1 -1
View File
@@ -70,7 +70,7 @@ The following ROM features are currently missing:
| :----------------: | :------: | :------------------------------------------------: |
| VIC-II | DONE | |
| 80 columns, VDC | NOT DONE | |
| 80 columns, Mega65 | PARTIAL | work-in-progreess, not useable yet |
| 80 columns, Mega65 | PARTIAL | work-in-progress |
<br />
+19 -1
View File
@@ -52,6 +52,24 @@
.label M65_TXTWIN_X1 = $590 // text window - bottom-right X coordinate + 1
.label M65_TXTWIN_Y1 = $591 // text window - bottom-right Y coordinate + 1
.label M65_TXTROW_OFF = $592 // $592-$593 offset to the current text row
// $594-$5FF -- UNUSED --
// $594-$5EB -- UNUSED --
.label M65_DMAGIC_LIST = $5EF // $5EF-$5FF reserved for DMAgic list, 17 bytes
.label M65_RS232_INBUF = $600 // $600-$6FF -- reserved for RS-232 input buffer --
.label M65_RS232_OUTBUF = $700 // $700-$7FF -- reserved for RS-232 output buffer --
//
// Addresses for configuring the DMA job
//
.label M65_DMAJOB_SIZE_0 = M65_DMAGIC_LIST + 7
.label M65_DMAJOB_SIZE_1 = M65_DMAGIC_LIST + 8
.label M65_DMAJOB_SRC_0 = M65_DMAGIC_LIST + 10
.label M65_DMAJOB_SRC_1 = M65_DMAGIC_LIST + 11
.label M65_DMAJOB_SRC_2 = M65_DMAGIC_LIST + 9
.label M65_DMAJOB_SRC_3 = M65_DMAGIC_LIST + 2
.label M65_DMAJOB_DST_0 = M65_DMAGIC_LIST + 13
.label M65_DMAJOB_DST_1 = M65_DMAGIC_LIST + 14
.label M65_DMAJOB_DST_2 = M65_DMAGIC_LIST + 12
.label M65_DMAJOB_DST_3 = M65_DMAGIC_LIST + 4
+63
View File
@@ -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
+2
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -3,6 +3,7 @@
// XXX deduplicate pointer manipulation, see M65_CLRSCR
// XXX consider using DMAgic for this - FILL command
M65_CLRWIN: