remove hacks from floats.parse now that kernal R47 is out

This commit is contained in:
Irmen de Jong 2024-03-30 22:29:13 +01:00
parent ff23fb0086
commit 63a4525f06
2 changed files with 5 additions and 16 deletions

View File

@ -136,14 +136,12 @@ asmsub FREADUY (ubyte value @Y) {
}
asmsub parse(str value @AY) -> float @FAC1 {
; -- parse a string value of a number to float in FAC1
; warning: on older <R47 kernals it uses an internal BASIC routine that is ROM version dependent,
; ($deb6 is inside the routine for VAL at $deb3) See basic.sym from x16-rom
; TODO once ROM v47 is released, all the workarounds here can be removed. But probably keep the kernal VAL_1 existance check
; -- Parse a string value of a number to float in FAC1.
; Requires kernal R47 or newer! (depends on val_1 working)
%asm {{
ldx VAL_1
cpx #$4c ; is there an implementation in VAL_1? (test for JMP)
bne + ; no, do it ourselves
bne _borked ; no, print error message
pha ; yes, count the length and call rom VAL_1.
phy
jsr prog8_lib.strlen
@ -151,15 +149,7 @@ asmsub parse(str value @AY) -> float @FAC1 {
ply
plx
jmp VAL_1
+ sta $a9 ; 'index' variable
sty $aa
jsr prog8_lib.strlen
lda $deb6
cmp #$d0 ; sanity check for kernal routine correct
bne +
tya
jmp $deb6 ; kernal version dependent...
+ ; print error message if routine is borked in kernal, and exit program
_borked
ldy #0
- lda _msg,y
beq +
@ -168,7 +158,7 @@ asmsub parse(str value @AY) -> float @FAC1 {
bne -
+ jmp sys.exit
_msg .text 13,"?val kaputt",13,0
_msg .text 13,"?rom 47+ required for val1",13,0
}}
}

View File

@ -51,7 +51,6 @@ Compiler:
Libraries:
- gfx2: add EOR mode support like in monogfx and see PAINT for inspiration. Self modifying code to keep it optimized?
- once kernal rom v47 is released, remove most of the workarounds in cx16 floats.parse_f() . Prototype parse routine in examples/cx16/floatparse.p8
- fix the problems in atari target, and flesh out its libraries.
- c128 target: make syslib more complete (missing kernal routines)?
- pet32 target: make syslib more complete (missing kernal routines)?