1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2026-03-12 01:41:40 +00:00
Commit Graph

2208 Commits

Author SHA1 Message Date
Brendan Robert
2db2129806 Implement additional hardware-accelerated functions using trig identities
Extended hardware acceleration to more functions by using mathematical
identities with the base MegaFlash FPU operations:

New Functions (all hardware-accelerated):
- neg(x) = x * -1 (preserves precision vs sign flip)
- abs(x) = sign check + neg if needed
- log2(x) = ln(x) / ln(2)
- pow2(x) = e^(x * ln(2))
- asin(x) = atan(x / sqrt(1 - x²))
- acos(x) = π/2 - asin(x)
- sinh(x) = (e^x - e^-x) / 2
- cosh(x) = (e^x + e^-x) / 2
- tanh(x) = sinh(x) / cosh(x)
- sec(x) = 1 / cos(x)
- csc(x) = 1 / sin(x)
- cot(x) = 1 / tan(x)

All functions use hardware mul, div, sqrt, sin, cos, tan, atan, ln, and exp
operations from MegaFlash, providing significant speedup over software
implementations.

Updated documentation to reflect extended hardware acceleration coverage.
2026-01-24 17:49:32 -06:00
Brendan Robert
a4fa5a162a Fix spelling: Thomas Fok (not Tomas) 2026-01-24 17:42:43 -06:00
Brendan Robert
680a1c032b Update MegaFlash repository link to https://github.com/ThomasFok/MegaFlash 2026-01-24 17:41:56 -06:00
Brendan Robert
9555036473 Fix attribution: MegaFlash hardware by Tomas Fok 2026-01-24 17:41:28 -06:00
Brendan Robert
3103d44635 Add MegaFlash hardware-accelerated FPU library (fpu_mf)
This commit adds optional hardware floating-point acceleration for PLASMA
programs running on Apple IIc/IIc+ systems with MegaFlash storage devices.

New Features:
- fpu_mf.pla: Drop-in replacement for fpu.pla with hardware acceleration
- API-compatible with existing fpu.pla library
- Automatic hardware detection and transparent SANE fallback
- 10-100x speedup for transcendental functions (sin, cos, tan, log, exp)
- 3-5x speedup for multiplication and division

New Files:
- src/inc/megaflash.plh: MegaFlash hardware constants
- src/libsrc/fpu_mf.pla: Hardware-accelerated FPU library
- src/libsrc/README_fpu_mf.md: Library documentation
- src/samplesrc/fptest_mf.pla: Comprehensive test program
- MEGAFLASH_FPU.md: Integration overview and PR documentation

Usage:
Users can switch from 'import fpu' to 'import fpu_mf' with no other
code changes required. Programs work on all systems (with or without
MegaFlash hardware).

Backwards Compatibility:
- No changes to existing PLASMA code
- Opt-in only - existing programs unchanged
- Works on all Apple II systems (fallback to SANE if no hardware)

Technical Details:
- Automatic format conversion (SANE Extended <-> MBF)
- Hardware operations: mul, div, sqrt, sin, cos, tan, atan, ln, exp
- SANE fallback for unsupported operations
- MegaFlash detection via ID register ()

