aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-09-14 23:48:01 +0200
committerEugene Sandulenko2017-01-25 22:41:54 +0100
commit0fbe26e06ac2a9f128a102f5a291aad715f9e2a2 (patch)
treee39154a8a22aad054ce9b6b757eef6d0ca383b89
parent85ba17c475f154c6e670e0fcd22642d680d85e6c (diff)
downloadscummvm-rg350-0fbe26e06ac2a9f128a102f5a291aad715f9e2a2.tar.gz
scummvm-rg350-0fbe26e06ac2a9f128a102f5a291aad715f9e2a2.tar.bz2
scummvm-rg350-0fbe26e06ac2a9f128a102f5a291aad715f9e2a2.zip
CRYO: Use standard ScummVM types
-rw-r--r--engines/cryo/ResourceManager.cpp8
-rw-r--r--engines/cryo/ResourceManager.h12
-rw-r--r--engines/cryo/clerror.cpp2
-rw-r--r--engines/cryo/clhnm.cpp136
-rw-r--r--engines/cryo/clsoundgroup.cpp12
-rw-r--r--engines/cryo/clsoundraw.cpp2
-rw-r--r--engines/cryo/cryolib.cpp96
-rw-r--r--engines/cryo/cryolib.h182
-rw-r--r--engines/cryo/defs.h466
-rw-r--r--engines/cryo/eden.cpp866
-rw-r--r--engines/cryo/eden.h384
-rw-r--r--engines/cryo/staticdata.cpp28
12 files changed, 1097 insertions, 1097 deletions
diff --git a/engines/cryo/ResourceManager.cpp b/engines/cryo/ResourceManager.cpp
index 6de5b626e9..25d2cde50d 100644
--- a/engines/cryo/ResourceManager.cpp
+++ b/engines/cryo/ResourceManager.cpp
@@ -20,9 +20,9 @@ bool ResourceManager::LoadDatFile(const Common::String &datFileName) {
assert(_datFile.open(datFileName));
- unsigned short numFiles = _datFile.readUint16LE();
+ uint16 numFiles = _datFile.readUint16LE();
- for (unsigned short i = 0; i < numFiles; i++) {
+ for (uint16 i = 0; i < numFiles; i++) {
DatFileEntry entry;
_datFile.read(entry._name, sizeof(entry._name));
@@ -76,7 +76,7 @@ void *ResourceManager::StreamToBuffer(Common::SeekableReadStream *stream, unsign
return nullptr;
unsigned int readSize = stream->size();
- unsigned char *data = new unsigned char[readSize + 1];
+ byte *data = new byte[readSize + 1];
readSize = stream->read(data, readSize);
if (size)
@@ -97,4 +97,4 @@ void *ResourceManager::GetData(int resIndex, unsigned int *size) {
delete resource;
return data;
}
-} \ No newline at end of file
+}
diff --git a/engines/cryo/ResourceManager.h b/engines/cryo/ResourceManager.h
index da38c9dfad..b50e6d6f55 100644
--- a/engines/cryo/ResourceManager.h
+++ b/engines/cryo/ResourceManager.h
@@ -12,11 +12,11 @@ namespace Cryo {
template<typename T>
class CryoArray {
private:
- unsigned char *_data;
+ byte *_data;
bool _ownData;
- unsigned short ElementOffset(int num) {
+ uint16 ElementOffset(int num) {
assert(_data && num < Count())
- return (static_cast<unsigned short *>_data)[num];
+ return (static_cast<uint16 *>_data)[num];
}
public:
CryoArray(void *data, bool ownData) : _data(data), _ownData(ownData) {
@@ -25,7 +25,7 @@ public:
if (_ownData)
delete data;
}
- unsigned short Count() {
+ uint16 Count() {
return ElementOffset(0) / 2;
}
const T *operator[](int index) {
@@ -39,7 +39,7 @@ private:
char _name[16];
unsigned int _size;
unsigned int _offset;
- unsigned char _flag;
+ byte _flag;
};
Common::Array<DatFileEntry> _files;
@@ -67,4 +67,4 @@ public:
};
-} \ No newline at end of file
+}
diff --git a/engines/cryo/clerror.cpp b/engines/cryo/clerror.cpp
index 40b374b5de..ae904e3b86 100644
--- a/engines/cryo/clerror.cpp
+++ b/engines/cryo/clerror.cpp
@@ -24,6 +24,6 @@
namespace Cryo {
-short __debug, __libError, __osError;
+int16 __debug, __libError, __osError;
} // End of namespace Cryo
diff --git a/engines/cryo/clhnm.cpp b/engines/cryo/clhnm.cpp
index 8e4bf03035..c36955c2ea 100644
--- a/engines/cryo/clhnm.cpp
+++ b/engines/cryo/clhnm.cpp
@@ -26,32 +26,32 @@
namespace Cryo {
-static short safe_palette = 0;
-static short pred_r = 0, pred_l = 0;
-static short use_adpcm = 0;
+static int16 safe_palette = 0;
+static int16 pred_r = 0, pred_l = 0;
+static int16 use_adpcm = 0;
static float hnm_rate = 0.0;
static float next_frame_time = 0.0;
static float expected_frame_time = 0.0;
static float time_drift = 0.0;
-static short use_mono = 0;
-static short use_sound = 0;
-static short use_sound_sync = 0;
-static short pending_sounds = 0;
-static short sound_started = 0;
-static short preserve_color0 = 0;
+static int16 use_mono = 0;
+static int16 use_sound = 0;
+static int16 use_sound_sync = 0;
+static int16 pending_sounds = 0;
+static int16 sound_started = 0;
+static int16 preserve_color0 = 0;
static soundchannel_t *soundChannel_adpcm = 0;
static soundgroup_t *soundGroup_adpcm = 0;
static soundchannel_t *soundChannel = 0;
static soundgroup_t *soundGroup = 0;
-static void (*custom_chunk_handler)(unsigned char *buffer, int size, short id, char h6, char h7) = 0;
-static short use_preload = 0;
-static short decomp_table[256];
+static void (*custom_chunk_handler)(byte *buffer, int size, int16 id, char h6, char h7) = 0;
+static int16 use_preload = 0;
+static int16 decomp_table[256];
-void CLHNM_Desentrelace320(unsigned char *frame_buffer, unsigned char *final_buffer, unsigned short height);
+void CLHNM_Desentrelace320(byte *frame_buffer, byte *final_buffer, uint16 height);
-void CLHNM_DecompLempelZiv(unsigned char *buffer, unsigned char *output) {
- unsigned char *inp = buffer;
- unsigned char *out = output;
+void CLHNM_DecompLempelZiv(byte *buffer, byte *output) {
+ byte *inp = buffer;
+ byte *out = output;
unsigned int queue = 0;
int qpos = -1;
@@ -66,7 +66,7 @@ void CLHNM_DecompLempelZiv(unsigned char *buffer, unsigned char *output) {
int l, o;
if (GetBit()) {
l = *inp & 7;
- o = *(unsigned short *)inp >> 3;
+ o = *(uint16 *)inp >> 3;
inp += 2;
o -= 8192;
if (!l)
@@ -90,14 +90,14 @@ void CLHNM_DecompLempelZiv(unsigned char *buffer, unsigned char *output) {
return;
}
-void CLHNM_DecompUBA(unsigned char *output, unsigned char *curr_buffer, unsigned char *prev_buffer,
- unsigned char *input, int width, char flags) {
+void CLHNM_DecompUBA(byte *output, byte *curr_buffer, byte *prev_buffer,
+ byte *input, int width, char flags) {
unsigned int code;
char mode, count, color;
- unsigned short offs;
- unsigned char *ref;
- unsigned char *out_start = output;
- unsigned char swap;
+ uint16 offs;
+ byte *ref;
+ byte *out_start = output;
+ byte swap;
int shft1, shft2;
// return;
if ((flags & 1) == 0) {
@@ -123,8 +123,8 @@ void CLHNM_DecompUBA(unsigned char *output, unsigned char *curr_buffer, unsigned
shft2 = 1;
}
while (count--) {
- unsigned char b0 = ref[shft1];
- unsigned char b1 = ref[shft2];
+ byte b0 = ref[shft1];
+ byte b1 = ref[shft2];
output[swap] = b0;
output[swap ^ 1] = b1;
output += 2;
@@ -215,14 +215,14 @@ void CLHNM_WaitLoop(hnm_t *hnm) {
time_drift = TimerTicks - next_frame_time;
}
-void CLHNM_SetupSound(short numSounds, short arg4, short sampleSize, float rate, short mode) {
+void CLHNM_SetupSound(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode) {
soundChannel = CLSoundChannel_New(mode);
soundGroup = CLSoundGroup_New(numSounds, arg4, sampleSize, rate, mode);
if (sampleSize == 16)
CLSoundGroup_Reverse16All(soundGroup);
}
-void CLHNM_SetupSoundADPCM(short numSounds, short arg4, short sampleSize, float rate, short mode) {
+void CLHNM_SetupSoundADPCM(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode) {
soundChannel_adpcm = CLSoundChannel_New(mode);
soundGroup_adpcm = CLSoundGroup_New(numSounds, arg4, sampleSize, rate, mode);
}
@@ -248,13 +248,13 @@ void CLHNM_CloseSound() {
}
}
-void CLHNM_SetForceZero2Black(short forceblack) {
+void CLHNM_SetForceZero2Black(int16 forceblack) {
preserve_color0 = forceblack;
}
hnm_t *CLHNM_New(int preload_size) {
hnm_t *hnm;
- short i;
+ int16 i;
preload_size = 0; //TODO: let's ignore it for now
@@ -308,7 +308,7 @@ void CLHNM_SetFile(hnm_t *hnm, file_t *file) {
CLNoError;
}
-void CLHNM_SetFinalBuffer(hnm_t *hnm, unsigned char *buffer) {
+void CLHNM_SetFinalBuffer(hnm_t *hnm, byte *buffer) {
hnm->final_buffer = buffer;
CLNoError;
}
@@ -316,13 +316,13 @@ void CLHNM_SetFinalBuffer(hnm_t *hnm, unsigned char *buffer) {
void CLHNM_AllocMemory(hnm_t *hnm) {
CLBeginCheck;
- hnm->work_buffer[0] = (unsigned char *)CLMemory_Alloc(hnm->header.buffersize + 2);
+ hnm->work_buffer[0] = (byte *)CLMemory_Alloc(hnm->header.buffersize + 2);
CLCheckError();
if (!hnm->work_buffer[0])
goto fin;
- hnm->work_buffer[1] = (unsigned char *)CLMemory_Alloc(hnm->header.buffersize + 2);
+ hnm->work_buffer[1] = (byte *)CLMemory_Alloc(hnm->header.buffersize + 2);
CLCheckError();
if (!hnm->work_buffer[1]) {
@@ -333,7 +333,7 @@ void CLHNM_AllocMemory(hnm_t *hnm) {
}
if (!use_preload) {
- hnm->read_buffer = (unsigned char *)CLMemory_Alloc(hnm->header.buffersize + 2);
+ hnm->read_buffer = (byte *)CLMemory_Alloc(hnm->header.buffersize + 2);
// CLCheckError();
if (!hnm->read_buffer) {
CLMemory_Free(hnm->work_buffer[0]);
@@ -387,7 +387,7 @@ void CLHNM_GiveTime(hnm_t *hnm) {
}
}
-void CLHNM_CanLoop(hnm_t *hnm, short can_loop) {
+void CLHNM_CanLoop(hnm_t *hnm, int16 can_loop) {
hnm->can_loop = can_loop;
}
@@ -402,13 +402,13 @@ void CLHNM_SelectBuffers(hnm_t *hnm) {
}
void CLHNM_ChangePalette(hnm_t *hnm) {
- short mincolor, maxcolor;
- unsigned short fst, cnt;
- unsigned char *pal;
+ int16 mincolor, maxcolor;
+ uint16 fst, cnt;
+ byte *pal;
color_t *color;
CLPalette_GetLastPalette(hnm->palette);
pal = hnm->data_ptr;
- if (*(unsigned short *)pal == 0xFFFF)
+ if (*(uint16 *)pal == 0xFFFF)
return;
mincolor = 255;
maxcolor = 0;
@@ -426,12 +426,12 @@ void CLHNM_ChangePalette(hnm_t *hnm) {
color = hnm->palette + fst;
if (safe_palette) {
while (cnt--) {
- unsigned char r = *pal++;
- unsigned char g = *pal++;
- unsigned char b = *pal++;
- short rr = r << 10;
- short gg = g << 10;
- short bb = b << 10;
+ byte r = *pal++;
+ byte g = *pal++;
+ byte b = *pal++;
+ int16 rr = r << 10;
+ int16 gg = g << 10;
+ int16 bb = b << 10;
if (color->r != rr || color->g != gg || color->b != bb)
CLBlitter_OneBlackFlash();
color->r = rr;
@@ -441,9 +441,9 @@ void CLHNM_ChangePalette(hnm_t *hnm) {
}
} else {
while (cnt--) {
- unsigned char r = *pal++;
- unsigned char g = *pal++;
- unsigned char b = *pal++;
+ byte r = *pal++;
+ byte g = *pal++;
+ byte b = *pal++;
color->r = r << 10;
color->g = g << 10;
color->b = b << 10;
@@ -451,7 +451,7 @@ void CLHNM_ChangePalette(hnm_t *hnm) {
}
}
- } while (*(unsigned short *)pal != 0xFFFF);
+ } while (*(uint16 *)pal != 0xFFFF);
#if 0
if (preserve_color0) {
hnm->palette[0].r = 0;
@@ -491,7 +491,7 @@ soundchannel_t *CLHNM_GetSoundChannel() {
void CLHNM_TryRead(hnm_t *hnm, int size) {
- short err;
+ int16 err;
do {
CLHNM_Read(hnm, size);
err = __libError == -6;
@@ -515,7 +515,7 @@ void CLHNM_Reset(hnm_t *hnm) {
CLNoError;
}
-short CLHNM_LoadFrame(hnm_t *hnm) {
+int16 CLHNM_LoadFrame(hnm_t *hnm) {
int chunk;
CLBeginCheck;
CLHNM_TryRead(hnm, 4);
@@ -546,21 +546,21 @@ short CLHNM_LoadFrame(hnm_t *hnm) {
return 1;
}
-void CLHNM_WantsSound(short sound) {
+void CLHNM_WantsSound(int16 sound) {
use_sound = sound;
}
-void CLHNM_LoadDecompTable(short *buffer) {
- short i;
- short e;
+void CLHNM_LoadDecompTable(int16 *buffer) {
+ int16 i;
+ int16 e;
for (i = 0; i < 256; i++) {
e = *buffer++;
decomp_table[i] = LE16(e);
}
}
-void CLHNM_DecompADPCM(unsigned char *buffer, short *output, int size) {
- short l = pred_l, r = pred_r;
+void CLHNM_DecompADPCM(byte *buffer, int16 *output, int size) {
+ int16 l = pred_l, r = pred_r;
size &= ~1;
while (size--) {
*output++ = l += decomp_table[*buffer++];
@@ -572,19 +572,19 @@ void CLHNM_DecompADPCM(unsigned char *buffer, short *output, int size) {
pred_r = r;
}
-void CLHNM_SoundInADPCM(short is_adpcm) {
+void CLHNM_SoundInADPCM(int16 is_adpcm) {
use_adpcm = is_adpcm;
}
-void CLHNM_SoundMono(short is_mono) {
+void CLHNM_SoundMono(int16 is_mono) {
use_mono = is_mono;
}
-short CLHNM_NextElement(hnm_t *hnm) {
+int16 CLHNM_NextElement(hnm_t *hnm) {
int sz;
- short id;
+ int16 id;
char h6, h7;
- short i;
+ int16 i;
if (hnm->frame == 0) {
CLHNM_ResetInternalTimer();
pred_l = pred_r = 0;
@@ -596,7 +596,7 @@ short CLHNM_NextElement(hnm_t *hnm) {
for (;;) {
sz = PLE32(hnm->data_ptr) & 0xFFFFFF;
hnm->data_ptr += 4;
- id = *(short *)hnm->data_ptr;
+ id = *(int16 *)hnm->data_ptr;
hnm->data_ptr += 2;
h6 = *hnm->data_ptr;
hnm->data_ptr += 1;
@@ -667,10 +667,10 @@ short CLHNM_NextElement(hnm_t *hnm) {
else
pending_sounds++;
} else {
- short *sound_buffer = (short *)CLSoundGroup_GetNextBuffer(soundGroup_adpcm);
+ int16 *sound_buffer = (int16 *)CLSoundGroup_GetNextBuffer(soundGroup_adpcm);
if (!pending_sounds) {
- const int kDecompTableSize = 256 * sizeof(short);
- CLHNM_LoadDecompTable((short *)hnm->data_ptr);
+ const int kDecompTableSize = 256 * sizeof(int16);
+ CLHNM_LoadDecompTable((int16 *)hnm->data_ptr);
CLHNM_DecompADPCM(hnm->data_ptr + kDecompTableSize, sound_buffer, sound_size - kDecompTableSize);
CLSoundGroup_AssignDatas(soundGroup_adpcm, sound_buffer, (sound_size - kDecompTableSize) * 2, 0);
} else {
@@ -723,7 +723,7 @@ void CLHNM_ReadHeader(hnm_t *hnm) {
hnm->header.buffersize += 4096; //TODO: checkme
}
-short CLHNM_GetVersion(hnm_t *hnm) {
+int16 CLHNM_GetVersion(hnm_t *hnm) {
CLNoError;
if (hnm->header.id == BE32('HNM4'))
return 4;
@@ -747,13 +747,13 @@ void CLHNM_SetPosIntoFile(hnm_t *hnm, long pos) {
CLFile_SetPosition(*hnm->file, 1, pos);
}
-void CLHNM_Desentrelace320(unsigned char *frame_buffer, unsigned char *final_buffer, unsigned short height) {
+void CLHNM_Desentrelace320(byte *frame_buffer, byte *final_buffer, uint16 height) {
unsigned int *input = (unsigned int *)frame_buffer;
unsigned int *line0 = (unsigned int *)final_buffer;
unsigned int *line1 = (unsigned int *)(final_buffer + 320);
int count = (height) / 2;
while (count--) {
- short i;
+ int16 i;
for (i = 0; i < 320 / 4; i++) {
unsigned int p0 = *input++;
unsigned int p4 = *input++;
diff --git a/engines/cryo/clsoundgroup.cpp b/engines/cryo/clsoundgroup.cpp
index b20306b68e..0058dee899 100644
--- a/engines/cryo/clsoundgroup.cpp
+++ b/engines/cryo/clsoundgroup.cpp
@@ -24,9 +24,9 @@
namespace Cryo {
-soundgroup_t *CLSoundGroup_New(short numSounds, short arg4, short sampleSize, float rate, short mode) {
+soundgroup_t *CLSoundGroup_New(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode) {
soundgroup_t *sg;
- short i;
+ int16 i;
sg = (soundgroup_t *)CLMemory_Alloc(sizeof(*sg));
if (numSounds < CL_MAX_SOUNDS)
@@ -50,14 +50,14 @@ soundgroup_t *CLSoundGroup_New(short numSounds, short arg4, short sampleSize, fl
}
void CLSoundGroup_Free(soundgroup_t *sg) {
- short i;
+ int16 i;
for (i = 0; i < sg->numSounds; i++)
CLSoundRaw_Free(sg->sound[i]);
CLMemory_Free(sg);
}
void CLSoundGroup_Reverse16All(soundgroup_t *sg) {
- short i;
+ int16 i;
for (i = 0; i < sg->numSounds; i++)
sg->sound[i]->reversed = 1;
}
@@ -69,7 +69,7 @@ void *CLSoundGroup_GetNextBuffer(soundgroup_t *sg) {
return ((char *)(*sound->sndHandle)) + sound->headerLen;
}
-short CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, short isSigned) {
+int16 CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, int16 isSigned) {
sound_t *sound = sg->sound[sg->soundIndex];
if (sg->ff_106)
while (sound->locked) ;
@@ -90,7 +90,7 @@ short CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, short
return 1;
}
-short CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, short isSigned) {
+int16 CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, int16 isSigned) {
void *buffer;
sound_t *sound = sg->sound[sg->soundIndex];
if (length >= sound->ff_1A) {
diff --git a/engines/cryo/clsoundraw.cpp b/engines/cryo/clsoundraw.cpp
index e47ce7b4cf..ec280e49ed 100644
--- a/engines/cryo/clsoundraw.cpp
+++ b/engines/cryo/clsoundraw.cpp
@@ -24,7 +24,7 @@
namespace Cryo {
-sound_t *CLSoundRaw_New(short arg1, float rate, short sampleSize, short mode) {
+sound_t *CLSoundRaw_New(int16 arg1, float rate, int16 sampleSize, int16 mode) {
sound_t *sound;
CLBeginCheck;
diff --git a/engines/cryo/cryolib.cpp b/engines/cryo/cryolib.cpp
index cff9f331c1..99bb486f06 100644
--- a/engines/cryo/cryolib.cpp
+++ b/engines/cryo/cryolib.cpp
@@ -32,24 +32,24 @@
namespace Cryo {
///// Mac APIs
-typedef short OSErr;
+typedef int16 OSErr;
-short MemError() {
+int16 MemError() {
return 0;
}
void SysBeep(int x) {
}
-OSErr SetFPos(short handle, short mode, long pos) {
+OSErr SetFPos(int16 handle, int16 mode, long pos) {
return 0;
}
-OSErr FSRead(short handle, long *size, void *buffer) {
+OSErr FSRead(int16 handle, long *size, void *buffer) {
return 0;
}
-void FlushEvents(short arg1, short arg2) {
+void FlushEvents(int16 arg1, int16 arg2) {
}
char *c2pstr(char *s) {
@@ -96,7 +96,7 @@ void CLView_Free(view_t *view) {
CLMemory_Free(view);
}
void CLView_InitDatas(view_t *view, int w, int h, void *buffer) {
- view->p_buffer = (unsigned char *)buffer;
+ view->p_buffer = (byte *)buffer;
view->width = w;
view->height = h;
view->pitch = w;
@@ -117,7 +117,7 @@ void CLView_InitDatas(view_t *view, int w, int h, void *buffer) {
view_t *CLView_New(int w, int h) {
view_t *view = (view_t *)CLMemory_Alloc(sizeof(view_t));
if (view) {
- void *buffer = (unsigned char *)CLMemory_Alloc(w * h);
+ void *buffer = (byte *)CLMemory_Alloc(w * h);
if (buffer) {
view->allocated = 1;
CLView_InitDatas(view, w, h, buffer);
@@ -150,35 +150,35 @@ void CLScreenView_CenterIn(view_t *view) {
}
///// CLPalette
-unsigned short gIntervalLast, gIntervalFirst, gIntervalSet;
-short gMacintize = 0;
+uint16 gIntervalLast, gIntervalFirst, gIntervalSet;
+int16 gMacintize = 0;
color_t black_palette[256];
color_t last_palette[256];
void CLPalette_Init() {
- short i;
+ int16 i;
for (i = 0; i < 256; i++)
black_palette[i].r = black_palette[i].g = black_palette[i].b = 0;
}
-void CLPalette_SetLastPalette(color_t *palette, short first, short count) {
- short i;
+void CLPalette_SetLastPalette(color_t *palette, int16 first, int16 count) {
+ int16 i;
for (i = first; i < first + count; i++)
last_palette[i] = palette[i];
}
void CLPalette_GetLastPalette(color_t *palette) {
- short i;
+ int16 i;
for (i = 0; i < 256; i++)
palette[i] = last_palette[i];
}
-void CLPalette_SetRGBColor(color_t *palette, unsigned short index, color3_t *rgb) {
+void CLPalette_SetRGBColor(color_t *palette, uint16 index, color3_t *rgb) {
palette[index].r = rgb->r;
palette[index].g = rgb->g;
palette[index].b = rgb->b;
palette[index].a = 0;
}
-void CLPalette_Macintize(short macintize) {
+void CLPalette_Macintize(int16 macintize) {
gMacintize = macintize;
}
-void CLPalette_SetInterval(unsigned short first, unsigned short last) {
+void CLPalette_SetInterval(uint16 first, uint16 last) {
gIntervalFirst = first;
gIntervalSet = 1;
gIntervalLast = last;
@@ -186,9 +186,9 @@ void CLPalette_SetInterval(unsigned short first, unsigned short last) {
void CLPalette_DeactivateInterval() {
gIntervalSet = 0;
}
-void CLPalette_Send2Screen(struct color_t *palette, unsigned short first, unsigned short count) {
+void CLPalette_Send2Screen(struct color_t *palette, uint16 first, uint16 count) {
OSErr err;
- short i;
+ int16 i;
if (gMacintize) {
palette[0].r = palette[0].g = palette[0].b = 0xFFFF;
palette[255].r = palette[255].g = palette[255].b = 0;
@@ -219,9 +219,9 @@ void CLPalette_BeSystem() {
}
///// CLBlitter
-static unsigned short newPaletteCount, newPaletteFirst;
+static uint16 newPaletteCount, newPaletteFirst;
static color_t *pNewPalette;
-static unsigned short useNewPalette;
+static uint16 useNewPalette;
void CLBlitter_CopyViewRect(view_t *view1, view_t *view2, rect_t *rect1, rect_t *rect2) {
int sy, dy = rect2->sy, x, w = rect1->ex - rect1->sx + 1;
@@ -231,13 +231,13 @@ void CLBlitter_CopyViewRect(view_t *view1, view_t *view2, rect_t *rect1, rect_t
// (rect1->ex - rect1->sx == rect2->ex - rect2->sx && rect1->ey - rect1->sy == rect2->ey - rect2->sy) ? "ok" : "BAD");
assert(rect1->ex - rect1->sx == rect2->ex - rect2->sx && rect1->ey - rect1->sy == rect2->ey - rect2->sy);
for (sy = rect1->sy; sy <= rect1->ey; sy++, dy++) {
- unsigned char *s = view1->p_buffer + sy * view1->pitch + rect1->sx;
- unsigned char *d = view2->p_buffer + dy * view2->pitch + rect2->sx;
+ byte *s = view1->p_buffer + sy * view1->pitch + rect1->sx;
+ byte *d = view2->p_buffer + dy * view2->pitch + rect2->sx;
for (x = 0; x < w; x++)
*d++ = *s++;
}
}
-void CLBlitter_Send2ScreenNextCopy(color_t *palette, unsigned short first, unsigned short count) {
+void CLBlitter_Send2ScreenNextCopy(color_t *palette, uint16 first, uint16 count) {
pNewPalette = palette;
useNewPalette = 1;
newPaletteFirst = first;
@@ -245,9 +245,9 @@ void CLBlitter_Send2ScreenNextCopy(color_t *palette, unsigned short first, unsig
}
void CLBlitter_OneBlackFlash() {
}
-void CLBlitter_CopyView2ViewSimpleSize(unsigned char *src, short srcw, short srcp, short srch,
- unsigned char *dst, short dstw, short dstp, short dsth) {
- short x, y;
+void CLBlitter_CopyView2ViewSimpleSize(byte *src, int16 srcw, int16 srcp, int16 srch,
+ byte *dst, int16 dstw, int16 dstp, int16 dsth) {
+ int16 x, y;
for (y = 0; y < srch; y++) {
for (x = 0; x < srcw; x++)
*dst++ = *src++;
@@ -258,8 +258,8 @@ void CLBlitter_CopyView2ViewSimpleSize(unsigned char *src, short srcw, short src
void CLBlitter_CopyView2ScreenCUSTOM(view_t *view) {
view_t *dest = &ScreenView;
if (!view->doubled) {
- short srcpitch = view->pitch;
- short dstpitch = dest->pitch;
+ int16 srcpitch = view->pitch;
+ int16 dstpitch = dest->pitch;
// this is not quite correct?
// CLBlitter_CopyView2ViewSimpleSize(view->p_buffer + view->norm.src_top * srcpitch + view->norm.src_left, view->norm.width, srcpitch, view->norm.height,
@@ -292,8 +292,8 @@ void CLBlitter_UpdateScreen() {
CLBlitter_CopyView2Screen(nullptr);
}
void CLBlitter_FillView(view_t *view, unsigned int fill) {
- short x, y;
- unsigned char *d = view->p_buffer;
+ int16 x, y;
+ byte *d = view->p_buffer;
assert((fill & 0xFF) * 0x01010101 == fill);
for (y = 0; y < view->height; y++) {
for (x = 0; x < view->width; x++)
@@ -345,16 +345,16 @@ void pollEvents() {
///// CLKeyboard
-short CLKeyboard_HasCmdDown() {
+int16 CLKeyboard_HasCmdDown() {
return 0;
}
void CLKeyboard_Read() {
pollEvents();
}
-unsigned char CLKeyboard_GetLastASCII() {
+byte CLKeyboard_GetLastASCII() {
return 0;
}
-short CLKeyboard_IsScanCodeDown(short scancode) {
+int16 CLKeyboard_IsScanCodeDown(int16 scancode) {
return 0;
}
@@ -363,14 +363,14 @@ void CLMouse_Hide() {
}
void CLMouse_Show() {
}
-void CLMouse_GetPosition(short *x, short *y) {
+void CLMouse_GetPosition(int16 *x, int16 *y) {
*x = g_system->getEventManager()->getMousePos().x;
*y = g_system->getEventManager()->getMousePos().y;
}
-void CLMouse_SetPosition(short x, short y) {
+void CLMouse_SetPosition(int16 x, int16 y) {
g_system->warpMouse(x, y);
}
-unsigned short CLMouse_IsDown() {
+uint16 CLMouse_IsDown() {
pollEvents();
return _mouseButton != 0;
}
@@ -389,13 +389,13 @@ void CLFile_MakeStruct(int a3, int a4, char *name, filespec_t *fs) {
void CLFile_Create(filespec_t *fs) {
fs->create = 1;
}
-void CLFile_Open(filespec_t *fs, short mode, file_t &handle) {
+void CLFile_Open(filespec_t *fs, int16 mode, file_t &handle) {
handle.open(fs->name);
}
void CLFile_Close(file_t &handle) {
handle.close();
}
-void CLFile_SetPosition(file_t &handle, short mode, long pos) {
+void CLFile_SetPosition(file_t &handle, int16 mode, long pos) {
assert(mode == 1);
handle.seek(pos, 0);
}
@@ -408,7 +408,7 @@ void CLFile_Write(file_t &handle, void *buffer, long *size) {
///// CLSound
// base sound
-void CLSound_PrepareSample(sound_t *sound, short mode) {
+void CLSound_PrepareSample(sound_t *sound, int16 mode) {
sound->mode = mode;
sound->locked = 0;
sound->loopTimes = 0;
@@ -416,7 +416,7 @@ void CLSound_PrepareSample(sound_t *sound, short mode) {
sound->ff_32 = 0;
sound->volume = 255;
}
-void CLSound_SetWantsDesigned(short designed) {
+void CLSound_SetWantsDesigned(int16 designed) {
}
void CLSound_SetLength(sound_t *sound, int length) {
}
@@ -424,7 +424,7 @@ void CLSound_SetLength(sound_t *sound, int length) {
///// CLSoundChannel
/// sound output device that plays queue of sounds
soundchannel_t *CLSoundChannel_New(int arg1) {
- short i;
+ int16 i;
soundchannel_t *ch = (soundchannel_t *)CLMemory_Alloc(sizeof(*ch));
if (!ch)
return 0;
@@ -445,21 +445,21 @@ void CLSoundChannel_Stop(soundchannel_t *ch) {
}
void CLSoundChannel_Play(soundchannel_t *ch, sound_t *sound) {
}
-short CLSoundChannel_GetVolume(soundchannel_t *ch) {
+int16 CLSoundChannel_GetVolume(soundchannel_t *ch) {
return (ch->volumeLeft + ch->volumeRight) / 2;
}
-void CLSoundChannel_SetVolume(soundchannel_t *ch, short volume) {
+void CLSoundChannel_SetVolume(soundchannel_t *ch, int16 volume) {
if (volume < 0 || volume > 255)
return;
ch->volumeLeft = volume;
ch->volumeRight = volume;
}
-void CLSoundChannel_SetVolumeRight(soundchannel_t *ch, short volume) {
+void CLSoundChannel_SetVolumeRight(soundchannel_t *ch, int16 volume) {
if (volume < 0 || volume > 255)
return;
ch->volumeRight = volume;
}
-void CLSoundChannel_SetVolumeLeft(soundchannel_t *ch, short volume) {
+void CLSoundChannel_SetVolumeLeft(soundchannel_t *ch, int16 volume) {
if (volume < 0 || volume > 255)
return;
ch->volumeLeft = volume;
@@ -498,7 +498,7 @@ void CRYOLib_ManagersInit() {
void CRYOLib_ManagersDone() {
CLTimer_Done();
}
-void CRYOLib_SetDebugMode(short enable) {
+void CRYOLib_SetDebugMode(int16 enable) {
}
void CRYOLib_InstallEmergencyExit(void(*proc)()) {
}
@@ -510,10 +510,10 @@ void CRYOLib_TestConfig() {
}
///// CLComputer
-short CLComputer_Has68030() {
+int16 CLComputer_Has68030() {
return 0;
}
-short CLComputer_Has68040() {
+int16 CLComputer_Has68040() {
return 0;
}
diff --git a/engines/cryo/cryolib.h b/engines/cryo/cryolib.h
index 1262c75d42..7bc324c8b4 100644
--- a/engines/cryo/cryolib.h
+++ b/engines/cryo/cryolib.h
@@ -44,8 +44,8 @@ namespace Cryo {
#define BE16(n) SW16(n)
#define BE32(n) SW32(n)
#endif
-#define PLE16(p) ( (((unsigned char*)(p))[1] << 8) | ((unsigned char*)(p))[0] )
-#define PLE32(p) ( (((unsigned char*)(p))[3] << 24) | (((unsigned char*)(p))[2] << 16) | (((unsigned char*)(p))[1] << 8) | ((unsigned char*)(p))[0] )
+#define PLE16(p) ( (((byte*)(p))[1] << 8) | ((byte*)(p))[0] )
+#define PLE32(p) ( (((byte*)(p))[3] << 24) | (((byte*)(p))[2] << 16) | (((byte*)(p))[1] << 8) | ((byte*)(p))[0] )
typedef void *SndChannel;
typedef char *Handle;
@@ -53,11 +53,11 @@ enum {
fsFromStart = 1
};
-extern short __debug2;
+extern int16 __debug2;
-extern short __debug, __libError, __osError;
+extern int16 __debug, __libError, __osError;
-#define CLBeginCheck { short __oldDebug = __debug; __debug = -1;
+#define CLBeginCheck { int16 __oldDebug = __debug; __debug = -1;
#define CLEndCheck __debug = __oldDebug; }
#define CLNoError __libError = 0;
@@ -79,12 +79,12 @@ struct rect_t {
typedef struct rect_t rect_t;
struct view_t {
- unsigned char *p_buffer;
+ byte *p_buffer;
int width;
int height;
- short pitch;
- short doubled;
- short allocated;
+ int16 pitch;
+ int16 doubled;
+ int16 allocated;
struct {
int src_left;
int src_top;
@@ -97,12 +97,12 @@ struct view_t {
typedef struct view_t view_t;
struct color3_t {
- short r, g, b;
+ int16 r, g, b;
};
typedef struct color3_t color3_t;
struct color_t {
- short a, r, g, b;
+ int16 a, r, g, b;
};
typedef struct color_t color_t;
@@ -118,15 +118,15 @@ struct hnmheader_t {
char flag2;
char reseverd;
char bpp;
- unsigned short width;
- unsigned short height;
+ uint16 width;
+ uint16 height;
int filesize;
int nframe;
int table_offset;
- short speed;
- short maxbuffer;
+ int16 speed;
+ int16 maxbuffer;
int buffersize;
- short ff_20;
+ int16 ff_20;
char reserved2[14];
char copyright[16];
};
@@ -138,18 +138,18 @@ struct hnm_t {
int ff_4;
file_t *file;
hnmheader_t header;
- unsigned char *work_buffer[2];
- unsigned char *final_buffer;
- unsigned char *new_frame_buffer;
- unsigned char *old_frame_buffer;
- unsigned char *read_buffer;
- unsigned char *data_ptr;
+ byte *work_buffer[2];
+ byte *final_buffer;
+ byte *new_frame_buffer;
+ byte *old_frame_buffer;
+ byte *read_buffer;
+ byte *data_ptr;
color_t palette[256];
- short can_loop;
+ int16 can_loop;
- short ff_896;
- short chunk_id;
+ int16 ff_896;
+ int16 chunk_id;
int total_read;
};
typedef struct hnm_t hnm_t;
@@ -160,23 +160,23 @@ typedef struct hnm_t hnm_t;
struct sound_t {
Handle sndHandle;
- short headerLen;
+ int16 headerLen;
long headerOffset;
- short ff_A;
+ int16 ff_A;
char *buffer;
int ff_16;
- short ff_1A;
+ int16 ff_1A;
float rate;
- short sampleSize;
+ int16 sampleSize;
int length;
- short mode;
- volatile short locked;
+ int16 mode;
+ volatile int16 locked;
long loopStart;
- short loopTimes;
- short reversed;
- short ff_32;
- short volume;
+ int16 loopTimes;
+ int16 reversed;
+ int16 ff_32;
+ int16 volume;
};
typedef struct sound_t sound_t;
@@ -184,10 +184,10 @@ typedef struct sound_t sound_t;
struct soundgroup_t {
sound_t *sound[CL_MAX_SOUNDS];
- short numSounds;
- short soundIndex;
- short playIndex;
- short ff_106;
+ int16 numSounds;
+ int16 soundIndex;
+ int16 playIndex;
+ int16 ff_106;
};
typedef struct soundgroup_t soundgroup_t;
@@ -197,13 +197,13 @@ struct soundchannel_t {
Audio::SoundHandle ch;
int xx;
- short volumeLeft;
- short volumeRight;
- short numSounds;
+ int16 volumeLeft;
+ int16 volumeRight;
+ int16 numSounds;
sound_t *sounds[CL_MAX_CH_SOUNDS];
- short ff_536;
+ int16 ff_536;
};
typedef struct soundchannel_t soundchannel_t;
@@ -211,15 +211,15 @@ extern volatile long TimerTicks;
extern view_t ScreenView;
-soundgroup_t *CLSoundGroup_New(short numSounds, short arg4, short sampleSize, float rate, short mode);
+soundgroup_t *CLSoundGroup_New(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode);
void CLSoundGroup_Free(soundgroup_t *sg);
void CLSoundGroup_Reverse16All(soundgroup_t *sg);
void *CLSoundGroup_GetNextBuffer(soundgroup_t *sg);
-short CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, short isSigned);
-short CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, short isSigned);
+int16 CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, int16 isSigned);
+int16 CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, int16 isSigned);
void CLSoundGroup_PlayNextSample(soundgroup_t *sg, soundchannel_t *ch);
-sound_t *CLSoundRaw_New(short arg1, float rate, short sampleSize, short mode);
+sound_t *CLSoundRaw_New(int16 arg1, float rate, int16 sampleSize, int16 mode);
void CLSoundRaw_Free(sound_t *sound);
void CLSoundRaw_AssignBuffer(sound_t *sound, void *buffer, int bufferOffs, int length);
@@ -227,16 +227,16 @@ char *c2pstr(char *s);
void DebugStr(char *s);
void *CLMemory_Alloc(int size);
void CLMemory_Free(void *ptr);
-short MemError();
+int16 MemError();
void SysBeep(int x);
long TickCount();
-void FlushEvents(short arg1, short arg2);
+void FlushEvents(int16 arg1, int16 arg2);
void CLBlitter_CopyViewRect(view_t *view1, view_t *view2, rect_t *rect1, rect_t *rect2);
-void CLBlitter_Send2ScreenNextCopy(color_t *palette, unsigned short first, unsigned short count);
+void CLBlitter_Send2ScreenNextCopy(color_t *palette, uint16 first, uint16 count);
void CLBlitter_OneBlackFlash();
-void CLBlitter_CopyView2ViewSimpleSize(unsigned char *src, short srcw, short srcp, short srch,
- unsigned char *dst, short dstw, short dstp, short dsth);
+void CLBlitter_CopyView2ViewSimpleSize(byte *src, int16 srcw, int16 srcp, int16 srch,
+ byte *dst, int16 dstw, int16 dstp, int16 dsth);
void CLBlitter_CopyView2ScreenCUSTOM(view_t *view);
void CLBlitter_CopyView2Screen(view_t *view);
void CLBlitter_UpdateScreen();
@@ -244,13 +244,13 @@ void CLBlitter_FillView(view_t *view, unsigned int fill);
void CLBlitter_FillScreenView(unsigned int fill);
void CLPalette_Init();
-void CLPalette_SetLastPalette(color_t *palette, short first, short count);
+void CLPalette_SetLastPalette(color_t *palette, int16 first, int16 count);
void CLPalette_GetLastPalette(color_t *palette);
-void CLPalette_SetRGBColor(color_t *palette, unsigned short index, color3_t *rgb);
-void CLPalette_Macintize(short macintize);
-void CLPalette_SetInterval(unsigned short first, unsigned short last);
+void CLPalette_SetRGBColor(color_t *palette, uint16 index, color3_t *rgb);
+void CLPalette_Macintize(int16 macintize);
+void CLPalette_SetInterval(uint16 first, uint16 last);
void CLPalette_DeactivateInterval();
-void CLPalette_Send2Screen(struct color_t *palette, unsigned short first, unsigned short count);
+void CLPalette_Send2Screen(struct color_t *palette, uint16 first, uint16 count);
void CLPalette_BeBlack();
void CLPalette_BeSystem();
@@ -259,35 +259,35 @@ void CLFile_SetFinderInfos(void *fs, int a4, int a5);
void CLFile_GetFullPath(void *a3, char *a4);
void CLFile_MakeStruct(int a3, int a4, char *name, filespec_t *fs);
void CLFile_Create(filespec_t *fs);
-void CLFile_Open(filespec_t *fs, short mode, file_t &handle);
+void CLFile_Open(filespec_t *fs, int16 mode, file_t &handle);
void CLFile_Close(file_t &handle);
-void CLFile_SetPosition(file_t &handle, short mode, long pos);
+void CLFile_SetPosition(file_t &handle, int16 mode, long pos);
void CLFile_Read(file_t &handle, void *buffer, long *size);
void CLFile_Write(file_t &handle, void *buffer, long *size);
-void CLSound_PrepareSample(sound_t *sound, short mode);
-void CLSound_SetWantsDesigned(short designed);
+void CLSound_PrepareSample(sound_t *sound, int16 mode);
+void CLSound_SetWantsDesigned(int16 designed);
void CLSound_SetLength(sound_t *sound, int length);
soundchannel_t *CLSoundChannel_New(int arg1);
void CLSoundChannel_Free(soundchannel_t *ch);
void CLSoundChannel_Stop(soundchannel_t *ch);
void CLSoundChannel_Play(soundchannel_t *ch, sound_t *sound);
-short CLSoundChannel_GetVolume(soundchannel_t *ch);
-void CLSoundChannel_SetVolume(soundchannel_t *ch, short volume);
-void CLSoundChannel_SetVolumeRight(soundchannel_t *ch, short volume);
-void CLSoundChannel_SetVolumeLeft(soundchannel_t *ch, short volume);
+int16 CLSoundChannel_GetVolume(soundchannel_t *ch);
+void CLSoundChannel_SetVolume(soundchannel_t *ch, int16 volume);
+void CLSoundChannel_SetVolumeRight(soundchannel_t *ch, int16 volume);
+void CLSoundChannel_SetVolumeLeft(soundchannel_t *ch, int16 volume);
-short CLKeyboard_HasCmdDown();
+int16 CLKeyboard_HasCmdDown();
void CLKeyboard_Read();
-unsigned char CLKeyboard_GetLastASCII();
-short CLKeyboard_IsScanCodeDown(short scancode);
+byte CLKeyboard_GetLastASCII();
+int16 CLKeyboard_IsScanCodeDown(int16 scancode);
void CLMouse_Hide();
void CLMouse_Show();
-void CLMouse_GetPosition(short *x, short *y);
-void CLMouse_SetPosition(short x, short y);
-unsigned short CLMouse_IsDown();
+void CLMouse_GetPosition(int16 *x, int16 *y);
+void CLMouse_SetPosition(int16 x, int16 y);
+uint16 CLMouse_IsDown();
void CLView_SetSrcZoomValues(view_t *view, int x, int y);
void CLView_SetDisplayZoomValues(view_t *view, int w, int h);
@@ -306,37 +306,37 @@ void CRYOLib_Done();
void CRYOLib_MinimalInit();
void CRYOLib_ManagersInit();
void CRYOLib_ManagersDone();
-void CRYOLib_SetDebugMode(short enable);
+void CRYOLib_SetDebugMode(int16 enable);
void CRYOLib_InstallEmergencyExit(void(*proc)());
void CRYOLib_SetupEnvironment();
void CRYOLib_RestoreEnvironment();
void CRYOLib_TestConfig();
-short CLComputer_Has68030();
-short CLComputer_Has68040();
+int16 CLComputer_Has68030();
+int16 CLComputer_Has68040();
void CLDesktop_TestOpenFileAtStartup();
-void CLHNM_DecompLempelZiv(unsigned char *buffer, unsigned char *output);
-void CLHNM_DecompUBA(unsigned char *output, unsigned char *curr_buffer, unsigned char *prev_buffer,
- unsigned char *input, int width, char flags);
+void CLHNM_DecompLempelZiv(byte *buffer, byte *output);
+void CLHNM_DecompUBA(byte *output, byte *curr_buffer, byte *prev_buffer,
+ byte *input, int width, char flags);
void CLHNM_Init();
void CLHNM_Done();
void CLHNM_SetupTimer(float rate);
void CLHNM_WaitLoop(hnm_t *hnm);
-void CLHNM_SetupSound(short numSounds, short arg4, short sampleSize, float rate, short mode);
-void CLHNM_SetupSoundADPCM(short numSounds, short arg4, short sampleSize, float rate, short mode);
+void CLHNM_SetupSound(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode);
+void CLHNM_SetupSoundADPCM(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode);
void CLHNM_CloseSound();
-void CLHNM_SetForceZero2Black(short forceblack);
+void CLHNM_SetForceZero2Black(int16 forceblack);
hnm_t *CLHNM_New(int preload_size);
void CLHNM_Dispose(hnm_t *hnm);
void CLHNM_SetFile(hnm_t *hnm, file_t *file);
-void CLHNM_SetFinalBuffer(hnm_t *hnm, unsigned char *buffer);
+void CLHNM_SetFinalBuffer(hnm_t *hnm, byte *buffer);
void CLHNM_AllocMemory(hnm_t *hnm);
void CLHNM_DeallocMemory(hnm_t *hnm);
void CLHNM_Read(hnm_t *hnm, int size);
void CLHNM_GiveTime(hnm_t *hnm);
-void CLHNM_CanLoop(hnm_t *hnm, short can_loop);
+void CLHNM_CanLoop(hnm_t *hnm, int16 can_loop);
void CLHNM_SelectBuffers(hnm_t *hnm);
void CLHNM_ChangePalette(hnm_t *hnm);
void CLHNM_Desentrelace(hnm_t *hnm);
@@ -345,20 +345,20 @@ soundchannel_t *CLHNM_GetSoundChannel();
void CLHNM_TryRead(hnm_t *hnm, int size);
void CLHNM_ResetInternalTimer();
void CLHNM_Reset(hnm_t *hnm);
-short CLHNM_LoadFrame(hnm_t *hnm);
-void CLHNM_WantsSound(short sound);
-void CLHNM_LoadDecompTable(short *buffer);
-void CLHNM_DecompADPCM(unsigned char *buffer, short *output, int size);
-void CLHNM_SoundInADPCM(short is_adpcm);
-void CLHNM_SoundMono(short is_mono);
-short CLHNM_NextElement(hnm_t *hnm);
+int16 CLHNM_LoadFrame(hnm_t *hnm);
+void CLHNM_WantsSound(int16 sound);
+void CLHNM_LoadDecompTable(int16 *buffer);
+void CLHNM_DecompADPCM(byte *buffer, int16 *output, int size);
+void CLHNM_SoundInADPCM(int16 is_adpcm);
+void CLHNM_SoundMono(int16 is_mono);
+int16 CLHNM_NextElement(hnm_t *hnm);
void CLHNM_ReadHeader(hnm_t *hnm);
-short CLHNM_GetVersion(hnm_t *hnm);
+int16 CLHNM_GetVersion(hnm_t *hnm);
int CLHNM_GetFrameNum(hnm_t *hnm);
void CLHNM_DeactivatePreloadBuffer();
void CLHNM_Prepare2Read(hnm_t *hnm, int mode);
void CLHNM_SetPosIntoFile(hnm_t *hnm, long pos);
-void CLHNM_Desentrelace320(unsigned char *frame_buffer, unsigned char *final_buffer, unsigned short height);
+void CLHNM_Desentrelace320(byte *frame_buffer, byte *final_buffer, uint16 height);
} // End of namespace Cryo
diff --git a/engines/cryo/defs.h b/engines/cryo/defs.h
index ee456f0f1a..62ce0ec1ea 100644
--- a/engines/cryo/defs.h
+++ b/engines/cryo/defs.h
@@ -30,12 +30,12 @@ namespace Cryo {
#define GetElem(array, idx) \
( (char*)(array) + PLE16((idx) * 2 + (char*)(array)) )
/*
-static inline void* AGetElem(unsigned char *arr, short index)
+static inline void* AGetElem(byte *arr, int16 index)
{
- unsigned char *p = arr + num * 2;
- unsigned char o0 = *p++;
- unsigned char o1 = *p++;
- unsigned short ofs = (o1 << 8) | o0;
+ byte *p = arr + num * 2;
+ byte o0 = *p++;
+ byte o1 = *p++;
+ uint16 ofs = (o1 << 8) | o0;
return arr + ofs;
}
*/
@@ -318,26 +318,26 @@ enum PersonFlags {
#pragma pack(push, 1)
struct perso_t {
- unsigned short roomNum; // room this person currently in
- unsigned short actionId; // TODO: checkme
- unsigned short party; // party bit mask
- unsigned char id; // character
- unsigned char flags; // flags and kind
- unsigned char roomBankIdx;// index in kPersoRoomBankTable for specific room banks
- unsigned char bank; // sprite bank
- unsigned short items; // inventory
- unsigned short powers; // obj of power bitmask
- unsigned char targetLoc; // For party member this is mini sprite index
- unsigned char lastLoc; // For party member this is mini sprite x offset
- unsigned char speed; // num ticks per step
- unsigned char steps; // current ticks
+ uint16 roomNum; // room this person currently in
+ uint16 actionId; // TODO: checkme
+ uint16 party; // party bit mask
+ byte id; // character
+ byte flags; // flags and kind
+ byte roomBankIdx;// index in kPersoRoomBankTable for specific room banks
+ byte bank; // sprite bank
+ uint16 items; // inventory
+ uint16 powers; // obj of power bitmask
+ byte targetLoc; // For party member this is mini sprite index
+ byte lastLoc; // For party member this is mini sprite x offset
+ byte speed; // num ticks per step
+ byte steps; // current ticks
};
typedef struct perso_t perso_t;
class EdenGame;
struct phase_t {
- short id;
+ int16 id;
void (EdenGame::*disp)();
};
typedef struct phase_t phase_t;
@@ -351,12 +351,12 @@ enum ObjectFlags {
#define MAX_OBJECTS 42
struct object_t {
- unsigned char id;
- unsigned char flags;
+ byte id;
+ byte flags;
int locations; // index in kObjectLocations
- short itemMask;
- short powerMask; // object of power bitmask
- short count;
+ int16 itemMask;
+ int16 powerMask; // object of power bitmask
+ int16 count;
};
typedef struct object_t object_t;
@@ -389,11 +389,11 @@ struct dial_t {
typedef struct dial_t dial_t;
struct tape_t {
- short textNum;
+ int16 textNum;
perso_t *perso;
- short party;
- short roomNum;
- short bgBankNum;
+ int16 party;
+ int16 roomNum;
+ int16 bgBankNum;
dial_t *dialog;
};
typedef struct tape_t tape_t;
@@ -401,33 +401,33 @@ typedef struct tape_t tape_t;
struct suiveur_t { // Characters on Mirror screen
char id; // character
char image; // sprite number
- short sx;
- short sy;
- short ex;
- short ey;
- short bank;
- short ff_C;
- short ff_E;
+ int16 sx;
+ int16 sy;
+ int16 ex;
+ int16 ey;
+ int16 bank;
+ int16 ff_C;
+ int16 ff_E;
};
typedef struct suiveur_t suiveur_t;
struct icon_t {
- short sx;
- short sy;
- short ex;
- short ey;
- unsigned short cursor_id; // & 0x8000 - inactive/hidden
+ int16 sx;
+ int16 sy;
+ int16 ex;
+ int16 ey;
+ uint16 cursor_id; // & 0x8000 - inactive/hidden
unsigned int action_id;
unsigned int object_id;
};
typedef struct icon_t icon_t;
struct goto_t {
- unsigned char areaNum; // target area
- unsigned char curAreaNum; // current area
- unsigned char departVid;
- unsigned char travelTime; // time to skip while in travel
- unsigned char arriveVid;
+ byte areaNum; // target area
+ byte curAreaNum; // current area
+ byte departVid;
+ byte travelTime; // time to skip while in travel
+ byte arriveVid;
};
typedef struct goto_t goto_t;
@@ -445,15 +445,15 @@ enum RoomFlags {
}
struct room_t {
- unsigned char ff_0;
- unsigned char exits[4]; //TODO: signed?
- unsigned char flags;
- unsigned short bank;
- unsigned short party;
- unsigned char level; // Citadel level
- unsigned char video;
- unsigned char location;
- unsigned char background; // bg/mirror image number (relative)
+ byte ff_0;
+ byte exits[4]; //TODO: signed?
+ byte flags;
+ uint16 bank;
+ uint16 party;
+ byte level; // Citadel level
+ byte video;
+ byte location;
+ byte background; // bg/mirror image number (relative)
};
typedef struct room_t room_t;
@@ -484,14 +484,14 @@ enum AreaType {
}
struct area_t {
- unsigned char num;
- unsigned char type;
- unsigned short flags;
- unsigned short firstRoomIndex;
- unsigned char citadelLevel;
- unsigned char salNum;
+ byte num;
+ byte type;
+ uint16 flags;
+ uint16 firstRoomIndex;
+ byte citadelLevel;
+ byte salNum;
room_t *citadelRoom;
- short visitCount;
+ int16 visitCount;
};
typedef struct area_t area_t;
@@ -600,87 +600,87 @@ enum GameFlags {
}
struct global_t {
- unsigned char areaNum;
- unsigned char areaVisitCount;
- unsigned char menuItemIdLo;
- unsigned char menuItemIdHi; //TODO: pad?
- unsigned short randomNumber; //TODO: this is randomized in pc ver and used by some conds. always zero on mac
- unsigned short gameTime;
- unsigned short gameDays;
- unsigned short chrono;
- unsigned short eloiDepartureDay;
- unsigned short roomNum; // current room number
- unsigned short newRoomNum; // target room number selected on world map
- unsigned short phaseNum;
- unsigned short metPersonsMask1;
- unsigned short party;
- unsigned short partyOutside;
- unsigned short metPersonsMask2;
- unsigned short __UNUSED_1C; //TODO: write-only?
- unsigned short phaseActionsCount;
- unsigned short curAreaFlags;
- unsigned short curItemsMask;
- unsigned short curPowersMask;
- unsigned short curPersoItems;
- unsigned short curPersoPowers;
- unsigned short wonItemsMask;
- unsigned short wonPowersMask;
- unsigned short stepsToFindAppleFast;
- unsigned short stepsToFindAppleNormal;
- unsigned short roomPersoItems; //TODO: write-only?
- unsigned short roomPersoPowers; //TODO: write-only?
- unsigned short gameFlags;
- unsigned short curVideoNum;
- unsigned short morkusSpyVideoNum1; //TODO: pad?
- unsigned short morkusSpyVideoNum2; //TODO: pad?
- unsigned short morkusSpyVideoNum3; //TODO: pad?
- unsigned short morkusSpyVideoNum4; //TODO: pad?
- unsigned char newMusicType;
- unsigned char ff_43;
- unsigned char videoSubtitleIndex;
- unsigned char partyInstruments; // &1 - Bell for Monk, &2 - Drum for Thugg
- unsigned char monkGotRing;
- unsigned char chrono_on;
- unsigned char curRoomFlags;
- unsigned char endGameFlag;
- unsigned char last_info;
- unsigned char autoDialog;
- unsigned char worldTyrannSighted;
- unsigned char ff_4D;
- unsigned char ff_4E;
- unsigned char worldGaveGold;
- unsigned char worldHasTriceraptors;
- unsigned char worldHasVelociraptors;
- unsigned char worldHasTyrann;
- unsigned char ff_53;
- unsigned char ff_54;
- unsigned char ff_55; //TODO: pad?
- unsigned char ff_56;
- unsigned char textToken1;
- unsigned char textToken2; //TODO: pad?
- unsigned char eloiHaveNews;
- unsigned char dialogFlags;
- unsigned char curAreaType;
- unsigned char curCitadelLevel;
- unsigned char newLocation;
- unsigned char prevLocation;
- unsigned char curPersoFlags;
- unsigned char ff_60;
- unsigned char eventType;
- unsigned char ff_62; //TODO: pad?
- unsigned char curObjectId;
- unsigned char curObjectFlags;
- unsigned char ff_65; //TODO: pad?
- unsigned char roomPersoType;
- unsigned char roomPersoFlags;
- unsigned char narratorSequence;
- unsigned char ff_69;
- unsigned char ff_6A;
- unsigned char fresqNumber;
- unsigned char ff_6C; //TODO: pad?
- unsigned char ff_6D; //TODO: pad?
- unsigned char labyrinthDirections;
- unsigned char labyrinthRoom;
+ byte areaNum;
+ byte areaVisitCount;
+ byte menuItemIdLo;
+ byte menuItemIdHi; //TODO: pad?
+ uint16 randomNumber; //TODO: this is randomized in pc ver and used by some conds. always zero on mac
+ uint16 gameTime;
+ uint16 gameDays;
+ uint16 chrono;
+ uint16 eloiDepartureDay;
+ uint16 roomNum; // current room number
+ uint16 newRoomNum; // target room number selected on world map
+ uint16 phaseNum;
+ uint16 metPersonsMask1;
+ uint16 party;
+ uint16 partyOutside;
+ uint16 metPersonsMask2;
+ uint16 __UNUSED_1C; //TODO: write-only?
+ uint16 phaseActionsCount;
+ uint16 curAreaFlags;
+ uint16 curItemsMask;
+ uint16 curPowersMask;
+ uint16 curPersoItems;
+ uint16 curPersoPowers;
+ uint16 wonItemsMask;
+ uint16 wonPowersMask;
+ uint16 stepsToFindAppleFast;
+ uint16 stepsToFindAppleNormal;
+ uint16 roomPersoItems; //TODO: write-only?
+ uint16 roomPersoPowers; //TODO: write-only?
+ uint16 gameFlags;
+ uint16 curVideoNum;
+ uint16 morkusSpyVideoNum1; //TODO: pad?
+ uint16 morkusSpyVideoNum2; //TODO: pad?
+ uint16 morkusSpyVideoNum3; //TODO: pad?
+ uint16 morkusSpyVideoNum4; //TODO: pad?
+ byte newMusicType;
+ byte ff_43;
+ byte videoSubtitleIndex;
+ byte partyInstruments; // &1 - Bell for Monk, &2 - Drum for Thugg
+ byte monkGotRing;
+ byte chrono_on;
+ byte curRoomFlags;
+ byte endGameFlag;
+ byte last_info;
+ byte autoDialog;
+ byte worldTyrannSighted;
+ byte ff_4D;
+ byte ff_4E;
+ byte worldGaveGold;
+ byte worldHasTriceraptors;
+ byte worldHasVelociraptors;
+ byte worldHasTyrann;
+ byte ff_53;
+ byte ff_54;
+ byte ff_55; //TODO: pad?
+ byte ff_56;
+ byte textToken1;
+ byte textToken2; //TODO: pad?
+ byte eloiHaveNews;
+ byte dialogFlags;
+ byte curAreaType;
+ byte curCitadelLevel;
+ byte newLocation;
+ byte prevLocation;
+ byte curPersoFlags;
+ byte ff_60;
+ byte eventType;
+ byte ff_62; //TODO: pad?
+ byte curObjectId;
+ byte curObjectFlags;
+ byte ff_65; //TODO: pad?
+ byte roomPersoType;
+ byte roomPersoFlags;
+ byte narratorSequence;
+ byte ff_69;
+ byte ff_6A;
+ byte fresqNumber;
+ byte ff_6C; //TODO: pad?
+ byte ff_6D; //TODO: pad?
+ byte labyrinthDirections;
+ byte labyrinthRoom;
void *__UNUSED_70; //TODO: pad?
dial_t *dialog_ptr;
tape_t *tape_ptr;
@@ -688,9 +688,9 @@ struct global_t {
dial_t *narrator_dialog_ptr;
dial_t *last_dialog_ptr;
icon_t *nextRoomIcon;
- unsigned char *phraseBufferPtr;
- unsigned char *__UNUSED_90; //TODO: write-only?
- unsigned char *__UNUSED_94; //TODO: write-only?
+ byte *phraseBufferPtr;
+ byte *__UNUSED_90; //TODO: write-only?
+ byte *__UNUSED_94; //TODO: write-only?
room_t *room_ptr;
area_t *area_ptr;
area_t *last_area_ptr;
@@ -698,72 +698,72 @@ struct global_t {
room_t *cita_area_firstRoom;
perso_t *perso_ptr;
perso_t *room_perso;
- unsigned char last_info_idx;
- unsigned char next_info_idx;
- unsigned char *persoSpritePtr;
- unsigned char *persoSpritePtr2;
- unsigned char *curPersoAnimPtr;
- unsigned char *ff_C2; //TODO: image desc arr
- short iconsIndex;
- short curObjectCursor; // TODO: useless?
- short ff_CA;
- short __UNUSED_CC; //TODO: unused/pad
- short perso_img_bank; //TODO: unsigned?
- unsigned short roomImgBank;
- unsigned short persoBackgroundBankIdx;
- unsigned short ff_D4; //TODO: unsigned?
- unsigned short fresqWidth;
- unsigned short fresqImgBank;
- unsigned short ff_DA; //TODO: pad?
- unsigned short ff_DC; //TODO: pad?
- unsigned short room_x_base;
- unsigned short ff_E0; //TODO: pad?
- unsigned short dialogType;
- unsigned short ff_E4; //TODO: pad?
- unsigned short currentMusicNum;
- short textNum;
- unsigned short travelTime;
- unsigned short ff_EC; //TODO: pad?
- unsigned char displayFlags;
- unsigned char oldDisplayFlags;
- unsigned char drawFlags;
- unsigned char ff_F1;
- unsigned char ff_F2;
- unsigned char menuFlags;
- unsigned char ff_F4; //TODO: write-only?
- unsigned char ff_F5;
- unsigned char ff_F6;
- unsigned char ff_F7;
- unsigned char ff_F8; //TODO: pad?
- unsigned char ff_F9; //TODO: pad?
- unsigned char ff_FA; //TODO: pad?
- unsigned char animationFlags;
- unsigned char __UNUSED_FC; //TODO: pad?
- unsigned char giveobj1;
- unsigned char giveobj2;
- unsigned char giveobj3;
- unsigned char ff_100;
- unsigned char roomVidNum;
- unsigned char ff_102;
- unsigned char ff_103;
- unsigned char roomBgBankNum;
- unsigned char valleyVidNum;
- unsigned char updatePaletteFlag;
- unsigned char inventoryScrollPos;
- unsigned char obj_count;
- unsigned char ff_109; //TODO: write-only?
- unsigned char textBankIndex;
- unsigned char pref_language;
- unsigned char pref_10C[2]; //TODO: volume
- unsigned char pref_10E[2]; // -//-
- unsigned char pref_110[2]; // -//-
- unsigned char cita_area_num;
- unsigned char ff_113;
- unsigned char lastSalNum;
- unsigned char save_end;
- short textWidthLimit;
- unsigned char numGiveObjs;
- unsigned char ff_119; // unused
+ byte last_info_idx;
+ byte next_info_idx;
+ byte *persoSpritePtr;
+ byte *persoSpritePtr2;
+ byte *curPersoAnimPtr;
+ byte *ff_C2; //TODO: image desc arr
+ int16 iconsIndex;
+ int16 curObjectCursor; // TODO: useless?
+ int16 ff_CA;
+ int16 __UNUSED_CC; //TODO: unused/pad
+ int16 perso_img_bank; //TODO: unsigned?
+ uint16 roomImgBank;
+ uint16 persoBackgroundBankIdx;
+ uint16 ff_D4; //TODO: unsigned?
+ uint16 fresqWidth;
+ uint16 fresqImgBank;
+ uint16 ff_DA; //TODO: pad?
+ uint16 ff_DC; //TODO: pad?
+ uint16 room_x_base;
+ uint16 ff_E0; //TODO: pad?
+ uint16 dialogType;
+ uint16 ff_E4; //TODO: pad?
+ uint16 currentMusicNum;
+ int16 textNum;
+ uint16 travelTime;
+ uint16 ff_EC; //TODO: pad?
+ byte displayFlags;
+ byte oldDisplayFlags;
+ byte drawFlags;
+ byte ff_F1;
+ byte ff_F2;
+ byte menuFlags;
+ byte ff_F4; //TODO: write-only?
+ byte ff_F5;
+ byte ff_F6;
+ byte ff_F7;
+ byte ff_F8; //TODO: pad?
+ byte ff_F9; //TODO: pad?
+ byte ff_FA; //TODO: pad?
+ byte animationFlags;
+ byte __UNUSED_FC; //TODO: pad?
+ byte giveobj1;
+ byte giveobj2;
+ byte giveobj3;
+ byte ff_100;
+ byte roomVidNum;
+ byte ff_102;
+ byte ff_103;
+ byte roomBgBankNum;
+ byte valleyVidNum;
+ byte updatePaletteFlag;
+ byte inventoryScrollPos;
+ byte obj_count;
+ byte ff_109; //TODO: write-only?
+ byte textBankIndex;
+ byte pref_language;
+ byte pref_10C[2]; //TODO: volume
+ byte pref_10E[2]; // -//-
+ byte pref_110[2]; // -//-
+ byte cita_area_num;
+ byte ff_113;
+ byte lastSalNum;
+ byte save_end;
+ int16 textWidthLimit;
+ byte numGiveObjs;
+ byte ff_119; // unused
};
typedef struct global_t global_t;
@@ -776,15 +776,15 @@ struct pakfile_t {
typedef struct pakfile_t pakfile_t;
struct pak_t {
- unsigned short count;
+ uint16 count;
pakfile_t files[10];
};
typedef struct pak_t pak_t;
#pragma pack(pop)
struct cita_t {
- short ff_0;
- short ff_2[8 * 2];
+ int16 ff_0;
+ int16 ff_2[8 * 2];
};
typedef struct cita_t cita_t;
@@ -807,7 +807,7 @@ enum {
LAB_W
};
-extern unsigned char kLabyrinthPath[];
+extern byte kLabyrinthPath[];
extern char kDinoSpeedForCitaLevel[16];
@@ -818,46 +818,46 @@ extern char kPersoRoomBankTable[];
// area transition descriptors
extern goto_t gotos[];
-extern short tab_2D24C[];
-extern short tab_2D28E[];
-extern short tab_2D298[];
-extern short tab_2D2AA[];
-extern short tab_2D2C4[];
+extern int16 tab_2D24C[];
+extern int16 tab_2D28E[];
+extern int16 tab_2D298[];
+extern int16 tab_2D2AA[];
+extern int16 tab_2D2C4[];
extern object_t objects[];
-extern short kObjectLocations[100];
+extern int16 kObjectLocations[100];
extern perso_t kPersons[];
extern cita_t cita_list[];
-extern short tab_2CB16[];
+extern int16 tab_2CB16[];
extern char tab_2CB1E[8][4];
struct prect_t {
- short sx, sy, ex, ey;
+ int16 sx, sy, ex, ey;
};
typedef struct prect_t prect_t;
extern prect_t perso_rects[];
-extern unsigned char tab_persxx[][5];
+extern byte tab_persxx[][5];
extern area_t kAreasTable[];
-extern short tab_2CEF0[64];
-extern short tab_2CF70[64];
-extern short kActionCursors[299];
+extern int16 tab_2CEF0[64];
+extern int16 tab_2CF70[64];
+extern int16 kActionCursors[299];
struct cubeface_t {
int tri;
char ff_4;
char ff_5;
- unsigned char *texptr;
- unsigned short *indices;
- short *uv;
+ byte *texptr;
+ uint16 *indices;
+ int16 *uv;
};
typedef struct cubeface_t cubeface_t;
struct cube_t {
int num;
cubeface_t **faces;
- short *projection; // projected XYZ coords
- short *vertices;
+ int16 *projection; // projected XYZ coords
+ int16 *vertices;
};
typedef struct cube_t cube_t;
@@ -868,7 +868,7 @@ extern float flt_2DF84;
// Cube faces to texture coords mapping
// each entry is num_polys(6) * num_faces_per_poly(2) * vertex_per_face(3) * uv(2)
-extern short cube_texcoords[3][6 * 2 * 3 * 2];
+extern int16 cube_texcoords[3][6 * 2 * 3 * 2];
extern char tab_2E138[4 * 3];
} // End of namespace Cryo
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index f168fb301f..80591a9cd4 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -47,15 +47,15 @@
namespace Cryo {
-short word_2C300 = 0;
-short word_2C302 = 0;
-short word_2C304 = 0;
+int16 word_2C300 = 0;
+int16 word_2C302 = 0;
+int16 word_2C304 = 0;
-unsigned char allow_doubled = 1;
+byte allow_doubled = 1;
int curs_center = 11;
struct {
- short x, y;
+ int16 x, y;
} saved_repadam = { -1, -1 };
void EdenGame::RemoveConsole() {
@@ -174,7 +174,7 @@ void EdenGame::scrollpano() {
scroll();
}
-void EdenGame::affsuiveur(suiveur_t *suiveur, short x, short y) {
+void EdenGame::affsuiveur(suiveur_t *suiveur, int16 x, int16 y) {
use_bank(suiveur->bank);
noclipax(suiveur->image, x, y + 16);
}
@@ -183,7 +183,7 @@ void EdenGame::persoinmiroir() {
icon_t *icon1 = &gameIcons[3];
icon_t *icon = &gameIcons[28];
suiveur_t *suiveur = suiveurs_list;
- short num = 1;
+ int16 num = 1;
int i;
for (i = 0; i < 16; i++) {
if (p_global->party & (1 << i))
@@ -221,8 +221,8 @@ void EdenGame::persoinmiroir() {
}
}
-void EdenGame::gametomiroir(unsigned char arg1) {
- short bank;
+void EdenGame::gametomiroir(byte arg1) {
+ int16 bank;
if (p_global->displayFlags != DisplayFlags::dfFlag2) {
rundcurs();
restaurefrises();
@@ -348,9 +348,9 @@ void EdenGame::gotolieu(goto_t *go) {
saved_repadam.y = -1;
}
-void EdenGame::deplaval(unsigned short roomNum) {
- unsigned char c1, newAreaNum, curAreaNum;
- short newRoomNum;
+void EdenGame::deplaval(uint16 roomNum) {
+ byte c1, newAreaNum, curAreaNum;
+ int16 newRoomNum;
p_global->newLocation = roomNum & 0xFF;
p_global->valleyVidNum = 0;
p_global->phaseActionsCount++;
@@ -425,9 +425,9 @@ void EdenGame::deplaval(unsigned short roomNum) {
}
}
-void EdenGame::deplacement(short dir) {
+void EdenGame::deplacement(int16 dir) {
room_t *room = p_global->room_ptr;
- short roomNum = p_global->roomNum;
+ int16 roomNum = p_global->roomNum;
debug("deplacement: from room %4X", roomNum);
char newLoc;
rundcurs();
@@ -450,9 +450,9 @@ void EdenGame::deplacement(short dir) {
deplaval((roomNum & 0xFF00) | newLoc);
}
-void EdenGame::deplacement2(short dir) {
+void EdenGame::deplacement2(int16 dir) {
room_t *room = p_global->room_ptr;
- short roomNum = p_global->roomNum;
+ int16 roomNum = p_global->roomNum;
char newLoc;
p_global->prevLocation = roomNum & 0xFF;
switch (dir) {
@@ -558,7 +558,7 @@ void EdenGame::squelmoorkong() {
}
void EdenGame::choisir() {
- unsigned char obj, objid = current_spot2->object_id;
+ byte obj, objid = current_spot2->object_id;
switch (objid) {
case 0:
obj = p_global->giveobj1;
@@ -579,7 +579,7 @@ void EdenGame::choisir() {
}
void EdenGame::dinaparle() {
- short num;
+ int16 num;
char res;
perso_t *perso = &kPersons[PER_DINA];
if (perso->party & (p_global->party | p_global->partyOutside)) {
@@ -735,7 +735,7 @@ void EdenGame::voirlac() {
perso_t *perso = &kPersons[PER_MORKUS];
room_t *room = p_global->room_ptr;
area_t *area = p_global->area_ptr;
- short vid = p_global->curObjectId == Objects::obApple ? 81 : 54;
+ int16 vid = p_global->curObjectId == Objects::obApple ? 81 : 54;
for (++perso; perso->roomNum != 0xFFFF; perso++) {
if (perso->roomNum != p_global->roomNum)
continue;
@@ -767,7 +767,7 @@ void EdenGame::gotohall() {
}
void EdenGame::demitourlabi() {
- unsigned short target;
+ uint16 target;
p_global->prevLocation = p_global->roomNum & 0xFF;
p_global->ff_100 = -1;
target = (p_global->roomNum & 0xFF00) | p_global->room_ptr->exits[2];
@@ -790,7 +790,7 @@ void EdenGame::gotonido() {
}
void EdenGame::gotoval() {
- unsigned short target = p_global->roomNum;
+ uint16 target = p_global->roomNum;
char obj;
rundcurs();
afficher();
@@ -811,7 +811,7 @@ void EdenGame::final() {
if (p_global->curObjectId != 0)
return;
bars_out();
- *(short *)(gameRooms + 0x6DC) = 319; //TODO
+ *(int16 *)(gameRooms + 0x6DC) = 319; //TODO
p_global->roomImgBank = 319;
playhnm(97);
maj2();
@@ -877,7 +877,7 @@ void EdenGame::sauvefrises() {
sauvefrisesbas();
}
-void EdenGame::sauvefriseshaut(short x) { // Save top bar
+void EdenGame::sauvefriseshaut(int16 x) { // Save top bar
underTopBarScreenRect.sy = 0; //TODO: wrong fields order?
underTopBarScreenRect.sx = x;
underTopBarScreenRect.ex = x + 320 - 1;
@@ -916,7 +916,7 @@ void EdenGame::use_main_bank() {
bank_data_ptr = main_bank_buf;
}
-void EdenGame::use_bank(short bank) {
+void EdenGame::use_bank(int16 bank) {
if (bank > 2500)
debug("attempt to load bad bank %d", bank);
bank_data_ptr = bank_data_buf;
@@ -927,9 +927,9 @@ void EdenGame::use_bank(short bank) {
}
}
-void EdenGame::sundcurs(short x, short y) {
- unsigned char *scr, *keep = curs_keepbuf;
- short w, h;
+void EdenGame::sundcurs(int16 x, int16 y) {
+ byte *scr, *keep = curs_keepbuf;
+ int16 w, h;
curs_keepx = x - 4;
curs_keepy = y - 4;
scr = p_mainview_buf + curs_keepx + curs_keepy * 640;
@@ -942,8 +942,8 @@ void EdenGame::sundcurs(short x, short y) {
}
void EdenGame::rundcurs() {
- unsigned char *scr, *keep = curs_keepbuf;
- short w, h;
+ byte *scr, *keep = curs_keepbuf;
+ int16 w, h;
scr = p_mainview_buf + curs_keepx + curs_keepy * 640;
if (!curs_saved || (curs_keepx == -1 && curs_keepy == -1)) //TODO ...
return;
@@ -955,20 +955,20 @@ void EdenGame::rundcurs() {
}
-void EdenGame::noclipax(short index, short x, short y) {
- unsigned char *pix = bank_data_ptr;
- unsigned char *scr = p_mainview_buf + x + y * 640;
- unsigned char h0, h1, mode;
- short w, h;
+void EdenGame::noclipax(int16 index, int16 x, int16 y) {
+ byte *pix = bank_data_ptr;
+ byte *scr = p_mainview_buf + x + y * 640;
+ byte h0, h1, mode;
+ int16 w, h;
if (cur_bank_num != 117 && !no_palette) {
if (PLE16(pix) > 2)
readpalette(pix + 2);
}
pix += PLE16(pix);
pix += PLE16(pix + index * 2);
- // short height:9
- // short pad:6;
- // short flag:1;
+ // int16 height:9
+ // int16 pad:6;
+ // int16 flag:1;
h0 = *pix++;
h1 = *pix++;
w = ((h1 & 1) << 8) | h0;
@@ -982,17 +982,17 @@ void EdenGame::noclipax(short index, short x, short y) {
if (h1 & 0x80) {
// compressed
for (; h-- > 0;) {
- short ww;
+ int16 ww;
for (ww = w; ww > 0;) {
- unsigned char c = *pix++;
+ byte c = *pix++;
if (c >= 0x80) {
if (c == 0x80) {
- unsigned char fill = *pix++;
+ byte fill = *pix++;
if (fill == 0) {
scr += 128 + 1;
ww -= 128 + 1;
} else {
- unsigned char run;
+ byte run;
*scr++ = fill; //TODO: wha?
*scr++ = fill;
ww -= 128 + 1;
@@ -1000,8 +1000,8 @@ void EdenGame::noclipax(short index, short x, short y) {
*scr++ = fill;
}
} else {
- unsigned char fill = *pix++;
- unsigned char run = 255 - c + 2;
+ byte fill = *pix++;
+ byte run = 255 - c + 2;
ww -= run;
if (fill == 0)
scr += run;
@@ -1010,10 +1010,10 @@ void EdenGame::noclipax(short index, short x, short y) {
*scr++ = fill;
}
} else {
- unsigned char run = c + 1;
+ byte run = c + 1;
ww -= run;
for (; run--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
if (p == 0)
scr++;
else
@@ -1026,9 +1026,9 @@ void EdenGame::noclipax(short index, short x, short y) {
} else {
// uncompressed
for (; h--;) {
- short ww;
+ int16 ww;
for (ww = w; ww--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
if (p == 0)
scr++;
else
@@ -1039,20 +1039,20 @@ void EdenGame::noclipax(short index, short x, short y) {
}
}
-void EdenGame::noclipax_avecnoir(short index, short x, short y) {
- unsigned char *pix = bank_data_ptr;
- unsigned char *scr = p_mainview_buf + x + y * 640;
- unsigned char h0, h1, mode;
- short w, h;
+void EdenGame::noclipax_avecnoir(int16 index, int16 x, int16 y) {
+ byte *pix = bank_data_ptr;
+ byte *scr = p_mainview_buf + x + y * 640;
+ byte h0, h1, mode;
+ int16 w, h;
if (cur_bank_num != 117) {
if (PLE16(pix) > 2)
readpalette(pix + 2);
}
pix += PLE16(pix);
pix += PLE16(pix + index * 2);
- // short height:9
- // short pad:6;
- // short flag:1;
+ // int16 height:9
+ // int16 pad:6;
+ // int16 flag:1;
h0 = *pix++;
h1 = *pix++;
w = ((h1 & 1) << 8) | h0;
@@ -1065,30 +1065,30 @@ void EdenGame::noclipax_avecnoir(short index, short x, short y) {
if (h1 & 0x80) {
// compressed
for (; h-- > 0;) {
- short ww;
+ int16 ww;
for (ww = w; ww > 0;) {
- unsigned char c = *pix++;
+ byte c = *pix++;
if (c >= 0x80) {
if (c == 0x80) {
- unsigned char fill = *pix++;
- unsigned char run;
+ byte fill = *pix++;
+ byte run;
*scr++ = fill; //TODO: wha?
*scr++ = fill;
ww -= 128 + 1;
for (run = 127; run--;)
*scr++ = fill;
} else {
- unsigned char fill = *pix++;
- unsigned char run = 255 - c + 2;
+ byte fill = *pix++;
+ byte run = 255 - c + 2;
ww -= run;
for (; run--;)
*scr++ = fill;
}
} else {
- unsigned char run = c + 1;
+ byte run = c + 1;
ww -= run;
for (; run--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
*scr++ = p;
}
}
@@ -1098,9 +1098,9 @@ void EdenGame::noclipax_avecnoir(short index, short x, short y) {
} else {
// uncompressed
for (; h--;) {
- short ww;
+ int16 ww;
for (ww = w; ww--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
*scr++ = p;
}
scr += 640 - w;
@@ -1108,15 +1108,15 @@ void EdenGame::noclipax_avecnoir(short index, short x, short y) {
}
}
-void EdenGame::getglow(short x, short y, short w, short h) {
- unsigned char *scr = p_mainview_buf + x + y * 640;
- unsigned char *gl = glow_buffer;
+void EdenGame::getglow(int16 x, int16 y, int16 w, int16 h) {
+ byte *scr = p_mainview_buf + x + y * 640;
+ byte *gl = glow_buffer;
glow_x = x;
glow_y = y;
glow_w = w;
glow_h = h;
for (; h--;) {
- short ww;
+ int16 ww;
for (ww = w; ww--;)
*gl++ = *scr++;
scr += 640 - w;
@@ -1124,30 +1124,30 @@ void EdenGame::getglow(short x, short y, short w, short h) {
}
void EdenGame::unglow() {
- unsigned char *gl = glow_buffer;
- unsigned char *scr = p_mainview_buf + glow_x + glow_y * 640;
+ byte *gl = glow_buffer;
+ byte *scr = p_mainview_buf + glow_x + glow_y * 640;
if (glow_x < 0 || glow_y < 0) //TODO: move it up
return;
for (; glow_h--;) {
- short ww;
+ int16 ww;
for (ww = glow_w; ww--;)
*scr++ = *gl++;
scr += 640 - glow_w;
}
}
-void EdenGame::glow(short index) {
- unsigned char pixbase;
- unsigned char *pix = bank_data_ptr;
- unsigned char *scr;
- unsigned char h0, h1, mode;
- short w, h, x, y, ex, dx, dy, pstride, sstride;
+void EdenGame::glow(int16 index) {
+ byte pixbase;
+ byte *pix = bank_data_ptr;
+ byte *scr;
+ byte h0, h1, mode;
+ int16 w, h, x, y, ex, dx, dy, pstride, sstride;
index += 9;
pix += PLE16(pix);
pix += PLE16(pix + index * 2);
- // short height:9
- // short pad:6;
- // short flag:1;
+ // int16 height:9
+ // int16 pad:6;
+ // int16 flag:1;
h0 = *pix++;
h1 = *pix++;
w = ((h1 & 1) << 8) | h0;
@@ -1193,9 +1193,9 @@ void EdenGame::glow(short index) {
getglow(x, y, w, h);
for (; h--;) {
- short ww;
+ int16 ww;
for (ww = w; ww--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
if (p == 0)
scr++;
else
@@ -1206,12 +1206,12 @@ void EdenGame::glow(short index) {
}
}
-void EdenGame::readpalette(unsigned char *ptr) {
+void EdenGame::readpalette(byte *ptr) {
int doit = 1;
while (doit) {
- unsigned short idx = *ptr++;
+ uint16 idx = *ptr++;
if (idx != 0xFF) {
- unsigned short cnt = *ptr++;
+ uint16 cnt = *ptr++;
while (cnt--) {
if (idx == 0) {
pal_entry.r = 0;
@@ -1231,20 +1231,20 @@ void EdenGame::readpalette(unsigned char *ptr) {
}
}
-void EdenGame::spritesurbulle(short index, short x, short y) {
- unsigned char *pix = bank_data_ptr;
- unsigned char *scr = p_subtitlesview_buf + x + y * subtitles_x_width;
- unsigned char h0, h1, mode;
- short w, h;
+void EdenGame::spritesurbulle(int16 index, int16 x, int16 y) {
+ byte *pix = bank_data_ptr;
+ byte *scr = p_subtitlesview_buf + x + y * subtitles_x_width;
+ byte h0, h1, mode;
+ int16 w, h;
if (cur_bank_num != 117) {
if (PLE16(pix) > 2)
readpalette(pix + 2);
}
pix += PLE16(pix);
pix += PLE16(pix + index * 2);
- // short height:9
- // short pad:6;
- // short flag:1;
+ // int16 height:9
+ // int16 pad:6;
+ // int16 flag:1;
h0 = *pix++;
h1 = *pix++;
w = ((h1 & 1) << 8) | h0;
@@ -1255,17 +1255,17 @@ void EdenGame::spritesurbulle(short index, short x, short y) {
if (h1 & 0x80) {
// compressed
for (; h-- > 0;) {
- short ww;
+ int16 ww;
for (ww = w; ww > 0;) {
- unsigned char c = *pix++;
+ byte c = *pix++;
if (c >= 0x80) {
if (c == 0x80) {
- unsigned char fill = *pix++;
+ byte fill = *pix++;
if (fill == 0) {
scr += 128 + 1;
ww -= 128 + 1;
} else {
- unsigned char run;
+ byte run;
*scr++ = fill; //TODO: wha?
*scr++ = fill;
ww -= 128 + 1;
@@ -1273,8 +1273,8 @@ void EdenGame::spritesurbulle(short index, short x, short y) {
*scr++ = fill;
}
} else {
- unsigned char fill = *pix++;
- unsigned char run = 255 - c + 2;
+ byte fill = *pix++;
+ byte run = 255 - c + 2;
ww -= run;
if (fill == 0)
scr += run;
@@ -1283,10 +1283,10 @@ void EdenGame::spritesurbulle(short index, short x, short y) {
*scr++ = fill;
}
} else {
- unsigned char run = c + 1;
+ byte run = c + 1;
ww -= run;
for (; run--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
if (p == 0)
scr++;
else
@@ -1299,9 +1299,9 @@ void EdenGame::spritesurbulle(short index, short x, short y) {
} else {
// uncompressed
for (; h--;) {
- short ww;
+ int16 ww;
for (ww = w; ww--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
if (p == 0)
scr++;
else
@@ -1313,7 +1313,7 @@ void EdenGame::spritesurbulle(short index, short x, short y) {
}
void EdenGame::bars_out() {
- short i, r19, r20, r25, r24;
+ int16 i, r19, r20, r25, r24;
unsigned int *scr40, *scr41, *scr42;
if (showBlackBars)
return;
@@ -1385,7 +1385,7 @@ void EdenGame::bars_out() {
}
void EdenGame::bars_in() {
- short r29, r28;
+ int16 r29, r28;
if (!showBlackBars)
return;
blackbars();
@@ -1442,8 +1442,8 @@ void EdenGame::restaurefondbouche() {
}
void EdenGame::blackbars() {
- unsigned char *scr = p_mainview_buf;
- short x, y;
+ byte *scr = p_mainview_buf;
+ int16 x, y;
for (y = 0; y < 16; y++)
for (x = 0; x < 640; x++)
*scr++ = 0;
@@ -1471,7 +1471,7 @@ void EdenGame::afftopscr() { // Draw top bar (location / party / map)
}
void EdenGame::affplanval() { // Draw mini-map
- short loc;
+ int16 loc;
perso_t *perso;
if (p_global->area_ptr->type == AreaType::atValley) {
noclipax(p_global->area_ptr->num + 9, 266, 1);
@@ -1493,15 +1493,15 @@ void EdenGame::affplanval() { // Draw mini-map
}
}
-void EdenGame::affrepere(short index, short location) {
+void EdenGame::affrepere(int16 index, int16 location) {
noclipax(index, 269 + location % 16 * 4, 2 + (location - 16) / 16 * 3);
}
-void EdenGame::affrepereadam(short location) {
- short x = 269;
- short y = 2;
- short w;
- unsigned char *pix;
+void EdenGame::affrepereadam(int16 location) {
+ int16 x = 269;
+ int16 y = 2;
+ int16 w;
+ byte *pix;
rest_repadam();
if (location > 15 && location < 76) {
x += (location & 15) * 4;
@@ -1524,8 +1524,8 @@ void EdenGame::affrepereadam(short location) {
}
void EdenGame::rest_repadam() {
- short x, y, w;
- unsigned char *pix;
+ int16 x, y, w;
+ byte *pix;
if (saved_repadam.x == -1 && saved_repadam.y == -1)
return;
x = saved_repadam.x;
@@ -1545,9 +1545,9 @@ void EdenGame::rest_repadam() {
pix[2] = keep22;
}
-void EdenGame::save_repadam(short x, short y) {
- short w;
- unsigned char *pix;
+void EdenGame::save_repadam(int16 x, int16 y) {
+ int16 w;
+ byte *pix;
saved_repadam.x = x;
saved_repadam.y = y;
pix = p_underBarsView->p_buffer;
@@ -1565,9 +1565,9 @@ void EdenGame::save_repadam(short x, short y) {
keep22 = pix[2];
}
-char EdenGame::istrice(short roomNum) {
+char EdenGame::istrice(int16 roomNum) {
char loc = roomNum & 0xFF;
- short area = roomNum & 0xFF00;
+ int16 area = roomNum & 0xFF00;
perso_t *perso;
for (perso = &kPersons[PER_UNKN_18C]; perso != &kPersons[PER_UNKN_372]; perso++) {
if ((perso->flags & PersonFlags::pf80) || (perso->flags & PersonFlags::pfTypeMask) != PersonFlags::pftTriceraptor)
@@ -1584,9 +1584,9 @@ char EdenGame::istrice(short roomNum) {
return 0;
}
-char EdenGame::istyran(short roomNum) {
+char EdenGame::istyran(int16 roomNum) {
char loc = roomNum & 0xFF;
- short area = roomNum & 0xFF00;
+ int16 area = roomNum & 0xFF00;
// TODO: orig bug: this ptr is not initialized when first called from getsalle
// PC version scans kPersons[] directly and is not affected
if (!tyranPtr)
@@ -1609,7 +1609,7 @@ char EdenGame::istyran(short roomNum) {
void EdenGame::istyranval(area_t *area) {
perso_t *perso;
- unsigned char areaNum = area->num;
+ byte areaNum = area->num;
area->flags &= ~AreaFlags::HasTyrann;
for (perso = &kPersons[PER_UNKN_372]; perso->roomNum != 0xFFFF; perso++) {
if (perso->flags & PersonFlags::pf80)
@@ -1623,8 +1623,8 @@ void EdenGame::istyranval(area_t *area) {
char EdenGame::getdirection(perso_t *perso) {
char dir = -1;
- unsigned char trgLoc = perso->targetLoc;
- unsigned char curLoc = perso->roomNum & 0xFF; //TODO name
+ byte trgLoc = perso->targetLoc;
+ byte curLoc = perso->roomNum & 0xFF; //TODO name
if (curLoc != trgLoc) {
curLoc &= 0xF;
trgLoc &= 0xF;
@@ -1647,7 +1647,7 @@ char EdenGame::getdirection(perso_t *perso) {
}
char EdenGame::caselibre(char loc, perso_t *perso) {
- short roomNum;
+ int16 roomNum;
room_t *room = p_global->cita_area_firstRoom;
if (loc <= 0x10 || loc > 76 || (loc & 0xF) >= 12 || loc == perso->lastLoc)
return 0;
@@ -1721,9 +1721,9 @@ char EdenGame::naitredino(char persoType) {
return 0;
}
-void EdenGame::newcita(char arg1, short arg2, room_t *room) {
- unsigned short index;
- short *ptr;
+void EdenGame::newcita(char arg1, int16 arg2, room_t *room) {
+ uint16 index;
+ int16 *ptr;
cita_t *cita = cita_list;
while (cita->ff_0 < arg2)
cita++;
@@ -1736,10 +1736,10 @@ void EdenGame::newcita(char arg1, short arg2, room_t *room) {
room->flags |= RoomFlags::rf02;
}
-void EdenGame::citaevol(short level) {
+void EdenGame::citaevol(int16 level) {
room_t *room = p_global->cur_area_ptr->citadelRoom;
perso_t *perso = &kPersons[PER_UNKN_372];
- unsigned char speed, loc = room->location;
+ byte speed, loc = room->location;
if (level >= 80 && !istrice((p_global->cita_area_num << 8) | room->location)) { //TODO: loc ?
room->level = 79;
return;
@@ -1765,7 +1765,7 @@ void EdenGame::citaevol(short level) {
}
}
-void EdenGame::citacapoute(short roomNum) {
+void EdenGame::citacapoute(int16 roomNum) {
perso_t *perso = &kPersons[PER_UNKN_18C];
room_t *room = p_global->cur_area_ptr->citadelRoom;
room->flags |= RoomFlags::rf01;
@@ -1822,11 +1822,11 @@ void EdenGame::citatombe(char level) {
}
void EdenGame::constcita() {
- unsigned char level;
+ byte level;
room_t *room;
- unsigned char loc;
+ byte loc;
// room_t *room = p_global->cur_area_ptr->room_ptr; //TODO: wrong? chk below
- // unsigned char id = room->ff_C;
+ // byte id = room->ff_C;
if (!p_global->cur_area_ptr->citadelLevel || !p_global->cur_area_ptr->citadelRoom)
return;
room = p_global->cur_area_ptr->citadelRoom; //TODO: copied here by me
@@ -1850,7 +1850,7 @@ void EdenGame::constcita() {
void EdenGame::depladino(perso_t *perso) {
char *dirs, dir, dir2;
- unsigned char loc;
+ byte loc;
dir = getdirection(perso);
if (dir != -1) {
melangedir();
@@ -1922,8 +1922,8 @@ void EdenGame::deplaalldino() {
void EdenGame::newvallee() {
perso_t *perso = &kPersons[PER_UNKN_372];
- short *ptr = tab_2CB16;
- short roomNum;
+ int16 *ptr = tab_2CB16;
+ int16 roomNum;
while ((roomNum = *ptr++) != -1) {
perso->roomNum = roomNum;
perso->flags &= ~PersonFlags::pf80;
@@ -1947,7 +1947,7 @@ char EdenGame::whereiscita() {
return res;
}
-char EdenGame::iscita(short loc) {
+char EdenGame::iscita(int16 loc) {
room_t *room = p_global->cita_area_firstRoom;
loc &= 0xFF;
for (; room->ff_0 != 0xFF; room++) {
@@ -1966,7 +1966,7 @@ char EdenGame::iscita(short loc) {
}
void EdenGame::lieuvava(area_t *area) {
- unsigned char mask;
+ byte mask;
if (area->type == AreaType::atValley) {
istyranval(area);
area->citadelLevel = 0;
@@ -2079,7 +2079,7 @@ void EdenGame::vivredino() {
}
}
if (!perso->targetLoc) {
- short loc;
+ int16 loc;
perso->lastLoc = 0;
do {
loc = (g_ed->_rnd->getRandomNumber(63) & 63) + 16;
@@ -2094,7 +2094,7 @@ void EdenGame::vivredino() {
}
}
-void EdenGame::vivreval(short areaNum) {
+void EdenGame::vivreval(int16 areaNum) {
p_global->cita_area_num = areaNum;
p_global->cur_area_ptr = &kAreasTable[areaNum - 1];
p_global->cita_area_firstRoom = &gameRooms[p_global->cur_area_ptr->firstRoomIndex];
@@ -2119,9 +2119,9 @@ void EdenGame::chaquejour() {
p_global->drawFlags |= DrawFlags::drDrawTopScreen;
}
-void EdenGame::temps_passe(short t) {
- short days = p_global->gameDays;
- short lo = p_global->ff_56;
+void EdenGame::temps_passe(int16 t) {
+ int16 days = p_global->gameDays;
+ int16 lo = p_global->ff_56;
lo += t;
if (lo > 255) {
days++;
@@ -2191,7 +2191,7 @@ void EdenGame::anim_perso() {
bank_data_ptr = perso_img_bank_data_ptr;
restaurefondbouche();
// debug("perso spr %d", animationIndex);
- perso_spr(p_global->persoSpritePtr2 + animationIndex * 2); //TODO: shorts?
+ perso_spr(p_global->persoSpritePtr2 + animationIndex * 2); //TODO: int16s?
dword_3072C = imagedesc + 200;
if (*dword_3072C)
af_image();
@@ -2202,9 +2202,9 @@ void EdenGame::anim_perso() {
}
void EdenGame::getanimrnd() {
- short rnd;
+ int16 rnd;
animationDelay = 8;
- rnd = g_ed->_rnd->getRandomNumber(65535) & (unsigned char)~0x18; //TODO
+ rnd = g_ed->_rnd->getRandomNumber(65535) & (byte)~0x18; //TODO
dword_30724 = p_global->persoSpritePtr + 16; //TODO
p_global->curPersoAnimPtr = p_global->persoSpritePtr + ((dword_30724[1] << 8) + dword_30724[0]);
p_global->animationFlags = 1;
@@ -2238,13 +2238,13 @@ void EdenGame::addanim() {
}
void EdenGame::virespritebouche() {
- unsigned char *src = dword_3072C + 2;
- unsigned char *dst = src;
+ byte *src = dword_3072C + 2;
+ byte *dst = src;
char cnt = dword_3072C[0];
while (cnt--) {
- unsigned char a = *src++;
- unsigned char b = *src++;
- unsigned char c = *src++;
+ byte a = *src++;
+ byte b = *src++;
+ byte c = *src++;
dst[0] = a;
dst[1] = b;
dst[2] = c;
@@ -2265,13 +2265,13 @@ void EdenGame::anim_perfin() {
animationActive = 0;
}
-void EdenGame::perso_spr(unsigned char *spr) {
- unsigned char *img = imagedesc + 200 + 2;
- short count = 0;
- unsigned char c, cc;
+void EdenGame::perso_spr(byte *spr) {
+ byte *img = imagedesc + 200 + 2;
+ int16 count = 0;
+ byte c, cc;
while ((c = *spr++)) {
- unsigned char *src;
- short index;
+ byte *src;
+ int16 index;
cc = 0;
if (c == 1) {
cc = index;
@@ -2299,8 +2299,8 @@ void EdenGame::perso_spr(unsigned char *spr) {
}
void EdenGame::af_image() {
- unsigned char *img = imagedesc + 200, *img_start, *curimg = imagedesc;
- short count;
+ byte *img = imagedesc + 200, *img_start, *curimg = imagedesc;
+ int16 count;
count = PLE16(img);
if (!count)
@@ -2315,21 +2315,21 @@ void EdenGame::af_image() {
img += 2;
/////// draw it
while (count--) {
- unsigned short index = *img++;
- unsigned short x = *img++ + gameIcons[0].sx;
- unsigned short y = *img++ + gameIcons[0].sy;
- unsigned char *pix = bank_data_ptr;
- unsigned char *scr = p_mainview_buf + x + y * 640;
- unsigned char h0, h1, mode;
- short w, h;
+ uint16 index = *img++;
+ uint16 x = *img++ + gameIcons[0].sx;
+ uint16 y = *img++ + gameIcons[0].sy;
+ byte *pix = bank_data_ptr;
+ byte *scr = p_mainview_buf + x + y * 640;
+ byte h0, h1, mode;
+ int16 w, h;
index--;
if (PLE16(pix) > 2)
readpalette(pix + 2);
pix += PLE16(pix);
pix += PLE16(pix + index * 2);
- // short height:9
- // short pad:6;
- // short flag:1;
+ // int16 height:9
+ // int16 pad:6;
+ // int16 flag:1;
h0 = *pix++;
h1 = *pix++;
w = ((h1 & 1) << 8) | h0;
@@ -2340,17 +2340,17 @@ void EdenGame::af_image() {
if (h1 & 0x80) {
// compressed
for (; h-- > 0;) {
- short ww;
+ int16 ww;
for (ww = w; ww > 0;) {
- unsigned char c = *pix++;
+ byte c = *pix++;
if (c >= 0x80) {
if (c == 0x80) {
- unsigned char fill = *pix++;
+ byte fill = *pix++;
if (fill == 0) {
scr += 128 + 1;
ww -= 128 + 1;
} else {
- unsigned char run;
+ byte run;
*scr++ = fill; //TODO: wha?
*scr++ = fill;
ww -= 128 + 1;
@@ -2358,8 +2358,8 @@ void EdenGame::af_image() {
*scr++ = fill;
}
} else {
- unsigned char fill = *pix++;
- unsigned char run = 255 - c + 2;
+ byte fill = *pix++;
+ byte run = 255 - c + 2;
ww -= run;
if (fill == 0)
scr += run;
@@ -2368,10 +2368,10 @@ void EdenGame::af_image() {
*scr++ = fill;
}
} else {
- unsigned char run = c + 1;
+ byte run = c + 1;
ww -= run;
for (; run--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
if (p == 0)
scr++;
else
@@ -2384,9 +2384,9 @@ void EdenGame::af_image() {
} else {
// uncompressed
for (; h--;) {
- short ww;
+ int16 ww;
for (ww = w; ww--;) {
- unsigned char p = *pix++;
+ byte p = *pix++;
if (p == 0)
scr++;
else
@@ -2413,12 +2413,12 @@ void EdenGame::ef_perso() {
}
void EdenGame::load_perso(perso_t *perso) {
- unsigned char *ptr, *baseptr;
+ byte *ptr, *baseptr;
perso_img_bank_data_ptr = 0;
if (!perso->bank)
return;
if (perso->bank != p_global->perso_img_bank) {
- cur_perso_rect = &perso_rects[perso->id]; //TODO: array of short?
+ cur_perso_rect = &perso_rects[perso->id]; //TODO: array of int16?
dword_30728 = tab_persxx[perso->id];
ef_perso();
p_global->perso_img_bank = perso->bank;
@@ -2530,7 +2530,7 @@ void EdenGame::af_fondsuiveur() {
}
void EdenGame::af_fondperso1() {
- unsigned char bank;
+ byte bank;
char *ptab;
if (p_global->perso_ptr == &kPersons[PER_MESSAGER]) {
gameIcons[0].sx = 0;
@@ -2659,7 +2659,7 @@ void EdenGame::showpersopanel() {
}
void EdenGame::getdatasync() {
- short num = p_global->textNum;
+ int16 num = p_global->textNum;
if (p_global->textBankIndex != 1)
num += 565;
if (p_global->textBankIndex == 3)
@@ -2676,8 +2676,8 @@ void EdenGame::getdatasync() {
animationTable = 0;
}
-short EdenGame::ReadNombreFrames() {
- short num = 0;
+int16 EdenGame::ReadNombreFrames() {
+ int16 num = 0;
animationTable = gameLipsync + 7262; //TODO: fix me
while (*animationTable++ != 0xFF)
num++;
@@ -2708,12 +2708,12 @@ void EdenGame::waitendspeak() {
}
void EdenGame::my_bulle() {
- unsigned char c;
- unsigned char i;
- short words_on_line, word_width, line_width;
- unsigned char *icons = phraseIconsBuffer;
- unsigned char *lines = phraseCoordsBuffer;
- unsigned char *phrasePtr = phraseBuffer;
+ byte c;
+ byte i;
+ int16 words_on_line, word_width, line_width;
+ byte *icons = phraseIconsBuffer;
+ byte *lines = phraseCoordsBuffer;
+ byte *phrasePtr = phraseBuffer;
if (!p_global->textNum)
return;
p_global->numGiveObjs = 0;
@@ -2742,7 +2742,7 @@ void EdenGame::my_bulle() {
else if (c >= 0xC0 && c < 0xD0)
p_global->textToken2 = c & 0xF;
else if (c >= 0xD0 && c < 0xE0) {
- unsigned char c1 = *text_ptr++;
+ byte c1 = *text_ptr++;
if (c == 0xD2)
#ifdef FAKE_DOS_VERSION
p_global->textWidthLimit = c1 + 160;
@@ -2750,7 +2750,7 @@ void EdenGame::my_bulle() {
p_global->textWidthLimit = c1 + subtitles_x_center; //TODO: signed? 160 in pc ver
#endif
else {
- unsigned char c2 = *text_ptr++;
+ byte c2 = *text_ptr++;
switch (p_global->numGiveObjs) {
case 0:
p_global->giveobj1 = c2;
@@ -2770,8 +2770,8 @@ void EdenGame::my_bulle() {
} else if (c >= 0xE0 && c < 0xFF)
SysBeep(1);
else if (c != '\r') {
- unsigned char width;
- short overrun;
+ byte width;
+ int16 overrun;
*phrasePtr++ = c;
width = gameFont[c];
#ifdef FAKE_DOS_VERSION
@@ -2816,18 +2816,18 @@ void EdenGame::my_bulle() {
num_text_lines = 3;
icons = phraseIconsBuffer;
for (i = 0; i < p_global->numGiveObjs; i++) {
- unsigned char x = *icons++;
- unsigned char y = *icons++;
- unsigned char s = *icons++;
+ byte x = *icons++;
+ byte y = *icons++;
+ byte s = *icons++;
spritesurbulle(52, x + subtitles_x_center, y - 1);
spritesurbulle(s + 9, x + subtitles_x_center + 1, y);
}
}
void EdenGame::my_pr_bulle() {
- unsigned char *cur_out;
- unsigned char *coo = phraseCoordsBuffer;
- short extra_spacing, lines;
+ byte *cur_out;
+ byte *coo = phraseCoordsBuffer;
+ int16 extra_spacing, lines;
char done = 0;
CLBlitter_FillView(p_subtitlesview, 0);
if (p_global->pref_language == 0)
@@ -2836,9 +2836,9 @@ void EdenGame::my_pr_bulle() {
text_ptr = phraseBuffer;
lines = 1;
while (!done) {
- unsigned char c;
- short num_words = *coo++; // num words on line
- short pad_size = *coo++; // amount of extra spacing
+ byte c;
+ int16 num_words = *coo++; // num words on line
+ int16 pad_size = *coo++; // amount of extra spacing
cur_out = textout;
extra_spacing = num_words > 1 ? pad_size / (num_words - 1) + 1 : 0;
if (lines == num_text_lines)
@@ -2856,7 +2856,7 @@ void EdenGame::my_pr_bulle() {
pad_size = 0;
}
} else {
- short char_width = gameFont[c];
+ int16 char_width = gameFont[c];
if (!(p_global->drawFlags & DrawFlags::drDrawMenu)) {
textout += subtitles_x_width;
if (!specialTextMode)
@@ -2884,13 +2884,13 @@ void EdenGame::my_pr_bulle() {
}
}
-void EdenGame::charsurbulle(unsigned char c, unsigned char color, short width) {
- short w, h;
- unsigned char *glyph = gameFont + 256 + c * FONT_HEIGHT;
+void EdenGame::charsurbulle(byte c, byte color, int16 width) {
+ int16 w, h;
+ byte *glyph = gameFont + 256 + c * FONT_HEIGHT;
textoutptr = textout;
for (h = 0; h < FONT_HEIGHT; h++) {
- unsigned char bits = *glyph++;
- short mask = 0x80;
+ byte bits = *glyph++;
+ int16 mask = 0x80;
for (w = 0; w < width; w++) {
if (bits & mask)
*textoutptr = color;
@@ -2902,8 +2902,8 @@ void EdenGame::charsurbulle(unsigned char c, unsigned char color, short width) {
}
void EdenGame::af_subtitle() {
- short w, h, y;
- unsigned char *src = p_subtitlesview_buf, *dst = p_mainview_buf;
+ int16 w, h, y;
+ byte *src = p_subtitlesview_buf, *dst = p_mainview_buf;
if (p_global->displayFlags & DisplayFlags::dfFlag2) {
y = 174;
if ((p_global->drawFlags & DrawFlags::drDrawMenu) && num_text_lines == 1)
@@ -2918,7 +2918,7 @@ void EdenGame::af_subtitle() {
sauvefondbulle(y);
for (h = 0; h < num_text_lines * FONT_HEIGHT + 1; h++) {
for (w = 0; w < subtitles_x_width; w++) {
- unsigned char c = *src++;
+ byte c = *src++;
if (c)
*dst = c;
dst++;
@@ -2927,7 +2927,7 @@ void EdenGame::af_subtitle() {
}
}
-void EdenGame::sauvefondbulle(short y) {
+void EdenGame::sauvefondbulle(int16 y) {
underSubtitlesScreenRect.sy = y - num_text_lines * FONT_HEIGHT;
underSubtitlesScreenRect.sx = scroll_pos + subtitles_x_scr_margin;
underSubtitlesScreenRect.ex = scroll_pos + subtitles_x_scr_margin + subtitles_x_width - 1;
@@ -2946,9 +2946,9 @@ void EdenGame::restaurefondbulle() {
}
void EdenGame::af_subtitlehnm() {
- short x, y;
- unsigned char *src = p_subtitlesview_buf;
- unsigned char *dst = p_hnmview_buf + subtitles_x_scr_margin + (158 - num_text_lines * FONT_HEIGHT) * 320;
+ int16 x, y;
+ byte *src = p_subtitlesview_buf;
+ byte *dst = p_hnmview_buf + subtitles_x_scr_margin + (158 - num_text_lines * FONT_HEIGHT) * 320;
for (y = 0; y < num_text_lines * FONT_HEIGHT; y++) {
for (x = 0; x < subtitles_x_width; x++) {
char c = *src++;
@@ -3033,7 +3033,7 @@ void EdenGame::parlemoi_normal() {
if (!p_global->next_dialog_ptr) {
perso_t *perso = p_global->perso_ptr;
if (perso) {
- short num = (perso->id << 3) | p_global->dialogType;
+ int16 num = (perso->id << 3) | p_global->dialogType;
dial = (dial_t *)GetElem(gameDialogs, num);
} else {
close_perso();
@@ -3056,7 +3056,7 @@ void EdenGame::parlemoi_normal() {
}
void EdenGame::parle_moi() {
- unsigned char r28;
+ byte r28;
char ok;
dial_t *dial;
endpersovox();
@@ -3087,7 +3087,7 @@ void EdenGame::parle_moi() {
return;
}
if (!p_global->last_dialog_ptr) {
- short num = 160;
+ int16 num = 160;
if (p_global->phaseNum >= 400)
num++;
dial = (dial_t *)GetElem(gameDialogs, num);
@@ -3141,10 +3141,10 @@ void EdenGame::perso_normal(perso_t *perso) {
perso1(perso);
}
-void EdenGame::persoparle(short pers) {
+void EdenGame::persoparle(int16 pers) {
char res;
- unsigned short idx;
- unsigned char *ptr;
+ uint16 idx;
+ byte *ptr;
perso_t *perso = &kPersons[pers];
p_global->perso_ptr = perso;
p_global->dialogType = DialogType::dtInspect;
@@ -3309,7 +3309,7 @@ void EdenGame::comment() {
void EdenGame::adam() {
char *objvid;
object_t *object;
- short vid;
+ int16 vid;
resetscroll();
switch (p_global->curObjectId) {
case Objects::obNone:
@@ -3696,7 +3696,7 @@ skip:
}
void EdenGame::vrf_phrases_file() {
- short num = 3;
+ int16 num = 3;
if (p_global->dialog_ptr < (dial_t *)GetElem(gameDialogs, 48))
num = 1;
else if (p_global->dialog_ptr < (dial_t *)GetElem(gameDialogs, 128))
@@ -3712,9 +3712,9 @@ void EdenGame::vrf_phrases_file() {
verifh(gamePhrases);
}
-unsigned char *EdenGame::gettxtad(short id) {
+byte *EdenGame::gettxtad(int16 id) {
vrf_phrases_file();
- return (unsigned char *)GetElem(gamePhrases, id - 1);
+ return (byte *)GetElem(gamePhrases, id - 1);
}
void EdenGame::gotocarte() {
@@ -3747,7 +3747,7 @@ void EdenGame::gotocarte() {
}
void EdenGame::record() {
- short i;
+ int16 i;
tape_t *tape;
perso_t *perso;
if (p_global->curObjectId)
@@ -3781,11 +3781,11 @@ void EdenGame::record() {
}
char EdenGame::dial_scan(dial_t *dial) {
- unsigned char flags;
- unsigned char hidx, lidx;
+ byte flags;
+ byte hidx, lidx;
char bidx, pnum;
- short i;
- unsigned short mask;
+ int16 i;
+ uint16 mask;
perso_t *perso;
if (p_global->numGiveObjs) {
if (!(p_global->displayFlags & DisplayFlags::dfFlag2))
@@ -3902,7 +3902,7 @@ void EdenGame::stay_here() {
reste_ici5();
}
-void EdenGame::mort(short vid) {
+void EdenGame::mort(int16 vid) {
bars_out();
playhnm(vid);
fadetoblack(2);
@@ -3916,7 +3916,7 @@ void EdenGame::mort(short vid) {
}
void EdenGame::evenchrono() {
- unsigned short old;
+ uint16 old;
if (!(p_global->displayFlags & DisplayFlags::dfFlag1))
return;
old = p_global->gameTime;
@@ -3935,7 +3935,7 @@ void EdenGame::evenchrono() {
p_global->chrono_on = 0;
p_global->chrono = 0;
if (p_global->roomPersoType == PersonFlags::pftTyrann) {
- short vid = 272;
+ int16 vid = 272;
if (p_global->curRoomFlags & 0xC0) {
vid += 2;
if ((p_global->curRoomFlags & 0xC0) != 0x80) {
@@ -3962,12 +3962,12 @@ void EdenGame::evenchrono() {
showevents();
}
-void EdenGame::chronoon(short t) {
+void EdenGame::chronoon(int16 t) {
p_global->chrono = t;
p_global->chrono_on = 1;
}
-void EdenGame::prechargephrases(short vid) {
+void EdenGame::prechargephrases(int16 vid) {
int num;
dial_t *dial;
perso_t *perso = &kPersons[PER_MORKUS];
@@ -3983,8 +3983,8 @@ void EdenGame::prechargephrases(short vid) {
void EdenGame::effet1() {
debug(__FUNCTION__);
int x, y;
- short i;
- short dy, ny;
+ int16 i;
+ int16 dy, ny;
rectanglenoir32();
if (!doubled) {
setRS1(0, 0, 16 - 1, 4 - 1);
@@ -4049,22 +4049,22 @@ void EdenGame::effet2() {
}
switch (++eff2pat) {
case 1: {
- static short pattern[] = {0, 1, 2, 3, 7, 11, 15, 14, 13, 12, 8, 4, 5, 6, 10, 9};
+ static int16 pattern[] = {0, 1, 2, 3, 7, 11, 15, 14, 13, 12, 8, 4, 5, 6, 10, 9};
colimacon(pattern);
break;
}
case 2: {
- static short pattern[] = {0, 15, 1, 14, 2, 13, 3, 12, 7, 8, 11, 4, 5, 10, 6, 9};
+ static int16 pattern[] = {0, 15, 1, 14, 2, 13, 3, 12, 7, 8, 11, 4, 5, 10, 6, 9};
colimacon(pattern);
break;
}
case 3: {
- static short pattern[] = {0, 2, 5, 7, 8, 10, 13, 15, 1, 3, 4, 6, 9, 11, 12, 14};
+ static int16 pattern[] = {0, 2, 5, 7, 8, 10, 13, 15, 1, 3, 4, 6, 9, 11, 12, 14};
colimacon(pattern);
break;
}
case 4: {
- static short pattern[] = {0, 3, 15, 12, 1, 7, 14, 8, 2, 11, 13, 4, 5, 6, 10, 9};
+ static int16 pattern[] = {0, 3, 15, 12, 1, 7, 14, 8, 2, 11, 13, 4, 5, 6, 10, 9};
colimacon(pattern);
eff2pat = 0;
break;
@@ -4074,7 +4074,7 @@ void EdenGame::effet2() {
void EdenGame::effet3() {
debug(__FUNCTION__);
- unsigned short i, c;
+ uint16 i, c;
CLPalette_GetLastPalette(oldPalette);
for (i = 0; i < 6; i++) {
for (c = 0; c < 256; c++) {
@@ -4101,11 +4101,11 @@ void EdenGame::effet3() {
void EdenGame::effet4() {
debug(__FUNCTION__);
- unsigned char *scr, *pix, *r24, *r25, *r30, c;
- short i;
- short x, y;
- short w, h, ww;
- short r17, r23, r16, r18, r19, r22, r27, r31;
+ byte *scr, *pix, *r24, *r25, *r30, c;
+ int16 i;
+ int16 x, y;
+ int16 w, h, ww;
+ int16 r17, r23, r16, r18, r19, r22, r27, r31;
CLPalette_Send2Screen(global_palette, 0, 256);
w = ScreenView.width;
h = ScreenView.height;
@@ -4242,9 +4242,9 @@ void EdenGame::effet4() {
}
void EdenGame::ClearScreen() {
- unsigned char *scr;
- short x, y, xx, yy;
- short w, h, ww;
+ byte *scr;
+ int16 x, y, xx, yy;
+ int16 w, h, ww;
w = ScreenView.width;
h = ScreenView.height;
ww = ScreenView.pitch;
@@ -4277,11 +4277,11 @@ void EdenGame::ClearScreen() {
CLBlitter_UpdateScreen();
}
-void EdenGame::colimacon(short pattern[16]) {
- unsigned char *scr, *pix;
- short x, y, xx, yy;
- short w, h, ww;
- short i, j, p, r27, r25;
+void EdenGame::colimacon(int16 pattern[16]) {
+ byte *scr, *pix;
+ int16 x, y, xx, yy;
+ int16 w, h, ww;
+ int16 i, j, p, r27, r25;
w = ScreenView.width;
h = ScreenView.height;
ww = ScreenView.pitch;
@@ -4307,7 +4307,7 @@ void EdenGame::colimacon(short pattern[16]) {
p = pattern[i];
r27 = p % 4 * 2 + p / 4 * ww * 2;
for (j = 0; j < 320 * 160 / 16; j++) {
- unsigned char *sc = &scr[j / (320 / 4) * ww * 4 * 2 + j % (320 / 4) * 4 * 2 + r27];
+ byte *sc = &scr[j / (320 / 4) * ww * 4 * 2 + j % (320 / 4) * 4 * 2 + r27];
sc[0] = 0;
sc[1] = 0;
sc[ww] = 0;
@@ -4346,8 +4346,8 @@ void EdenGame::colimacon(short pattern[16]) {
r25 = p % 4 + p / 4 * 640;
r27 = p % 4 * 2 + p / 4 * ww * 2;
for (j = 0; j < 320 * 160 / 16; j++) {
- unsigned char c = pix[j / (320 / 4) * 640 * 4 + j % (320 / 4) * 4 + r25];
- unsigned char *sc = &scr[j / (320 / 4) * ww * 4 * 2 + j % (320 / 4) * 4 * 2 + r27];
+ byte c = pix[j / (320 / 4) * 640 * 4 + j % (320 / 4) * 4 + r25];
+ byte *sc = &scr[j / (320 / 4) * ww * 4 * 2 + j % (320 / 4) * 4 * 2 + r27];
sc[0] = c;
sc[1] = c;
sc[ww] = c;
@@ -4359,7 +4359,7 @@ void EdenGame::colimacon(short pattern[16]) {
}
void EdenGame::fadetoblack(int delay) {
- short i, j;
+ int16 i, j;
CLPalette_GetLastPalette(oldPalette);
for (i = 0; i < 6; i++) {
for (j = 0; j < 256; j++) {
@@ -4374,7 +4374,7 @@ void EdenGame::fadetoblack(int delay) {
}
void EdenGame::fadetoblack128(int delay) {
- short i, j;
+ int16 i, j;
CLPalette_GetLastPalette(oldPalette);
for (i = 0; i < 6; i++) {
for (j = 0; j < 129; j++) { //TODO: wha?
@@ -4389,7 +4389,7 @@ void EdenGame::fadetoblack128(int delay) {
}
void EdenGame::fadefromblack128(int delay) {
- short i, j;
+ int16 i, j;
for (i = 0; i < 6; i++) {
for (j = 0; j < 129; j++) { //TODO: wha?
newColor.r = global_palette[j].r >> (5 - i);
@@ -4419,14 +4419,14 @@ void EdenGame::rectanglenoir32() {
}
}
-void EdenGame::setRS1(short sx, short sy, short ex, short ey) {
+void EdenGame::setRS1(int16 sx, int16 sy, int16 ex, int16 ey) {
rect_src.sx = sx;
rect_src.sy = sy;
rect_src.ex = ex;
rect_src.ey = ey;
}
-void EdenGame::setRD1(short sx, short sy, short ex, short ey) {
+void EdenGame::setRD1(int16 sx, int16 sy, int16 ex, int16 ey) {
rect_dst.sx = sx;
rect_dst.sy = sy;
rect_dst.ex = ex;
@@ -4443,12 +4443,12 @@ void EdenGame::wait(int howlong) {
void EdenGame::effetpix() {
debug(__FUNCTION__);
- unsigned char *scr, *pix;
- short x, y, xx, yy;
- short w, h, ww;
- short i, j, p, r25, r18, r31, r30; //TODO: change to xx/yy
- unsigned char r24, r23; //TODO: change to p0/p1
- short r26, r27, r20;
+ byte *scr, *pix;
+ int16 x, y, xx, yy;
+ int16 w, h, ww;
+ int16 i, j, p, r25, r18, r31, r30; //TODO: change to xx/yy
+ byte r24, r23; //TODO: change to p0/p1
+ int16 r26, r27, r20;
w = ScreenView.width;
h = ScreenView.height;
ww = ScreenView.pitch;
@@ -4551,11 +4551,11 @@ void EdenGame::effetpix() {
////// datfile.c
void EdenGame::verifh(void *ptr) {
- unsigned char sum = 0;
- unsigned char *data;
- unsigned char *head = (unsigned char *)ptr;
- unsigned short h0, h3;
- short i;
+ byte sum = 0;
+ byte *data;
+ byte *head = (byte *)ptr;
+ uint16 h0, h3;
+ int16 i;
char h2;
for (i = 0; i < 6; i++)
sum += *head++;
@@ -4574,7 +4574,7 @@ void EdenGame::verifh(void *ptr) {
for (; h3; h3--)
*data-- = *head--;
head = data + 1;
- data = (unsigned char *)ptr;
+ data = (byte *)ptr;
Expand_hsq(head, data);
}
@@ -4592,8 +4592,8 @@ void EdenGame::closebigfile() {
CLFile_Close(h_bigfile);
}
-void EdenGame::loadfile(unsigned short num, void *buffer) {
- short retry, res = 1;
+void EdenGame::loadfile(uint16 num, void *buffer) {
+ int16 retry, res = 1;
assert(num < bigfile_header->count);
for (retry = 0; res && retry < 5; retry++) {
pakfile_t *file = &bigfile_header->files[num];
@@ -4608,7 +4608,7 @@ void EdenGame::loadfile(unsigned short num, void *buffer) {
quit_flag = 1;
}
-void EdenGame::shnmfl(unsigned short num) {
+void EdenGame::shnmfl(uint16 num) {
int res;
assert(num + 484 < bigfile_header->count);
pakfile_t *file = &bigfile_header->files[num + 484];
@@ -4618,7 +4618,7 @@ void EdenGame::shnmfl(unsigned short num) {
CLHNM_SetPosIntoFile(p_hnmcontext, offs);
}
-int EdenGame::ssndfl(unsigned short num) {
+int EdenGame::ssndfl(uint16 num) {
int res;
assert(num + 660 < bigfile_header->count);
pakfile_t *file = &bigfile_header->files[num + 660];
@@ -4683,7 +4683,7 @@ void EdenGame::loadpermfiles() {
#endif
}
-char EdenGame::ReadDataSync(unsigned short num) {
+char EdenGame::ReadDataSync(uint16 num) {
long pos, len;
pos = PLE32(gameLipsync + num * 4);
len = 1024;
@@ -4694,8 +4694,8 @@ char EdenGame::ReadDataSync(unsigned short num) {
return 0;
}
-void EdenGame::loadpartoffile(unsigned short num, void *buffer, long pos, long len) {
- short res;
+void EdenGame::loadpartoffile(uint16 num, void *buffer, long pos, long len) {
+ int16 res;
assert(num < bigfile_header->count);
pakfile_t *file = &bigfile_header->files[num];
long offs = PLE32(&file->offs);
@@ -4705,13 +4705,13 @@ void EdenGame::loadpartoffile(unsigned short num, void *buffer, long pos, long l
}
void EdenGame::Expand_hsq(void *input, void *output) {
- unsigned char *src = (unsigned char *)input;
- unsigned char *dst = (unsigned char *)output;
- unsigned char *ptr;
- unsigned short bit; // bit
- unsigned short queue = 0; // queue
- unsigned short len = 0;
- short ofs;
+ byte *src = (byte *)input;
+ byte *dst = (byte *)output;
+ byte *ptr;
+ uint16 bit; // bit
+ uint16 queue = 0; // queue
+ uint16 len = 0;
+ int16 ofs;
#define GetBit \
bit = queue & 1; \
queue >>= 1; \
@@ -4754,8 +4754,8 @@ void EdenGame::Expand_hsq(void *input, void *output) {
}
//////
-void EdenGame::ajouinfo(unsigned char info) {
- unsigned char idx = p_global->next_info_idx;
+void EdenGame::ajouinfo(byte info) {
+ byte idx = p_global->next_info_idx;
if (kPersons[PER_MESSAGER].roomNum)
info |= 0x80;
info_list[idx] = info;
@@ -4767,7 +4767,7 @@ void EdenGame::ajouinfo(unsigned char info) {
}
void EdenGame::unlockinfo() {
- unsigned char idx;
+ byte idx;
for (idx = 0; idx < 16; idx++) {
if (info_list[idx] != 0xFF)
info_list[idx] &= ~0x80;
@@ -4777,7 +4777,7 @@ void EdenGame::unlockinfo() {
void EdenGame::nextinfo() {
do {
- unsigned char idx = p_global->last_info_idx;
+ byte idx = p_global->last_info_idx;
info_list[idx] = 0;
idx++;
if (idx == 16) idx = 0;
@@ -4786,8 +4786,8 @@ void EdenGame::nextinfo() {
} while (p_global->last_info == 0xFF);
}
-void EdenGame::delinfo(unsigned char info) {
- unsigned char idx;
+void EdenGame::delinfo(byte info) {
+ byte idx;
for (idx = 0; idx < 16; idx++) {
if ((info_list[idx] & ~0x80) == info) {
info_list[idx] = 0xFF;
@@ -5007,11 +5007,11 @@ void EdenGame::closesalle() {
}
void EdenGame::afsalle1(room_t *room) {
- unsigned char *ptr = (unsigned char *)GetElem(sal_buf, room->ff_0 - 1);
+ byte *ptr = (byte *)GetElem(sal_buf, room->ff_0 - 1);
ptr++;
for (;;) {
- unsigned char b0, b1;
- short index, x, y, ex, ey;
+ byte b0, b1;
+ int16 index, x, y, ex, ey;
b0 = *ptr++;
b1 = *ptr++;
index = (b1 << 8) | b0;
@@ -5122,7 +5122,7 @@ void EdenGame::aflieu() {
needPaletteUpdate = 1;
}
-void EdenGame::loadsal(short num) {
+void EdenGame::loadsal(int16 num) {
if (num == p_global->lastSalNum)
return;
p_global->lastSalNum = num;
@@ -5223,9 +5223,9 @@ void EdenGame::animpiece() {
void EdenGame::getdino(room_t *room) {
assert(tab_2CEF0[4] == 0x25);
perso_t *perso = &kPersons[PER_UNKN_18C];
- short *tab;
- unsigned char persoType, r27;
- short bank;
+ int16 *tab;
+ byte persoType, r27;
+ int16 bank;
room->flags &= ~0xC;
for (; perso->roomNum != 0xFFFF; perso++) {
if (perso->flags & PersonFlags::pf80)
@@ -5259,7 +5259,7 @@ void EdenGame::getdino(room_t *room) {
}
}
-room_t *EdenGame::getsalle(short loc) { //TODO: unsigned char?
+room_t *EdenGame::getsalle(int16 loc) { //TODO: byte?
debug("get room for %X, starting from %d, looking for %X", loc, p_global->area_ptr->firstRoomIndex, p_global->partyOutside);
room_t *room = &gameRooms[p_global->area_ptr->firstRoomIndex];
loc &= 0xFF;
@@ -5295,7 +5295,7 @@ room_t *EdenGame::getsalle(short loc) { //TODO: unsigned char?
return room;
}
-void EdenGame::initlieu(short roomNum) {
+void EdenGame::initlieu(int16 roomNum) {
area_t *area;
p_global->gameFlags |= GameFlags::gfFlag4000;
gameIcons[18].cursor_id |= 0x8000;
@@ -5355,7 +5355,7 @@ void EdenGame::maj2() {
specialin();
}
-void EdenGame::majsalle1(short roomNum) {
+void EdenGame::majsalle1(int16 roomNum) {
room_t *room = getsalle(roomNum & 0xFF);
p_global->room_ptr = room;
debug("DrawRoom: room 0x%X, arg = 0x%X", p_global->roomNum, roomNum);
@@ -5366,7 +5366,7 @@ void EdenGame::majsalle1(short roomNum) {
maj2();
}
-void EdenGame::maj_salle(unsigned short roomNum) {
+void EdenGame::maj_salle(uint16 roomNum) {
setpersohere();
majsalle1(roomNum);
}
@@ -5376,17 +5376,17 @@ void EdenGame::initbuf() {
ALLOC(bigfile_header, 0x10000, pak_t);
ALLOC(gameRooms, 0x4000, room_t);
ALLOC(gameIcons, 0x4000, icon_t);
- ALLOC(bank_data_buf, 0x10000, unsigned char);
+ ALLOC(bank_data_buf, 0x10000, byte);
ALLOC(p_global, sizeof(*p_global), global_t);
ALLOC(sal_buf, 2048, void);
- ALLOC(gameConditions, 0x4800, unsigned char);
- ALLOC(gameDialogs, 0x2800, unsigned char);
- ALLOC(gamePhrases, 0x10000, unsigned char);
- ALLOC(main_bank_buf, 0x9400, unsigned char);
- ALLOC(glow_buffer, 0x2800, unsigned char);
- ALLOC(gameFont, 0x900, unsigned char);
- ALLOC(gameLipsync, 0x205C, unsigned char);
- ALLOC(music_buf, 0x140000, unsigned char);
+ ALLOC(gameConditions, 0x4800, byte);
+ ALLOC(gameDialogs, 0x2800, byte);
+ ALLOC(gamePhrases, 0x10000, byte);
+ ALLOC(main_bank_buf, 0x9400, byte);
+ ALLOC(glow_buffer, 0x2800, byte);
+ ALLOC(gameFont, 0x900, byte);
+ ALLOC(gameLipsync, 0x205C, byte);
+ ALLOC(music_buf, 0x140000, byte);
#undef ALLOC
}
@@ -5561,7 +5561,7 @@ void EdenGame::intro() {
return;
#endif
- short speed = 0;
+ int16 speed = 0;
if (!machine_speed) {
if (!word_378CC)
speed = 4;
@@ -5658,7 +5658,7 @@ void EdenGame::testPommeQ() {
}
void EdenGame::FRDevents() {
- short dx, dy, max_y;
+ int16 dx, dy, max_y;
CLKeyboard_Read();
if (allow_doubled) {
if (CLKeyboard_IsScanCodeDown(0x30)) { //TODO: const
@@ -5762,7 +5762,7 @@ void EdenGame::FRDevents() {
}
}
-icon_t *EdenGame::scan_icon_list(short x, short y, short index) {
+icon_t *EdenGame::scan_icon_list(int16 x, int16 y, int16 index) {
icon_t *icon;
for (icon = &gameIcons[index]; icon->sx >= 0; icon++) {
if (icon->cursor_id & 0x8000)
@@ -6109,7 +6109,7 @@ void EdenGame::mouse() {
////// film.c
void EdenGame::showfilm(char arg1) {
- short playing;
+ int16 playing;
CLHNM_Prepare2Read(p_hnmcontext, 0);
CLHNM_ReadHeader(p_hnmcontext);
if (p_global->curVideoNum == 92) {
@@ -6170,12 +6170,12 @@ void EdenGame::showfilm(char arg1) {
CLHNM_DeallocMemory(p_hnmcontext);
}
-void EdenGame::playhnm(short num) {
+void EdenGame::playhnm(int16 num) {
perso_t *perso;
- short oldDialogType;
+ int16 oldDialogType;
p_global->curVideoNum = num;
if (num != 2001 && num != 2012 && num != 98 && num != 171) {
- unsigned char oldMusicType = p_global->newMusicType;
+ byte oldMusicType = p_global->newMusicType;
p_global->newMusicType = MusicType::mtEvent;
musique();
musicspy();
@@ -6227,7 +6227,7 @@ void EdenGame::playhnm(short num) {
}
void EdenGame::bullehnm() {
- short *frames, *frames_start, frame, num;
+ int16 *frames, *frames_start, frame, num;
perso_t *perso;
switch (p_global->curVideoNum) {
case 170:
@@ -6279,7 +6279,7 @@ void EdenGame::bullehnm() {
////// sound.c
void EdenGame::musique() {
- unsigned char flag, hidx, lidx, mus;
+ byte flag, hidx, lidx, mus;
dial_t *dial;
if (p_global->newMusicType == MusicType::mtDontChange)
return;
@@ -6301,8 +6301,8 @@ void EdenGame::musique() {
startmusique(mus);
}
-void EdenGame::startmusique(unsigned char num) {
- short seq_size, pat_size, freq;
+void EdenGame::startmusique(byte num) {
+ int16 seq_size, pat_size, freq;
if (num == p_global->currentMusicNum)
return;
if (musicPlaying) {
@@ -6330,7 +6330,7 @@ void EdenGame::startmusique(unsigned char num) {
}
void EdenGame::musicspy() {
- unsigned char patnum, *patptr;
+ byte patnum, *patptr;
int ofs, len;
if (!mus_queue_grp)
return;
@@ -6357,8 +6357,8 @@ void EdenGame::musicspy() {
}
}
-int EdenGame::loadmusicfile(short num) {
- short res;
+int EdenGame::loadmusicfile(int16 num) {
+ int16 res;
long numread;
pakfile_t *file = &bigfile_header->files[num + 435];
long size = PLE32(&file->size);
@@ -6372,8 +6372,8 @@ int EdenGame::loadmusicfile(short num) {
}
void EdenGame::persovox() {
- short vol_l, vol_r, step_l, step_r;
- short num = p_global->textNum;
+ int16 vol_l, vol_r, step_l, step_r;
+ int16 num = p_global->textNum;
if (p_global->textBankIndex != 1)
num += 565;
if (p_global->textBankIndex == 3)
@@ -6419,7 +6419,7 @@ void EdenGame::endpersovox() {
}
void EdenGame::fademusicup() {
- short vol;
+ int16 vol;
if (mus_fade_flags & 2) {
vol = music_channel->volumeLeft;
if (vol < mus_vol_left) {
@@ -6452,8 +6452,8 @@ void EdenGame::fademusicup() {
}
}
-void EdenGame::fademusica0(short delay) {
- short volume;
+void EdenGame::fademusica0(int16 delay) {
+ int16 volume;
while ((volume = CLSoundChannel_GetVolume(music_channel)) > 2) {
volume -= 2;
if (volume < 2)
@@ -6464,7 +6464,7 @@ void EdenGame::fademusica0(short delay) {
}
//// obj.c
-object_t *EdenGame::getobjaddr(short id) {
+object_t *EdenGame::getobjaddr(int16 id) {
int i;
for (i = 0; i < MAX_OBJECTS; i++)
if (objects[i].id == id)
@@ -6473,11 +6473,11 @@ object_t *EdenGame::getobjaddr(short id) {
}
void EdenGame::countobjects() {
- short index = 0;
- unsigned char total = 0;
+ int16 index = 0;
+ byte total = 0;
int i;
for (i = 0; i < MAX_OBJECTS; i++) {
- short count = objects[i].count;
+ int16 count = objects[i].count;
#ifdef EDEN_DEBUG
count = 1;
goto show_all_objects; //DEBUG
@@ -6498,7 +6498,7 @@ show_all_objects:
}
void EdenGame::showobjects() {
- short i, total, index;
+ int16 i, total, index;
icon_t *icon = &gameIcons[19];
p_global->drawFlags &= ~(DrawFlags::drDrawInventory | DrawFlags::drDrawFlag2);
countobjects();
@@ -6527,7 +6527,7 @@ void EdenGame::showobjects() {
}
}
-void EdenGame::winobject(short id) {
+void EdenGame::winobject(int16 id) {
object_t *object = getobjaddr(id);
object->flags |= ObjectFlags::ofFlag1;
object->count++;
@@ -6537,7 +6537,7 @@ void EdenGame::winobject(short id) {
p_global->wonPowersMask |= object->powerMask;
}
-void EdenGame::loseobject(short id) {
+void EdenGame::loseobject(int16 id) {
object_t *object = getobjaddr(id);
if (object->count > 0)
object->count--;
@@ -6562,7 +6562,7 @@ void EdenGame::lostobject() {
loseobject(p_global->curObjectId);
}
-char EdenGame::objecthere(short id) {
+char EdenGame::objecthere(int16 id) {
object_t *object = getobjaddr(id);
for (pCurrentObjectLocation = &kObjectLocations[object->locations]; *pCurrentObjectLocation != -1; pCurrentObjectLocation++) {
if (*pCurrentObjectLocation == p_global->roomNum)
@@ -6571,7 +6571,7 @@ char EdenGame::objecthere(short id) {
return 0;
}
-void EdenGame::objectmain(short id) {
+void EdenGame::objectmain(int16 id) {
object_t *object = getobjaddr(id);
gameIcons[16].cursor_id &= ~0x8000;
p_global->curObjectId = object->id;
@@ -6582,7 +6582,7 @@ void EdenGame::objectmain(short id) {
normalCursor = 0;
}
-void EdenGame::getobject(short id) {
+void EdenGame::getobject(int16 id) {
room_t *room = p_global->room_ptr;
if (p_global->curObjectId)
return;
@@ -6614,9 +6614,9 @@ void EdenGame::putobject() {
normalCursor = 1;
}
-void EdenGame::newobject(short id, short arg2) {
+void EdenGame::newobject(int16 id, int16 arg2) {
object_t *object = getobjaddr(id);
- short e, *t = &kObjectLocations[object->locations];
+ int16 e, *t = &kObjectLocations[object->locations];
while ((e = *t) != -1) {
e &= ~0x8000;
if ((e >> 8) == arg2)
@@ -6625,7 +6625,7 @@ void EdenGame::newobject(short id, short arg2) {
}
}
-void EdenGame::giveobjectal(short id) {
+void EdenGame::giveobjectal(int16 id) {
if (id == Objects::obKnife)
kObjectLocations[2] = 0;
if (id == Objects::obApple)
@@ -6639,7 +6639,7 @@ void EdenGame::giveobjectal(short id) {
}
void EdenGame::giveobject() {
- unsigned char id;
+ byte id;
id = p_global->giveobj1;
if (id) {
p_global->giveobj1 = 0;
@@ -6675,7 +6675,7 @@ void EdenGame::newchampi() {
}
void EdenGame::newnidv() {
- short *ptr;
+ int16 *ptr;
object_t *obj;
room_t *room = p_global->cita_area_firstRoom;
if (objects[Objects::obNest - 1].count)
@@ -6698,7 +6698,7 @@ void EdenGame::newnidv() {
}
void EdenGame::newnido() {
- short *ptr;
+ int16 *ptr;
object_t *obj;
room_t *room = p_global->cita_area_firstRoom;
if (objects[Objects::obFullNest - 1].count)
@@ -6748,7 +6748,7 @@ void EdenGame::gotopanel() {
}
void EdenGame::noclicpanel() {
- unsigned char num;
+ byte num;
if (p_global->menuFlags & MenuFlags::mfFlag4) {
depcurstape();
return;
@@ -6815,7 +6815,7 @@ void EdenGame::cancel2() {
void EdenGame::testvoice() {
char res; //TODO: useless?
- short num;
+ int16 num;
p_global->fresqNumber = 0;
p_global->perso_ptr = kPersons;
p_global->dialogType = DialogType::dtInspect;
@@ -6832,7 +6832,7 @@ void EdenGame::testvoice() {
void EdenGame::load() {
char name[132];
- unsigned char oldMusic, talk;
+ byte oldMusic, talk;
gameLoaded = 0;
oldMusic = p_global->currentMusicNum; //TODO: from ush to byte?!
fademusica0(1);
@@ -6929,7 +6929,7 @@ void EdenGame::desktopcolors() {
}
void EdenGame::panelrestart() {
- unsigned char curmus, curlng;
+ byte curmus, curlng;
gameLoaded = 0;
curmus = p_global->currentMusicNum;
curlng = p_global->pref_language;
@@ -7016,7 +7016,7 @@ void EdenGame::EdenQuit() {
}
void EdenGame::choixsubtitle() {
- unsigned char lang = current_spot2->object_id & 0xF;
+ byte lang = current_spot2->object_id & 0xF;
if (lang == p_global->pref_language)
return;
if (lang > 5)
@@ -7027,7 +7027,7 @@ void EdenGame::choixsubtitle() {
}
void EdenGame::reglervol() {
- unsigned char *valptr = &p_global->pref_10C[current_spot2->object_id & 7];
+ byte *valptr = &p_global->pref_10C[current_spot2->object_id & 7];
curs_y = 104 - ((*valptr >> 2) & 0x3F); // TODO: check me
cur_slider_value_ptr = valptr;
p_global->menuFlags |= MenuFlags::mfFlag1;
@@ -7038,7 +7038,7 @@ void EdenGame::reglervol() {
}
void EdenGame::changervol() {
- short delta;
+ int16 delta;
if (mouse_held) {
limitezonecurs(cur_slider_x - 1, cur_slider_x + 3, 40, 110);
delta = cur_slider_y - curs_y;
@@ -7054,8 +7054,8 @@ void EdenGame::changervol() {
p_global->menuFlags &= ~(MenuFlags::mfFlag1 | MenuFlags::mfFlag2);
}
-void EdenGame::newvol(unsigned char *volptr, short delta) {
- short vol = *volptr / 4;
+void EdenGame::newvol(byte *volptr, int16 delta) {
+ int16 vol = *volptr / 4;
vol += delta;
if (vol < 0)
vol = 0;
@@ -7067,8 +7067,8 @@ void EdenGame::newvol(unsigned char *volptr, short delta) {
}
void EdenGame::playtape() {
- unsigned short oldRoomNum, oldParty;
- unsigned char oldBack;
+ uint16 oldRoomNum, oldParty;
+ byte oldBack;
perso_t *oldPerso;
if (p_global->menuItemIdHi & 8)
p_global->tape_ptr++;
@@ -7218,8 +7218,8 @@ void EdenGame::afflangue() {
noclipax(7, 77, p_global->pref_language * 9 + 44);
}
-void EdenGame::affcursvol(short x, short vol1, short vol2) {
- short slider = 3;
+void EdenGame::affcursvol(int16 x, int16 vol1, int16 vol2) {
+ int16 slider = 3;
if (lastMenuItemIdLo && (lastMenuItemIdLo & 9) != 1) //TODO check me
slider = 4;
noclipax(slider, x, 104 - vol1);
@@ -7252,7 +7252,7 @@ void EdenGame::afftoppano() {
}
void EdenGame::affresult() {
- short num;
+ int16 num;
restaurefondbulle();
p_global->perso_ptr = &kPersons[19];
p_global->dialogType = DialogType::dtInspect;
@@ -7264,7 +7264,7 @@ void EdenGame::affresult() {
p_global->perso_ptr = 0;
}
-void EdenGame::limitezonecurs(short xmin, short xmax, short ymin, short ymax) {
+void EdenGame::limitezonecurs(int16 xmin, int16 xmax, int16 ymin, int16 ymax) {
if (curs_x < xmin) curs_x = xmin;
if (curs_x > xmax) curs_x = xmax;
if (curs_y < ymin) curs_y = ymin;
@@ -7371,7 +7371,7 @@ void EdenGame::rangermammi(perso_t *perso, room_t *room) {
p_global->party &= ~perso->party;
}
-void EdenGame::perso_ici(short action) {
+void EdenGame::perso_ici(int16 action) {
perso_t *perso = &kPersons[PER_UNKN_156];
// room_t *room = p_global->last_area_ptr->room_ptr; //TODO: compiler opt bug? causes access to zero ptr??? last_area_ptr == 0
switch (action) {
@@ -7434,7 +7434,7 @@ void EdenGame::setpersohere() {
}
}
-void EdenGame::faire_suivre(short roomNum) {
+void EdenGame::faire_suivre(int16 roomNum) {
destinationRoom = roomNum;
perso_ici(4);
}
@@ -7447,7 +7447,7 @@ void EdenGame::suis_moi5() {
p_global->drawFlags |= DrawFlags::drDrawTopScreen;
}
-void EdenGame::suis_moi(short index) {
+void EdenGame::suis_moi(int16 index) {
perso_t *old_perso = p_global->perso_ptr;
p_global->perso_ptr = &kPersons[index];
suis_moi5();
@@ -7462,7 +7462,7 @@ void EdenGame::reste_ici5() {
p_global->drawFlags |= DrawFlags::drDrawTopScreen;
}
-void EdenGame::reste_ici(short index) {
+void EdenGame::reste_ici(int16 index) {
perso_t *old_perso = p_global->perso_ptr;
p_global->perso_ptr = &kPersons[index];
reste_ici5();
@@ -7705,7 +7705,7 @@ void EdenGame::bigphase1() {
&EdenGame::phase560
};
- short phase = (p_global->phaseNum & ~3) + 0x10; //TODO: check me
+ int16 phase = (p_global->phaseNum & ~3) + 0x10; //TODO: check me
debug("!!! big phase - %4X", phase);
p_global->phaseActionsCount = 0;
p_global->phaseNum = phase;
@@ -8155,16 +8155,16 @@ void EdenGame::bandeoffsetin() {
//// cond.c
-unsigned char *code_ptr;
+byte *code_ptr;
-char EdenGame::testcondition(short index) {
+char EdenGame::testcondition(int16 index) {
char end = 0;
- unsigned char op;
- unsigned short value, value2;
- unsigned short stack[32], *sp = stack, *sp2;
- unsigned short ofs;
+ byte op;
+ uint16 value, value2;
+ uint16 stack[32], *sp = stack, *sp2;
+ uint16 ofs;
assert(index > 0);
- code_ptr = (unsigned char *)GetElem(gameConditions, (index - 1));
+ code_ptr = (byte *)GetElem(gameConditions, (index - 1));
do {
value = cher_valeur();
for (;;) {
@@ -8201,51 +8201,51 @@ char EdenGame::testcondition(short index) {
return value != 0;
}
-unsigned short EdenGame::opera_add(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_add(uint16 v1, uint16 v2) {
return v1 + v2;
}
-unsigned short EdenGame::opera_sub(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_sub(uint16 v1, uint16 v2) {
return v1 - v2;
}
-unsigned short EdenGame::opera_and(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_and(uint16 v1, uint16 v2) {
return v1 & v2;
}
-unsigned short EdenGame::opera_or(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_or(uint16 v1, uint16 v2) {
return v1 | v2;
}
-unsigned short EdenGame::opera_egal(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_egal(uint16 v1, uint16 v2) {
return v1 == v2 ? -1 : 0;
}
-unsigned short EdenGame::opera_petit(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_petit(uint16 v1, uint16 v2) {
return v1 < v2 ? -1 : 0; //TODO: all comparisons are unsigned!
}
-unsigned short EdenGame::opera_grand(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_grand(uint16 v1, uint16 v2) {
return v1 > v2 ? -1 : 0;
}
-unsigned short EdenGame::opera_diff(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_diff(uint16 v1, uint16 v2) {
return v1 != v2 ? -1 : 0;
}
-unsigned short EdenGame::opera_petega(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_petega(uint16 v1, uint16 v2) {
return v1 <= v2 ? -1 : 0;
}
-unsigned short EdenGame::opera_graega(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_graega(uint16 v1, uint16 v2) {
return v1 >= v2 ? -1 : 0;
}
-unsigned short EdenGame::opera_faux(unsigned short v1, unsigned short v2) {
+uint16 EdenGame::opera_faux(uint16 v1, uint16 v2) {
return 0;
}
-unsigned short EdenGame::operation(unsigned char op, unsigned short v1, unsigned short v2) {
- static unsigned short(EdenGame::*operations[16])(unsigned short, unsigned short) = {
+uint16 EdenGame::operation(byte op, uint16 v1, uint16 v2) {
+ static uint16(EdenGame::*operations[16])(uint16, uint16) = {
&EdenGame::opera_egal,
&EdenGame::opera_petit,
&EdenGame::opera_grand,
@@ -8266,15 +8266,15 @@ unsigned short EdenGame::operation(unsigned char op, unsigned short v1, unsigned
return (this->*operations[(op & 0x1F) >> 1])(v1, v2);
}
-unsigned short EdenGame::cher_valeur() {
- unsigned short val;
- unsigned char typ = *code_ptr++;
+uint16 EdenGame::cher_valeur() {
+ uint16 val;
+ byte typ = *code_ptr++;
if (typ < 0x80) {
- unsigned char ofs = *code_ptr++;
+ byte ofs = *code_ptr++;
if (typ == 1)
- val = *(unsigned char *)(ofs + (unsigned char *)p_global);
+ val = *(byte *)(ofs + (byte *)p_global);
else
- val = *(unsigned short *)(ofs + (unsigned char *)p_global);
+ val = *(uint16 *)(ofs + (byte *)p_global);
} else if (typ == 0x80)
val = *code_ptr++;
else {
@@ -8293,17 +8293,17 @@ void EdenGame::ret() {
}
//// cube.c
-short tabcos[361 * 2];
+int16 tabcos[361 * 2];
int dword_32424, dword_32428, dword_3242C;
int dword_32430, dword_32434, dword_32438;
int dword_3243C, dword_32440, dword_32444;
-short word_32448;
-short word_3244A, word_3244C;
+int16 word_32448;
+int16 word_3244A, word_3244C;
float flt_32450, flt_32454;
cube_t cube;
-short curs_cur_map;
-short lines[200 * 8];
-unsigned char cube_texture[0x4000];
+int16 curs_cur_map;
+int16 lines[200 * 8];
+byte cube_texture[0x4000];
int cube_faces;
long curs_old_tick, curs_new_tick;
@@ -8316,7 +8316,7 @@ void EdenGame::make_tabcos() {
}
void EdenGame::make_matrice_fix() {
- short r30, r28, r29;
+ int16 r30, r28, r29;
r30 = word_3244C;
r28 = word_3244A;
r29 = word_32448;
@@ -8379,7 +8379,7 @@ void EdenGame::affiche_objet(cube_t *cube) {
affiche_polygone_mapping(cube, cube->faces[i]);
}
-void EdenGame::NEWcharge_map(int file_id, unsigned char *buffer) {
+void EdenGame::NEWcharge_map(int file_id, byte *buffer) {
int i;
loadpartoffile(file_id, buffer, 32, 256 * 3);
@@ -8395,17 +8395,17 @@ void EdenGame::NEWcharge_map(int file_id, unsigned char *buffer) {
loadpartoffile(file_id, buffer, 32 + 256 * 3, 0x4000);
}
-void EdenGame::NEWcharge_objet_mob(cube_t *cube, int file_id, unsigned char *texptr) {
+void EdenGame::NEWcharge_objet_mob(cube_t *cube, int file_id, byte *texptr) {
int i, j, count2;
char *tmp1, *next, error;
cubeface_t **tmp4;
- short *vertices, *projection;
+ int16 *vertices, *projection;
tmp1 = (char *)malloc(454);
loadpartoffile(file_id, tmp1, 0, 454);
next = tmp1;
cube_faces = next_val(&next, &error);
- vertices = (short *)malloc(cube_faces * 4 * sizeof(*vertices));
- projection = (short *)malloc(cube_faces * 4 * sizeof(*projection));
+ vertices = (int16 *)malloc(cube_faces * 4 * sizeof(*vertices));
+ projection = (int16 *)malloc(cube_faces * 4 * sizeof(*projection));
for (i = 0; i < cube_faces; i++) {
vertices[i * 4] = next_val(&next, &error);
vertices[i * 4 + 1] = next_val(&next, &error);
@@ -8419,8 +8419,8 @@ void EdenGame::NEWcharge_objet_mob(cube_t *cube, int file_id, unsigned char *tex
tmp4[i]->tri = 3;
textured = next_val(&next, &error);
tmp4[i]->ff_5 = next_val(&next, &error);
- tmp4[i]->indices = (unsigned short *)malloc(3 * sizeof(*tmp4[i]->indices));
- tmp4[i]->uv = (short *)malloc(3 * 2 * sizeof(*tmp4[i]->uv));
+ tmp4[i]->indices = (uint16 *)malloc(3 * sizeof(*tmp4[i]->indices));
+ tmp4[i]->uv = (int16 *)malloc(3 * 2 * sizeof(*tmp4[i]->uv));
for (j = 0; j < 3; j++) {
tmp4[i]->indices[j] = next_val(&next, &error);
if (textured) {
@@ -8452,9 +8452,9 @@ int EdenGame::next_val(char **ptr, char *error) {
return val;
}
-void EdenGame::selectmap(short num) {
+void EdenGame::selectmap(int16 num) {
int i, j;
- short k, x, y;
+ int16 k, x, y;
char mode;
curs_cur_map = num;
k = 0;
@@ -8471,7 +8471,7 @@ void EdenGame::selectmap(short num) {
}
void EdenGame::Eden_dep_and_rot() {
- short curs;
+ int16 curs;
curs = current_cursor;
if (normalCursor && (p_global->drawFlags & DrawFlags::drDrawFlag20))
curs = 10;
@@ -8551,10 +8551,10 @@ void EdenGame::restoreZDEP() {
}
void EdenGame::affiche_polygone_mapping(cube_t *cube, cubeface_t *face) {
- short r20, r30, r26, r31, r19, r18, /*r25,*/ r24, ymin, ymax, v46, v48, v4A, v4C, v4E, v50;
- short *uv;
- unsigned short r25;
- unsigned short *indices = face->indices;
+ int16 r20, r30, r26, r31, r19, r18, /*r25,*/ r24, ymin, ymax, v46, v48, v4A, v4C, v4E, v50;
+ int16 *uv;
+ uint16 r25;
+ uint16 *indices = face->indices;
int r17, r29;
r29 = indices[0] * 4;
v46 = cube->projection[r29];
@@ -8618,9 +8618,9 @@ void EdenGame::affiche_polygone_mapping(cube_t *cube, cubeface_t *face) {
affiche_ligne_mapping(ymin, ymax, p_mainview->p_buffer, face->texptr);
}
-void EdenGame::trace_ligne_mapping(short r3, short r4, short r5, short r6, short r7, short r8, short r9, short r10, short *lines) {
- short t;
- short r26;
+void EdenGame::trace_ligne_mapping(int16 r3, int16 r4, int16 r5, int16 r6, int16 r7, int16 r8, int16 r9, int16 r10, int16 *lines) {
+ int16 t;
+ int16 r26;
int r30, r29, r28, r23, r24, r25;
int i;
r26 = r6 - r4;
@@ -8678,13 +8678,13 @@ void EdenGame::trace_ligne_mapping(short r3, short r4, short r5, short r6, short
}
}
-void EdenGame::affiche_ligne_mapping(short r3, short r4, unsigned char *target, unsigned char *texture) {
- short r21, r20, r26, r25, r29, r28, len;
+void EdenGame::affiche_ligne_mapping(int16 r3, int16 r4, byte *target, byte *texture) {
+ int16 r21, r20, r26, r25, r29, r28, len;
int r22;
- unsigned short r31, r30;
- short height = r4 - r3;
- unsigned char *trg, *trg_line = p_mainview->p_buffer + r3 * 640; //TODO: target??
- short *line = &lines[r3 * 8];
+ uint16 r31, r30;
+ int16 height = r4 - r3;
+ byte *trg, *trg_line = p_mainview->p_buffer + r3 * 640; //TODO: target??
+ int16 *line = &lines[r3 * 8];
// debug("curs: beg draw %d - %d", r3, r4);
for (r22 = height; r22; r22--, line += 8, trg_line += 640) {
r29 = line[0];
@@ -8717,7 +8717,7 @@ void EdenGame::affiche_ligne_mapping(short r3, short r4, unsigned char *target,
////// macgame.c
//void MyDlgHook() { }
//void PrepareReply() { }
-short EdenGame::OpenDialog(void *arg1, void *arg2) {
+int16 EdenGame::OpenDialog(void *arg1, void *arg2) {
//TODO
return 0;
}
diff --git a/engines/cryo/eden.h b/engines/cryo/eden.h
index 556f4a65c3..5f14ac301d 100644
--- a/engines/cryo/eden.h
+++ b/engines/cryo/eden.h
@@ -44,17 +44,17 @@ private:
void finfresques();
void scrollmiroir();
void scrollpano();
- void affsuiveur(suiveur_t *suiveur, short x, short y);
+ void affsuiveur(suiveur_t *suiveur, int16 x, int16 y);
void persoinmiroir();
- void gametomiroir(unsigned char arg1);
+ void gametomiroir(byte arg1);
void flipmode();
void quitmiroir();
void clictimbre();
void clicplanval();
void gotolieu(goto_t *go);
- void deplaval(unsigned short roomNum);
- void deplacement(short dir);
- void deplacement2(short dir);
+ void deplaval(uint16 roomNum);
+ void deplacement(int16 dir);
+ void deplacement2(int16 dir);
void dinosoufle();
void plaquemonk();
void fresquesgraa();
@@ -94,22 +94,22 @@ private:
void afficher();
void afficher128();
void sauvefrises();
- void sauvefriseshaut(short x);
+ void sauvefriseshaut(int16 x);
void sauvefrisesbas();
void restaurefrises();
void restaurefriseshaut();
void restaurefrisesbas();
void use_main_bank();
- void use_bank(short bank);
- void sundcurs(short x, short y);
+ void use_bank(int16 bank);
+ void sundcurs(int16 x, int16 y);
void rundcurs();
- void noclipax(short index, short x, short y);
- void noclipax_avecnoir(short index, short x, short y);
- void getglow(short x, short y, short w, short h);
+ void noclipax(int16 index, int16 x, int16 y);
+ void noclipax_avecnoir(int16 index, int16 x, int16 y);
+ void getglow(int16 x, int16 y, int16 w, int16 h);
void unglow();
- void glow(short index);
- void readpalette(unsigned char *ptr);
- void spritesurbulle(short index, short x, short y);
+ void glow(int16 index);
+ void readpalette(byte *ptr);
+ void spritesurbulle(int16 index, int16 x, int16 y);
void bars_out();
void bars_in();
void sauvefondbouche();
@@ -117,12 +117,12 @@ private:
void blackbars();
void afftopscr();
void affplanval();
- void affrepere(short index, short location);
- void affrepereadam(short location);
+ void affrepere(int16 index, int16 location);
+ void affrepereadam(int16 location);
void rest_repadam();
- void save_repadam(short x, short y);
- char istrice(short roomNum);
- char istyran(short roomNum);
+ void save_repadam(int16 x, int16 y);
+ char istrice(int16 roomNum);
+ char istyran(int16 roomNum);
void istyranval(area_t *area);
char getdirection(perso_t *perso);
char caselibre(char loc, perso_t *perso);
@@ -130,9 +130,9 @@ private:
void melange2(char elem[4]);
void melangedir();
char naitredino(char persoType);
- void newcita(char arg1, short arg2, room_t *room);
- void citaevol(short level);
- void citacapoute(short roomNum);
+ void newcita(char arg1, int16 arg2, room_t *room);
+ void citaevol(int16 level);
+ void citacapoute(int16 roomNum);
void buildcita();
void citatombe(char level);
void constcita();
@@ -140,19 +140,19 @@ private:
void deplaalldino();
void newvallee();
char whereiscita();
- char iscita(short loc);
+ char iscita(int16 loc);
void lieuvava(area_t *area);
void vivredino();
- void vivreval(short areaNum);
+ void vivreval(int16 areaNum);
void chaquejour();
- void temps_passe(short t);
+ void temps_passe(int16 t);
void heurepasse();
void anim_perso();
void getanimrnd();
void addanim();
void virespritebouche();
void anim_perfin();
- void perso_spr(unsigned char *spr);
+ void perso_spr(byte *spr);
void af_image();
void af_perso1();
void af_perso();
@@ -169,13 +169,13 @@ private:
void show_perso();
void showpersopanel();
void getdatasync();
- short ReadNombreFrames();
+ int16 ReadNombreFrames();
void waitendspeak();
void my_bulle();
void my_pr_bulle();
- void charsurbulle(unsigned char c, unsigned char color, short width);
+ void charsurbulle(byte c, byte color, int16 width);
void af_subtitle();
- void sauvefondbulle(short y);
+ void sauvefondbulle(int16 y);
void restaurefondbulle();
void af_subtitlehnm();
void patchphrase();
@@ -190,7 +190,7 @@ private:
void init_perso_ptr(perso_t *perso);
void perso1(perso_t *perso);
void perso_normal(perso_t *perso);
- void persoparle(short pers);
+ void persoparle(int16 pers);
void roi();
void dina();
void thoo();
@@ -237,48 +237,48 @@ private:
void abortdial();
void narrateur();
void vrf_phrases_file();
- unsigned char *gettxtad(short id);
+ byte *gettxtad(int16 id);
void gotocarte();
void record();
char dial_scan(dial_t *dial);
char dialoscansvmas(dial_t *dial);
char dialo_even(perso_t *perso);
void stay_here();
- void mort(short vid);
+ void mort(int16 vid);
void evenchrono();
- void chronoon(short t);
- void prechargephrases(short vid);
+ void chronoon(int16 t);
+ void prechargephrases(int16 vid);
void effet1();
void effet2();
void effet3();
void effet4();
void ClearScreen();
- void colimacon(short pattern[16]);
+ void colimacon(int16 pattern[16]);
void fadetoblack(int delay);
void fadetoblack128(int delay);
void fadefromblack128(int delay);
void rectanglenoir32();
- void setRS1(short sx, short sy, short ex, short ey);
- void setRD1(short sx, short sy, short ex, short ey);
+ void setRS1(int16 sx, int16 sy, int16 ex, int16 ey);
+ void setRD1(int16 sx, int16 sy, int16 ex, int16 ey);
void wait(int howlong);
void effetpix();
void verifh(void *ptr);
void openbigfile();
void closebigfile();
- void loadfile(unsigned short num, void *buffer);
- void shnmfl(unsigned short num);
- int ssndfl(unsigned short num);
+ void loadfile(uint16 num, void *buffer);
+ void shnmfl(uint16 num);
+ int ssndfl(uint16 num);
void ConvertIcons(icon_t *icon, int count);
void ConvertLinks(room_t *room, int count);
void ConvertMacToPC();
void loadpermfiles();
- char ReadDataSync(unsigned short num);
- void loadpartoffile(unsigned short num, void *buffer, long pos, long len);
+ char ReadDataSync(uint16 num);
+ void loadpartoffile(uint16 num, void *buffer, long pos, long len);
void Expand_hsq(void *input, void *output);
- void ajouinfo(unsigned char info);
+ void ajouinfo(byte info);
void unlockinfo();
void nextinfo();
- void delinfo(unsigned char info);
+ void delinfo(byte info);
void updateinfolist();
void init_globals();
void initrect();
@@ -286,17 +286,17 @@ private:
void afsalle1(room_t *room);
void afsalle();
void aflieu();
- void loadsal(short num);
+ void loadsal(int16 num);
void specialoutside();
void specialout();
void specialin();
void animpiece();
void getdino(room_t *room);
- room_t *getsalle(short loc);
- void initlieu(short roomNum);
+ room_t *getsalle(int16 loc);
+ void initlieu(int16 roomNum);
void maj2();
- void majsalle1(short roomNum);
- void maj_salle(unsigned short roomNum);
+ void majsalle1(int16 roomNum);
+ void maj_salle(uint16 roomNum);
void initbuf();
void freebuf();
void openwindow();
@@ -308,32 +308,32 @@ private:
void signon(char *s);
void testPommeQ();
void FRDevents();
- icon_t *scan_icon_list(short x, short y, short index);
+ icon_t *scan_icon_list(int16 x, int16 y, int16 index);
void update_cursor();
void mouse();
void showfilm(char arg1);
- void playhnm(short num);
+ void playhnm(int16 num);
void bullehnm();
void musique();
- void startmusique(unsigned char num);
+ void startmusique(byte num);
void musicspy();
- int loadmusicfile(short num);
+ int loadmusicfile(int16 num);
void persovox();
void endpersovox();
void fademusicup();
- void fademusica0(short delay);
- object_t *getobjaddr(short id);
+ void fademusica0(int16 delay);
+ object_t *getobjaddr(int16 id);
void countobjects();
void showobjects();
- void winobject(short id);
- void loseobject(short id);
+ void winobject(int16 id);
+ void loseobject(int16 id);
void lostobject();
- char objecthere(short id);
- void objectmain(short id);
- void getobject(short id);
+ char objecthere(int16 id);
+ void objectmain(int16 id);
+ void getobject(int16 id);
void putobject();
- void newobject(short id, short arg2);
- void giveobjectal(short id);
+ void newobject(int16 id, int16 arg2);
+ void giveobjectal(int16 id);
void giveobject();
void takeobject();
void newchampi();
@@ -359,7 +359,7 @@ private:
void choixsubtitle();
void reglervol();
void changervol();
- void newvol(unsigned char *volptr, short delta);
+ void newvol(byte *volptr, int16 delta);
void playtape();
void rewindtape();
void depcurstape();
@@ -372,25 +372,25 @@ private:
void langbuftopanel();
void affpanel();
void afflangue();
- void affcursvol(short x, short vol1, short vol2);
+ void affcursvol(int16 x, int16 vol1, int16 vol2);
void affcurseurs();
void curseurselect(int itemId);
void afftoppano();
void affresult();
- void limitezonecurs(short xmin, short xmax, short ymin, short ymax);
+ void limitezonecurs(int16 xmin, int16 xmax, int16 ymin, int16 ymax);
void PommeQ();
void habitants(perso_t *perso);
void suiveurs(perso_t *perso);
void evenements(perso_t *perso);
void followme(perso_t *perso);
void rangermammi(perso_t *perso, room_t *room);
- void perso_ici(short action);
+ void perso_ici(int16 action);
void setpersohere();
- void faire_suivre(short roomNum);
+ void faire_suivre(int16 roomNum);
void suis_moi5();
- void suis_moi(short index);
+ void suis_moi(int16 index);
void reste_ici5();
- void reste_ici(short index);
+ void reste_ici(int16 index);
void eloipart();
char eloirevientq();
void eloirevient();
@@ -459,20 +459,20 @@ private:
void lieuoffsetin();
void bandeoffsetout();
void bandeoffsetin();
- char testcondition(short index);
- unsigned short opera_add(unsigned short v1, unsigned short v2);
- unsigned short opera_sub(unsigned short v1, unsigned short v2);
- unsigned short opera_and(unsigned short v1, unsigned short v2);
- unsigned short opera_or(unsigned short v1, unsigned short v2);
- unsigned short opera_egal(unsigned short v1, unsigned short v2);
- unsigned short opera_petit(unsigned short v1, unsigned short v2);
- unsigned short opera_grand(unsigned short v1, unsigned short v2);
- unsigned short opera_diff(unsigned short v1, unsigned short v2);
- unsigned short opera_petega(unsigned short v1, unsigned short v2);
- unsigned short opera_graega(unsigned short v1, unsigned short v2);
- unsigned short opera_faux(unsigned short v1, unsigned short v2);
- unsigned short operation(unsigned char op, unsigned short v1, unsigned short v2);
- unsigned short cher_valeur();
+ char testcondition(int16 index);
+ uint16 opera_add(uint16 v1, uint16 v2);
+ uint16 opera_sub(uint16 v1, uint16 v2);
+ uint16 opera_and(uint16 v1, uint16 v2);
+ uint16 opera_or(uint16 v1, uint16 v2);
+ uint16 opera_egal(uint16 v1, uint16 v2);
+ uint16 opera_petit(uint16 v1, uint16 v2);
+ uint16 opera_grand(uint16 v1, uint16 v2);
+ uint16 opera_diff(uint16 v1, uint16 v2);
+ uint16 opera_petega(uint16 v1, uint16 v2);
+ uint16 opera_graega(uint16 v1, uint16 v2);
+ uint16 opera_faux(uint16 v1, uint16 v2);
+ uint16 operation(byte op, uint16 v1, uint16 v2);
+ uint16 cher_valeur();
void monbreak();
void ret();
void make_tabcos();
@@ -481,36 +481,36 @@ private:
void init_cube();
void moteur();
void affiche_objet(cube_t *cube);
- void NEWcharge_map(int file_id, unsigned char *buffer);
- void NEWcharge_objet_mob(cube_t *cube, int file_id, unsigned char *texptr);
+ void NEWcharge_map(int file_id, byte *buffer);
+ void NEWcharge_objet_mob(cube_t *cube, int file_id, byte *texptr);
static int next_val(char **ptr, char *error);
- void selectmap(short num);
+ void selectmap(int16 num);
void Eden_dep_and_rot();
void restoreZDEP();
void affiche_polygone_mapping(cube_t *cube, cubeface_t *face);
- void trace_ligne_mapping(short r3, short r4, short r5, short r6, short r7, short r8, short r9, short r10, short *lines);
- void affiche_ligne_mapping(short r3, short r4, unsigned char *target, unsigned char *texture);
- short OpenDialog(void *arg1, void *arg2);
+ void trace_ligne_mapping(int16 r3, int16 r4, int16 r5, int16 r6, int16 r7, int16 r8, int16 r9, int16 r10, int16 *lines);
+ void affiche_ligne_mapping(int16 r3, int16 r4, byte *target, byte *texture);
+ int16 OpenDialog(void *arg1, void *arg2);
void LostEdenMac_InitPrefs();
private:
- short old_scroll_pos, scroll_pos;
- short word_2F514;
- unsigned char fresqTalk;
- unsigned char keep01, keep02, keep10, keep11, keep12, keep13, keep21, keep22;
- unsigned char curs_keepbuf[2500];
- short curs_keepy, curs_keepx;
- short torchCursor;
- short cur_bank_num;
- short glow_h;
- short glow_w;
- short glow_y;
- short glow_x;
- unsigned char needPaletteUpdate;
- unsigned char curs_saved;
- unsigned char showBlackBars;
- unsigned char fond_saved;
- unsigned char *bank_data_ptr;
+ int16 old_scroll_pos, scroll_pos;
+ int16 word_2F514;
+ byte fresqTalk;
+ byte keep01, keep02, keep10, keep11, keep12, keep13, keep21, keep22;
+ byte curs_keepbuf[2500];
+ int16 curs_keepy, curs_keepx;
+ int16 torchCursor;
+ int16 cur_bank_num;
+ int16 glow_h;
+ int16 glow_w;
+ int16 glow_y;
+ int16 glow_x;
+ byte needPaletteUpdate;
+ byte curs_saved;
+ byte showBlackBars;
+ byte fond_saved;
+ byte *bank_data_ptr;
color3_t pal_entry;
color_t global_palette[256]; //TODO palette_t
perso_t *tyranPtr;
@@ -518,34 +518,34 @@ private:
int cur_anim_frame_num;
int last_anim_ticks;
prect_t *cur_perso_rect;
- short num_anim_frames;
- short max_perso_desc;
- short num_img_desc;
- unsigned char restartAnimation;
- unsigned char animationActive;
- unsigned char animationDelay;
- unsigned char animationIndex;
- unsigned char lastAnimationIndex;
+ int16 num_anim_frames;
+ int16 max_perso_desc;
+ int16 num_img_desc;
+ byte restartAnimation;
+ byte animationActive;
+ byte animationDelay;
+ byte animationIndex;
+ byte lastAnimationIndex;
- unsigned char *dword_30724;
- unsigned char *dword_30728; //TODO: rename - something amim-related
- unsigned char *dword_3072C; //TODO ditto
- unsigned char *animationTable;
- unsigned char imagedesc[512];
- unsigned char *perso_img_bank_data_ptr;
- unsigned char savedUnderSubtitles;
- short num_text_lines;
- unsigned char phraseBuffer[400];
- unsigned char *text_ptr;
- unsigned char phraseIconsBuffer[10];
- unsigned char phraseCoordsBuffer[22];
- unsigned char *textoutptr;
- unsigned char *textout;
+ byte *dword_30724;
+ byte *dword_30728; //TODO: rename - something amim-related
+ byte *dword_3072C; //TODO ditto
+ byte *animationTable;
+ byte imagedesc[512];
+ byte *perso_img_bank_data_ptr;
+ byte savedUnderSubtitles;
+ int16 num_text_lines;
+ byte phraseBuffer[400];
+ byte *text_ptr;
+ byte phraseIconsBuffer[10];
+ byte phraseCoordsBuffer[22];
+ byte *textoutptr;
+ byte *textout;
object_t *currentSpecialObject;
- short word_30AFC;
- unsigned char byte_30AFE;
+ int16 word_30AFC;
+ byte byte_30AFE;
- unsigned char byte_30B00;
+ byte byte_30B00;
int dword_30B04;
char lastPhrasesFile;
@@ -557,36 +557,36 @@ private:
rect_t rect_dst, rect_src;
void *voiceSamplesBuffer; //TODO: sound sample buffer
file_t h_bigfile;
- unsigned char info_list[16];
- unsigned char needToFade;
- unsigned char lastMusicNum;
- unsigned char *main_bank_buf;
- unsigned char *music_buf;
- unsigned char *gameLipsync;
- unsigned char *gamePhrases;
- unsigned char *gameDialogs; //TODO: rename to dialogs?
- unsigned char *gameConditions;
+ byte info_list[16];
+ byte needToFade;
+ byte lastMusicNum;
+ byte *main_bank_buf;
+ byte *music_buf;
+ byte *gameLipsync;
+ byte *gamePhrases;
+ byte *gameDialogs; //TODO: rename to dialogs?
+ byte *gameConditions;
void *sal_buf; //TODO: fixme
- unsigned char *bank_data_buf;
+ byte *bank_data_buf;
icon_t *gameIcons;
room_t *gameRooms;
pak_t *bigfile_header;
- unsigned char *glow_buffer;
- unsigned char *p_mainview_buf;
- unsigned char *p_view2_buf;
- unsigned char *gameFont; //TODO: rename to font?
- unsigned char *p_subtitlesview_buf;
- unsigned char *p_underSubtitlesView_buf;
+ byte *glow_buffer;
+ byte *p_mainview_buf;
+ byte *p_view2_buf;
+ byte *gameFont; //TODO: rename to font?
+ byte *p_subtitlesview_buf;
+ byte *p_underSubtitlesView_buf;
global_t *p_global;
- unsigned short mouse_y_center, mouse_x_center;
+ uint16 mouse_y_center, mouse_x_center;
int quit_flag3; //TODO: some obsolete error flag?
- unsigned short machine_speed;
- unsigned char quit_flag;
+ uint16 machine_speed;
+ byte quit_flag;
- unsigned char gameStarted;
+ byte gameStarted;
- unsigned char quit_flag2;
- unsigned char soundAllocated;
+ byte quit_flag2;
+ byte soundAllocated;
soundchannel_t *music_channel;
soundchannel_t *hnmsound_ch;
sound_t *voiceSound;
@@ -604,59 +604,59 @@ private:
int demoCurrentTicks;
int demoStartTicks;
int currentTime;
- short mouse_y;
- short mouse_x;
- short doubled;
- short curs_x_pan;
- short inventoryScrollDelay;
- short curs_y, curs_x;
- short current_cursor;
+ int16 mouse_y;
+ int16 mouse_x;
+ int16 doubled;
+ int16 curs_x_pan;
+ int16 inventoryScrollDelay;
+ int16 curs_y, curs_x;
+ int16 current_cursor;
icon_t *current_spot;
icon_t *current_spot2;
- unsigned char pomme_q;
- unsigned char keybd_held;
- unsigned char mouse_held;
- unsigned char normalCursor;
- unsigned char *p_hnmview_buf;
- unsigned char showVideoSubtitle;
- unsigned char videoCanceled; //TODO: hnm_canceled
- unsigned char specialTextMode;
+ byte pomme_q;
+ byte keybd_held;
+ byte mouse_held;
+ byte normalCursor;
+ byte *p_hnmview_buf;
+ byte showVideoSubtitle;
+ byte videoCanceled; //TODO: hnm_canceled
+ byte specialTextMode;
int hnm_position;
int voiceSamplesSize; //TODO: perso vox sample data len
- short mus_vol_right;
- short mus_vol_left;
+ int16 mus_vol_right;
+ int16 mus_vol_left;
- unsigned char animateTalking;
- unsigned char personTalking;
- unsigned char mus_fade_flags;
+ byte animateTalking;
+ byte personTalking;
+ byte mus_fade_flags;
char musicSequencePos;
- unsigned char musicPlaying;
+ byte musicPlaying;
- unsigned char *mus_samples_ptr;
- unsigned char *mus_patterns_ptr; //TODO: sndblock_t ?
- unsigned char *mus_sequence_ptr;
+ byte *mus_samples_ptr;
+ byte *mus_patterns_ptr; //TODO: sndblock_t ?
+ byte *mus_sequence_ptr;
soundgroup_t *mus_queue_grp;
- short *pCurrentObjectLocation;
- unsigned char own_objects[128];
- unsigned char byte_31D64;
+ int16 *pCurrentObjectLocation;
+ byte own_objects[128];
+ byte byte_31D64;
- unsigned char no_palette;
- unsigned char gameLoaded;
+ byte no_palette;
+ byte gameLoaded;
#define MAX_TAPES 16
tape_t tapes[MAX_TAPES];
- unsigned char confirmMode;
- unsigned char *cur_slider_value_ptr;
- unsigned char lastMenuItemIdLo;
- short lastTapeRoomNum;
- short cur_slider_x;
- short cur_slider_y;
- short destinationRoom;
- short word_31E7A;
+ byte confirmMode;
+ byte *cur_slider_value_ptr;
+ byte lastMenuItemIdLo;
+ int16 lastTapeRoomNum;
+ int16 cur_slider_x;
+ int16 cur_slider_y;
+ int16 destinationRoom;
+ int16 word_31E7A;
- short word_378CC; //TODO: set by CLComputer_Init to 0
- short word_378CE;
+ int16 word_378CC; //TODO: set by CLComputer_Init to 0
+ int16 word_378CE;
};
diff --git a/engines/cryo/staticdata.cpp b/engines/cryo/staticdata.cpp
index 92b29778fb..7b700d720e 100644
--- a/engines/cryo/staticdata.cpp
+++ b/engines/cryo/staticdata.cpp
@@ -52,7 +52,7 @@ suiveur_t suiveurs_list[] = {
*/
-unsigned char kLabyrinthPath[] = {
+byte kLabyrinthPath[] = {
// each nibble tells wich direction to choose to exit the labyrinth
0x11, 0x11, 0x11, 0x22, 0x33, 0x55, 0x25, 0x44, 0x25, 0x11, 0x11, 0x11,
0x11, 0x35, 0x55, 0x45, 0x45, 0x44, 0x44, 0x34, 0x44, 0x34, 0x32, 0x52,
@@ -239,7 +239,7 @@ goto_t gotos[] = {
#define SUB_LINE(start, end) \
(start), (end) | 0x8000
-short tab_2D24C[] = {
+int16 tab_2D24C[] = {
SUB_LINE(68, 120),
123, 32964,
199, 33042,
@@ -259,13 +259,13 @@ short tab_2D24C[] = {
-1
};
-short tab_2D28E[] = {
+int16 tab_2D28E[] = {
99, 32923,
157, 33024,
-1
};
-short tab_2D298[] = {
+int16 tab_2D298[] = {
106, 32941,
175, 33012,
246, 33118,
@@ -273,7 +273,7 @@ short tab_2D298[] = {
-1
};
-short tab_2D2AA[] = {
+int16 tab_2D2AA[] = {
126, 32944,
178, 33035,
269, 33110,
@@ -283,7 +283,7 @@ short tab_2D2AA[] = {
-1
};
-short tab_2D2C4[] = {
+int16 tab_2D2C4[] = {
101, 32981,
215, 33121,
355, 33223,
@@ -344,7 +344,7 @@ object_t objects[] = {
{ 42, 0, 3, 0x8000, 0, 0} // Tablet #6 (Castra)
};
-short kObjectLocations[100] = {
+int16 kObjectLocations[100] = {
0x112, -1,
0x202, -1,
0x120, -1,
@@ -496,7 +496,7 @@ cita_t cita_list[] = {
};
-short tab_2CB16[] = { 2075, 2080, 2119, -1};
+int16 tab_2CB16[] = { 2075, 2080, 2119, -1};
char tab_2CB1E[8][4] = {
{ 0x10, 0x81, 1, 0x90},
@@ -509,7 +509,7 @@ char tab_2CB1E[8][4] = {
{ 0x81, 0x90, 1, 0x10}
};
-prect_t perso_rects[] = { //TODO: just an array of shorts?
+prect_t perso_rects[] = { //TODO: just an array of int16s?
{ 93, 69, 223, 176},
{ 102, 86, 162, 126},
{ 88, 103, 168, 163},
@@ -531,7 +531,7 @@ prect_t perso_rects[] = { //TODO: just an array of shorts?
{ 188, 83, 251, 158}
};
-unsigned char tab_persxx[][5] = { //TODO: struc?
+byte tab_persxx[][5] = { //TODO: struc?
{ 8, 15, 23, 25, -1},
{ 0, 9, -1 },
{ 0, 9, -1 },
@@ -569,21 +569,21 @@ area_t kAreasTable[] = {
{ Areas::arMoorkusLair , AreaType::atCave , 0, 127, 0, 12}
};
-short tab_2CEF0[64] = {
+int16 tab_2CEF0[64] = {
25, 257, 0, 0, 37, 258, 38, 259, 0, 0, 24, 260, 0, 0, 0, 0,
0, 0, 53, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
39, 261, 0, 0, 40, 262, 62, 263, 0, 0, 63, 264, 0, 0, 0, 0,
18, 275, 0, 0, 35, 254, 36, 255, 19, 318, 23, 256, 0, 0, 0, 0
};
-short tab_2CF70[64] = {
+int16 tab_2CF70[64] = {
65, 266, 0, 0, 66, 267, 67, 268, 0, 0, 68, 269, 0, 0, 0, 0,
0, 0, 73, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
69, 270, 0, 0, 70, 271, 71, 272, 0, 0, 72, 273, 0, 0, 0, 0,
18, 275, 0, 0, 35, 254, 36, 255, 19, 318, 23, 256, 0, 0, 0, 0,
};
-short kActionCursors[299] = {
+int16 kActionCursors[299] = {
3, 1, 2, 4, 5, 5, 5, 0, 5, 5,
5, 5, 5, 3, 2, 5, 5, 5, 3, 2,
4, 5, 7, 7, 4, 5, 5, 0, 0, 0,
@@ -623,7 +623,7 @@ float flt_2DF84 = 200;
// Cube faces to texture coords mapping
// each entry is num_polys(6) * num_faces_per_poly(2) * vertex_per_face(3) * uv(2)
-short cube_texcoords[3][6 * 2 * 3 * 2] = {
+int16 cube_texcoords[3][6 * 2 * 3 * 2] = {
{
32, 32, 0, 32, 0, 0,
32, 32, 0, 0, 32, 0,