From 9dde73a14ba021a97a060a102c4307f3cfe0770f Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Sun, 20 Apr 2025 13:08:09 +0200 Subject: [PATCH] Add config option for transcendental BASIC functions Also move all transcendental functions to a separate source directory Turn off these functions for all configurations for now --- Makefile | 1 + src/,,config_custom.s | 5 +++++ src/,,config_cx16.s | 5 +++++ src/,,config_generic_crt.s | 5 +++++ src/,,config_mega65.s | 5 +++++ src/,,config_testing_38K.s | 5 +++++ src/,,config_testing_60K.s | 5 +++++ src/,,config_ultimate64.s | 5 +++++ src/,,config_ultimate64_crt.s | 5 +++++ src/basic/{math => math_trans}/b9ea.interop | 0 src/basic/{math => math_trans}/b9ea.log_FAC1.s | 5 +++++ src/basic/{math => math_trans}/bf71.interop | 0 src/basic/{math => math_trans}/bf71.sqr_FAC1.s | 6 ++++++ src/basic/{math => math_trans}/bf78.interop | 0 src/basic/{math => math_trans}/bf78.pwr_FAC2_MEM.s | 6 ++++++ src/basic/{math => math_trans}/e043.interop | 0 src/basic/{math => math_trans}/e043.poly1_FAC1.s | 6 ++++++ src/basic/{math => math_trans}/e059.interop | 0 src/basic/{math => math_trans}/e059.poly2_FAC1.s | 6 ++++++ src/basic/{math => math_trans}/e264.cos_FAC1.s | 7 +++++++ src/basic/{math => math_trans}/e264.interop | 0 src/basic/{math => math_trans}/e26b.interop | 0 src/basic/{math => math_trans}/e26b.sin_FAC1.s | 5 +++++ src/basic/{math => math_trans}/e2b4.interop | 0 src/basic/{math => math_trans}/e2b4.tan_FAC1.s | 7 +++++++ src/basic/{math => math_trans}/e30e.atn_FAC1.s | 6 ++++++ src/basic/{math => math_trans}/e30e.interop | 0 src/basic/{math => math_trans}/poly_atn.s | 7 +++++++ src/basic/{math => math_trans}/poly_exp.s | 7 +++++++ src/basic/{math => math_trans}/poly_log.s | 7 +++++++ src/basic/{math => math_trans}/poly_sin.s | 6 ++++++ strings/A390034C | 3 +++ strings/A6A9012CA9 | 3 +++ strings/B0A90085 | 3 +++ strings/E0A90020 | 3 +++ 35 files changed, 134 insertions(+) rename src/basic/{math => math_trans}/b9ea.interop (100%) rename src/basic/{math => math_trans}/b9ea.log_FAC1.s (97%) rename src/basic/{math => math_trans}/bf71.interop (100%) rename src/basic/{math => math_trans}/bf71.sqr_FAC1.s (91%) rename src/basic/{math => math_trans}/bf78.interop (100%) rename src/basic/{math => math_trans}/bf78.pwr_FAC2_MEM.s (92%) rename src/basic/{math => math_trans}/e043.interop (100%) rename src/basic/{math => math_trans}/e043.poly1_FAC1.s (95%) rename src/basic/{math => math_trans}/e059.interop (100%) rename src/basic/{math => math_trans}/e059.poly2_FAC1.s (97%) rename src/basic/{math => math_trans}/e264.cos_FAC1.s (91%) rename src/basic/{math => math_trans}/e264.interop (100%) rename src/basic/{math => math_trans}/e26b.interop (100%) rename src/basic/{math => math_trans}/e26b.sin_FAC1.s (96%) rename src/basic/{math => math_trans}/e2b4.interop (100%) rename src/basic/{math => math_trans}/e2b4.tan_FAC1.s (94%) rename src/basic/{math => math_trans}/e30e.atn_FAC1.s (96%) rename src/basic/{math => math_trans}/e30e.interop (100%) rename src/basic/{math => math_trans}/poly_atn.s (92%) rename src/basic/{math => math_trans}/poly_exp.s (90%) rename src/basic/{math => math_trans}/poly_log.s (87%) rename src/basic/{math => math_trans}/poly_sin.s (91%) create mode 100644 strings/A390034C create mode 100644 strings/A6A9012CA9 create mode 100644 strings/B0A90085 create mode 100644 strings/E0A90020 diff --git a/Makefile b/Makefile index 3df903d9..a06a6849 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ SRCDIR_BASIC = $(SRCDIR_COMMON) \ src/basic/math \ src/basic/math_consts \ src/basic/math_mov \ + src/basic/math_trans \ src/basic/memory \ src/basic/print \ src/basic/rom_revision \ diff --git a/src/,,config_custom.s b/src/,,config_custom.s index 6c33a923..a35a5866 100644 --- a/src/,,config_custom.s +++ b/src/,,config_custom.s @@ -114,6 +114,11 @@ ;; #CONFIG# BCD_SAFE_INTERRUPTS YES +; --- BASIC features + +;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO + + ; --- Eye candy ;; #CONFIG# COLORS_BRAND NO diff --git a/src/,,config_cx16.s b/src/,,config_cx16.s index f5605fd9..b848b562 100644 --- a/src/,,config_cx16.s +++ b/src/,,config_cx16.s @@ -51,6 +51,11 @@ ;; #CONFIG# BCD_SAFE_INTERRUPTS YES +; --- BASIC features + +;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO + + ; --- Eye candy ;; #CONFIG# COLORS_BRAND NO diff --git a/src/,,config_generic_crt.s b/src/,,config_generic_crt.s index 37dc7deb..c50faf6d 100644 --- a/src/,,config_generic_crt.s +++ b/src/,,config_generic_crt.s @@ -105,6 +105,11 @@ ;; #CONFIG# BCD_SAFE_INTERRUPTS YES +; --- BASIC features + +;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO + + ; --- Eye candy ;; #CONFIG# COLORS_BRAND YES diff --git a/src/,,config_mega65.s b/src/,,config_mega65.s index 07bdd2ca..d9f34a9d 100644 --- a/src/,,config_mega65.s +++ b/src/,,config_mega65.s @@ -88,6 +88,11 @@ ;; #CONFIG# BCD_SAFE_INTERRUPTS YES +; --- BASIC features + +;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO + + ; --- Built-in DOS configuration ;; #CONFIG# UNIT_SDCARD 27 diff --git a/src/,,config_testing_38K.s b/src/,,config_testing_38K.s index 3371fb6e..bf008a0d 100644 --- a/src/,,config_testing_38K.s +++ b/src/,,config_testing_38K.s @@ -103,6 +103,11 @@ ;; #CONFIG# BCD_SAFE_INTERRUPTS YES +; --- BASIC features + +;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO + + ; --- Eye candy ;; #CONFIG# COLORS_BRAND NO diff --git a/src/,,config_testing_60K.s b/src/,,config_testing_60K.s index f2b60b78..73001456 100644 --- a/src/,,config_testing_60K.s +++ b/src/,,config_testing_60K.s @@ -103,6 +103,11 @@ ;; #CONFIG# BCD_SAFE_INTERRUPTS YES +; --- BASIC features + +;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO + + ; --- Eye candy ;; #CONFIG# COLORS_BRAND NO diff --git a/src/,,config_ultimate64.s b/src/,,config_ultimate64.s index e292e4b0..fa223469 100644 --- a/src/,,config_ultimate64.s +++ b/src/,,config_ultimate64.s @@ -93,6 +93,11 @@ ;; #CONFIG# BCD_SAFE_INTERRUPTS YES +; --- BASIC features + +;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO + + ; --- Eye candy ;; #CONFIG# COLORS_BRAND YES diff --git a/src/,,config_ultimate64_crt.s b/src/,,config_ultimate64_crt.s index 710d5077..062d3124 100644 --- a/src/,,config_ultimate64_crt.s +++ b/src/,,config_ultimate64_crt.s @@ -95,6 +95,11 @@ ;; #CONFIG# BCD_SAFE_INTERRUPTS YES +; --- BASIC features + +;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO + + ; --- Eye candy ;; #CONFIG# COLORS_BRAND YES diff --git a/src/basic/math/b9ea.interop b/src/basic/math_trans/b9ea.interop similarity index 100% rename from src/basic/math/b9ea.interop rename to src/basic/math_trans/b9ea.interop diff --git a/src/basic/math/b9ea.log_FAC1.s b/src/basic/math_trans/b9ea.log_FAC1.s similarity index 97% rename from src/basic/math/b9ea.log_FAC1.s rename to src/basic/math_trans/b9ea.log_FAC1.s index 9f2f609d..5c9f7e2e 100644 --- a/src/basic/math/b9ea.log_FAC1.s +++ b/src/basic/math_trans/b9ea.log_FAC1.s @@ -22,6 +22,8 @@ ; 5. Multiply by LOG(2) giving LOG(X) +!ifdef CONFIG_TRANSCENDENTAL_FUNCTIONS { + log_FAC1: lda FAC1_exponent ; Store exponent for later @@ -62,3 +64,6 @@ log_FAC1: ldy #>const_LOG_2 ; FAC1 <- FAC1 * log(2.0) lda #const_HALF_PI lda #poly_sin lda #