some shadow registers added to make uppercase()/lowercase() work

This commit is contained in:
Irmen de Jong 2021-12-22 21:20:34 +01:00
parent 608dc5e284
commit cabf1e82e8
4 changed files with 45 additions and 14 deletions

View File

@ -264,6 +264,14 @@ asmsub RDTIM16() -> uword @AY {
}
c128 {
; ---- C128 specific registers ----
&ubyte VM1 = $0A2C ; shadow for VUC $d018 in text mode
&ubyte VM2 = $0A2D ; shadow for VIC $d018 in bitmap screen mode
&ubyte VM3 = $0A2E ; starting page for VDC screen mem
&ubyte VM4 = $0A2F ; starting page for VDC attribute mem
; ---- C128 specific system utility routines: ----
asmsub init_system() {
@ -314,6 +322,27 @@ asmsub disable_runstop_and_charsetswitch() clobbers(A) {
}}
}
asmsub disable_basic() clobbers(A) {
%asm {{
lda $0a04 ; disable BASIC shadow registers
and #$fe
sta $0a04
lda #$01 ; disable BASIC IRQ service routine
sta $12fd
lda #$ff ; disable screen editor IRQ setup
sta $d8
lda #$b7 ; skip programmable function key check
sta $033c
lda #$0e ; bank out BASIC ROM
sta $ff00
rts
}}
}
asmsub set_irq(uword handler @AY, ubyte useKernal @Pc) clobbers(A) {
%asm {{
sta _modified+1

View File

@ -92,10 +92,12 @@ sub color (ubyte txtcol) {
sub lowercase() {
c64.VMCSB |= 2
c128.VM1 |= 2
}
sub uppercase() {
c64.VMCSB &= ~2
c128.VM1 &= ~2
}
asmsub scroll_left (ubyte alsocolors @ Pc) clobbers(A, Y) {

View File

@ -109,7 +109,7 @@ sys (part of syslib)
note: a more accurate way to wait for vsync is to set up a vsync irq handler instead.
note for cx16: the system irq handler has to be active for this to work (this is not required on c64)
``waitrastborder()`` (c64 target only)
``waitrastborder()`` (c64/c128 targets only)
busy wait till the raster position has reached the bottom screen border (approximately)
can be used to avoid screen flicker/tearing when updating screen contents.
note: a more accurate way to do this is by using a raster irq handler instead.

View File

@ -1,19 +1,19 @@
%import textio
main {
ubyte @shared joy_info
sub start() {
void pushing_start()
}
sub pushing_start() -> ubyte {
joy_info++
return not c64.READST()
}
sub derp(ubyte aa) -> ubyte {
aa++
return aa*2
str input = "?" * 20
txt.lowercase()
txt.print("Hello There! Enter Your Name: ")
void txt.input_chars(input)
txt.nl()
repeat {
txt.print(input)
txt.spc()
sys.waitvsync()
sys.waitvsync()
sys.waitvsync()
sys.waitvsync()
}
}
}