See MEGAFLASH_FPU.md for complete documentation.
2026-01-24 17:36:30 -06:00
David Schmenk
e2ef600dd2 Add visibility algorithm to solving 2026-01-24 13:24:04 -08:00
David Schmenk
e22ad3e3c1 Updaate the update image 2026-01-08 14:41:50 -08:00
David Schmenk
3a03bbd5f8 Add self booting MAZE RUNNER disk image 2026-01-03 15:00:54 -08:00
David Schmenk
51a33d5750 Timer divisor measured on actual //c 2026-01-03 14:56:37 -08:00
David Schmenk
a9befc3b37 Improved maze generation and timer result 2026-01-03 13:59:08 -08:00
David Schmenk
e968a5911f Further random number improvements 2026-01-02 20:04:45 -08:00
David Schmenk
2522d1faab Play again option 2026-01-02 17:47:17 -08:00
David Schmenk
2239b6de9e Force 40 column mode before HGR 2026-01-02 15:56:01 -08:00
David Schmenk
0424867ead Maze game and improve random numbers 2026-01-02 14:39:51 -08:00
David Schmenk
0d4b0f9607 Change autorun script 2026-01-01 11:02:50 -08:00
David Schmenk
6bc88b8f7d Change volume label 2025-12-30 19:14:05 -08:00
David Schmenk
ff175b5d1e Script cleanup 2025-12-30 08:33:30 -08:00
David Schmenk
dd545c7aa5 Improve starbusrt visual 2025-12-29 16:32:02 -08:00
David Schmenk
102b1ef652 Happy New Year 2026 demo 2025-12-29 13:43:58 -08:00
David Schmenk
c143596032 run turtle graphics demo in PLFORTH disk image 2025-12-22 07:29:47 -08:00
David Schmenk
e3550d4a83 Add fixed point move routine and sample 2025-12-21 17:27:53 -08:00
David Schmenk
d6a51f4656 Update turtle graphics sample 2025-12-20 21:40:15 -08:00
David Schmenk
5830f8b34e Add to turtle graphics demo 2025-12-20 15:08:32 -08:00
David Schmenk
eafd2df444 Fix resetting of lastsym after execmod 2025-12-20 13:38:36 -08:00
David Schmenk
fffb06b8b3 Add TXTMODE word 2025-12-20 09:21:51 -08:00
David Schmenk
34bc475d16 Add TXTMODE word 2025-12-20 09:18:41 -08:00
David Schmenk
b9c84db58e Update sample code 2025-12-19 15:20:29 -08:00
David Schmenk
2d419672e0 Tweak line clip outcode checks 2025-12-15 20:15:59 -08:00
David Schmenk
ca6bad1068 Update plasma.4th 2025-12-15 19:22:09 -08:00
David Schmenk
b3f980b330 Update 2.21 files 2025-12-15 18:54:53 -08:00
David Schmenk
8da58ce734 Update grturtle.4th script 2025-12-13 14:51:12 -08:00
David Schmenk
9c76ea92c3 Simplify turtle API 2025-12-11 18:28:45 -08:00
David Schmenk
d35774eac4 Use high precision cos for RGB->DHGR Conversion
Add some raster op routines for FORTH turtle graphcis
2025-12-10 15:23:30 -08:00
David Schmenk
f987458a15 Use fractional coordinates to improve angular movement accuracy 2025-12-09 09:47:34 -08:00
David Schmenk
1286daff45 Why am I having problems editing this script? 2025-12-07 14:57:52 -08:00
David Schmenk
9891eec8cd Why haven't I ever had the problem with the filename before? 2025-12-07 14:39:06 -08:00
David Schmenk
2955e07d93 Fix TEXT hack to check that it is already defined 2025-12-04 04:36:44 -08:00
David Schmenk
786bb692f6 Hack fix for crashing textmode set from hgrlib 2025-12-04 04:28:51 -08:00
David Schmenk
c4b98f1866 Increase symbol table and increase free memory for 64K VM 2025-12-03 19:57:24 -08:00
David Schmenk
6b4017abb1 Fix extended clip line error and add mixed hires mode turtle 2025-12-03 09:02:22 -08:00
David Schmenk
1413ddd30a Fix sin/cos accuracy 2025-12-02 17:51:09 -08:00
David Schmenk
73bf667236 make FORTH callable from PLASMA 2025-12-02 16:28:51 -08:00
David Schmenk
1dd707dcee Remove unused tilebuf init 2025-12-02 10:01:51 -08:00
David Schmenk
43c5ed5839 Break out HGR libraries into separate includes for memory savings 2025-12-02 09:59:34 -08:00
David Schmenk
ca87c5b678 Update turtle test 2025-12-01 19:55:16 -08:00
David Schmenk
af2e3143f6 Add rounding to sin/cos calc to improve accuracy 2025-12-01 19:24:44 -08:00
David Schmenk
15488e61c7 Add hires turtle graphics sample 2025-12-01 17:51:04 -08:00
David Schmenk
4172c2c5e4 Move and increase symbol table 2025-12-01 16:53:04 -08:00
David Schmenk
77b94b0339 Initial turtle graphics library 2025-12-01 11:06:58 -08:00
David Schmenk
35dd0f0eb5 add SINCOS include 2025-11-30 13:58:45 -08:00