Baremetal: Spics and specs

Yes, you are reading right. After more than a year I have been PiTrexing again lately. You might have also seen that on the additional pages accessable from the PiTrex menu.

Anyway, I just want to sum up the changes I did the last couple of weeks.

Major enhancement 1: Vectrex emulation
I have consolidated the vectrex emulations in ONE emulator. Theoretically these are “three”.
a) VIA emulation
b) VIA direct access
c) VIA direct access with exact timing

At the time I make no use of the VIA emulation part. The other two can be used.
The best one (where nearly all programs are running 100% correct) is c). I also added save/load features for Vectorblade in special and “general” save states in general (you can e.g. save you Animaction RAM). – Ah, btw extra RAM is emulated.

The b) emulator can not run everything – but what it runs, it runs just the better. With this thing it is possible to run emulation with a 30% speed increase which in many games results in less flicker.

The exact emulation was possible due to changing every access to via to be “wrapped” in Pi-Cycle counters for EXACT timings. Actually I didn’t think this was possible – but I proved myself wrong… yeah!

Major enhancement 2: New Menu
I built a completely new menu system to start things. This has graphical representation of almost all available games. Very nice!

Beginnings of the menu system can be seen in this video…

Major enhancement 3: Emulator ROMS
All roms can now be used from a “current” MAME distribution. Just copy the ZIP files into the ROM directory. YES, ZIP is supported! Files are checked for the correct CRC.

Major enhancement 4: Vectrex Interface
After doing the “exact” thing to the Vectrex emulators, I also changed the complete vectrexInterface.c to also use cycle timing.
The CycleCounter of the Pi is used to time SET/GET to/from VIA. This one “resets” upon each access.
The Counter1 is used for other timing stuff, this one is reset once every vectrex round, timing must use “setMark()” and/or waitUntilMark() functionalities (e.g. T1 timing, Zero timing, “round” timing…)
These changes made the output a couple of percent faster, and the image much more stable.
Also this is in preparation of a new feature I call “interleaved emulation” – but I have not started that yet.

Major enhancement 5: Asteroids
I always wanted to revisit the emulators to enhance “specific” emulators. My first test step here was Asteroids. There were a couple of things that were annoying:
– the blinking “PUSH START” made the whole game “breath”
– the bright shots made the whole gamescreen grow/shrink
– the asteroids were not moving really “smooth”, near the edges they even started to “shake” a little
– sounds were not correctly played (sometimes)
All of the above are “done” as good as I probably can. Asteroids looks really, REALLY slick now!
(Although – if you want it to look as nicely on your vectrex you probably have to add “good” settings to your ini files!!! This is fiddlesticks – still!)

Still left todo here:
– highscore saving/loading
– better sounding sounds
– the game over text to be enhanced to be displayable in 50Hz (right now it is about 3000 vectrex cycles to slow)

Old/new Asteroids emulation in one video….

Minor enhancement 1: Ini-Files
This is not completly finished, but all emulators have now “access” to their own (human readable/writeable) ini files.

Minor enhancement 2: Vectrex little things
Changed directory structure where the binaries reside.
(most) Vectrex games can be exited with a 4 button press. Leaving with 4 buttons saves the current state. (Some people reported problems with this – not resolved yet). You can use the ini-file to switch state saving off.
The used BIOS of the vectrex can be configured in the ini-File.

I also added Joypad 2 Button 1 – save state, Joypad Button 4 – load state.
This is great for cheating ANY vectrex game :-). I played thru Peer new game completly with that…

Future dream 1: interleaved emulation
With this I hope to achieve some sort of parallel running “tasks”.
During the “wait phases” of the VIA / drawing, I want to execute small “packages” of emulation code.
Other “smart” cards can run the vectrex output mostly in parallel on the 6809. On the PiTrex we can’t do that, the processor is always halted.
BUT, what the other smartcards cannot do – is thus to use the VIA waits for their own good. It might be, that we are in the end equally fast… :-)!

Future dream 2: Separation of emulated Hz and vectrex round Hz
This is little more than a “thought” right now – and even if it works, I am not sure I like what it looks like.
The idea is to have 3 “vector pipelines”. The emulation runs in e.g. 60Hz with an own timing. It fills one pipeline after another with vector data, thus this vectorpipelines overall will be filled with 60Hz.
The vectrexinterface “runs the VIA output” at 50Hz, and thus we have a STABLE display (all other Hz numbers wobble one way or the other, no clue WHY). The vectrex interface alway uses and “locks” the latest finished pipeline. About every 5 rounds, it will “automatically” overstep one pipeline, to catch up with the faster emulator.
I am not sure how “good” that will look – but I am willing to try that out!

4 thoughts on “Baremetal: Spics and specs

    1. Malban Post author

      In 99% of the cases – NO.
      While waiting VIA usualy either draws or positions the beam. Changing port A or port B during that is a very bad idea.

    1. Malban Post author

      I don’t think that 3d imager games work with PiTrex yet.
      Actually I never tried and would be surprised if they did.

      But – without changing the games themself – they will NOT look any better.
      The thing is, the games regulate the imager thru voltages sent on the joystick port, and they are timed using the VIA.
      The timing will be exactly the same, as the wheel spinning. Thus if they display in about 25Hz now – they will also when run from the PiTrex (if they’d work).

Leave a Reply to Ethan Schur Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.