This page contains notes for the game Thunder Offshore.
The game is splitted in various EXE files:
- SETENV.EXE is the first to be run, and just sets the environment.
- MENUS.EXE is open at every menu of the game, at every video mode. It also plays the intro video.
- JUEGO[64][M].EXE is open when a race starts. 64 means 640x480 mode, and M means mortal effects.
I didn't tried to debug the executables because my current debuggers don't support 16bit executables.
All this executables are switched by the THUNDER.BAT batch file. They all need at least one parameter to be run, or a message saying to run THUNDER.BAT will appear.
The executables doesn't read the parameters, and they communicate through temporary INI files in the game folder.
Game menu and intro video sounds are stored in the DIGITAL folder from the CD in DFX format. These files are simple wave files that can be renamed to WAV to be played.
Game sounds are stored in the GRA and GRA640 folders from the CD in WAV format. The same sounds are duplicated for both folders, having no differences.
Game menu graphics are stored in the packed RESOURCE.PAK file. They are all palletized 256 color images:
- PAL files are the palette files. Their 256 colors are organized with one byte per channel as RGBRGBRGB... and their range is from {hex|0x00} to {hex|0x3F}
- PIC files are the uncompressed raw image files. They start with 2 int16 values with the width and height of the image followed by the raw data.
- SPR files have the uncompressed raw sprites.
Here is an util I made to extract the PIC files into palletized BMP files:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
FILE *pal,*img,*out;
char outn[128];
short dim[2];
int dimt;
const char bm1[]={0x42,0x4d};
int bm2;
const char bm3[]={0x00,0x00,0x00,0x00,0x36,0x04,0x00,0x00,0x28,0x00,0x00,0x00};
int bm4[2];
const char bm5[]={0x01,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xE8,0x03,0x00,0x13,0x0B,0x00,0x00,0x13,0x0B,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00};
int i;
char curcol[4];
char *rawimg;
if (argc!=3 || !(img=fopen(argv[1],"rb")) || !(pal=fopen(argv[2],"rb"))) {
printf("Usage: %s image.pic palette.pal\n",argv[0]);
return (EXIT_SUCCESS);
}
fread(dim,2,2,img);
printf("Image dimensions: %dx%d\n",dim[0],dim[1]);
dimt=dim[0]*dim[1];
bm2=dimt+1078;
bm4[0]=dim[0];
bm4[1]=dim[1];
strcpy(outn, argv[1]);
strcat(outn, ".bmp");
if (!(out=fopen(outn,"wb+"))) {
puts("Check write permissions");
return (EXIT_SUCCESS);
}
fwrite(bm1,2,1,out);
fwrite(&bm2,4,1,out);
fwrite(bm3,12,1,out);
fwrite(bm4,2,4,out);
fwrite(bm5,28,1,out);
curcol[3]=0;
for (i=0;i<256;i++)
{
curcol[2]=fgetc(pal)<<2;
curcol[1]=fgetc(pal)<<2;
curcol[0]=fgetc(pal)<<2;
fwrite(&curcol,4,1,out);
}
rawimg=malloc(dimt);
for (i=(dimt-bm4[0]);i>=0;i-=bm4[0])
{
fread(rawimg+i,bm4[0],1,img);
}
fwrite(rawimg,dimt,1,out);
return (EXIT_SUCCESS);
}