Hi guys,
I have a couple resource files from an old MS-DOS game called Zeliard. The files have a .sar extension, if that is of any help.
I would like to find out how the sprite information is stored in these files, but I have no knowledge of how it is packed. Some data for the game text is stored in plain ascii and there are some references to other files inside it in plain ascii, like KING.GRP, ...
The whole file is about 330kB, so I tried storing each byte as a single color value (0..255) and block storing the data in 8x8, 16x16 and 32x32 chunks and then storing the chunks in a single image file, to see if anything would visually stand out as being a sprite, but no luck (well at least I can't see anything useful).
Any ideas on where to start?
Thanks, Matic
I'm not very familiar with MS-DOS games, but I have a bit of knowledge about NES games.
It might be possible that the data you're looking for is compressed. Something like RLE with small modifications wasn't uncommon on the NES, especially for storing level data. What's also possible, is that multiple pixels are stored in one byte. I don't know the exact specs, though it might be possible that if a sprite can only have four colors, each pixel is a palette color index stored in two bits therefore a byte holds four pixels and the palette selector for each sprite is stored somewhere else. The last option would be to run the game in an emulator with a disassembler attached and just search for writes to the video memory, which is probably the least pleasant way.
Getting sprites out old dos game can be hard. You will not find standard images formats like png, jpg or dds. It can be stored in extremely convoluted way. One game I ripped the sprites from (Panzer General) used a strange pen method where it stored all images as move pen left, right, draw color X... like G-Code for CNC machine.
I would recommend just taking a bunch of screen shots and cutting out the sprites in image editor.
You can also just use whole map as a single image like: https://faqs.neoseeker.com/Games/PC/zeliard_milagro.png
No need to mess with spires/level data.
What's also possible, is that multiple pixels are stored in one byte. I don't know the exact specs, though it might be possible that if a sprite can only have four colors, each pixel is a palette color index stored in two bits therefore a byte holds four pixels and the palette selector for each sprite is stored somewhere else.
Yeah, I thought so. I was hoping there were some standard thing one could try to see if data was packed in some slightly standard way. Oh well.
I would recommend just taking a bunch of screen shots and cutting out the sprites in image editor.
In the end, if I don't find anything else, I'll probably go this route.
Thanks guys.
Even if you get the sprites they might be all jumbled up like this:
http://www.gamasutra.com/db_area/images/news/253377/fig03.png
Older games tent to reuse/recolor spires. Even when you get spires it might be really hard to put together again.
Ok, so I disassembled the file that I think has the loading routines for MCGA sprites with Cutter (https://github.com/radareorg/cutter), but I do not have enough experience to read the assembly code. Can someone give me some hints/pointer of what is going on in the function below?
The binary is DOS 16-bit MZ format:
fcn.00000000 (int arg_22h);
; arg int arg_22h @ bp+0x22
0000:0000 inc si
0000:0001 and byte [0x9521], al
0000:0005 and word [bx], sp
0000:0007 and dl, byte [arg_22h]
0000:000a xor word [bp + si], sp
0000:000c pushaw
0000:000d and bh, byte [bx - 0x32de]
0000:0011 and al, byte [di - 0x70dd]
0000:0015 and bp, word [si - 0x33dd]
0000:0019 and si, bp
0000:001b and cx, word [si + 0x25]
0000:001e loop 0x45
0000:0020 cld
0000:0021 and ax, 0x27e9
0000:0024 push di
0000:0025 sub byte [bp + si - 0x26d8], bl
0000:0029 sub byte [bp + si], bl
0000:002b sub word [bx + 0x29], bp
0000:002e ret
By the way, I am trying to remake the game in Nim, that is why I am posting this here.You are completely correct @cumulonimbus (sorry for the long silence). I am a complete beginner when it comes to assembly.
But I've played around with the DOS debugging (in DOSBox) and here are my observations:
My question is: does anyone know any DOS (MS-DOS) assembly to help me figure out how sprites are loaded from these .sar files?
Or does anyone know of a website/forum that specializes in these kind of things?
Thanks