diff options
-rw-r--r-- | conio/cgetc.s | 2 | ||||
-rw-r--r-- | conio/cputc.s | 4 | ||||
-rw-r--r-- | conio/mul40.s | 20 | ||||
-rw-r--r-- | console.s | 2 |
4 files changed, 25 insertions, 3 deletions
diff --git a/conio/cgetc.s b/conio/cgetc.s index d1ae705..0085258 100644 --- a/conio/cgetc.s +++ b/conio/cgetc.s @@ -8,7 +8,7 @@ .include "atari.inc" .export _cgetc .import KEYBDV_handler - .import cursor,mul40 + .import cursor _cgetc: lda #12 diff --git a/conio/cputc.s b/conio/cputc.s index fb60ffc..60fa7cc 100644 --- a/conio/cputc.s +++ b/conio/cputc.s @@ -15,11 +15,13 @@ ;.export _cputcxy, _cputc .export _cputc .export plot, cputdirect, putchar - .import popa, _gotoxy, mul40 + .import popa, _gotoxy .importzp tmp4,ptr4 .import _revflag .include "atari.inc" + .include "mul40.s" + ;_cputcxy: ;pha ; Save C diff --git a/conio/mul40.s b/conio/mul40.s new file mode 100644 index 0000000..99dd006 --- /dev/null +++ b/conio/mul40.s @@ -0,0 +1,20 @@ +; Compatibility wrapper for cc65's mul40 or _mul40 library routine. +; Necessary because cc65 <= 2.17 has "mul40" as part of its atari +; library, but 2.18 and up made it a C-callable routine on all +; platforms, meaning its name grew a _ in front, "_mul40". + +; The .VERSION pseudo-variable is documented as "major version +; times $100, plus minor version times $10". Whoever came up with +; this design must have thought the minor version would never exceed +; 15... starting with 2.16, the minor nybble overflows into the major +; one, meaning cc65-2.17's .VERSION is actually $0310. Which is fine, +; so long as there's never a cc65 major version 3.x (if this happens, +; versions 3.0 and 3.1 will fail to build this correctly, then 3.2 +; will work again). + +.if .VERSION <= $0310 ; $0310 == 2.17 + .import mul40 +.else + .import _mul40 +mul40 = _mul40 +.endif @@ -1,10 +1,10 @@ .include "atari.inc" + .include "conio/mul40.s" .export _clrtobot, _clrtoeol, _clr_screen, _clrtoline, _cspaces, _cblank, _backspace, _cprint_pipe, _cprint_bang, _cspace, _cputc_s, _comma_space, _cprint_colon_space, _cprint_question_space, _cprint_period, _cprint_taipan_prompt, _crlf, _plus_or_space, _gotox0y, _cputc0, _set_orders .export _rvs_on, _rvs_off - .import mul40 ; from cc65's runtime .importzp tmp3 ; ditto .import _revflag ; conio/revers.s .import bump_destptr ; these two are |