For interest, I've ported an
existing Asteroids game using SDL windowing to use the ReGIS serial interface. Asteroids is an original
vector display game from 1979. It is derived from the original
SpaceWar! game from 1962.
Using ReGIS for display means that any RC2014 based system can drive a Xterm screen to produce high resolution colour vector graphics.
My game repository is here.
https://github.com/feilipu/asteroids_regisHow to get ReGIS working on XTerm is here.
https://github.com/feilipu/ReGIS?tab=re ... port-regisI have tested a bunch of different build options for a general CP/M target with 8085, z80, or z180 hardware. Obviously, the best performance is on z180 using 16-bit floating point. Only the BDOS STDIO interfaces are used for output and input. Of course either the punch or list output could alternatively be used for screen output.
Unfortunately the game is very very slow on an RC2014 z80 at 7.2MHz, so the next work is to optimise where possible.
The slowest code is
rotating the asteroids (
each with 10 vertices) on each iteration. Each vertice calculation requires a
sin() and
cos() calculation and matrix multiplication. Temporarily removing the ability for asteroids to rotate does speed things up substantially, but still nowhere near enough to make this game usable.
I mention this so that if anyone is interested in building or optimising this game so that it can run on period correct z80 based hardware (aka RC2014), it makes a good start to have working code from which to proceed.
I've used this code to further test completeness for different math libraries and machine types within z88dk. And specifically done some code optimisation using some useful z88dk math functions.
The
hypot() function is worth special mention, as using it saves a lot of loading and unloading of intermediate variables over the simple implementation of
sqrt(x*x + y*y). There are special assembly implementations for
math16,
math32, and for the APU math library
am9511.
Hope this is interesting reading.
Cheers, Phillip