[J-core] Pondering j-core kickstarter ideas.

Ken Phillis Jr kphillisjr at gmail.com
Thu Oct 19 17:24:54 EDT 2017

On Thu, Oct 19, 2017 at 11:02 AM, mike maloney <mikerm610 at gmail.com> wrote:
> What about porting or extending something similar to
> http://belogic.com/uzebox/index.asp
> It's open source console running on a microcontroller. The j2 should be able
> to handle it. Though an extended library to support 3d on the j3+ should be
> doable. Just a thought.
> Mike

I stated this before, but the J2 Core is capable of handling 3D Math.
The trick is to use Fixed Point Arithmetic[1] to perform calculations.
This is a common method for providing a limited form of decimal math
on systems lacking an hardware Floating Point Unit. Fixed Point
arithmetic is what allowed the original Dos version of Id Software's
Doom game to be playable on Intel 386 and Intel 486sx processors.

Now as far as Consoles are Concerned, I know that 1990's Home Consoles
[2][3], and  Handheld Consoles [4][5] used Fixed Point math for all 3D
computations because the hardware actually lacked floating point
calculations. Also, Taking a few tricks from these consoles, The
J-Core chip can be coaxed into extremely fast performance for 3d math
with very few issues... The steps for this are as follows...

Step 1: Add Hardware Acceleration for Fixed Point Calculations

For the Most part, this is adding instructions for the various
calculations found in Libfixmath [6]. The accelerated functions an be
done as a Co-Processor, but in general this is making modifications to
the Integer ALU.

Step 2: Implement Hardware Vector Math.

This is SIMD Instructions for Fixed Point math. In general these
instructions are geared towards improving performance for Fixed Point
Matrices [7] and Fixed Point Vectors [8] math. The SIMD Instructions
for Fixed Point Vectors can be used to Fixed Point Matrix math.

Step 3: Implement a 3D Software Renderer for the Hardware

This is straight forward once the Vector math is implemented. A
simplified 3D rendering demo, and tutorial set exists on github [9].
The author of this project has a set of Wiki pages attached that helps
greatly with explaining how the Modern 3D graphics chips work. This
covers both Fragment Shaders and Vertex Shaders.The only issue is this
tutorial is written using mostly Floating point math.

Step 4: Port popular libraries to the Device.

This is mostly porting the libraries game and software developers use
to create games. Some of the libraries are things like zlib, libPNG,
libSDL 1.2, libSDL2, etc.

[1] Wikipedia: Fixed Point Arithmetic:
[2] Wikipedia: Playstation 1 Console:
[3] Wikipedia: Sega Saturn Console: https://en.wikipedia.org/wiki/Sega_Saturn
[4] Wikipedia: Nintendo GameBoy Advance:
[5] Wikipedia: Nintendo DS: https://en.wikipedia.org/wiki/Nintendo_DS
[6] Github: Libfixmath: https://github.com/PetteriAimonen/libfixmath
[7] Github: LibfixMatrix: https://github.com/PetteriAimonen/libfixmatrix
[8] Github: Vector_lib: https://github.com/rampantpixels/vector_lib
Note: This library uses Floating Point, so The math needs slight changes.
[9] Github: Tinyrenderer: https://github.com/ssloy/tinyrenderer
Note: This tutorial is written against mostly Floating Point Math, but
it can be used with changes to make use of the Fixed point math.

More information about the J-core mailing list