Original Post

Hey Everyone,

if you read the planetvb discord you already know about this. Some time ago I tried to run an vectrex emulator on the VirtualBoy. I simply took vecx, removed everything os specific. combined it with the core of Gregs wireframe library and reduced memory usage.

The result is minestorm being emulated very slowly. I did some performance optimization myself and used an optimized version of vecx. However, some basic measurements showed that the emulator would need to be 10 to 20 times faster. I checked and Gregs library is very fast. It’s the actual emulation that is slow.

There are many things missing like sound, controls and loading games. Minestorm stops at the select screen right now. It used to start all the way but I think the newer version of vecx is waiting for inputs.

However, I’m not the one who will go ahead and optimize the emulator because that sounds very boring. If someone else wants to, you can find the sources here: https://github.com/thunderstruckProjects/virtualtrex

Attached is the Minestorm ROM and some screenshots. It looks allot better on hardware.

9 Replies

Hot damn that’s awesome!! Great work! Here’s hoping someone picks up the task of optimizing it.

Very cool! A Vectrex is always one of those things I’ve wanted. Playing it on the VB seems like a good fit!

Also fascinated that another emulator is made for the VB, not an easy task I’m sure!

Awesome idea, Thunderstruck. I just wrote this up for RetroRGB https://www.retrorgb.com/virtualtrex-vectrex-emulator-for-virtual-boy.html

Bob will probably cover it in his Weekly Roundup next week https://www.youtube.com/RetroRGB

Since you need something like a 10 to 20 times speedup, optimising the emulator is not going to cut it. However there is a potential solution: pick a game and create a static binary translation (or more practically, a decompilation into C that can be recompiled for the VB) I would suggest replacing the default minestorm in the built-in rom woth a copy of Minestorm 3D, and producing an emulation of just that one game. (There are only a few 3D games on the Vectrex and they could each be handled this way)

You can read more about static binary translation at: http://gtoal.com/sbt/

The technique has been applied in the Vectrex world already to port arcade vector games to the Vectrex, running on attached ARM processors.

Well maybe this is more complicated than necessary, but do we know if the VB follows the same design concept of previous Nintendo hardware to date (1995?)

The NES, SNES and even Gameboy used memory mappers and other extended chipsets to expand beyond the capabilities of each piece of hardware. The NES with its MMCs etc, Gameboy with MBC1-5, and SNES with DSP through SA1, FX1-2, SDD1, C4, etc chips.

Would it be possible to create a new board like mellott did for larger games such as that Hyper Fighting cart, where an expansion chip can go on it. Maybe something like a DSP that can handle more math, or even a SA1 analog to SNES where a VA1 is a faster co-processor) could handle the work in tandem? I know this is just a reach, but can the hardware take more than it was intended for through outside means? Or is it limited like the GBA to clever programming and little else?

don’t quote me on it, but I thiiiiiiink it has similar methods for stuff like that. I’m almost totally certain it has audio expansion-out capabilities, just like the Famicom did (and GB, SNES, even if those didn’t use it iirc) so if that’s there, there’s little doubt you could pop in an extra mapper or somethin for that kinda stuffs

SmokeMonster wrote:
Awesome idea, Thunderstruck. I just wrote this up for RetroRGB https://www.retrorgb.com/virtualtrex-vectrex-emulator-for-virtual-boy.html

Bob will probably cover it in his Weekly Roundup next week https://www.youtube.com/RetroRGB

Thanks allot. I always appreciate the coverage.

Graham Toal wrote:
Since you need something like a 10 to 20 times speedup, optimising the emulator is not going to cut it. However there is a potential solution: pick a game and create a static binary translation (or more practically, a decompilation into C that can be recompiled for the VB) I would suggest replacing the default minestorm in the built-in rom woth a copy of Minestorm 3D, and producing an emulation of just that one game. (There are only a few 3D games on the Vectrex and they could each be handled this way)

You can read more about static binary translation at: http://gtoal.com/sbt/

The technique has been applied in the Vectrex world already to port arcade vector games to the Vectrex, running on attached ARM processors.

