several more stubs for math routines

This commit is contained in:
FeralChild64 committed 2020-01-29 18:24:31 +01:00
1 parent ee9bda8652
commit 9de9a6c0a7
43 files changed
+535 -20

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - convert FAC1 to 16-bit signed integer
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 105
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
//
// XXX provide implementation
FACINX:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - subtract FAC1 from RAM
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 112
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FSUB:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+23
View File
@@ -0,0 +1,23 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - subtract FAC1 from FAC2
//
// Input:
// - .A - must load FAC1 exponent ($61) beforehand to set the zero flag
//
// Note:
// - load FAC2 after FAC1, or mimic the Kernals sign comparison
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 112
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FSUBT:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - add RAM to FAC1
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 112
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FADD:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+23
View File
@@ -0,0 +1,23 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - add FAC2 to FAC1
//
// Input:
// - .A - must load FAC1 exponent ($61) beforehand to set the zero flag
//
// Note:
// - load FAC2 after FAC1, or mimic the Kernals sign comparison
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 112
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FADDT:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+24
View File
@@ -0,0 +1,24 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - multiplies FAC1 by RAM
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// Note:
// - C64 Wiki calls it FMULT, this looks like a mistake
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 113
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FMUL:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+23
View File
@@ -0,0 +1,23 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - multiplies FAC1 by FAC2
//
// Input:
// - .A - must load FAC1 exponent ($61) beforehand to set the zero flag
//
// Note:
// - load FAC2 after FAC1, or mimic the Kernals sign comparison
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 113 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
FMULT:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+17
View File
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - multiply FAC1 by 10
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
MUL10:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - divide FAC1 by 10, result is always positive
//
// Notes:
// - shifts FAC1 to FAC2, loads FAC1 with the constant 10, falls through to the division routine
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
DIV10:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - divide RAM by FAC1
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FDIV:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+23
View File
@@ -0,0 +1,23 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - divide FAC2 by FAC1, ignores sign
//
// Input:
// - .A - must load FAC1 exponent ($61) beforehand to set the zero flag
//
// Output:
// - leaves the quotient FAC1 and the remainder in FAC2
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FDIVT:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+20
View File
@@ -0,0 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - evaluate FAC1 sign
//
// Output:
// - .A - $00 for equal, $01 for FAC1 > RAM, $FF for FAC1 < RAM
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
SIGN:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+28
View File
@@ -0,0 +1,28 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - compare FAC1 with RAM location
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// Output:
// - .A - $00 for equal, $01 for FAC1 > RAM, $FF for FAC1 < RAM
// - flags N/Z, depending on whether FAC1 is 0, positive, or negative
//
// Notes:
// - uses vector at $24, leaves FAC1 and FAC2 unchanged (Codebase64)
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FCOMP:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - set FAC1 as RAM raised to the power of FAC1
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 117 (FPWRT)
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FPWR:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+24
View File
@@ -0,0 +1,24 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - set FAC1 as FAC2 raised to the power of FAC1
//
// Input:
// - .A - must load FAC1 exponent ($61) beforehand to set the zero flag
//
// Note:
// - load FAC2 after FAC1, or mimic the Kernals sign comparison
// - uses exp(x*log(y)) formula to calculate y^x; slow and inaccurate
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 117
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FPWRT:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+16
View File
@@ -0,0 +1,16 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - toggle FAC1 sign (if not 0)
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 117
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
//
// XXX provide implementation
NEGOP:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+27
View File
@@ -0,0 +1,27 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - evaluate polynomial with odd powers only for FAC1 value
//
// Input:
// - .A - table address low byte
// - .Y - table address low byte
// - table format:
// - polynomial degree (8 bit integer)
// - oefficients (floats), starting from highest degree, times 1+degree
//
// Notes:
// - calls POLY2(table, X*X)*X
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 206
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://www.c64-wiki.com/wiki/POLY1
//
// XXX provide implementation
POLY1:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+27
View File
@@ -0,0 +1,27 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - evaluate polynomial with odd and even powers for FAC1 value
//
// Input:
// - .A - table address low byte
// - .Y - table address low byte
// - table format:
// - polynomial degree (8 bit integer)
// - oefficients (floats), starting from highest degree, times 1+degree
//
// Notes:
// - uses Horner method
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 207
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://www.c64-wiki.com/wiki/POLY1
//
// XXX provide implementation
POLY2:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+17
View File
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - cosine of FAC1 in radians
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 210
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
COS:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+17
View File
@@ -0,0 +1,17 @@
// #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:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+17
View File
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - tangent of FAC1 in radians
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 210
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
TAN:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example