more work towards MEGA65 native mode screen support
This commit is contained in:
1 parent
0d4898d91c
commit
ee549361ab
7 files changed
+101
-38
No files matched your search
@@ -20,6 +20,13 @@
|
|||||||
.label M65_LPNT_KERN = $EE // $EE-$F1 4-byte pointer for temporary usage by KERNAL
|
.label M65_LPNT_KERN = $EE // $EE-$F1 4-byte pointer for temporary usage by KERNAL
|
||||||
.label M65_TMP__K2 = $F2 // $F2 -- UNUSED -- temporary value for various Kernal routines
|
.label M65_TMP__K2 = $F2 // $F2 -- UNUSED -- temporary value for various Kernal routines
|
||||||
|
|
||||||
|
//
|
||||||
|
// Page 0 - other reused values
|
||||||
|
//
|
||||||
|
|
||||||
|
.label M65__TXTROW = PNTR // screen row
|
||||||
|
.label M65__TXTCOL = TBLX // screen column
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pages 4-7 - reused screen memory
|
// Pages 4-7 - reused screen memory
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
.label return_from_interrupt = KERNAL_0.return_from_interrupt
|
.label return_from_interrupt = KERNAL_0.return_from_interrupt
|
||||||
.label clrchn_reset = KERNAL_0.clrchn_reset
|
.label clrchn_reset = KERNAL_0.clrchn_reset
|
||||||
.label udtim_keyboard = KERNAL_0.udtim_keyboard
|
.label udtim_keyboard = KERNAL_0.udtim_keyboard
|
||||||
|
.label chrout_to_screen_code = KERNAL_0.chrout_to_screen_code
|
||||||
|
|
||||||
.label setup_irq_timer = KERNAL_0.setup_irq_timer
|
.label setup_irq_timer = KERNAL_0.setup_irq_timer
|
||||||
.label wait_x_bars = KERNAL_0.wait_x_bars
|
.label wait_x_bars = KERNAL_0.wait_x_bars
|
||||||
|
|||||||
@@ -26,49 +26,16 @@ chrout_screen:
|
|||||||
// ones are always printable characters; separate away control codes
|
// ones are always printable characters; separate away control codes
|
||||||
|
|
||||||
and #$60
|
and #$60
|
||||||
bne !+
|
beq_16 chrout_screen_control
|
||||||
jmp chrout_screen_control
|
|
||||||
!:
|
|
||||||
txa
|
txa
|
||||||
|
|
||||||
// Literals - first convert PETSCII to screen code
|
// Literals - first convert PETSCII to screen code
|
||||||
|
|
||||||
// Codes $C0-$DF become $40-$5F
|
jsr chrout_to_screen_code
|
||||||
cmp #$E0
|
|
||||||
bcs !+
|
|
||||||
cmp #$C0
|
|
||||||
bcc !+
|
|
||||||
|
|
||||||
and #$7F
|
|
||||||
jmp chrout_screen_literal // not high char
|
|
||||||
|
|
||||||
!:
|
|
||||||
// Range $20-$3F is unchanged
|
|
||||||
cmp #$40
|
|
||||||
bcc chrout_screen_literal // not high char
|
|
||||||
|
|
||||||
// Unshifted letters and symbols from $40-$5F
|
|
||||||
// all end up being -$40
|
|
||||||
// (C64 PRG p376)
|
|
||||||
|
|
||||||
// But anything >= $80 needs to be -$40
|
|
||||||
// (C64 PRG p380-381)
|
|
||||||
// And bit 7 should be cleared, only to be
|
|
||||||
// set by reverse video
|
|
||||||
sec
|
|
||||||
sbc #$40
|
|
||||||
|
|
||||||
// Fix shifted chars by adding $20 again
|
|
||||||
cmp #$20
|
|
||||||
bcc chrout_screen_literal // not high char
|
|
||||||
cmp #$40
|
|
||||||
bcs chrout_screen_literal // not high char
|
|
||||||
clc
|
|
||||||
adc #$20
|
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
chrout_screen_literal:
|
chrout_screen_literal: // entry point for chrout_screen_quote
|
||||||
|
|
||||||
// Write normal character on the screen
|
// Write normal character on the screen
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * KERNAL_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
//
|
||||||
|
// CHROUT routine - convert PETSCII to screen code
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
chrout_to_screen_code:
|
||||||
|
|
||||||
|
// Codes $C0-$DF become $40-$5F
|
||||||
|
cmp #$E0
|
||||||
|
bcs !+
|
||||||
|
cmp #$C0
|
||||||
|
bcc !+
|
||||||
|
|
||||||
|
and #$7F
|
||||||
|
rts // not high char
|
||||||
|
!:
|
||||||
|
// Range $20-$3F is unchanged
|
||||||
|
cmp #$40
|
||||||
|
bcc !+ // not high char
|
||||||
|
|
||||||
|
// Unshifted letters and symbols from $40-$5F
|
||||||
|
// all end up being -$40
|
||||||
|
// (C64 PRG p376)
|
||||||
|
|
||||||
|
// But anything >= $80 needs to be -$40
|
||||||
|
// (C64 PRG p380-381)
|
||||||
|
// And bit 7 should be cleared, only to be
|
||||||
|
// set by reverse video
|
||||||
|
sec
|
||||||
|
sbc #$40
|
||||||
|
|
||||||
|
// Fix shifted chars by adding $20 again
|
||||||
|
cmp #$20
|
||||||
|
bcc !+ // not high char
|
||||||
|
cmp #$40
|
||||||
|
bcs !+ // not high char
|
||||||
|
clc
|
||||||
|
adc #$20
|
||||||
|
!:
|
||||||
|
rts
|
||||||
@@ -1,9 +1,40 @@
|
|||||||
// #LAYOUT# M65 KERNAL_1 #TAKE
|
// #LAYOUT# M65 KERNAL_1 #TAKE
|
||||||
// #LAYOUT# * * #IGNORE
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
//
|
||||||
|
// CHROUT routine - screen support (character output), MEGA65 native mode version
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
m65_chrout_screen:
|
m65_chrout_screen:
|
||||||
|
|
||||||
// XXX provide implementation
|
// XXX hide cursor if visible
|
||||||
|
|
||||||
|
lda SCHAR
|
||||||
|
tax
|
||||||
|
|
||||||
|
// All the PETSCII control codes are within $0x, $1x, $8x, $9x, remaining
|
||||||
|
// ones are always printable characters; separate away control codes
|
||||||
|
|
||||||
|
and #$60
|
||||||
|
beq_16 m65_chrout_screen_control
|
||||||
|
txa
|
||||||
|
|
||||||
|
// Literals - first convert PETSCII to screen code
|
||||||
|
|
||||||
|
jsr chrout_to_screen_code
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
|
m65_chrout_screen_literal: // entry point for m65_chrout_screen_quote
|
||||||
|
|
||||||
|
// Write normal character on the screen
|
||||||
|
|
||||||
|
tax // store screen code, we need .A for calculations
|
||||||
|
|
||||||
|
// XXX continue the implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rts
|
rts
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// #LAYOUT# M65 KERNAL_1 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
|
||||||
|
m65_chrout_screen_control:
|
||||||
|
|
||||||
|
// XXX provide implementation
|
||||||
|
|
||||||
|
rts
|
||||||
@@ -113,6 +113,10 @@ m65_clrscr_loop:
|
|||||||
|
|
||||||
// Set screen variables
|
// Set screen variables
|
||||||
|
|
||||||
// XXX implement this, together with HOME
|
// XXX provide proper implementation, together with HOME
|
||||||
|
|
||||||
|
lda #$00
|
||||||
|
sta M65__TXTROW
|
||||||
|
sta M65__TXTCOL
|
||||||
|
|
||||||
rts
|
rts
|
||||||
Reference in new issue
Block a user