Update convert_Y_to_FAC1

This commit is contained in:
Rikard Nordgren authored and FeralChild64 committed 2026-03-29 21:45:24 +02:00
1 parent 27b03948a2
commit 376823fc65
3 files changed
+10 -7

No files matched your search

+1 -1
View File
@@ -200,7 +200,7 @@ Floating point mathematical routines - not official, but well known and broadly
| `$B1AA` | `FACINX` | NOT DONE | convert FAC1 to 16-bit signed integer |
| `$B1BF` | `convert_FAC1_to_s16` | NOT DONE | |
| `$B391` | `GIVAYF` | PARTIAL | not fully tested yet |
| `$B3A2` | `convert_Y_to_FAC1` | DONE | |
| `$B3A2` | `convert_Y_to_FAC1` | DONE | From the Microsoft BASIC, original name: SNGFLT |
| `$B794` | `convert_u8_A_to_FAC1` | DONE | |
| `$B7B5` | `STRVAL` | PARTIAL | Only for 38k memory model |
| `$B7F7` | `convert_FAC1_to_ADDR` | NOT DONE | |
+7 -5
View File
@@ -3,7 +3,9 @@
;; #LAYOUT# * BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
;
; This file is under the MIT license, it contains code released by Microsoft Corporation.
; See LICENSE for more information.
; Math package - convert uint8 in Y to FAC1
;
; Input: Y - uint8 to convert to float
@@ -11,6 +13,8 @@
;
; Stores Y into first FAC1 mantissa byte, clears the second and calls convert_i16_to_FAC1
;
; This is verified to be identical to the original Microsoft implementation where it was named SNGFLT.
;
; - https://www.c64-wiki.com/wiki/BASIC-ROM
; - https://sta.c64.org/cbm64basconv.html
; - https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
@@ -18,7 +22,5 @@
;
convert_Y_to_FAC1:
sty FAC1_mantissa+1
lda #$00
sta FAC1_mantissa
jmp convert_i16_to_FAC1
lda #0
beq GIVAYF ; Always branches
+2 -1
View File
@@ -20,9 +20,10 @@ int matches[MAX_SIZE];
int phase_mask[MAX_SIZE+MAX_SIZE];
#define NUM_CHUNKS 6
#define NUM_CHUNKS 7
// Pairs of start, end memory addresses of known exact similarity with the open source Microsoft BASIC
unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = {
0xB3A2, 0xB3A5,
0xB849, 0xB84F,
0xB8D2, 0xB8D5,
0xB947, 0xB97D,