Hacker News new | ask | show | jobs
by ndiddy 1630 days ago
The Koei strategy games on NES ran in a bytecode virtual machine. The actual game program would be written in C and compiled to the virtual machine. This allowed them to use the same codebase as the computer versions of their strategy games. As for why they use a VM rather than compiling to 6502, my guess is it saved ROM space (for example a 16 bit memory + memory add would be one instruction instead of 7)

More information: https://forums.nesdev.org/viewtopic.php?f=2&t=15931

1 comments

There were a few game engine that adopted this approach (though I can mentally visualise the games, my mind has gone totally blank trying to name said engines). I wouldn’t go so far as to say it was common practice but it certainly was a technique used by a few game developers.

A lot of the time is was as much down to portability as anything else. However I’m not that familiar with Koei (aside having a few titles as a gamer) to comment on their design decisions.