https://github.com/zenith391/numworks-rasterizer
Fast rasterizer for the NumWorks calculator
https://github.com/zenith391/numworks-rasterizer
numworks
Last synced: about 1 year ago
JSON representation
Fast rasterizer for the NumWorks calculator
- Host: GitHub
- URL: https://github.com/zenith391/numworks-rasterizer
- Owner: zenith391
- License: gpl-3.0
- Created: 2022-10-16T13:41:29.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T15:05:29.000Z (over 1 year ago)
- Last Synced: 2025-02-17T15:23:08.535Z (over 1 year ago)
- Topics: numworks
- Language: Zig
- Homepage:
- Size: 86.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NumWorks Rasterizer
A simple rasterizer for NumWorks calculators, made to test the feasability of running 3D graphics
on this hardware.
## Design Decisions
- A fixed-point number implementation has been added, as it has a much higher performance than
floating-point numbers on the CPU (Cortex M7). Using a lousy benchmark quickly tested on the
calculator, fixed point computations are about 10 to 15 times faster than floating point.
An excellent ressource I like discussing floating point is http://x86asm.net/articles/fixed-point-arithmetic-and-tricks/
- All vector operations use fixed point numbers, including matrix multiplication
- Linear interpolation is used for triangles, even if that's incorrect (and leaves to the warping
walls effect like in PS1 games) as it's much better for performance
## Running on your calculator
Make sure you have NodeJS installed first
1. Connect your calculator
2. You only need to execute
```sh
zig build run -Doptimize=ReleaseFast
```
(`-Doptimize=ReleaseFast` is recommended even in debug for the app to run at reasonable speed)