Added option to disable the force-to-uppercase behavior of the apple2 target. (#2474)

* Added option to disable the force-to-uppercase behavior of the apple2 target.

* Fixed dangling spaces.
This commit is contained in:
Oliver Schmidt
2024-08-07 18:27:09 +02:00
committed by GitHub
parent 925a589b90
commit feb5026823
7 changed files with 52 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
;
; Oliver Schmidt, 2024-08-06
;
; unsigned char __fastcall__ allow_lowercase (unsigned char onoff);
;
.export _allow_lowercase
.import uppercasemask, return0, return1
_allow_lowercase:
tax
lda values,x
ldx uppercasemask
sta uppercasemask
cpx #$FF
beq :+
jmp return0
: jmp return1
.rodata
values: .byte $DF ; Force uppercase
.byte $FF ; Keep lowercase

View File

@@ -11,6 +11,9 @@
.export _cputcxy, _cputc
.export cputdirect, newline, putchar, putchardirect
.import gotoxy, VTABZ
.ifndef __APPLE2ENH__
.import uppercasemask
.endif
.include "apple2.inc"
@@ -43,7 +46,7 @@ _cputc:
.ifndef __APPLE2ENH__
cmp #$E0 ; Test for lowercase
bcc cputdirect
and #$DF ; Convert to uppercase
and uppercasemask
.endif
cputdirect:

View File

@@ -0,0 +1,9 @@
;
; Oliver Schmidt, 2024-08-06
;
.export uppercasemask
.data
uppercasemask: .byte $DF ; Convert to uppercase

View File

@@ -7,6 +7,9 @@
.export _write
.import rwprolog, rwcommon, rwepilog
.import COUT
.ifndef __APPLE2ENH__
.import uppercasemask
.endif
.include "zeropage.inc"
.include "errno.inc"
@@ -84,7 +87,7 @@ next: lda (ptr1),y
.ifndef __APPLE2ENH__
cmp #$E0 ; Test for lowercase
bcc output
and #$DF ; Convert to uppercase
and uppercasemask
.endif
output: jsr COUT ; Preserves X and Y