Re:Recompiling the Lost Vikings
by faragon on Wednesday March 29, 2017 @07:21PM
(#13991523)
Looks like Game Maker (a tool for creating video games using scripting). Very interesting stuff. Anyone knows if other ports of TLV, e.g. SNES, use the same virtual machine?
[ Parent
| on HN ]
It seems likely that they would as the purpose of the virtual machine seems to be to make porting to other systems easier. If you can extract the data files from the SNES version (or another port) then it is possible that the pack_tool (from https://github.com/RyanMallon/TheLostVikingsTools) will be able to extract the chunks containing the virtual machine programs. The format of the virtual machine programs might be a bit different. For example the load/store instructions for globals in DS may not be directly portable to other architectures (at the very least I would expect global offsets to be different). The rest of the vm design appears to be fairly portable though.
One would think so but I went and checked. In a Lost Vikings SNES ROM image, search for a sequence of VM opcodes. The turret program shown has a bit that goes 97 00 01 00 9C 18 08 2F 00, doesn't seem to contain any addresses and is long enough to not just appear at random. It shows up in the ROM image so it looks like yes, the VM was used in the SNES version too.
Cool. Is the data not compressed in the SNES ROMs or were you reading the data directly from memory? In the DOS version the DATA.DAT file contains a bunch of chunks, most of which (including the vm programs) are compressed using an LZSS type compression.
The image seemed to be uncompressed, or at least, the relevant parts of it were uncompressed. I'd guess they had to be much pickier how what and where to compress, given the constraints of the system.
Accessing the cart was as fast as accessing RAM, and you didn't have much RAM to go around, so I imagine there just wasn't much advantage to it.
No, compression was used extensively. Just often hand-rolled and for specific things. https://multimedia.cx/eggs/nes-compression/ has a link to an RLE implementation used in some Zelda game.