more work towards Mega65 screen support

This commit is contained in:
FeralChild64 committed 2020-08-08 20:39:55 +02:00
1 parent 83cdf37c0d
commit 52e2060026
11 files changed
+221 -24

No files matched your search

@@ -23,6 +23,8 @@
.label VK1__M65_MODE65 = $4000 + 2 * 9
.label VK1__M65_SCRMODEGET = $4000 + 2 * 10
.label VK1__M65_SCRMODESET = $4000 + 2 * 11
.label VK1__M65_CLRSCR = $4000 + 2 * 12
.label VK1__M65_CLRWIN = $4000 + 2 * 13
#else
@@ -61,6 +63,8 @@
.word M65_MODE64
.word M65_MODE65
.word M65_SCRMODEGET
.word M65_SCRMODESET
.word M65_SCRMODESET
.word M65_CLRSCR
.word M65_CLRWIN
#endif
+20 -3
View File
@@ -9,22 +9,39 @@ M65_MODE64:
jsr map_KERNAL_1
jsr_ind VK1__M65_MODE64
jmp map_NORMAL
bra m65_api_end
M65_MODE65:
jsr map_KERNAL_1
jsr_ind VK1__M65_MODE65
jmp map_NORMAL
bra m65_api_end
M65_SCRMODEGET:
jsr map_KERNAL_1
jsr_ind VK1__M65_SCRMODEGET
jmp map_NORMAL
bra m65_api_end
M65_SCRMODESET:
jsr map_KERNAL_1
jsr_ind VK1__M65_SCRMODESET
bra m65_api_end
M65_CLRSCR:
jsr map_KERNAL_1
jsr_ind VK1__M65_CLRSCR
bra m65_api_end
M65_CLRWIN:
jsr map_KERNAL_1
jsr_ind VK1__M65_CLRWIN
// FALLTROUGH
m65_api_end:
jmp map_NORMAL
@@ -12,4 +12,3 @@ m65_chrout_screen:
jsr_ind VK1__m65_chrout_screen
jsr map_NORMAL
jmp chrout_done_success
@@ -25,3 +25,9 @@ M65_JFAST:
M65_JSELDEV:
jsr SELDEV
M65_JCLRSCR:
jsr M65_CLRSCR
M65_JCLRWIN:
jsr M65_CLRWIN
-9
View File
@@ -1,9 +0,0 @@
// #LAYOUT# M65 KERNAL_1 #TAKE
// #LAYOUT# * * #IGNORE
M65_CLRSCR:
// XXX impplement this
rts
@@ -0,0 +1,83 @@
// #LAYOUT# M65 KERNAL_1 #TAKE
// #LAYOUT# * * #IGNORE
M65_CLRSCR:
// Set the text window to whole screen area
lda #$00
sta M65_TXTWIN_X0
sta M65_TXTWIN_Y0
ldx M65_SCRMODE
lda m65_scrtab_txtwidth, X
sta M65_TXTWIN_X1
lda m65_scrtab_txtheight, X
sta M65_TXTWIN_Y1
// FALLTROUGH
M65_CLRWIN:
// To clear the window, two zeropage long pointers will be used:
// - M65_LPNT_SCR for screen memory
// - M65_LPNT_KERN for colour memory (starts from $FF80000)
// First initialize both pointers
ldx #$03
!:
lda M65_SCRTXTBASE,x
sta M65_LPNT_SCR,x
lda #$00
sta M65_LPNT_KERN,x
dex
bpl !-
lda #$0F
sta M65_LPNT_KERN+2
lda #$F8
sta M65_LPNT_KERN+1
// Go trough all the rows
phz
ldy #$00
// FALLTROUGH
m65_clrwin_loop:
// Check if .Y cordinate is not below the window
cpy M65_TXTWIN_Y0
bcc m65_clrwin_loop_next // branch if we should skip this row
// Clear the row
ldz M65_TXTWIN_X0
!:
lda #$20
sta_lp (M65_LPNT_SCR),z
lda #$00
sta_lp (M65_LPNT_KERN),z
inz
cpz M65_TXTWIN_X1
bne !-
// FALLTROUGH
m65_clrwin_loop_next:
iny
// XXX
plz
// XXX implement this
rts
+13 -3
View File
@@ -2,10 +2,20 @@
// #LAYOUT# * * #IGNORE
// Table of parameters for VIC control register B
m65_scrtab_vic_ctrlb:
m65_scrtab_vic_ctrlb: // parameters for VIC control register B
.byte %00100000 // 40x25 + extended attributes
.byte %10100000 // 80x25 + extended attributes
.byte %10100100 // 80x50 + extended attributes
m65_scrtab_txtwidth: // width of the text screen
.byte 40
.byte 80
.byte 80
m65_scrtab_txtheight: // height of the text screen
.byte 25
.byte 25
.byte 50