mirror of
https://github.com/cc65/cc65.git
synced 2025-02-08 11:31:34 +00:00
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:
parent
925a589b90
commit
feb5026823
@ -330,6 +330,7 @@ usage.
|
|||||||
<item>_dos_type
|
<item>_dos_type
|
||||||
<item>_filetype
|
<item>_filetype
|
||||||
<item>_datetime
|
<item>_datetime
|
||||||
|
<item>allow_lowercase
|
||||||
<item>beep
|
<item>beep
|
||||||
<item>get_ostype
|
<item>get_ostype
|
||||||
<item>gmtime_dt
|
<item>gmtime_dt
|
||||||
|
@ -95,6 +95,7 @@ function.
|
|||||||
|
|
||||||
<itemize>
|
<itemize>
|
||||||
<item>_dos_type
|
<item>_dos_type
|
||||||
|
<item>allow_lowercase
|
||||||
<item><ref id="beep" name="beep">
|
<item><ref id="beep" name="beep">
|
||||||
<item><ref id="get_ostype" name="get_ostype">
|
<item><ref id="get_ostype" name="get_ostype">
|
||||||
<item><ref id="gmtime_dt" name="gmtime_dt">
|
<item><ref id="gmtime_dt" name="gmtime_dt">
|
||||||
|
@ -232,6 +232,16 @@ struct tm* __fastcall__ gmtime_dt (const struct datetime* dt);
|
|||||||
time_t __fastcall__ mktime_dt (const struct datetime* dt);
|
time_t __fastcall__ mktime_dt (const struct datetime* dt);
|
||||||
/* Converts a ProDOS date/time structure to a time_t UNIX timestamp */
|
/* Converts a ProDOS date/time structure to a time_t UNIX timestamp */
|
||||||
|
|
||||||
|
#if !defined(__APPLE2ENH__)
|
||||||
|
unsigned char __fastcall__ allow_lowercase (unsigned char onoff);
|
||||||
|
/* If onoff is 0, lowercase characters printed to the screen via STDIO and
|
||||||
|
** CONIO are forced to uppercase. If onoff is 1, lowercase characters are
|
||||||
|
** printed to the screen untouched. By default lowercase characters are
|
||||||
|
** forced to uppercase because a stock Apple ][+ doesn't support lowercase
|
||||||
|
** display. The function returns the old lowercase setting.
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* End of apple2.h */
|
/* End of apple2.h */
|
||||||
|
23
libsrc/apple2/allow_lowercase.s
Normal file
23
libsrc/apple2/allow_lowercase.s
Normal 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
|
@ -11,6 +11,9 @@
|
|||||||
.export _cputcxy, _cputc
|
.export _cputcxy, _cputc
|
||||||
.export cputdirect, newline, putchar, putchardirect
|
.export cputdirect, newline, putchar, putchardirect
|
||||||
.import gotoxy, VTABZ
|
.import gotoxy, VTABZ
|
||||||
|
.ifndef __APPLE2ENH__
|
||||||
|
.import uppercasemask
|
||||||
|
.endif
|
||||||
|
|
||||||
.include "apple2.inc"
|
.include "apple2.inc"
|
||||||
|
|
||||||
@ -43,7 +46,7 @@ _cputc:
|
|||||||
.ifndef __APPLE2ENH__
|
.ifndef __APPLE2ENH__
|
||||||
cmp #$E0 ; Test for lowercase
|
cmp #$E0 ; Test for lowercase
|
||||||
bcc cputdirect
|
bcc cputdirect
|
||||||
and #$DF ; Convert to uppercase
|
and uppercasemask
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
cputdirect:
|
cputdirect:
|
||||||
|
9
libsrc/apple2/uppercasemask.s
Normal file
9
libsrc/apple2/uppercasemask.s
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2024-08-06
|
||||||
|
;
|
||||||
|
|
||||||
|
.export uppercasemask
|
||||||
|
|
||||||
|
.data
|
||||||
|
|
||||||
|
uppercasemask: .byte $DF ; Convert to uppercase
|
@ -7,6 +7,9 @@
|
|||||||
.export _write
|
.export _write
|
||||||
.import rwprolog, rwcommon, rwepilog
|
.import rwprolog, rwcommon, rwepilog
|
||||||
.import COUT
|
.import COUT
|
||||||
|
.ifndef __APPLE2ENH__
|
||||||
|
.import uppercasemask
|
||||||
|
.endif
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "errno.inc"
|
.include "errno.inc"
|
||||||
@ -84,7 +87,7 @@ next: lda (ptr1),y
|
|||||||
.ifndef __APPLE2ENH__
|
.ifndef __APPLE2ENH__
|
||||||
cmp #$E0 ; Test for lowercase
|
cmp #$E0 ; Test for lowercase
|
||||||
bcc output
|
bcc output
|
||||||
and #$DF ; Convert to uppercase
|
and uppercasemask
|
||||||
.endif
|
.endif
|
||||||
output: jsr COUT ; Preserves X and Y
|
output: jsr COUT ; Preserves X and Y
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user