diff --git a/STATUS.md b/STATUS.md index 53bab291..408f61ae 100644 --- a/STATUS.md +++ b/STATUS.md @@ -253,8 +253,8 @@ Floating point mathematical routines - not official, but well known and broadly | `$E097` | `rnd_FAC1` | DONE | | | `$E09A` | `rnd_A` | DONE | | | `$E0BE` | `rnd_generate` | DONE | | -| `$E264` | `cos_FAC1` | PARTIAL | needs `sin_FAC1` | -| `$E26B` | `sin_FAC1` | NOT DONE | some work already started | +| `$E264` | `cos_FAC1` | PARTIAL | not fully tested yet | +| `$E26B` | `sin_FAC1` | PARTIAL | not fully tested yet | | `$E2B4` | `tan_FAC1` | NOT DONE | | | `$E30E` | `atn_FAC1` | NOT DONE | | diff --git a/src/basic/,stubs_math/e26b.sin_FAC1.s b/src/basic/,stubs_math/e26b.sin_FAC1.s deleted file mode 100644 index f1f2f340..00000000 --- a/src/basic/,stubs_math/e26b.sin_FAC1.s +++ /dev/null @@ -1,29 +0,0 @@ -;; #LAYOUT# STD * #TAKE -;; #LAYOUT# * BASIC_0 #TAKE -;; #LAYOUT# * * #IGNORE - -; -; Math package - sine of FAC1 in radians -; -; See also: -; - [CM64] Computes Mapping the Commodore 64 - page 210 - XXX address does not match -; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic -; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics -; - -; XXX provide implementation - -sin_FAC1: - - +STUB_IMPLEMENTATION - -poly_sin: - - !byte $05 ; series length - 1 - - +PUT_CONST_POLY_SIN_1 - +PUT_CONST_POLY_SIN_2 - +PUT_CONST_POLY_SIN_3 - +PUT_CONST_POLY_SIN_4 - +PUT_CONST_POLY_SIN_5 - +PUT_CONST_POLY_SIN_6 diff --git a/src/basic/,stubs_math/e26b.interop b/src/basic/math/e26b.interop similarity index 100% rename from src/basic/,stubs_math/e26b.interop rename to src/basic/math/e26b.interop diff --git a/src/basic/math/e26b.sin_FAC1.s b/src/basic/math/e26b.sin_FAC1.s new file mode 100644 index 00000000..65c48f0f --- /dev/null +++ b/src/basic/math/e26b.sin_FAC1.s @@ -0,0 +1,55 @@ +;; #LAYOUT# STD * #TAKE +;; #LAYOUT# * BASIC_0 #TAKE +;; #LAYOUT# * * #IGNORE + +; +; Math package - sine of FAC1 in radians +; +; See also: +; - [CM64] Computes Mapping the Commodore 64 - page 210 - XXX address does not match +; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic +; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics +; - https://www.c64-wiki.com/wiki/SIN + + + +sin_FAC1: + + jsr mov_FAC1_FAC2 ; FAC1 <- X / (2*pi) (X2) + ldy #>const_DOUBLE_PI + lda #const_QUARTER + lda #sin_three_quarters + lda #const_ONE + lda #const_HALF + lda #poly_sin + lda #