Hey, I appreciate that you took the time to register and point this out. I actually think the speed of the emulator can be improved drastically. It’s author himself wrote it with portability and not performance in mind. So checking where time is lost and rewriting bigger parts in asm might bring the games to a playable level. I doubt as well that you can do a perfect emulation though.

A static binary translation is basically just a fancy word for writing a dissessembler and a converter that will make the result VB conform. The fact that other games have been treated this way to be playable on the Vectrex only helps very little. If there was an Vectrex dissessembler that produces c code already, this might be an option to look into. Otherwise, for me personally this sounds like and even worse task then writing an emulator.

From what I understand 3D Vectrex games also work differently then VB games. So they won’t magically work in 3D by running them on the VB. I didn’t try but the emulator itself should be able to run every other Vectrex game right now.

VmprHntrD wrote:
Well maybe this is more complicated than necessary, but do we know if the VB follows the same design concept of previous Nintendo hardware to date (1995?)

The NES, SNES and even Gameboy used memory mappers and other extended chipsets to expand beyond the capabilities of each piece of hardware. The NES with its MMCs etc, Gameboy with MBC1-5, and SNES with DSP through SA1, FX1-2, SDD1, C4, etc chips.

Would it be possible to create a new board like mellott did for larger games such as that Hyper Fighting cart, where an expansion chip can go on it. Maybe something like a DSP that can handle more math, or even a SA1 analog to SNES where a VA1 is a faster co-processor) could handle the work in tandem? I know this is just a reach, but can the hardware take more than it was intended for through outside means? Or is it limited like the GBA to clever programming and little else?

I guess you could do something like that. I think outsourcing music to a designated chip might make sense. But at some point you will have to ask yourself what’s the point of all of this. Just run the game on more powerful hardware and use the entire VB as a display?

thunderstruck wrote:
Hey Everyone,

if you read the planetvb discord you already know about this. Some time ago I tried to run an vectrex emulator on the VirtualBoy. I simply took vecx, removed everything os specific. combined it with the core of Gregs wireframe library and reduced memory usage.

The result is minestorm being emulated very slowly. I did some performance optimization myself and used an optimized version of vecx. However, some basic measurements showed that the emulator would need to be 10 to 20 times faster. I checked and Gregs library is very fast. It’s the actual emulation that is slow.

There are many things missing like sound, controls and loading games. Minestorm stops at the select screen right now. It used to start all the way but I think the newer version of vecx is waiting for inputs.

However, I’m not the one who will go ahead and optimize the emulator because that sounds very boring. If someone else wants to, you can find the sources here: https://github.com/thunderstruckProjects/virtualtrex

Attached is the Minestorm ROM and some screenshots. It looks allot better on hardware.

This is pretty damn awesome 😀

> If there was an Vectrex disassembler that produces c code already, this might be an option to look into.

As it happens… we have that now, if you’re still interested a couple of years later 🙂 It’s at https://gtoal.com/SBTPROJECT/6809sbt/

“6809dasm –vectrex –sbt file.bin” should output a C program that behaves the same as emulating that rom, but faster.
You might have to seed the disassembler with a .dat file containing a couple of known entry points to get it started, but if it’s just the one program you want to port, I can help ensure the translation is complete. (A huge speed win could come from *not* emulating the vectrex BIOS but by writing compatible native calls for the target system instead, but that may be too big a project to take on, especially for someone not already deep into the innards of the Vectrex – depends how much use the game makes of the BIOS)

It is somewhat ‘work in progress’ but it was good enough to let us run Star Wars so feel free to give it a try. My email address is easy to find (just google my name) and you can email me if you decide to use it and need help after downloading https://gtoal.com/SBTPROJECT/6809sbt/6809sbt.tar and building with ‘make 6809dasm’.

There’s a sample translation and an example .dat file (for the game “Polar Rescue”) in https://gtoal.com/SBTPROJECT/6809sbt/demo/

Graham

 

Write a reply

You must be logged in to reply to this topic.