more work towards Mega65 screen support
This commit is contained in:
1 parent
83cdf37c0d
commit
52e2060026
11 files changed
+221
-24
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user