Logo
News
Menu News Editorials Reviews Best of Saturn Resources Magazine Netplay Friends
 
 
 

NEW Powerful Development Tools to Push Sega Saturn’s Limits…

A new development library by Danny , SaturnMath++ has just been released. SaturnMath++ is a C++23 library dedicated to Sega Saturn hardware, offering essential mathematical operations tailored for fixed-point arithmetic and geometric calculations.

Why is this important, though? Well, the Sega Saturn has always been an interesting piece of hardware, with an arguably complex architecture that is, at the same time, simply brimming with potential… It’s a fascinating collection CPUs, VDPs, DSPs & microcontrollers that always allowed for more than one way of doing things, and this relative freedom is what really set it apart from PlayStation and made it a real ‘programmer’s machine’ .

Unlike N64, both Saturn & PlayStation did NOT have a Z-Buffer (depth buffer), which means that in order to draw 3D environments that were perspective-correct, they relied heavily on fixed-point arithmetic and lookup tables in order to basically approximate your character’s position in 3-dimensional space. The required maths had to be crunched by the system’s CPU and were pretty power hungry. Often times, this limitation would result in warped surfaces near the camera (aka affine texture warping) .

Some games suffered from this more than others, and depending on how good the math was , certain developers were able to mitigate this flaw almost entirely. (Saturn’s use of quads for geometry also helps with this). Below is an example of Lobotomy Software’s Quake (upscaled to 4K) . No warping here…

When it comes to homebrew game development, though, most folks have had to rely on SGL for math calculations, which is basically the same thing developers used (and struggled with) back in the day… SegaXtreme member Danny has decided to do something about that with the release of his new math library!

SaturnMath++ is a high-performance mathematical library specifically engineered for Sega Saturn game development. It provides a comprehensive suite of fixed-point arithmetic operations, vector/matrix transformations, and geometric calculations optimized for the Saturn’s SH-2 processors.

Developed with the Saturn’s unique hardware architecture in mind, SaturnMath++ addresses the platform’s key constraints while maximizing performance:

  • Fixed-Point Precision : Replaces costly floating-point operations with optimized 16.16 fixed-point arithmetic
  • Hardware-Aware Design : Takes advantage of the SH-2’s 32-bit operations and instruction set
  • Performance-First Philosophy : Offers multiple precision levels to balance accuracy and speed
  • Modern C++ Features : Leverages C++23 capabilities for compile-time optimizations
  • Zero Overhead : No dynamic memory allocation, minimal branching, and cache-friendly data structures

Danny claims to have spent months just on the alternate trigonometric functions and square root functions, and SegaXtreme members SLACK and Hassmaschine helped test the the square root functions with good results. The trigonometric functions still need to be tested on real hardware, but they appear to be a bit faster via emulation, and significantly more accurate, with higher resolution. Danny has written a special algorithm for interpolation that avoids gaps the way standard lookup tables do and does not require costly divisions [speaking in terms of CPU cycles].

Whether you’re developing a 3D racing game, a 2D sprite-based platformer, or a complex simulation, SaturnMath++ provides the mathematical foundation you need without sacrificing precious CPU cycles. SaturnMath++ will be used natively within SuperReye’s SRL (SaturnRingLibrary) , an easy to use SGL (SegaGraphicsLibrary) wrapper written in C++ that is currently in development.


SaturnDave
 

A massive Saturn fan since Christmas '96, Dave is enthusiastic about growing the community and spreading Saturn love and knowledge to fans old and new. Co-founding the SEGA SATURN, SHIRO! podcast back in 2017 and creating the SHIRO! SHOW in 2020, he seeks to create interesting and engaging Saturn-related content for the community. Dave's interests circle around game preservation, and he is a huge fan of game magazines and developer interviews.

 
 
Next Prev Go to top