aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/cine/anim.cpp240
-rw-r--r--engines/cine/anim.h42
-rw-r--r--engines/cine/bg.cpp46
-rw-r--r--engines/cine/bg.h14
-rw-r--r--engines/cine/bg_list.cpp12
-rw-r--r--engines/cine/bg_list.h2
-rw-r--r--engines/cine/cine.cpp4
-rw-r--r--engines/cine/cine.h8
-rw-r--r--engines/cine/flip_support.cpp26
-rw-r--r--engines/cine/flip_support.h10
-rw-r--r--engines/cine/font.h4
-rw-r--r--engines/cine/gfx.cpp74
-rw-r--r--engines/cine/gfx.h50
-rw-r--r--engines/cine/main_loop.cpp18
-rw-r--r--engines/cine/msg.cpp12
-rw-r--r--engines/cine/object.cpp44
-rw-r--r--engines/cine/object.h44
-rw-r--r--engines/cine/pal.cpp24
-rw-r--r--engines/cine/pal.h10
-rw-r--r--engines/cine/part.cpp34
-rw-r--r--engines/cine/part.h34
-rw-r--r--engines/cine/prc.cpp14
-rw-r--r--engines/cine/prc.h10
-rw-r--r--engines/cine/rel.cpp20
-rw-r--r--engines/cine/rel.h8
-rw-r--r--engines/cine/resource.cpp2
-rw-r--r--engines/cine/resource.h2
-rw-r--r--engines/cine/script.cpp940
-rw-r--r--engines/cine/script.h18
-rw-r--r--engines/cine/sfx_player.cpp28
-rw-r--r--engines/cine/sfx_player.h16
-rw-r--r--engines/cine/sound_driver.cpp60
-rw-r--r--engines/cine/sound_driver.h8
-rw-r--r--engines/cine/texte.cpp18
-rw-r--r--engines/cine/texte.h6
-rw-r--r--engines/cine/unpack.cpp22
-rw-r--r--engines/cine/unpack.h2
-rw-r--r--engines/cine/various.cpp712
-rw-r--r--engines/cine/various.h132
39 files changed, 1381 insertions, 1389 deletions
diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 808404a5b1..754e26ec2a 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -25,18 +25,18 @@
#include "cine/cine.h"
struct animHeader2Struct {
- u32 field_0;
- u16 width;
- u16 height;
- u16 type;
- u16 field_A;
- u16 field_C;
- u16 field_E;
+ uint32 field_0;
+ uint16 width;
+ uint16 height;
+ uint16 type;
+ uint16 field_A;
+ uint16 field_C;
+ uint16 field_E;
};
typedef struct animHeader2Struct animHeader2Struct;
-u16 frameVar0 = 0;
+uint16 frameVar0 = 0;
animHeaderStruct animHeader;
@@ -176,9 +176,9 @@ animDataEntry animData[] = {
#define NUM_ANIM_DATA (sizeof(animData)/sizeof(animDataEntry))
-u8 findAnimInHardcodedData(char *animName) {
+uint8 findAnimInHardcodedData(char *animName) {
char name[15];
- u16 i;
+ uint16 i;
removeExtention(name, animName);
@@ -191,9 +191,9 @@ u8 findAnimInHardcodedData(char *animName) {
return (0);
}
-s16 allocFrame(u16 width, u16 height, s8 isMask) {
- u16 i;
- u32 frameSize;
+int16 allocFrame(uint16 width, uint16 height, int8 isMask) {
+ uint16 i;
+ uint32 frameSize;
for (i = 0; i < NUM_MAX_PARTDATA; i++) {
if (!animDataTable[i].ptr1)
@@ -206,8 +206,8 @@ s16 allocFrame(u16 width, u16 height, s8 isMask) {
if (!isMask) { // sprite + generated mask
frameSize = width * height;
- animDataTable[i].ptr1 = (u8 *) malloc(frameSize);
- animDataTable[i].ptr2 = (u8 *) malloc(frameSize);
+ animDataTable[i].ptr1 = (uint8 *) malloc(frameSize);
+ animDataTable[i].ptr2 = (uint8 *) malloc(frameSize);
animDataTable[i].width = width;
animDataTable[i].var1 = width >> 3;
@@ -220,7 +220,7 @@ s16 allocFrame(u16 width, u16 height, s8 isMask) {
// mask
frameSize = width * height * 8;
- animDataTable[i].ptr1 = (u8 *) malloc(frameSize);
+ animDataTable[i].ptr1 = (uint8 *) malloc(frameSize);
animDataTable[i].ptr2 = NULL;
animDataTable[i].width = width;
@@ -237,9 +237,9 @@ s16 allocFrame(u16 width, u16 height, s8 isMask) {
return (i);
}
-s16 allocFrame2(u16 width, u16 height, u16 type) {
- u16 i;
- u32 frameSize;
+int16 allocFrame2(uint16 width, uint16 height, uint16 type) {
+ uint16 i;
+ uint32 frameSize;
for (i = 0; i < NUM_MAX_PARTDATA; i++) {
if (!animDataTable[i].ptr1)
@@ -264,7 +264,7 @@ s16 allocFrame2(u16 width, u16 height, u16 type) {
frameSize *= 2;
- animDataTable[i].ptr1 = (u8 *) malloc(frameSize);
+ animDataTable[i].ptr1 = (uint8 *) malloc(frameSize);
ASSERT_PTR(animDataTable[i].ptr1);
@@ -288,9 +288,9 @@ s16 allocFrame2(u16 width, u16 height, u16 type) {
return (i);
}
-s16 reserveFrame(u16 width, u16 height, u16 type, u16 idx) {
- u16 i;
- u32 frameSize;
+int16 reserveFrame(uint16 width, uint16 height, uint16 type, uint16 idx) {
+ uint16 i;
+ uint32 frameSize;
i = idx;
@@ -309,7 +309,7 @@ s16 reserveFrame(u16 width, u16 height, u16 type, u16 idx) {
frameSize *= 2;
- animDataTable[i].ptr1 = (u8 *) malloc(frameSize);
+ animDataTable[i].ptr1 = (uint8 *) malloc(frameSize);
ASSERT_PTR(animDataTable[i].ptr1);
@@ -333,8 +333,8 @@ s16 reserveFrame(u16 width, u16 height, u16 type, u16 idx) {
return (i);
}
-void generateMask(u8 * sprite, u8 * mask, u16 size, u8 transparency) {
- u16 i;
+void generateMask(uint8 * sprite, uint8 * mask, uint16 size, uint8 transparency) {
+ uint16 i;
for (i = 0; i < size; i++) {
if (*(sprite++) != transparency) {
@@ -345,12 +345,12 @@ void generateMask(u8 * sprite, u8 * mask, u16 size, u8 transparency) {
}
}
-void convertMask(u8 * dest, u8 * source, s16 width, s16 height) {
- s16 i;
- s16 j;
+void convertMask(uint8 * dest, uint8 * source, int16 width, int16 height) {
+ int16 i;
+ int16 j;
for (i = 0; i < width * height; i++) {
- u8 maskEntry = *(source++);
+ uint8 maskEntry = *(source++);
for (j = 0; j < 8; j++) {
if (maskEntry & 0x80) {
*(dest++) = 0;
@@ -363,31 +363,31 @@ void convertMask(u8 * dest, u8 * source, s16 width, s16 height) {
}
}
-void convert4BBP(u8 * dest, u8 * source, s16 width, s16 height) {
- s16 i;
+void convert4BBP(uint8 * dest, uint8 * source, int16 width, int16 height) {
+ int16 i;
for (i = 0; i < width * height; i++) {
- u8 maskEntry = *(source++);
+ uint8 maskEntry = *(source++);
*(dest++) = (maskEntry & 0xF0) >> 4;
*(dest++) = (maskEntry & 0xF);
}
}
void loadSpl(char *resourceName) {
- s16 foundFileIdx;
- u8 *dataPtr;
- s16 entry;
+ int16 foundFileIdx;
+ uint8 *dataPtr;
+ int16 entry;
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
entry =
- allocFrame((u16) partBuffer[foundFileIdx].unpacked_size, 1, -1);
+ allocFrame((uint16) partBuffer[foundFileIdx].unpacked_size, 1, -1);
ASSERT(entry != -1);
memcpy(animDataTable[entry].ptr1, dataPtr,
- (u16) partBuffer[foundFileIdx].unpacked_size);
+ (uint16) partBuffer[foundFileIdx].unpacked_size);
animDataTable[entry].fileIdx = foundFileIdx;
animDataTable[entry].frameIdx = 0;
@@ -395,11 +395,11 @@ void loadSpl(char *resourceName) {
}
void loadMsk(char *resourceName) {
- s16 foundFileIdx;
- u8 *dataPtr;
- s16 entry;
- u8 *ptr;
- s16 i;
+ int16 foundFileIdx;
+ uint8 *dataPtr;
+ int16 entry;
+ uint8 *ptr;
+ int16 i;
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
@@ -431,13 +431,13 @@ void loadMsk(char *resourceName) {
}
void loadAni(char *resourceName) {
- s16 foundFileIdx;
- u8 *dataPtr;
- s16 entry;
- u8 *ptr;
- s16 i;
- u8 transparentColor;
- u32 fullSize;
+ int16 foundFileIdx;
+ uint8 *dataPtr;
+ int16 entry;
+ uint8 *ptr;
+ int16 i;
+ uint8 transparentColor;
+ uint32 fullSize;
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
@@ -456,7 +456,7 @@ void loadAni(char *resourceName) {
fullSize = animHeader.frameWidth * animHeader.frameHeight;
for (i = 0; i < animHeader.numFrames; i++) {
- u8 *animPtr;
+ uint8 *animPtr;
entry =
allocFrame(animHeader.frameWidth * 2,
@@ -481,7 +481,7 @@ void loadAni(char *resourceName) {
}
}
- animPtr = (u8 *) malloc(fullSize);
+ animPtr = (uint8 *) malloc(fullSize);
memcpy(animPtr, ptr, fullSize);
ptr += fullSize;
@@ -502,34 +502,34 @@ void loadAni(char *resourceName) {
}
}
-void convert8BBP(u8 * dest, u8 * source, s16 width, s16 height) {
- u16 i;
- u8 table[16];
+void convert8BBP(uint8 * dest, uint8 * source, int16 width, int16 height) {
+ uint16 i;
+ uint8 table[16];
memcpy(table, source, 16);
source += 16;
for (i = 0; i < width * height; i++) {
- u8 color = *(source++);
+ uint8 color = *(source++);
*(dest++) = table[color >> 4];
*(dest++) = table[color & 0xF];
}
}
-void convert8BBP2(u8 * dest, u8 * source, s16 width, s16 height) {
- u16 i;
- u16 j;
+void convert8BBP2(uint8 * dest, uint8 * source, int16 width, int16 height) {
+ uint16 i;
+ uint16 j;
- u8 al;
- u8 ah;
- u8 bl;
- u8 bh;
- u8 cl;
- u8 ch;
- u8 dl;
- u8 dh;
- u8 color;
+ uint8 al;
+ uint8 ah;
+ uint8 bl;
+ uint8 bh;
+ uint8 cl;
+ uint8 ch;
+ uint8 dl;
+ uint8 dh;
+ uint8 color;
for (j = 0; j < (width * height) / 16; j++) {
al = *(source);
@@ -616,14 +616,14 @@ void convert8BBP2(u8 * dest, u8 * source, s16 width, s16 height) {
void loadSet(char *resourceName) {
animHeader2Struct header2;
- s16 foundFileIdx;
- u8 *dataPtr;
- s16 entry;
- u8 *ptr;
- s16 i;
- u32 fullSize;
- u16 numSpriteInAnim;
- u8 *startOfDataPtr;
+ int16 foundFileIdx;
+ uint8 *dataPtr;
+ int16 entry;
+ uint8 *ptr;
+ int16 i;
+ uint32 fullSize;
+ uint16 numSpriteInAnim;
+ uint8 *startOfDataPtr;
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
@@ -632,15 +632,15 @@ void loadSet(char *resourceName) {
ptr = dataPtr + 4;
- numSpriteInAnim = *(u16 *) ptr;
+ numSpriteInAnim = *(uint16 *) ptr;
flipU16(&numSpriteInAnim);
ptr += 2;
startOfDataPtr = ptr + numSpriteInAnim * 0x10;
for (i = 0; i < numSpriteInAnim; i++) {
- s16 typeParam;
- u8 table[16] =
+ int16 typeParam;
+ uint8 table[16] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
memcpy(&header2, ptr, 0x10);
@@ -710,16 +710,16 @@ void loadSet(char *resourceName) {
}
}
-void loadSetAbs(char *resourceName, u16 idx) {
+void loadSetAbs(char *resourceName, uint16 idx) {
animHeader2Struct header2;
- s16 foundFileIdx;
- u8 *dataPtr;
- s16 entry;
- u8 *ptr;
- s16 i;
- u32 fullSize;
- u16 numSpriteInAnim;
- u8 *startOfDataPtr;
+ int16 foundFileIdx;
+ uint8 *dataPtr;
+ int16 entry;
+ uint8 *ptr;
+ int16 i;
+ uint32 fullSize;
+ uint16 numSpriteInAnim;
+ uint8 *startOfDataPtr;
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
@@ -728,15 +728,15 @@ void loadSetAbs(char *resourceName, u16 idx) {
ptr = dataPtr + 4;
- numSpriteInAnim = *(u16 *) ptr;
+ numSpriteInAnim = *(uint16 *) ptr;
flipU16(&numSpriteInAnim);
ptr += 2;
startOfDataPtr = ptr + numSpriteInAnim * 0x10;
for (i = 0; i < numSpriteInAnim; i++) {
- s16 typeParam;
- u8 table[16] =
+ int16 typeParam;
+ uint8 table[16] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
memcpy(&header2, ptr, 0x10);
@@ -807,39 +807,39 @@ void loadSetAbs(char *resourceName, u16 idx) {
}
void loadSeq(char *resourceName) {
- s16 foundFileIdx;
- u8 *dataPtr;
- s16 entry;
+ int16 foundFileIdx;
+ uint8 *dataPtr;
+ int16 entry;
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
entry =
- allocFrame2((u16) partBuffer[foundFileIdx].unpacked_size, 1, 0);
+ allocFrame2((uint16) partBuffer[foundFileIdx].unpacked_size, 1, 0);
memcpy(animDataTable[entry].ptr1, dataPtr + 0x16,
- (u16) partBuffer[foundFileIdx].unpacked_size - 0x16);
+ (uint16) partBuffer[foundFileIdx].unpacked_size - 0x16);
}
-void loadSeqAbs(char *resourceName, u16 idx) {
- s16 foundFileIdx;
- u8 *dataPtr;
- s16 entry;
+void loadSeqAbs(char *resourceName, uint16 idx) {
+ int16 foundFileIdx;
+ uint8 *dataPtr;
+ int16 entry;
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
entry =
- reserveFrame((u16) partBuffer[foundFileIdx].unpacked_size, 1, 0,
+ reserveFrame((uint16) partBuffer[foundFileIdx].unpacked_size, 1, 0,
idx);
memcpy(animDataTable[entry].ptr1, dataPtr + 0x16,
- (u16) partBuffer[foundFileIdx].unpacked_size - 0x16);
+ (uint16) partBuffer[foundFileIdx].unpacked_size - 0x16);
}
void loadResource(char *resourceName) {
- u8 isMask = 0;
- u8 isSpl = 0;
+ uint8 isMask = 0;
+ uint8 isSpl = 0;
if (strstr(resourceName, ".SPL")) {
loadSpl(resourceName);
@@ -870,9 +870,9 @@ void loadResource(char *resourceName) {
ASSERT(0);
}
-void loadAbs(char *resourceName, u16 idx) {
- u8 isMask = 0;
- u8 isSpl = 0;
+void loadAbs(char *resourceName, uint16 idx) {
+ uint8 isMask = 0;
+ uint8 isSpl = 0;
if (strstr(resourceName, ".SET")) {
loadSetAbs(resourceName, idx);
@@ -896,18 +896,18 @@ void loadAbs(char *resourceName, u16 idx) {
void loadResourcesFromSave() {
char part[256];
- s16 currentAnim;
+ int16 currentAnim;
strcpy(part, currentPartName);
for (currentAnim = 0; currentAnim < NUM_MAX_ANIMDATA; currentAnim++) {
animDataStruct *currentPtr = &animDataTable[currentAnim];
if (currentPtr->ptr1 && currentPtr->fileIdx != -1) {
- s8 isMask = 0;
- s8 isSpl = 0;
- s16 foundFileIdx;
- u8 *dataPtr;
- u8 *ptr;
+ int8 isMask = 0;
+ int8 isSpl = 0;
+ int16 foundFileIdx;
+ uint8 *dataPtr;
+ uint8 *ptr;
char animName[256];
if (strcmp(currentPartName, currentPtr->name)) {
@@ -935,7 +935,7 @@ void loadResourcesFromSave() {
if (isSpl) {
animHeader.frameWidth =
- (u16) partBuffer[foundFileIdx].
+ (uint16) partBuffer[foundFileIdx].
unpacked_size;
animHeader.frameHeight = 1;
animHeader.numFrames = 1;
@@ -951,9 +951,9 @@ void loadResourcesFromSave() {
}
{
- u16 fullSize;
- u16 i;
- u8 transparentColor;
+ uint16 fullSize;
+ uint16 i;
+ uint8 transparentColor;
fullSize =
animHeader.frameWidth *
@@ -966,8 +966,8 @@ void loadResourcesFromSave() {
for (i = 0; i < animHeader.numFrames; i++) // load all the frames
{
- s16 entry;
- u8 *animPtr;
+ int16 entry;
+ uint8 *animPtr;
// special case transparency handling
if (!strcmp(animName, "L2202.ANI")) {
@@ -1002,7 +1002,7 @@ void loadResourcesFromSave() {
} else {
if (!isMask) {
animPtr =
- (u8 *)
+ (uint8 *)
malloc(fullSize);
memcpy(animPtr, ptr,
diff --git a/engines/cine/anim.h b/engines/cine/anim.h
index 5b1bbef3ef..76837ba6bc 100644
--- a/engines/cine/anim.h
+++ b/engines/cine/anim.h
@@ -25,34 +25,34 @@
#ifndef CINE_ANIM_H_
#define CINE_ANIM_H_
-extern u16 frameVar0;
+extern uint16 frameVar0;
struct animHeaderStruct {
- u8 field_0;
- u8 field_1;
- u8 field_2;
- u8 field_3;
- u16 frameWidth;
- u16 frameHeight;
- u8 field_8;
- u8 field_9;
- u8 field_A;
- u8 field_B;
- u8 field_C;
- u8 field_D;
- u16 numFrames;
- u8 field_10;
- u8 field_11;
- u8 field_12;
- u8 field_13;
- u16 field_14;
+ uint8 field_0;
+ uint8 field_1;
+ uint8 field_2;
+ uint8 field_3;
+ uint16 frameWidth;
+ uint16 frameHeight;
+ uint8 field_8;
+ uint8 field_9;
+ uint8 field_A;
+ uint8 field_B;
+ uint8 field_C;
+ uint8 field_D;
+ uint16 numFrames;
+ uint8 field_10;
+ uint8 field_11;
+ uint8 field_12;
+ uint8 field_13;
+ uint16 field_14;
};
typedef struct animHeaderStruct animHeaderStruct;
struct animDataEntry {
char name[9];
- u8 param;
+ uint8 param;
};
typedef struct animDataEntry animDataEntry;
@@ -60,7 +60,7 @@ typedef struct animDataEntry animDataEntry;
extern animDataEntry animData[];
void loadResource(char *animName);
-void loadAbs(char *resourceName, u16 idx);
+void loadAbs(char *resourceName, uint16 idx);
void loadResourcesFromSave();
#endif
diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp
index 8dc72ed38e..b8603cd48c 100644
--- a/engines/cine/bg.cpp
+++ b/engines/cine/bg.cpp
@@ -24,19 +24,19 @@
#include "cine/cine.h"
-u16 bgVar0;
+uint16 bgVar0;
-void loadCtHigh(u8 * currentPtr) {
+void loadCtHigh(uint8 * currentPtr) {
currentPtr += 256 * 3;
memcpy(page3Raw, currentPtr, 320 * 200);
}
-u8 loadCt(const char *ctName) {
- u8 *ptr;
- u8 *currentPtr;
- u8 i;
- u16 header[0x20];
+uint8 loadCt(const char *ctName) {
+ uint8 *ptr;
+ uint8 *currentPtr;
+ uint8 i;
+ uint16 header[0x20];
///
@@ -45,7 +45,7 @@ u8 loadCt(const char *ctName) {
currentPtr = ptr = readBundleFile(findFileInBundle(ctName));
if (gameType == Cine::GID_OS) {
- if (*(u16 *) currentPtr == 0x800) // detect 256 color background
+ if (*(uint16 *) currentPtr == 0x800) // detect 256 color background
{
loadCtHigh(currentPtr + 2);
return 0;
@@ -83,11 +83,11 @@ void loadBgHigh(char *currentPtr) {
colorMode256 = 1;
}
-u8 loadBg(const char *bgName) {
- u8 *ptr;
- u8 *currentPtr;
- u8 i;
- u8 fileIdx;
+uint8 loadBg(const char *bgName) {
+ uint8 *ptr;
+ uint8 *currentPtr;
+ uint8 i;
+ uint8 fileIdx;
strcpy(currentBgName[0], bgName);
@@ -95,7 +95,7 @@ u8 loadBg(const char *bgName) {
currentPtr = ptr = readBundleFile(fileIdx);
- if (*(u16 *) currentPtr == 0x800) // detect 256 color background
+ if (*(uint16 *) currentPtr == 0x800) // detect 256 color background
{
loadBgHigh((char *)currentPtr + 2);
return 0;
@@ -121,15 +121,15 @@ u8 loadBg(const char *bgName) {
return 0;
}
-u8 *additionalBgTable[9] =
+uint8 *additionalBgTable[9] =
{ page2Raw, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page3Raw };
-u8 currentAdditionalBgIdx = 0;
-u8 currentAdditionalBgIdx2 = 0;
+uint8 currentAdditionalBgIdx = 0;
+uint8 currentAdditionalBgIdx2 = 0;
-void addBackground(char *bgName, u16 bgIdx) {
- u8 *ptr;
- u8 *currentPtr;
- u8 fileIdx;
+void addBackground(char *bgName, uint16 bgIdx) {
+ uint8 *ptr;
+ uint8 *currentPtr;
+ uint8 fileIdx;
strcpy(currentBgName[bgIdx], bgName);
@@ -137,9 +137,9 @@ void addBackground(char *bgName, u16 bgIdx) {
currentPtr = ptr = readBundleFile(fileIdx);
- additionalBgTable[bgIdx] = (u8 *) malloc(320 * 200);
+ additionalBgTable[bgIdx] = (uint8 *) malloc(320 * 200);
- if (*(u16 *) currentPtr == 0x800) // detect 256 color background
+ if (*(uint16 *) currentPtr == 0x800) // detect 256 color background
{
memcpy(additionalBgTable[bgIdx], currentPtr + 2 + 3 * 256,
320 * 200);
diff --git a/engines/cine/bg.h b/engines/cine/bg.h
index 26947131e2..4c3df9240d 100644
--- a/engines/cine/bg.h
+++ b/engines/cine/bg.h
@@ -25,15 +25,15 @@
#ifndef CINE_BG_H_
#define CINE_BG_H_
-u8 loadBg(const char *bgName);
-u8 loadCt(const char *bgName);
+uint8 loadBg(const char *bgName);
+uint8 loadCt(const char *bgName);
-extern u8 *additionalBgTable[9];
-extern u8 currentAdditionalBgIdx;
-extern u8 currentAdditionalBgIdx2;
+extern uint8 *additionalBgTable[9];
+extern uint8 currentAdditionalBgIdx;
+extern uint8 currentAdditionalBgIdx2;
-void addBackground(char *bgName, u16 bgIdx);
+void addBackground(char *bgName, uint16 bgIdx);
-extern u16 bgVar0;
+extern uint16 bgVar0;
#endif
diff --git a/engines/cine/bg_list.cpp b/engines/cine/bg_list.cpp
index 1d3dab6cb1..0a6ae4b84e 100644
--- a/engines/cine/bg_list.cpp
+++ b/engines/cine/bg_list.cpp
@@ -24,13 +24,13 @@
#include "cine/cine.h"
-void createVar9Element(s16 objIdx, s16 param);
+void createVar9Element(int16 objIdx, int16 param);
-void addSpriteFilledToBGList(s16 idx) {
- s16 x;
- s16 y;
- s16 width;
- s16 height;
+void addSpriteFilledToBGList(int16 idx) {
+ int16 x;
+ int16 y;
+ int16 width;
+ int16 height;
x = objectTable[idx].x;
y = objectTable[idx].y;
diff --git a/engines/cine/bg_list.h b/engines/cine/bg_list.h
index 9724d492ce..7022448041 100644
--- a/engines/cine/bg_list.h
+++ b/engines/cine/bg_list.h
@@ -25,6 +25,6 @@
#ifndef CINE_BGLIST_H_
#define CINE_BGLIST_H_
-void addSpriteFilledToBGList(s16 idx);
+void addSpriteFilledToBGList(int16 idx);
#endif
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index c941690dd2..02c637a0cf 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -186,11 +186,11 @@ int CineEngine::go() {
int gameType;
static void initialize() {
- u16 i;
+ uint16 i;
init_video();
- textDataPtr = (u8 *) malloc(8000);
+ textDataPtr = (uint8 *) malloc(8000);
partBuffer = (partBufferStruct *) malloc(255 * sizeof(animDataStruct));
diff --git a/engines/cine/cine.h b/engines/cine/cine.h
index 29c77ec8dd..54656f7934 100644
--- a/engines/cine/cine.h
+++ b/engines/cine/cine.h
@@ -67,14 +67,6 @@ public:
extern char *savePath;
-typedef unsigned char u8;
-typedef unsigned short int u16;
-typedef unsigned long int u32;
-
-typedef signed char s8;
-typedef signed short int s16;
-typedef signed long int s32;
-
#define ASSERT_PTR assert
#define ASSERT assert
diff --git a/engines/cine/flip_support.cpp b/engines/cine/flip_support.cpp
index decd04d057..27d6a9d985 100644
--- a/engines/cine/flip_support.cpp
+++ b/engines/cine/flip_support.cpp
@@ -24,34 +24,34 @@
#include "cine/cine.h"
-void flipU16(u16 * pVar) {
+void flipU16(uint16 * pVar) {
*pVar = (((*pVar) & 0xFF) << 8) | (((*pVar) & 0xFF00) >> 8);
}
-void flipU32(u32 * pVar) {
- u16 part1;
- u16 part2;
+void flipU32(uint32 * pVar) {
+ uint16 part1;
+ uint16 part2;
- part1 = (u16) ((*pVar) & 0xFFFF);
- part2 = (u16) (((*pVar) & 0xFFFF0000) >> 16);
+ part1 = (uint16) ((*pVar) & 0xFFFF);
+ part2 = (uint16) (((*pVar) & 0xFFFF0000) >> 16);
flipU16(&part1);
flipU16(&part2);
- *pVar = (part2) | ((u32) part1 << 16);
+ *pVar = (part2) | ((uint32) part1 << 16);
}
-u16 readU16LE(const void *ptr) {
- const u8 *b = (const u8 *)ptr;
+uint16 readU16LE(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
return (b[1] << 8) | b[0];
}
-u16 readU16BE(const void *ptr) {
- const u8 *b = (const u8 *)ptr;
+uint16 readU16BE(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
return (b[0] << 8) | b[1];
}
-u32 readU32BE(const void *ptr) {
- const u8 *b = (const u8 *)ptr;
+uint32 readU32BE(const void *ptr) {
+ const uint8 *b = (const uint8 *)ptr;
return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
}
diff --git a/engines/cine/flip_support.h b/engines/cine/flip_support.h
index 6f8e86b218..536e31f66b 100644
--- a/engines/cine/flip_support.h
+++ b/engines/cine/flip_support.h
@@ -25,10 +25,10 @@
#ifndef CINE_FLIPSUPPORT_H_
#define CINE_FLIPSUPPORT_H_
-void flipU16(u16 *);
-void flipU32(u32 *);
-u16 readU16LE(const void *ptr);
-u16 readU16BE(const void *ptr);
-u32 readU32BE(const void *ptr);
+void flipU16(uint16 *);
+void flipU32(uint32 *);
+uint16 readU16LE(const void *ptr);
+uint16 readU16BE(const void *ptr);
+uint32 readU32BE(const void *ptr);
#endif
diff --git a/engines/cine/font.h b/engines/cine/font.h
index 2228779aa2..a9af36fbf8 100644
--- a/engines/cine/font.h
+++ b/engines/cine/font.h
@@ -26,8 +26,8 @@
#define CINE_FONT_H_
struct characterEntry {
- u8 characterIdx;
- u8 characterWidth;
+ uint8 characterIdx;
+ uint8 characterWidth;
};
typedef struct characterEntry characterEntry;
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 6536964516..2052861661 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -26,16 +26,16 @@
byte *screenBuffer;
-u16 c_palette[256];
+uint16 c_palette[256];
unsigned char *page0;
unsigned char *page1;
unsigned char *page2;
unsigned char *page3;
-u8 page1Raw[320 * 200];
-u8 page2Raw[320 * 200];
-u8 page3Raw[320 * 200];
+uint8 page1Raw[320 * 200];
+uint8 page2Raw[320 * 200];
+uint8 page3Raw[320 * 200];
void init_video() {
screenBuffer = (byte *) malloc(320 * 200 * 3);
@@ -47,10 +47,10 @@ void init_video() {
page3 = (unsigned char *)malloc(0x8000);
}
-u16 transformColor(u16 baseColor, s8 r, s8 g, s8 b) {
- s8 oriR = (baseColor & 0x7);
- s8 oriG = (baseColor & 0x70) >> 4;
- s8 oriB = (baseColor & 0x700) >> 8;
+uint16 transformColor(uint16 baseColor, int8 r, int8 g, int8 b) {
+ int8 oriR = (baseColor & 0x7);
+ int8 oriG = (baseColor & 0x70) >> 4;
+ int8 oriB = (baseColor & 0x700) >> 8;
oriR += r;
oriG += g;
@@ -77,8 +77,8 @@ u16 transformColor(u16 baseColor, s8 r, s8 g, s8 b) {
return (oriR | (oriG << 4) | (oriB << 8));
}
-void transformPaletteRange(u8 startColor, u8 stopColor, s8 r, s8 g, s8 b) {
- u8 i;
+void transformPaletteRange(uint8 startColor, uint8 stopColor, int8 r, int8 g, int8 b) {
+ uint8 i;
for (i = startColor; i <= stopColor; i++) {
c_palette[i] = transformColor(tempPalette[i], b, g, r);
@@ -86,12 +86,12 @@ void transformPaletteRange(u8 startColor, u8 stopColor, s8 r, s8 g, s8 b) {
//gfxFlipPage(page2);
}
-void gfxFillSprite(u8 *spritePtr, u16 width, u16 height, u8 *page, s16 x, s16 y) {
- s16 i;
- s16 j;
+void gfxFillSprite(uint8 *spritePtr, uint16 width, uint16 height, uint8 *page, int16 x, int16 y) {
+ int16 i;
+ int16 j;
for (i = 0; i < height; i++) {
- u8 *destPtr = page + x + y * 320;
+ uint8 *destPtr = page + x + y * 320;
destPtr += i * 320;
for (j = 0; j < width * 8; j++) {
@@ -110,8 +110,8 @@ void gfxFillSprite(u8 *spritePtr, u16 width, u16 height, u8 *page, s16 x, s16 y)
}
}
-void gfxDrawLine(s16 x1, s16 y1, s16 x2, s16 y2, u8 color, u8 *page) {
- s16 t;
+void gfxDrawLine(int16 x1, int16 y1, int16 x2, int16 y2, uint8 color, uint8 *page) {
+ int16 t;
if (x1 == x2) {
if (y1 > y2) {
t = y1;
@@ -136,8 +136,8 @@ void gfxDrawLine(s16 x1, s16 y1, s16 x2, s16 y2, u8 color, u8 *page) {
}
-void gfxDrawPlainBoxRaw(s16 x1, s16 y1, s16 x2, s16 y2, u8 color, u8 *page) {
- s16 t;
+void gfxDrawPlainBoxRaw(int16 x1, int16 y1, int16 x2, int16 y2, uint8 color, uint8 *page) {
+ int16 t;
if (x1 > x2) {
t = x1;
@@ -162,8 +162,8 @@ void gfxDrawPlainBoxRaw(s16 x1, s16 y1, s16 x2, s16 y2, u8 color, u8 *page) {
}
}
-s16 gfxGetBit(s16 x, s16 y, u8 *ptr, s16 width) {
- u8 *ptrToData = (ptr) + y * width + x;
+int16 gfxGetBit(int16 x, int16 y, uint8 *ptr, int16 width) {
+ uint8 *ptrToData = (ptr) + y * width + x;
if (x > width) {
return 0;
@@ -176,13 +176,13 @@ s16 gfxGetBit(s16 x, s16 y, u8 *ptr, s16 width) {
return (1);
}
-void gfxResetRawPage(u8 *pageRaw) {
+void gfxResetRawPage(uint8 *pageRaw) {
memset(pageRaw, 0, 320 * 200);
}
-void gfxConvertSpriteToRaw(u8 *dest, u8 *source, u16 width, u16 height) {
+void gfxConvertSpriteToRaw(uint8 *dest, uint8 *source, uint16 width, uint16 height) {
int x, y;
- u8 b1, b2, b3, b4, b5, b6, b7, b8, d1a, d1b, d2a, d2b, d3a, d3b, d4a,
+ uint8 b1, b2, b3, b4, b5, b6, b7, b8, d1a, d1b, d2a, d2b, d3a, d3b, d4a,
d4b;
for (y = 0; y < height; y++) {
@@ -289,14 +289,14 @@ void gfxConvertSpriteToRaw(u8 *dest, u8 *source, u16 width, u16 height) {
}
}
-void gfxCopyRawPage(u8 *source, u8 *dest) {
+void gfxCopyRawPage(uint8 *source, uint8 *dest) {
memcpy(dest, source, 320 * 200);
}
-void gfxFlipRawPage(u8 *frontBuffer) {
- u8 *page = frontBuffer;
+void gfxFlipRawPage(uint8 *frontBuffer) {
+ uint8 *page = frontBuffer;
int x, y;
- u8 *pixels = (u8 *) screenBuffer;
+ uint8 *pixels = (uint8 *) screenBuffer;
byte c;
for (y = 0; y < 200; y++) {
@@ -340,13 +340,13 @@ void gfxFlipRawPage(u8 *frontBuffer) {
g_system->delayMillis(100);
}
-void drawSpriteRaw(u8 *spritePtr, u8 *maskPtr, s16 width, s16 height,
- u8 *page, s16 x, s16 y) {
- s16 i;
- s16 j;
+void drawSpriteRaw(uint8 *spritePtr, uint8 *maskPtr, int16 width, int16 height,
+ uint8 *page, int16 x, int16 y) {
+ int16 i;
+ int16 j;
for (i = 0; i < height; i++) {
- u8 *destPtr = page + x + y * 320;
+ uint8 *destPtr = page + x + y * 320;
destPtr += i * 320;
for (j = 0; j < width * 8; j++) {
@@ -364,13 +364,13 @@ void drawSpriteRaw(u8 *spritePtr, u8 *maskPtr, s16 width, s16 height,
}
}
-void drawSpriteRaw2(u8 *spritePtr, u8 transColor, s16 width, s16 height,
- u8 *page, s16 x, s16 y) {
- s16 i;
- s16 j;
+void drawSpriteRaw2(uint8 *spritePtr, uint8 transColor, int16 width, int16 height,
+ uint8 *page, int16 x, int16 y) {
+ int16 i;
+ int16 j;
for (i = 0; i < height; i++) {
- u8 *destPtr = page + x + y * 320;
+ uint8 *destPtr = page + x + y * 320;
destPtr += i * 320;
for (j = 0; j < width * 8; j++) {
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 2b465b24a5..29b645ca75 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -25,7 +25,7 @@
#ifndef CINE_GFX_H_
#define CINE_GFX_H_
-void gfxDrawSprite(u8 *src4, u16 sw, u16 sh, u8 *dst4, s16 sx, s16 sy);
+void gfxDrawSprite(uint8 *src4, uint16 sw, uint16 sh, uint8 *dst4, int16 sx, int16 sy);
extern unsigned char *page0;
extern unsigned char *page1;
@@ -34,38 +34,38 @@ extern unsigned char *page3;
void init_video();
-void convertGfx(u8 *source, u8 *dest, const u16 width, const u16 height);
-void convertGfx2(u8 *source, u8 *dest, const u16 width, const u16 height);
-void gfxCopyPage(u8 *source, u8 *dest);
+void convertGfx(uint8 *source, uint8 *dest, const uint16 width, const uint16 height);
+void convertGfx2(uint8 *source, uint8 *dest, const uint16 width, const uint16 height);
+void gfxCopyPage(uint8 *source, uint8 *dest);
-void transformPaletteRange(u8 startColor, u8 numColor, s8 r, s8 g, s8 b);
+void transformPaletteRange(uint8 startColor, uint8 numColor, int8 r, int8 g, int8 b);
void gfxFlipPage(void);
-void gfxSpriteFunc1(u8 *ptr, u16 width, u16 height, u8 *page, s16 x, s16 y);
-void gfxFillSprite(u8 *src4, u16 sw, u16 sh, u8 *dst4, s16 sx, s16 sy);
+void gfxSpriteFunc1(uint8 *ptr, uint16 width, uint16 height, uint8 *page, int16 x, int16 y);
+void gfxFillSprite(uint8 *src4, uint16 sw, uint16 sh, uint8 *dst4, int16 sx, int16 sy);
-void gfxSpriteFunc2(u8 *spritePtr, s16 width, s16 height, u8 *maskPtr,
- s16 maskWidth, s16 maskHeight, u8 *bufferPtr, s16 x, s16 y, u8 maskIdx);
+void gfxSpriteFunc2(uint8 *spritePtr, int16 width, int16 height, uint8 *maskPtr,
+ int16 maskWidth, int16 maskHeight, uint8 *bufferPtr, int16 x, int16 y, uint8 maskIdx);
-void gfxDrawLine(s16 x1, s16 y1, s16 x2, s16 y2, u8 color, u8 *page);
-void gfxDrawPlainBox(s16 x1, s16 y1, s16 x2, s16 y2, u8 color);
+void gfxDrawLine(int16 x1, int16 y1, int16 x2, int16 y2, uint8 color, uint8 *page);
+void gfxDrawPlainBox(int16 x1, int16 y1, int16 x2, int16 y2, uint8 color);
-void gfxResetPage(u8 *pagePtr);
+void gfxResetPage(uint8 *pagePtr);
-s16 gfxGetBit(s16 x, s16 y, u8 *ptr, s16 width);
+int16 gfxGetBit(int16 x, int16 y, uint8 *ptr, int16 width);
-extern u8 page1Raw[320 * 200];
-extern u8 page2Raw[320 * 200];
-extern u8 page3Raw[320 * 200];
+extern uint8 page1Raw[320 * 200];
+extern uint8 page2Raw[320 * 200];
+extern uint8 page3Raw[320 * 200];
-void gfxResetRawPage(u8 *pageRaw);
-void gfxConvertSpriteToRaw(u8 *dest, u8 *source, u16 width, u16 height);
-void gfxCopyRawPage(u8 *source, u8 * dest);
-void gfxFlipRawPage(u8 *frontBuffer);
-void drawSpriteRaw(u8 *spritePtr, u8 *maskPtr, s16 width, s16 height,
- u8 *page, s16 x, s16 y);
-void gfxDrawPlainBoxRaw(s16 x1, s16 y1, s16 x2, s16 y2, u8 color, u8 *page);
-void drawSpriteRaw2(u8 *spritePtr, u8 transColor, s16 width, s16 height,
- u8 *page, s16 x, s16 y);
+void gfxResetRawPage(uint8 *pageRaw);
+void gfxConvertSpriteToRaw(uint8 *dest, uint8 *source, uint16 width, uint16 height);
+void gfxCopyRawPage(uint8 *source, uint8 * dest);
+void gfxFlipRawPage(uint8 *frontBuffer);
+void drawSpriteRaw(uint8 *spritePtr, uint8 *maskPtr, int16 width, int16 height,
+ uint8 *page, int16 x, int16 y);
+void gfxDrawPlainBoxRaw(int16 x1, int16 y1, int16 x2, int16 y2, uint8 color, uint8 *page);
+void drawSpriteRaw2(uint8 *spritePtr, uint8 transColor, int16 width, int16 height,
+ uint8 *page, int16 x, int16 y);
#endif
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index f2c12a00a0..e7c1119444 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -26,11 +26,11 @@
mouseStatusStruct mouseData;
-u16 mouseRight = 0;
-u16 mouseLeft = 0;
+uint16 mouseRight = 0;
+uint16 mouseLeft = 0;
-u16 mouseUpdateStatus;
-u16 dummyU16;
+uint16 mouseUpdateStatus;
+uint16 dummyU16;
void manageEvents(void) {
OSystem::Event event;
@@ -62,7 +62,7 @@ void manageEvents(void) {
mouseRight = 0;
}
-void getMouseData(u16 param, u16 *pButton, u16 *pX, u16 *pY) {
+void getMouseData(uint16 param, uint16 *pButton, uint16 *pX, uint16 *pY) {
*pX = mouseData.X;
*pY = mouseData.Y;
@@ -78,11 +78,11 @@ void getMouseData(u16 param, u16 *pButton, u16 *pX, u16 *pY) {
}
void mainLoop(int bootScriptIdx) {
- u16 var_6;
- u16 var_2;
- u16 i;
+ uint16 var_6;
+ uint16 var_2;
+ uint16 i;
char *di;
- u16 mouseButton;
+ uint16 mouseButton;
closeEngine3();
resetMessageHead();
diff --git a/engines/cine/msg.cpp b/engines/cine/msg.cpp
index e500fd8816..2732ab09bb 100644
--- a/engines/cine/msg.cpp
+++ b/engines/cine/msg.cpp
@@ -24,11 +24,11 @@
#include "cine/cine.h"
-u16 msgVar0;
+uint16 msgVar0;
void loadMsg(char *pMsgName) {
- u16 i;
- u8 *ptr;
+ uint16 i;
+ uint8 *ptr;
checkDataDisk(-1);
@@ -50,14 +50,14 @@ void loadMsg(char *pMsgName) {
processPendingUpdates(1);
- msgVar0 = *(u16 *) ptr;
+ msgVar0 = *(uint16 *) ptr;
ptr += 2;
flipU16(&msgVar0);
ASSERT(msgVar0 <= NUM_MAX_MESSAGE);
for (i = 0; i < msgVar0; i++) {
- messageTable[i].len = *(u16 *) ptr;
+ messageTable[i].len = *(uint16 *) ptr;
ptr += 2;
flipU16(&messageTable[i].len);
}
@@ -65,7 +65,7 @@ void loadMsg(char *pMsgName) {
for (i = 0; i < msgVar0; i++) {
if (messageTable[i].len) {
messageTable[i].ptr =
- (u8 *) malloc(messageTable[i].len);
+ (uint8 *) malloc(messageTable[i].len);
ASSERT_PTR(messageTable[i].ptr);
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index 6f3a534b5d..606484ea33 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -25,7 +25,7 @@
#include "cine/cine.h"
objectStruct objectTable[NUM_MAX_OBJECT];
-u16 globalVars[NUM_MAX_OBJECTDATA];
+uint16 globalVars[NUM_MAX_OBJECTDATA];
overlayHeadElement overlayHead;
void unloadAllMasks(void) {
@@ -48,10 +48,10 @@ void resetMessageHead(void) {
}
void loadObject(char *pObjectName) {
- u16 numEntry;
- u16 entrySize;
- u16 i;
- u8 *ptr;
+ uint16 numEntry;
+ uint16 entrySize;
+ uint16 i;
+ uint8 *ptr;
checkDataDisk(-1);
@@ -59,11 +59,11 @@ void loadObject(char *pObjectName) {
processPendingUpdates(1);
- numEntry = *(u16 *) ptr;
+ numEntry = *(uint16 *) ptr;
ptr += 2;
flipU16(&numEntry);
- entrySize = *(u16 *) ptr;
+ entrySize = *(uint16 *) ptr;
ptr += 2;
flipU16(&entrySize);
@@ -75,11 +75,11 @@ void loadObject(char *pObjectName) {
{
memcpy(&objectTable[i], ptr, entrySize);
- flipU16((u16 *) & objectTable[i].x);
- flipU16((u16 *) & objectTable[i].y);
+ flipU16((uint16 *) & objectTable[i].x);
+ flipU16((uint16 *) & objectTable[i].y);
flipU16(&objectTable[i].mask);
- flipU16((u16 *) & objectTable[i].frame);
- flipU16((u16 *) & objectTable[i].costume);
+ flipU16((uint16 *) & objectTable[i].frame);
+ flipU16((uint16 *) & objectTable[i].costume);
flipU16(&objectTable[i].part);
}
@@ -93,7 +93,7 @@ void loadObject(char *pObjectName) {
}
}
-s8 removeOverlayElement(u16 objIdx, u16 param) {
+int8 removeOverlayElement(uint16 objIdx, uint16 param) {
overlayHeadElement *currentHeadPtr = &overlayHead;
overlayHeadElement *tempHead = currentHeadPtr;
overlayHeadElement *tempPtr2;
@@ -129,7 +129,7 @@ s8 removeOverlayElement(u16 objIdx, u16 param) {
return (0);
}
-s16 freeOverlay(u16 objIdx, u16 param) {
+int16 freeOverlay(uint16 objIdx, uint16 param) {
overlayHeadElement *currentHeadPtr = overlayHead.next;
overlayHeadElement *tempHead = &overlayHead;
overlayHeadElement *tempPtr2;
@@ -164,11 +164,11 @@ s16 freeOverlay(u16 objIdx, u16 param) {
return 0;
}
-void loadOverlayElement(u16 objIdx, u16 param) {
+void loadOverlayElement(uint16 objIdx, uint16 param) {
overlayHeadElement *currentHeadPtr = &overlayHead;
overlayHeadElement *pNewElement;
- u16 si = objectTable[objIdx].mask;
+ uint16 si = objectTable[objIdx].mask;
overlayHeadElement *tempHead = currentHeadPtr;
@@ -200,7 +200,7 @@ void loadOverlayElement(u16 objIdx, u16 param) {
currentHeadPtr->previous = pNewElement;
}
-void setupObject(u8 objIdx, u16 param1, u16 param2, u16 param3, u16 param4) {
+void setupObject(uint8 objIdx, uint16 param1, uint16 param2, uint16 param3, uint16 param4) {
objectTable[objIdx].x = param1;
objectTable[objIdx].y = param2;
objectTable[objIdx].mask = param3;
@@ -211,7 +211,7 @@ void setupObject(u8 objIdx, u16 param1, u16 param2, u16 param3, u16 param4) {
}
}
-void subObjectParam(u8 objIdx, u8 paramIdx, s16 newValue) {
+void subObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) {
ASSERT(objIdx <= NUM_MAX_OBJECT);
paramIdx--;
@@ -256,7 +256,7 @@ void subObjectParam(u8 objIdx, u8 paramIdx, s16 newValue) {
}
}
-void addObjectParam(u8 objIdx, u8 paramIdx, s16 newValue) {
+void addObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) {
ASSERT(objIdx <= NUM_MAX_OBJECT);
paramIdx--;
@@ -301,7 +301,7 @@ void addObjectParam(u8 objIdx, u8 paramIdx, s16 newValue) {
}
}
-void modifyObjectParam(u8 objIdx, u8 paramIdx, s16 newValue) {
+void modifyObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) {
ASSERT(objIdx <= NUM_MAX_OBJECT);
paramIdx--;
@@ -350,8 +350,8 @@ void modifyObjectParam(u8 objIdx, u8 paramIdx, s16 newValue) {
}
}
-u8 compareObjectParam(u8 objIdx, u8 param1, s16 param2) {
- u8 compareResult = 0;
+uint8 compareObjectParam(uint8 objIdx, uint8 param1, int16 param2) {
+ uint8 compareResult = 0;
switch (param1 - 1) {
case 0:
@@ -445,7 +445,7 @@ u8 compareObjectParam(u8 objIdx, u8 param1, s16 param2) {
return (compareResult);
}
-s16 getObjectParam(u16 objIdx, u16 paramIdx) {
+int16 getObjectParam(uint16 objIdx, uint16 paramIdx) {
ASSERT(objIdx <= NUM_MAX_OBJECT);
paramIdx--;
diff --git a/engines/cine/object.h b/engines/cine/object.h
index 061ce8253e..b6ab5d6750 100644
--- a/engines/cine/object.h
+++ b/engines/cine/object.h
@@ -26,24 +26,24 @@
#define CINE_OBJECT_H_
typedef struct {
- s16 x;
- s16 y;
- u16 mask;
- s16 frame;
- s16 costume;
+ int16 x;
+ int16 y;
+ uint16 mask;
+ int16 frame;
+ int16 costume;
char name[20];
- u16 part;
+ uint16 part;
} objectStruct;
struct overlayHeadElement {
struct overlayHeadElement *next;
struct overlayHeadElement *previous;
- u16 objIdx;
- u16 type;
- s16 x;
- s16 y;
- s16 var10;
- s16 var12;
+ uint16 objIdx;
+ uint16 type;
+ int16 x;
+ int16 y;
+ int16 var10;
+ int16 var12;
};
typedef struct overlayHeadElement overlayHeadElement;
@@ -52,7 +52,7 @@ typedef struct overlayHeadElement overlayHeadElement;
#define NUM_MAX_OBJECTDATA 255
extern objectStruct objectTable[NUM_MAX_OBJECT];
-extern u16 globalVars[NUM_MAX_OBJECTDATA];
+extern uint16 globalVars[NUM_MAX_OBJECTDATA];
extern overlayHeadElement overlayHead;
@@ -60,17 +60,17 @@ void unloadAllMasks(void);
void resetMessageHead(void);
void loadObject(char *pObjectName);
-void setupObject(u8 objIdx, u16 param1, u16 param2, u16 param3, u16 param4);
-void modifyObjectParam(u8 objIdx, u8 paramIdx, s16 newValue);
+void setupObject(uint8 objIdx, uint16 param1, uint16 param2, uint16 param3, uint16 param4);
+void modifyObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue);
-void loadOverlayElement(u16 objIdx, u16 param);
-s8 removeOverlayElement(u16 objIdx, u16 param);
+void loadOverlayElement(uint16 objIdx, uint16 param);
+int8 removeOverlayElement(uint16 objIdx, uint16 param);
-s16 getObjectParam(u16 objIdx, u16 paramIdx);
-s16 freeOverlay(u16 objIdx, u16 param);
+int16 getObjectParam(uint16 objIdx, uint16 paramIdx);
+int16 freeOverlay(uint16 objIdx, uint16 param);
-void addObjectParam(u8 objIdx, u8 paramIdx, s16 newValue);
-void subObjectParam(u8 objIdx, u8 paramIdx, s16 newValue);
-u8 compareObjectParam(u8 objIdx, u8 param1, s16 param2);
+void addObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue);
+void subObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue);
+uint8 compareObjectParam(uint8 objIdx, uint8 param1, int16 param2);
#endif
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index a6acb33ac4..45c5bf9c04 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -24,20 +24,20 @@
#include "cine/cine.h"
-u16 tempPalette[256];
+uint16 tempPalette[256];
-u8 colorMode256 = 0;
-u8 palette256[256 * 3];
+uint8 colorMode256 = 0;
+uint8 palette256[256 * 3];
-u16 palVar;
-u16 palVar0;
+uint16 palVar;
+uint16 palVar0;
Common::File palFileHandle;
palEntryStruct *palPtr;
-u8 paletteBuffer1[16];
-u8 paletteBuffer2[16];
+uint8 paletteBuffer1[16];
+uint8 paletteBuffer2[16];
void loadPal(const char *fileName) {
char buffer[20];
@@ -70,10 +70,10 @@ void loadPal(const char *fileName) {
palFileHandle.read(palPtr, palVar * palVar0);
}
-s16 findPaletteFromName(const char *fileName) {
+int16 findPaletteFromName(const char *fileName) {
char buffer[10];
- u16 position = 0;
- u16 i;
+ uint16 position = 0;
+ uint16 i;
strcpy(buffer, fileName);
@@ -97,8 +97,8 @@ s16 findPaletteFromName(const char *fileName) {
void loadRelatedPalette(const char *fileName) {
char localName[16];
- u8 i;
- s16 paletteIndex;
+ uint8 i;
+ int16 paletteIndex;
removeExtention(localName, fileName);
diff --git a/engines/cine/pal.h b/engines/cine/pal.h
index 75d20e7cde..360bb871e3 100644
--- a/engines/cine/pal.h
+++ b/engines/cine/pal.h
@@ -27,17 +27,17 @@
struct palEntryStruct {
char name[10];
- u8 pal1[16];
- u8 pal2[16];
+ uint8 pal1[16];
+ uint8 pal2[16];
};
typedef struct palEntryStruct palEntryStruct;
void loadPal(const char *fileName);
-extern u16 tempPalette[256];
-extern u8 colorMode256;
-extern u8 palette256[256 * 3];
+extern uint16 tempPalette[256];
+extern uint8 colorMode256;
+extern uint8 palette256[256 * 3];
void loadRelatedPalette(const char *fileName);
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index 70f4eae88b..5739eb42c4 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -24,14 +24,14 @@
#include "cine/cine.h"
-u16 numElementInPart;
-u16 partVar1;
+uint16 numElementInPart;
+uint16 partVar1;
animDataStruct animDataTable[NUM_MAX_PARTDATA];
partBufferStruct *partBuffer;
void loadPart(const char *partName) {
- u16 i;
+ uint16 i;
ASSERT(sizeof(partBufferStruct) == 0x1E);
@@ -77,7 +77,7 @@ void loadPart(const char *partName) {
loadPal(partName);
}
-void freePartEntry(u8 idx) {
+void freePartEntry(uint8 idx) {
if (animDataTable[idx].ptr1) {
//free(animDataTable[idx].ptr1);
@@ -91,8 +91,8 @@ void freePartEntry(u8 idx) {
}
}
-void freePartRange(u8 startIdx, u8 numIdx) {
- u8 i;
+void freePartRange(uint8 startIdx, uint8 numIdx) {
+ uint8 i;
for (i = 0; i < numIdx; i++) {
freePartEntry(i + startIdx);
@@ -156,11 +156,11 @@ const char *bundleNames[] = {
*/
};
-s16 findFileInBundle(const char *fileName) {
- u16 i;
+int16 findFileInBundle(const char *fileName) {
+ uint16 i;
if (gameType == Cine::GID_OS) {
- u16 j;
+ uint16 j;
for (i = 0; i < numElementInPart; i++) {
if (!strcmp(fileName, partBuffer[i].part_name)) {
@@ -187,7 +187,7 @@ s16 findFileInBundle(const char *fileName) {
return -1;
}
-void readFromPart(s16 idx, u8 *dataPtr) {
+void readFromPart(int16 idx, uint8 *dataPtr) {
processPendingUpdates(1);
partFileHandle.seek(partBuffer[idx].offset, SEEK_SET);
@@ -195,23 +195,23 @@ void readFromPart(s16 idx, u8 *dataPtr) {
partFileHandle.read(dataPtr, partBuffer[idx].packed_size);
}
-u8 *readBundleFile(s16 foundFileIdx) {
- u8 *dataPtr;
+uint8 *readBundleFile(int16 foundFileIdx) {
+ uint8 *dataPtr;
- dataPtr = (u8 *) malloc(partBuffer[foundFileIdx].unpacked_size + 2);
+ dataPtr = (uint8 *) malloc(partBuffer[foundFileIdx].unpacked_size + 2);
memset(dataPtr, 0, partBuffer[foundFileIdx].unpacked_size + 2);
if (partBuffer[foundFileIdx].unpacked_size !=
partBuffer[foundFileIdx].packed_size) {
- u8 *unpackBuffer;
- u16 realSize;
+ uint8 *unpackBuffer;
+ uint16 realSize;
unpackBuffer =
- (u8 *) malloc(partBuffer[foundFileIdx].packed_size + 500);
+ (uint8 *) malloc(partBuffer[foundFileIdx].packed_size + 500);
readFromPart(foundFileIdx, unpackBuffer);
realSize =
- *(u16 *) (unpackBuffer +
+ *(uint16 *) (unpackBuffer +
partBuffer[foundFileIdx].packed_size - 2);
flipU16(&realSize);
diff --git a/engines/cine/part.h b/engines/cine/part.h
index d5504f53e8..67a869b10c 100644
--- a/engines/cine/part.h
+++ b/engines/cine/part.h
@@ -27,23 +27,23 @@
typedef struct {
char part_name[10];
- u32 varA; /* unused */
- u32 offset;
- u32 packed_size;
- u32 unpacked_size;
- u32 var1A; /* unused */
+ uint32 varA; /* unused */
+ uint32 offset;
+ uint32 packed_size;
+ uint32 unpacked_size;
+ uint32 var1A; /* unused */
} partBufferStruct;
typedef struct {
- u16 width;
- u16 var1;
- u16 field_4;
- u16 var2;
+ uint16 width;
+ uint16 var1;
+ uint16 field_4;
+ uint16 var2;
- u8 *ptr1;
- u8 *ptr2;
- s16 fileIdx;
- s16 frameIdx;
+ uint8 *ptr1;
+ uint8 *ptr2;
+ int16 fileIdx;
+ int16 frameIdx;
char name[10];
} animDataStruct;
@@ -54,13 +54,13 @@ extern animDataStruct animDataTable[NUM_MAX_ANIMDATA];
extern partBufferStruct *partBuffer;
void loadPart(const char *partName);
-void freePartRange(u8 startIdx, u8 numIdx);
+void freePartRange(uint8 startIdx, uint8 numIdx);
void closePart(void);
-s16 findFileInBundle(const char *fileName);
+int16 findFileInBundle(const char *fileName);
-void readFromPart(s16 idx, u8 *dataPtr);
+void readFromPart(int16 idx, uint8 *dataPtr);
-u8 *readBundleFile(s16 foundFileIdx);
+uint8 *readBundleFile(int16 foundFileIdx);
#endif
diff --git a/engines/cine/prc.cpp b/engines/cine/prc.cpp
index d39d4cb163..418b065661 100644
--- a/engines/cine/prc.cpp
+++ b/engines/cine/prc.cpp
@@ -53,8 +53,8 @@ void freePrcLinkedList(void) {
}
void loadPrc(char *pPrcName) {
- u8 i;
- u16 numEntry;
+ uint8 i;
+ uint16 numEntry;
ASSERT_PTR(pPrcName);
@@ -88,7 +88,7 @@ void loadPrc(char *pPrcName) {
}
for (i = 0; i < numEntry; i++) {
- u16 size;
+ uint16 size;
size = scriptTable[i].var4;
@@ -105,26 +105,26 @@ void loadPrc(char *pPrcName) {
}
}
} else {
- u8 *ptr = readBundleFile(findFileInBundle(pPrcName));
+ uint8 *ptr = readBundleFile(findFileInBundle(pPrcName));
ASSERT_PTR(ptr);
processPendingUpdates(1);
- numEntry = *(u16 *) ptr;
+ numEntry = *(uint16 *) ptr;
ptr += 2;
flipU16(&numEntry);
ASSERT(numEntry <= NUM_MAX_SCRIPT);
for (i = 0; i < numEntry; i++) {
- scriptTable[i].var4 = *(u16 *) ptr;
+ scriptTable[i].var4 = *(uint16 *) ptr;
ptr += 2;
flipU16(&scriptTable[i].var4);
}
for (i = 0; i < numEntry; i++) {
- u16 size;
+ uint16 size;
size = scriptTable[i].var4;
diff --git a/engines/cine/prc.h b/engines/cine/prc.h
index 7a5eb7fec6..4345913e98 100644
--- a/engines/cine/prc.h
+++ b/engines/cine/prc.h
@@ -27,12 +27,12 @@
struct prcLinkedListStruct {
struct prcLinkedListStruct *next;
- s16 stack[SCRIPT_STACK_SIZE];
- s16 localVars[50];
- u16 compareResult;
- u16 scriptPosition;
+ int16 stack[SCRIPT_STACK_SIZE];
+ int16 localVars[50];
+ uint16 compareResult;
+ uint16 scriptPosition;
byte *scriptPtr;
- s16 scriptIdx;
+ int16 scriptIdx;
};
typedef struct prcLinkedListStruct prcLinkedListStruct;
diff --git a/engines/cine/rel.cpp b/engines/cine/rel.cpp
index a42d46f01a..f0a7a81821 100644
--- a/engines/cine/rel.cpp
+++ b/engines/cine/rel.cpp
@@ -50,9 +50,9 @@ void releaseObjectScripts(void) {
}
void loadRel(char *pRelName) {
- u16 numEntry;
- u16 i;
- u8 *ptr;
+ uint16 numEntry;
+ uint16 i;
+ uint8 *ptr;
checkDataDisk(-1);
@@ -72,26 +72,26 @@ void loadRel(char *pRelName) {
processPendingUpdates(1);
- numEntry = *(u16 *) ptr;
+ numEntry = *(uint16 *) ptr;
ptr += 2;
flipU16(&numEntry);
ASSERT(numEntry <= NUM_MAX_REL);
for (i = 0; i < numEntry; i++) {
- relTable[i].var4 = *(u16 *) ptr;
+ relTable[i].var4 = *(uint16 *) ptr;
ptr += 2;
flipU16(&relTable[i].var4);
- relTable[i].var6 = *(u16 *) ptr;
+ relTable[i].var6 = *(uint16 *) ptr;
ptr += 2;
flipU16(&relTable[i].var6);
- relTable[i].var8 = *(u16 *) ptr;
+ relTable[i].var8 = *(uint16 *) ptr;
ptr += 2;
flipU16(&relTable[i].var8);
- relTable[i].varA = *(u16 *) ptr;
+ relTable[i].varA = *(uint16 *) ptr;
ptr += 2;
flipU16(&relTable[i].varA);
}
@@ -110,8 +110,8 @@ void loadRel(char *pRelName) {
#ifdef DUMP_SCRIPTS_OBJ
{
- u16 i;
- u8 buffer[256];
+ uint16 i;
+ uint8 buffer[256];
for (i = 0; i < numEntry; i++) {
if (relTable[i].var4) {
diff --git a/engines/cine/rel.h b/engines/cine/rel.h
index 3a46c8bc9d..e2c155af3e 100644
--- a/engines/cine/rel.h
+++ b/engines/cine/rel.h
@@ -27,10 +27,10 @@
typedef struct relData {
char *ptr0;
- u16 var4;
- u16 var6;
- u16 var8;
- u16 varA;
+ uint16 var4;
+ uint16 var6;
+ uint16 var8;
+ uint16 varA;
} relStruct;
#define NUM_MAX_REL 255
diff --git a/engines/cine/resource.cpp b/engines/cine/resource.cpp
index aaa0ce31c4..452d5ab721 100644
--- a/engines/cine/resource.cpp
+++ b/engines/cine/resource.cpp
@@ -24,5 +24,5 @@
#include "cine/cine.h"
-void checkDataDisk(s16 param) {
+void checkDataDisk(int16 param) {
}
diff --git a/engines/cine/resource.h b/engines/cine/resource.h
index ad3fa1fd4c..45160e7a25 100644
--- a/engines/cine/resource.h
+++ b/engines/cine/resource.h
@@ -25,6 +25,6 @@
#ifndef CINE_RESOURCE_H_
#define CINE_RESOURCE_H_
-void checkDataDisk(s16 param);
+void checkDataDisk(int16 param);
#endif
diff --git a/engines/cine/script.cpp b/engines/cine/script.cpp
index 8764131073..386adfd82f 100644
--- a/engines/cine/script.cpp
+++ b/engines/cine/script.cpp
@@ -24,7 +24,7 @@
#include "cine/cine.h"
-void addGfxElementA0(s16 param1, s16 param2) {
+void addGfxElementA0(int16 param1, int16 param2) {
overlayHeadElement *currentHead = &overlayHead;
overlayHeadElement *tempHead = currentHead;
overlayHeadElement *newElement;
@@ -68,7 +68,7 @@ void addGfxElementA0(s16 param1, s16 param2) {
currentHead->previous = newElement;
}
-void removeSeq(u16 param1, u16 param2, u16 param3) {
+void removeSeq(uint16 param1, uint16 param2, uint16 param3) {
unkListElementStruct *currentHead = &unkList;
unkListElementStruct *tempHead = currentHead;
@@ -85,7 +85,7 @@ void removeSeq(u16 param1, u16 param2, u16 param3) {
}
}
-u16 isSeqRunning(u16 param1, u16 param2, u16 param3) {
+uint16 isSeqRunning(uint16 param1, uint16 param2, uint16 param3) {
unkListElementStruct *currentHead = &unkList;
unkListElementStruct *tempHead = currentHead;
@@ -106,15 +106,15 @@ u16 isSeqRunning(u16 param1, u16 param2, u16 param3) {
scriptStruct scriptTable[NUM_MAX_SCRIPT];
-void createVar9Element(s16 objIdx, s16 param) {
+void createVar9Element(int16 objIdx, int16 param) {
}
-void addToBGList(s16 objIdx) {
- s16 x;
- s16 y;
- s16 width;
- s16 height;
- s16 part;
+void addToBGList(int16 objIdx) {
+ int16 x;
+ int16 y;
+ int16 width;
+ int16 height;
+ int16 part;
x = objectTable[objIdx].x;
y = objectTable[objIdx].y;
@@ -136,7 +136,7 @@ void addToBGList(s16 objIdx) {
createVar9Element(objIdx, 0);
}
-void stopGlobalScript(u16 scriptIdx) {
+void stopGlobalScript(uint16 scriptIdx) {
prcLinkedListStruct *currentHead = &globalScriptsHead;
prcLinkedListStruct *tempHead = currentHead;
@@ -158,13 +158,13 @@ void stopGlobalScript(u16 scriptIdx) {
currentHead->scriptIdx = -1;
}
-u16 computeScriptStackSub(u8 mode, byte *scriptPtr, s16 *stackPtr,
- u16 scriptSize, u8 param1, u16 startOffset) {
+uint16 computeScriptStackSub(uint8 mode, byte *scriptPtr, int16 *stackPtr,
+ uint16 scriptSize, uint8 param1, uint16 startOffset) {
byte *localScriptPtr = scriptPtr;
- u16 exitScript;
- u16 i;
- u16 position;
- u16 di;
+ uint16 exitScript;
+ uint16 i;
+ uint16 position;
+ uint16 di;
ASSERT_PTR(scriptPtr);
ASSERT_PTR(stackPtr);
@@ -182,7 +182,7 @@ u16 computeScriptStackSub(u8 mode, byte *scriptPtr, s16 *stackPtr,
exitScript = 0;
do {
- u16 opcode = *(localScriptPtr + position);
+ uint16 opcode = *(localScriptPtr + position);
position++;
//printf("Opcode: %X\n",opcode-1);
@@ -248,7 +248,7 @@ u16 computeScriptStackSub(u8 mode, byte *scriptPtr, s16 *stackPtr,
case 0x52:
case 0x53:
{
- u8 param;
+ uint8 param;
position++;
param = *(localScriptPtr + position);
@@ -263,7 +263,7 @@ u16 computeScriptStackSub(u8 mode, byte *scriptPtr, s16 *stackPtr,
}
case 0x9E:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -418,19 +418,19 @@ u16 computeScriptStackSub(u8 mode, byte *scriptPtr, s16 *stackPtr,
return (position);
}
-void computeScriptStack(byte *scriptPtr, s16 *stackPtr, u16 scriptSize) {
+void computeScriptStack(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize) {
computeScriptStackSub(1, scriptPtr, stackPtr, scriptSize, 0, 0);
}
-u16 computeScriptStackFromScript(byte *scriptPtr, u16 currentPosition,
- u16 labelIdx, u16 scriptSize) {
- return computeScriptStackSub(0, scriptPtr, (s16 *) & dummyU16,
- (u16) scriptSize, labelIdx, currentPosition);
+uint16 computeScriptStackFromScript(byte *scriptPtr, uint16 currentPosition,
+ uint16 labelIdx, uint16 scriptSize) {
+ return computeScriptStackSub(0, scriptPtr, (int16 *) & dummyU16,
+ (uint16) scriptSize, labelIdx, currentPosition);
}
-void palRotate(u8 var1, u8 var2, u8 var3) {
- s16 i;
- u16 currentColor;
+void palRotate(uint8 var1, uint8 var2, uint8 var3) {
+ int16 i;
+ uint16 currentColor;
if (var3 == 1) {
currentColor = c_palette[var2];
@@ -443,8 +443,8 @@ void palRotate(u8 var1, u8 var2, u8 var3) {
}
}
-void addScriptToList0(u16 idx) {
- u16 i;
+void addScriptToList0(uint16 idx) {
+ uint16 i;
prcLinkedListStruct *pNewElement;
prcLinkedListStruct *currentHead = &globalScriptsHead;
prcLinkedListStruct *tempHead = currentHead;
@@ -501,7 +501,7 @@ void debugScriptInline(int currentLine, const char *string, ...) {
}
#endif
-s16 endScript0(u16 scriptIdx) {
+int16 endScript0(uint16 scriptIdx) {
prcLinkedListStruct *currentHead = &globalScriptsHead;
prcLinkedListStruct *tempHead = currentHead;
@@ -528,7 +528,7 @@ s16 endScript0(u16 scriptIdx) {
return (0);
}
-s16 endScript1(u16 scriptIdx) {
+int16 endScript1(uint16 scriptIdx) {
prcLinkedListStruct *currentHead = &objScriptList;
prcLinkedListStruct *tempHead = currentHead;
@@ -553,9 +553,9 @@ s16 endScript1(u16 scriptIdx) {
return (0);
}
-s16 getZoneFromPosition(u8 *page, s16 x, s16 y, s16 width) {
- u8 *ptr = page + (y * width) + x / 2;
- u8 zoneVar;
+int16 getZoneFromPosition(uint8 *page, int16 x, int16 y, int16 width) {
+ uint8 *ptr = page + (y * width) + x / 2;
+ uint8 zoneVar;
if (!(x % 2)) {
zoneVar = (*(ptr) >> 4) & 0xF;
@@ -566,25 +566,25 @@ s16 getZoneFromPosition(u8 *page, s16 x, s16 y, s16 width) {
return (zoneVar);
}
-s16 getZoneFromPositionRaw(u8 *page, s16 x, s16 y, s16 width) {
- u8 *ptr = page + (y * width) + x;
- u8 zoneVar;
+int16 getZoneFromPositionRaw(uint8 *page, int16 x, int16 y, int16 width) {
+ uint8 *ptr = page + (y * width) + x;
+ uint8 zoneVar;
zoneVar = (*(ptr)) & 0xF;
return (zoneVar);
}
-s16 checkCollision(s16 objIdx, s16 x, s16 y, s16 numZones, s16 zoneIdx) {
- s16 i;
- s16 lx;
- s16 ly;
+int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneIdx) {
+ int16 i;
+ int16 lx;
+ int16 ly;
lx = objectTable[objIdx].x + x;
ly = objectTable[objIdx].y + y;
for (i = 0; i < numZones; i++) {
- s16 idx;
+ int16 idx;
// if(gameType == GAME_OS)
{
@@ -606,8 +606,8 @@ s16 checkCollision(s16 objIdx, s16 x, s16 y, s16 numZones, s16 zoneIdx) {
return 0;
}
-u16 compareVars(s16 var1, s16 var2) {
- u16 flag = 0;
+uint16 compareVars(int16 var1, int16 var2) {
+ uint16 flag = 0;
if (var1 == var2) {
flag |= 1;
@@ -624,10 +624,10 @@ u16 compareVars(s16 var1, s16 var2) {
return flag;
}
-void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
+void executeScript(prcLinkedListStruct *scriptElement, uint16 param) {
byte *currentScriptPtr;
- u16 closeScript;
- u16 currentPosition;
+ uint16 closeScript;
+ uint16 currentPosition;
ASSERT_PTR(scriptElement);
@@ -643,8 +643,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
closeScript = 0;
while (!closeScript) {
- u16 currentLine;
- u16 opcode;
+ uint16 currentLine;
+ uint16 opcode;
currentLine = currentPosition;
@@ -660,9 +660,9 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x0: //OP_modifyObjectParam
{
- u8 objIdx;
- u8 paramIdx;
- s16 newValue;
+ uint8 objIdx;
+ uint8 paramIdx;
+ int16 newValue;
objIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -672,10 +672,10 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
newValue =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & newValue);
+ flipU16((uint16 *) & newValue);
DEBUG_SCRIPT(currentLine,
"modifyObjectParam(objIdx:%d,paramIdx:%d,newValue:%d)",
@@ -687,9 +687,9 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x1: //OP_getObjectParam
{
- u8 objIdx;
- u8 paramIdx;
- u8 newValue;
+ uint8 objIdx;
+ uint8 paramIdx;
+ uint8 newValue;
objIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -713,9 +713,9 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x2:
{
- u8 objIdx;
- u8 paramIdx;
- s16 newValue;
+ uint8 objIdx;
+ uint8 paramIdx;
+ int16 newValue;
objIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -725,10 +725,10 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
newValue =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & newValue);
+ flipU16((uint16 *) & newValue);
DEBUG_SCRIPT(currentLine,
"addObjectParam(objIdx:%d,paramIdx:%d,newValue:%d)",
@@ -740,9 +740,9 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x3:
{
- u8 objIdx;
- u8 paramIdx;
- s16 newValue;
+ uint8 objIdx;
+ uint8 paramIdx;
+ int16 newValue;
objIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -752,10 +752,10 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
newValue =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & newValue);
+ flipU16((uint16 *) & newValue);
DEBUG_SCRIPT(currentLine,
"subObjectParam(objIdx:%d,paramIdx:%d,newValue:%d)",
@@ -767,9 +767,9 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x6:
{
- u8 objIdx;
- u8 param1;
- s16 param2;
+ uint8 objIdx;
+ uint8 param1;
+ int16 param2;
objIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -778,10 +778,10 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param2);
+ flipU16((uint16 *) & param2);
DEBUG_SCRIPT(currentLine,
"compareObjectParam(objIdx:%d,type:%d,value:%d)",
@@ -794,38 +794,38 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x7:
{
- u8 objIdx;
- s16 param1;
- s16 param2;
- s16 param3;
- s16 param4;
+ uint8 objIdx;
+ int16 param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
objIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
param1 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param1);
+ flipU16((uint16 *) & param1);
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param2);
+ flipU16((uint16 *) & param2);
param3 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param3);
+ flipU16((uint16 *) & param3);
param4 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param4);
+ flipU16((uint16 *) & param4);
DEBUG_SCRIPT(currentLine,
"setupObject(objIdx:%d,%d,%d,%d,%d)",
@@ -838,38 +838,38 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x8:
{
- u8 objIdx;
- s16 param1;
- s16 param2;
- s16 param3;
- s16 param4;
+ uint8 objIdx;
+ int16 param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
objIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
param1 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param1);
+ flipU16((uint16 *) & param1);
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param2);
+ flipU16((uint16 *) & param2);
param3 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param3);
+ flipU16((uint16 *) & param3);
param4 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param4);
+ flipU16((uint16 *) & param4);
DEBUG_SCRIPT(currentLine,
"checkCollision(objIdx:%d,%d,%d,%d,%d)",
@@ -883,8 +883,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x9: // OP_loadVar
{
- u8 varIdx;
- u8 varType;
+ uint8 varIdx;
+ uint8 varType;
varIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -894,7 +894,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
if (varType) {
- u8 dataIdx;
+ uint8 dataIdx;
dataIdx =
*(currentScriptPtr +
@@ -928,7 +928,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 3:
{
- s16 var;
+ int16 var;
DEBUG_SCRIPT
(currentLine,
@@ -937,8 +937,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
getMouseData
(mouseUpdateStatus,
&dummyU16,
- (u16 *) & var,
- (u16 *) &
+ (uint16 *) & var,
+ (uint16 *) &
dummyU16);
scriptElement->
localVars[varIdx] =
@@ -947,7 +947,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 4:
{
- s16 var;
+ int16 var;
DEBUG_SCRIPT
(currentLine,
@@ -956,8 +956,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
getMouseData
(mouseUpdateStatus,
&dummyU16,
- (u16 *) & dummyU16,
- (u16 *) & var);
+ (uint16 *) & dummyU16,
+ (uint16 *) & var);
scriptElement->
localVars[varIdx] =
var;
@@ -1006,13 +1006,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
}
} else {
- s16 newData;
+ int16 newData;
newData =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & newData);
+ flipU16((uint16 *) & newData);
DEBUG_SCRIPT(currentLine,
"var[%d] = %d", varIdx, newData);
@@ -1024,8 +1024,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0xA: // OP_addVar
{
- u8 param1;
- u8 type;
+ uint8 param1;
+ uint8 type;
param1 = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1034,7 +1034,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
if (type) {
- u8 param2;
+ uint8 param2;
param2 =
*(currentScriptPtr +
@@ -1048,13 +1048,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
scriptElement->localVars[param1] +=
scriptElement->localVars[param2];
} else {
- s16 param2;
+ int16 param2;
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param2);
+ flipU16((uint16 *) & param2);
DEBUG_SCRIPT(currentLine,
"var[%d] += %d", param1, param2);
@@ -1067,8 +1067,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0xB: // OP_subVar
{
- u8 param1;
- u8 type;
+ uint8 param1;
+ uint8 type;
param1 = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1077,7 +1077,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
if (type) {
- u8 param2;
+ uint8 param2;
param2 =
*(currentScriptPtr +
@@ -1092,13 +1092,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
scriptElement->localVars[param1] -
scriptElement->localVars[param2];
} else {
- s16 param2;
+ int16 param2;
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param2);
+ flipU16((uint16 *) & param2);
DEBUG_SCRIPT(currentLine,
"var[%d] -= %d", param1, param2);
@@ -1112,8 +1112,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0xC: // OP_mulVar
{
- u8 param1;
- u8 type;
+ uint8 param1;
+ uint8 type;
param1 = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1122,7 +1122,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
if (type) {
- u8 param2;
+ uint8 param2;
param2 =
*(currentScriptPtr +
@@ -1137,13 +1137,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
scriptElement->localVars[param1] *
scriptElement->localVars[param2];
} else {
- s16 param2;
+ int16 param2;
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param2);
+ flipU16((uint16 *) & param2);
DEBUG_SCRIPT(currentLine,
"var[%d] *= %d", param1, param2);
@@ -1157,8 +1157,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0xD: // OP_modVar
{
- u8 param1;
- u8 type;
+ uint8 param1;
+ uint8 type;
param1 = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1167,7 +1167,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
if (type) {
- u8 param2;
+ uint8 param2;
param2 =
*(currentScriptPtr +
@@ -1182,13 +1182,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
scriptElement->localVars[param1] /
scriptElement->localVars[param2];
} else {
- s16 param2;
+ int16 param2;
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & param2);
+ flipU16((uint16 *) & param2);
DEBUG_SCRIPT(currentLine,
"var[%d] /= %d", param1, param2);
@@ -1202,8 +1202,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0xE: // OP_ compareVar
{
- u8 varIdx;
- u8 varType;
+ uint8 varIdx;
+ uint8 varType;
varIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1213,7 +1213,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
if (varType) {
- u8 value;
+ uint8 value;
value =
*(currentScriptPtr +
@@ -1249,13 +1249,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
globalVars[value]);
}
} else {
- s16 value;
+ int16 value;
value =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & value);
+ flipU16((uint16 *) & value);
DEBUG_SCRIPT(currentLine,
"compare var[%d] and %d", varIdx,
@@ -1270,9 +1270,9 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0xF: //OP_modifyObjectParam2
{
- u8 objIdx;
- u8 paramIdx;
- u8 newValue;
+ uint8 objIdx;
+ uint8 paramIdx;
+ uint8 newValue;
objIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1296,7 +1296,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x13: // OP_loadV7Element
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1310,7 +1310,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x14:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1324,7 +1324,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x15:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1338,7 +1338,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x16:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1352,7 +1352,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x17:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1366,7 +1366,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x18:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1380,7 +1380,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x19:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1394,7 +1394,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x1A:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1414,7 +1414,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x1D: // OP_label
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -1430,7 +1430,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x1E: // OP_goto
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -1448,7 +1448,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x1F: // OP_gotoIfSup
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -1471,7 +1471,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x20: // OP_gotoIfSupEqu
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -1495,7 +1495,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x21: // OP_gotoIfInf
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -1518,7 +1518,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x22: // OP_gotoIfInfEqu
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -1542,7 +1542,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x23: // OP_gotoIfEqu
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -1565,7 +1565,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x24: // OP_gotoIfDiff
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -1588,8 +1588,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x26: // loop
{
- u8 varIdx;
- u8 labelIdx;
+ uint8 varIdx;
+ uint8 labelIdx;
varIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1618,7 +1618,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x31: // OP_startScript
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1633,7 +1633,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x32:
{
- u8 scriptIdx;
+ uint8 scriptIdx;
scriptIdx =
*(currentScriptPtr + currentPosition);
@@ -1716,7 +1716,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x41: // OP_loadData
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1787,7 +1787,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
// TODO: use real code
memcpy(c_palette, tempPalette,
- sizeof(u16) * 16);
+ sizeof(uint16) * 16);
drawOverlays();
flip();
@@ -1802,11 +1802,11 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x47:
{
- u8 startColor;
- u8 numColor;
- u16 r;
- u16 g;
- u16 b;
+ uint8 startColor;
+ uint8 numColor;
+ uint16 r;
+ uint16 g;
+ uint16 b;
startColor =
*(currentScriptPtr + currentPosition);
@@ -1816,17 +1816,17 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
*(currentScriptPtr + currentPosition);
currentPosition++;
- r = *(s16 *) (currentScriptPtr +
+ r = *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&r);
- g = *(s16 *) (currentScriptPtr +
+ g = *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&g);
- b = *(s16 *) (currentScriptPtr +
+ b = *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&b);
@@ -1842,9 +1842,9 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x4A:
{
- u8 var1;
- u8 var2;
- u8 var3;
+ uint8 var1;
+ uint8 var2;
+ uint8 var3;
var1 = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1898,35 +1898,35 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x51:
{
- u8 param1;
- u16 param2;
- u16 param3;
- u16 param4;
- u16 param5;
+ uint8 param1;
+ uint16 param2;
+ uint16 param3;
+ uint16 param4;
+ uint16 param5;
param1 = *(currentScriptPtr + currentPosition);
currentPosition++;
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&param2);
param3 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&param3);
param4 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&param4);
param5 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&param5);
@@ -1942,8 +1942,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x52: // OP_loadGlobalVar
{
- u8 idx;
- u8 type;
+ uint8 idx;
+ uint8 type;
idx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -1952,7 +1952,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
if (type) {
- u8 idx2;
+ uint8 idx2;
idx2 =
*(currentScriptPtr +
@@ -1976,10 +1976,10 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
globalVars[idx2];
}
} else {
- u16 newData;
+ uint16 newData;
newData =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&newData);
@@ -1995,8 +1995,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x53: // OP_compareGlobalVar
{
- u8 idx;
- u8 type;
+ uint8 idx;
+ uint8 type;
idx = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2005,7 +2005,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
if (type) {
- u8 var2;
+ uint8 var2;
var2 =
*(currentScriptPtr +
@@ -2020,10 +2020,10 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
compareVars(globalVars[idx],
scriptElement->localVars[var2]);
} else {
- u16 newData;
+ uint16 newData;
newData =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&newData);
@@ -2057,8 +2057,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x5A:
{
- u8 startIdx;
- u8 numIdx;
+ uint8 startIdx;
+ uint8 numIdx;
startIdx =
*(currentScriptPtr + currentPosition);
@@ -2087,7 +2087,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x65:
{
- u8 i;
+ uint8 i;
DEBUG_SCRIPT(currentLine,
"initializeZoneData()");
@@ -2100,15 +2100,15 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x66:
{
- u8 zoneIdx;
- u16 var;
+ uint8 zoneIdx;
+ uint16 var;
zoneIdx =
*(currentScriptPtr + currentPosition);
currentPosition++;
var =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&var);
@@ -2150,7 +2150,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x6B: // OP_changeDataDisk
{
- u8 newDisk;
+ uint8 newDisk;
newDisk =
*(currentScriptPtr + currentPosition);
@@ -2196,9 +2196,9 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
case 0x78:
{
DEBUG_SCRIPT(currentLine, "playSample()");
- u8 anim, channel;
- s16 volume;
- u16 flag;
+ uint8 anim, channel;
+ int16 volume;
+ uint16 flag;
anim = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2215,13 +2215,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
volume =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
- flipU16((u16 *) & volume);
+ flipU16((uint16 *) & volume);
flag =
- *(u16 *) (currentScriptPtr +
+ *(uint16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&flag);
@@ -2260,7 +2260,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x7A:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2274,7 +2274,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x7B:
{
- u8 param;
+ uint8 param;
param = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2288,13 +2288,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x7F:
{
- u8 param1;
- u8 param2;
- u8 param3;
- u8 param4;
- u16 param5;
- u16 param6;
- u16 param7;
+ uint8 param1;
+ uint8 param2;
+ uint8 param3;
+ uint8 param4;
+ uint16 param5;
+ uint16 param6;
+ uint16 param7;
param1 = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2309,17 +2309,17 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
currentPosition++;
param5 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
param6 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
param7 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
@@ -2339,8 +2339,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x80:
{
- u8 var1;
- u8 var2;
+ uint8 var1;
+ uint8 var2;
var1 = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2357,8 +2357,8 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x83:
{
- u8 var1;
- u8 var2;
+ uint8 var1;
+ uint8 var2;
var1 = *(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2378,7 +2378,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x84: // OP_gotoIfSup nearest
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -2407,7 +2407,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x85: // OP_gotoIfSupEqu nearest
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -2436,7 +2436,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x86: // OP_gotoIfInf nearest
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -2465,7 +2465,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x87: // OP_gotoIfInfEqu nearest
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -2494,7 +2494,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x88: // OP_gotoIfEqu nearest
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -2522,7 +2522,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x89: // OP_gotoIfDiff nearest
{
- u8 labelIdx;
+ uint8 labelIdx;
labelIdx =
*(currentScriptPtr + currentPosition);
@@ -2550,7 +2550,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x8B:
{
- u8 temp =
+ uint8 temp =
*(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2563,7 +2563,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x8C:
{
- u8 temp =
+ uint8 temp =
*(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2576,7 +2576,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x8E:
{
- u8 temp =
+ uint8 temp =
*(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2594,7 +2594,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x8F:
{
- u8 temp =
+ uint8 temp =
*(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2621,7 +2621,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x90:
{
- u8 temp =
+ uint8 temp =
*(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2639,7 +2639,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x91:
{
- u8 temp =
+ uint8 temp =
*(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2658,7 +2658,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x9D:
{
- u8 temp =
+ uint8 temp =
*(currentScriptPtr + currentPosition);
currentPosition++;
@@ -2674,13 +2674,13 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0x9E:
{
- u8 type;
+ uint8 type;
type = *(currentScriptPtr + currentPosition);
currentPosition++;
if (type) {
- u8 param2;
+ uint8 param2;
param2 =
*(currentScriptPtr +
@@ -2694,10 +2694,10 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
additionalBgVScroll =
scriptElement->localVars[param2];
} else {
- u16 param2;
+ uint16 param2;
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&param2);
@@ -2713,17 +2713,17 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
case 0xA0:
{
- u16 param1;
- u16 param2;
+ uint16 param1;
+ uint16 param2;
param1 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&param1);
param2 =
- *(s16 *) (currentScriptPtr +
+ *(int16 *) (currentScriptPtr +
currentPosition);
currentPosition += 2;
flipU16(&param2);
@@ -2796,15 +2796,15 @@ void purgeList0(void)
#ifdef DUMP_SCRIPTS
-u8 decompileBuffer[10000][1000];
-u16 decompileBufferPosition = 0;
+uint8 decompileBuffer[10000][1000];
+uint16 decompileBufferPosition = 0;
-u8 bufferDec[256];
+uint8 bufferDec[256];
-u8 compareString1[256];
-u8 compareString2[256];
+uint8 compareString1[256];
+uint8 compareString2[256];
-u8 *getObjPramName(u8 paramIdx) {
+uint8 *getObjPramName(uint8 paramIdx) {
switch (paramIdx) {
case 1:
{
@@ -2838,12 +2838,12 @@ u8 *getObjPramName(u8 paramIdx) {
}
}
-void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
- u16 scriptIdx) {
- u8 lineBuffer[256];
- u8 *localScriptPtr = scriptPtr;
- u16 exitScript;
- u32 position = 0;
+void decompileScript(uint8 *scriptPtr, int16 *stackPtr, uint16 scriptSize,
+ uint16 scriptIdx) {
+ uint8 lineBuffer[256];
+ uint8 *localScriptPtr = scriptPtr;
+ uint16 exitScript;
+ uint32 position = 0;
ASSERT_PTR(scriptPtr);
// ASSERT_PTR(stackPtr);
@@ -2854,7 +2854,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
"--------- SCRIPT %d ---------\n", scriptIdx);
do {
- u16 opcode = *(localScriptPtr + position);
+ uint16 opcode = *(localScriptPtr + position);
position++;
if (position == scriptSize) {
@@ -2872,9 +2872,9 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x0:
{
- u8 param1;
- u8 param2;
- s16 param3;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
param1 = *(localScriptPtr + position);
position++;
@@ -2882,7 +2882,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -2894,9 +2894,9 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x1:
{
- u8 param1;
- u8 param2;
- u8 param3;
+ uint8 param1;
+ uint8 param2;
+ uint8 param3;
param1 = *(localScriptPtr + position);
position++;
@@ -2913,9 +2913,9 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x2:
{
- u8 param1;
- u8 param2;
- s16 param3;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
param1 = *(localScriptPtr + position);
position++;
@@ -2923,7 +2923,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -2935,9 +2935,9 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x3:
{
- u8 param1;
- u8 param2;
- s16 param3;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
param1 = *(localScriptPtr + position);
position++;
@@ -2945,7 +2945,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -2957,9 +2957,9 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x4:
{
- u8 param1;
- u8 param2;
- s16 param3;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
param1 = *(localScriptPtr + position);
position++;
@@ -2967,7 +2967,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -2980,9 +2980,9 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x5:
{
- u8 param1;
- u8 param2;
- s16 param3;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
param1 = *(localScriptPtr + position);
position++;
@@ -2990,7 +2990,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -3003,9 +3003,9 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x6:
{
- u8 param1;
- u8 param2;
- s16 param3;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
param1 = *(localScriptPtr + position);
position++;
@@ -3013,7 +3013,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -3026,25 +3026,25 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x7:
{
- u8 param1;
- s16 param2;
- s16 param3;
- s16 param4;
- s16 param5;
+ uint8 param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
param1 = *(localScriptPtr + position);
position++;
- param2 = *(s16 *) (localScriptPtr + position);
+ param2 = *(int16 *) (localScriptPtr + position);
position += 2;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
- param4 = *(s16 *) (localScriptPtr + position);
+ param4 = *(int16 *) (localScriptPtr + position);
position += 2;
- param5 = *(s16 *) (localScriptPtr + position);
+ param5 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param2);
@@ -3060,25 +3060,25 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x8:
{
- u8 param1;
- s16 param2;
- s16 param3;
- s16 param4;
- s16 param5;
+ uint8 param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
param1 = *(localScriptPtr + position);
position++;
- param2 = *(s16 *) (localScriptPtr + position);
+ param2 = *(int16 *) (localScriptPtr + position);
position += 2;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
- param4 = *(s16 *) (localScriptPtr + position);
+ param4 = *(int16 *) (localScriptPtr + position);
position += 2;
- param5 = *(s16 *) (localScriptPtr + position);
+ param5 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param2);
@@ -3094,8 +3094,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x9:
{
- u8 param1;
- s16 param2;
+ uint8 param1;
+ int16 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3104,7 +3104,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
position++;
if (param2) {
- u8 param3;
+ uint8 param3;
param3 = *(localScriptPtr + position);
position++;
@@ -3133,10 +3133,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
ASSERT(0);
}
} else {
- s16 param3;
+ int16 param3;
param3 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
@@ -3150,8 +3150,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0xA:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3160,7 +3160,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
position++;
if (param2) {
- u8 param3;
+ uint8 param3;
param3 = *(localScriptPtr + position);
position++;
@@ -3169,10 +3169,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
"var[%d]+=var[%d]\n", param1,
param3);
} else {
- s16 param3;
+ int16 param3;
param3 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
@@ -3185,8 +3185,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0xB:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3195,7 +3195,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
position++;
if (param2) {
- u8 param3;
+ uint8 param3;
param3 = *(localScriptPtr + position);
position++;
@@ -3204,10 +3204,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
"var[%d]-=var[%d]\n", param1,
param3);
} else {
- s16 param3;
+ int16 param3;
param3 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
@@ -3220,8 +3220,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0xC:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3230,7 +3230,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
position++;
if (param2) {
- u8 param3;
+ uint8 param3;
param3 = *(localScriptPtr + position);
position++;
@@ -3239,10 +3239,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
"var[%d]*=var[%d]\n", param1,
param3);
} else {
- s16 param3;
+ int16 param3;
param3 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
@@ -3255,8 +3255,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0xD:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3265,7 +3265,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
position++;
if (param2) {
- u8 param3;
+ uint8 param3;
param3 = *(localScriptPtr + position);
position++;
@@ -3274,10 +3274,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
"var[%d]/=var[%d]\n", param1,
param3);
} else {
- s16 param3;
+ int16 param3;
param3 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
@@ -3290,8 +3290,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0xE:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3300,7 +3300,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
position++;
if (param2) {
- u8 param3;
+ uint8 param3;
param3 = *(localScriptPtr + position);
position++;
@@ -3320,10 +3320,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
ASSERT(0);
}
} else {
- s16 param3;
+ int16 param3;
param3 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
@@ -3337,9 +3337,9 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0xF:
{
- u8 param1;
- u8 param2;
- u8 param3;
+ uint8 param1;
+ uint8 param2;
+ uint8 param3;
param1 = *(localScriptPtr + position);
position++;
@@ -3357,7 +3357,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x13:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3368,7 +3368,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x14:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3380,7 +3380,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x15:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3391,7 +3391,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x16:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3402,7 +3402,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x17:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3414,7 +3414,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x18:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3425,7 +3425,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x19:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3437,7 +3437,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x1A:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3453,7 +3453,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x1D:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3464,7 +3464,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x1E:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3475,7 +3475,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x1F:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3487,7 +3487,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x20:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3499,7 +3499,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x21:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3511,7 +3511,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x22:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3523,7 +3523,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x23:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3535,7 +3535,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x24:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3547,7 +3547,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x25:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3559,8 +3559,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x26:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3575,7 +3575,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x31:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3587,7 +3587,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x32:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3640,7 +3640,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case OP_loadNewPrcName:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3670,11 +3670,11 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x47:
{
- u8 param1;
- u8 param2;
- s16 param3;
- s16 param4;
- s16 param5;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
param1 = *(localScriptPtr + position);
position++;
@@ -3682,13 +3682,13 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
- param4 = *(s16 *) (localScriptPtr + position);
+ param4 = *(int16 *) (localScriptPtr + position);
position += 2;
- param5 = *(s16 *) (localScriptPtr + position);
+ param5 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -3703,7 +3703,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x49:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3726,25 +3726,25 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x51:
{
- u8 param1;
- s16 param2;
- s16 param3;
- s16 param4;
- s16 param5;
+ uint8 param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
param1 = *(localScriptPtr + position);
position++;
- param2 = *(s16 *) (localScriptPtr + position);
+ param2 = *(int16 *) (localScriptPtr + position);
position += 2;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
- param4 = *(s16 *) (localScriptPtr + position);
+ param4 = *(int16 *) (localScriptPtr + position);
position += 2;
- param5 = *(s16 *) (localScriptPtr + position);
+ param5 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param2);
@@ -3760,8 +3760,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x52:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3770,7 +3770,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
position++;
if (param2) {
- u8 param3;
+ uint8 param3;
param3 = *(localScriptPtr + position);
position++;
@@ -3787,10 +3787,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
ASSERT(0);
}
} else {
- s16 param3;
+ int16 param3;
param3 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
@@ -3804,8 +3804,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x53:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3814,7 +3814,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
position++;
if (param2) {
- u8 param3;
+ uint8 param3;
param3 = *(localScriptPtr + position);
position++;
@@ -3833,10 +3833,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
ASSERT(0);
}
} else {
- s16 param3;
+ int16 param3;
param3 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
@@ -3858,8 +3858,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x5A:
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -3884,13 +3884,13 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x66:
{
- u8 param1;
- s16 param2;
+ uint8 param1;
+ int16 param2;
param1 = *(localScriptPtr + position);
position++;
- param2 = *(s16 *) (localScriptPtr + position);
+ param2 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param2);
@@ -3902,7 +3902,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x68:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3924,7 +3924,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case OP_changeDataDisk:
{
- u8 newDisk;
+ uint8 newDisk;
newDisk = *(localScriptPtr + position);
position++;
@@ -3961,7 +3961,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case OP_79:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -3973,12 +3973,12 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x77:
{
- u8 param1;
- u8 param2;
- s16 param3;
- u8 param4;
- s16 param5;
- s16 param6;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
+ uint8 param4;
+ int16 param5;
+ int16 param6;
param1 = *(localScriptPtr + position);
position++;
@@ -3986,16 +3986,16 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
param4 = *(localScriptPtr + position);
position++;
- param5 = *(s16 *) (localScriptPtr + position);
+ param5 = *(int16 *) (localScriptPtr + position);
position += 2;
- param6 = *(s16 *) (localScriptPtr + position);
+ param6 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -4010,12 +4010,12 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x78:
{
- u8 param1;
- u8 param2;
- s16 param3;
- u8 param4;
- s16 param5;
- s16 param6;
+ uint8 param1;
+ uint8 param2;
+ int16 param3;
+ uint8 param4;
+ int16 param5;
+ int16 param6;
param1 = *(localScriptPtr + position);
position++;
@@ -4023,16 +4023,16 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
param4 = *(localScriptPtr + position);
position++;
- param5 = *(s16 *) (localScriptPtr + position);
+ param5 = *(int16 *) (localScriptPtr + position);
position += 2;
- param6 = *(s16 *) (localScriptPtr + position);
+ param6 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
@@ -4047,7 +4047,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x7A:
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -4058,7 +4058,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x7B: // OS only
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -4069,13 +4069,13 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x7F: // OS only
{
- u8 param1;
- u8 param2;
- u8 param3;
- u8 param4;
- s16 param5;
- s16 param6;
- s16 param7;
+ uint8 param1;
+ uint8 param2;
+ uint8 param3;
+ uint8 param4;
+ int16 param5;
+ int16 param6;
+ int16 param7;
param1 = *(localScriptPtr + position);
position++;
@@ -4089,13 +4089,13 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param4 = *(localScriptPtr + position);
position++;
- param5 = *(s16 *) (localScriptPtr + position);
+ param5 = *(int16 *) (localScriptPtr + position);
position += 2;
- param6 = *(s16 *) (localScriptPtr + position);
+ param6 = *(int16 *) (localScriptPtr + position);
position += 2;
- param7 = *(s16 *) (localScriptPtr + position);
+ param7 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param5);
@@ -4110,8 +4110,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x80: // OS only
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -4126,11 +4126,11 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x82: // OS only
{
- u8 param1;
- u8 param2;
- u16 param3;
- u16 param4;
- u8 param5;
+ uint8 param1;
+ uint8 param2;
+ uint16 param3;
+ uint16 param4;
+ uint8 param5;
param1 = *(localScriptPtr + position);
position++;
@@ -4138,11 +4138,11 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
param2 = *(localScriptPtr + position);
position++;
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
- param4 = *(s16 *) (localScriptPtr + position);
+ param4 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param4);
@@ -4156,8 +4156,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x83: // OS only
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -4172,7 +4172,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x89: // OS only
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -4185,7 +4185,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x8B: // OS only
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -4196,7 +4196,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x8C: // OS only
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -4207,44 +4207,44 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x8D: // OS only
{
- s16 param1;
- s16 param2;
- s16 param3;
- s16 param4;
- s16 param5;
- s16 param6;
- s16 param7;
- s16 param8;
+ int16 param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
+ int16 param6;
+ int16 param7;
+ int16 param8;
- param1 = *(s16 *) (localScriptPtr + position);
+ param1 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param1);
- param2 = *(s16 *) (localScriptPtr + position);
+ param2 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param2);
- param3 = *(s16 *) (localScriptPtr + position);
+ param3 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param3);
- param4 = *(s16 *) (localScriptPtr + position);
+ param4 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param4);
- param5 = *(s16 *) (localScriptPtr + position);
+ param5 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param5);
- param6 = *(s16 *) (localScriptPtr + position);
+ param6 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param6);
- param7 = *(s16 *) (localScriptPtr + position);
+ param7 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param7);
- param8 = *(s16 *) (localScriptPtr + position);
+ param8 = *(int16 *) (localScriptPtr + position);
position += 2;
flipU16(&param8);
@@ -4257,7 +4257,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x8E: // OS only
{
- u8 param1;
+ uint8 param1;
param1 = *(localScriptPtr + position);
position++;
@@ -4271,7 +4271,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x8F: // OS only
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -4282,7 +4282,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x90: // OS only
{
- u8 param1;
+ uint8 param1;
param1 = *(localScriptPtr + position);
position++;
@@ -4296,7 +4296,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x91: // OS only
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -4307,7 +4307,7 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x9D: // OS only
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
@@ -4319,13 +4319,13 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0x9E: // OS only
{
- u8 param;
+ uint8 param;
param = *(localScriptPtr + position);
position++;
if (param) {
- u8 param2;
+ uint8 param2;
param2 = *(localScriptPtr + position);
position++;
@@ -4333,10 +4333,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
sprintf(lineBuffer, "OP_9E(%d,%d)\n",
param, param2);
} else {
- s16 param2;
+ int16 param2;
param2 =
- *(s16 *) (localScriptPtr +
+ *(int16 *) (localScriptPtr +
position);
position += 2;
flipU16(&param2);
@@ -4349,8 +4349,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0xA0: // OS only
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -4365,8 +4365,8 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
}
case 0xA1: // OS only
{
- u8 param1;
- u8 param2;
+ uint8 param1;
+ uint8 param2;
param1 = *(localScriptPtr + position);
position++;
@@ -4400,10 +4400,10 @@ void decompileScript(u8 *scriptPtr, s16 *stackPtr, u16 scriptSize,
} while (!exitScript);
}
-void dumpScript(u8 * dumpName)
+void dumpScript(uint8 * dumpName)
{
File *fHandle;
- u16 i;
+ uint16 i;
fHandle = fopen(dumpName, "wt+");
diff --git a/engines/cine/script.h b/engines/cine/script.h
index e04624e568..ae1108ac89 100644
--- a/engines/cine/script.h
+++ b/engines/cine/script.h
@@ -29,17 +29,17 @@
typedef struct {
byte *ptr;
- u16 var4;
- s16 stack[SCRIPT_STACK_SIZE];
+ uint16 var4;
+ int16 stack[SCRIPT_STACK_SIZE];
} scriptStruct;
#define NUM_MAX_SCRIPT 50
extern scriptStruct scriptTable[NUM_MAX_SCRIPT];
-void computeScriptStack(byte *scriptPtr, s16 *stackPtr, u16 scriptSize);
-void decompileScript(byte *scriptPtr, s16 *stackPtr, u16 scriptSize,
- u16 scriptIdx);
+void computeScriptStack(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize);
+void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize,
+ uint16 scriptIdx);
void dumpScript(char *dumpName);
#define OP_loadPart 0x3F
@@ -49,11 +49,11 @@ void dumpScript(char *dumpName);
#define OP_changeDataDisk 0x6B
#define OP_79 0x79
-void addScriptToList0(u16 idx);
-s16 checkCollision(s16 objIdx, s16 x, s16 y, s16 numZones, s16 zoneIdx);
+void addScriptToList0(uint16 idx);
+int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneIdx);
-void runObjectScript(s16 entryIdx);
-s16 stopObjectScript(s16 entryIdx);
+void runObjectScript(int16 entryIdx);
+int16 stopObjectScript(int16 entryIdx);
void executeList1(void);
void executeList0(void);
diff --git a/engines/cine/sfx_player.cpp b/engines/cine/sfx_player.cpp
index ac94450010..d2e48f3c8e 100644
--- a/engines/cine/sfx_player.cpp
+++ b/engines/cine/sfx_player.cpp
@@ -28,17 +28,17 @@
#include "cine/cine.h"
-u16 snd_eventsDelay;
+uint16 snd_eventsDelay;
int snd_songIsPlaying = 0;
-u8 snd_nullInstrument[] = { 0, 0 };
+uint8 snd_nullInstrument[] = { 0, 0 };
sfxStateStruct snd_sfxState;
-static u8 snd_mute = 0;
+static uint8 snd_mute = 0;
static char snd_songFileName[30];
/* LVDT specific */
static Common::File *snd_baseSndFile = NULL;
-static u16 snd_numBasesonEntries = 0;
+static uint16 snd_numBasesonEntries = 0;
static BasesonEntryStruct *snd_basesonEntries = NULL;
int snd_loadBasesonEntries(const char *fileName) {
@@ -94,9 +94,9 @@ static int snd_findBasesonEntry(const char *entryName) {
return -1;
}
-static u8 *snd_loadBasesonEntry(const char *entryName) {
+static uint8 *snd_loadBasesonEntry(const char *entryName) {
int entryNum;
- u8 *entryData = NULL;
+ uint8 *entryData = NULL;
if (gameType == Cine::GID_OS) {
entryNum = findFileInBundle((const char *)entryName);
@@ -107,10 +107,10 @@ static u8 *snd_loadBasesonEntry(const char *entryName) {
if (entryNum != -1 && entryNum < snd_numBasesonEntries) {
const BasesonEntryStruct *be =
&snd_basesonEntries[entryNum];
- entryData = (u8 *) malloc(be->unpackedSize);
+ entryData = (uint8 *) malloc(be->unpackedSize);
if (entryData) {
if (be->unpackedSize > be->size) {
- u8 *tempData = (u8 *) malloc(be->size);
+ uint8 *tempData = (uint8 *) malloc(be->size);
if (tempData) {
snd_baseSndFile->seek(be->
offset, SEEK_SET);
@@ -231,9 +231,9 @@ void snd_playSong() {
void snd_handleEvents() {
int i;
- const u8 *patternData = snd_sfxState.songData + 600;
- const u8 *orderTable = snd_sfxState.songData + 472;
- u16 patternNum = orderTable[snd_sfxState.currentOrder] * 1024;
+ const uint8 *patternData = snd_sfxState.songData + 600;
+ const uint8 *orderTable = snd_sfxState.songData + 472;
+ uint16 patternNum = orderTable[snd_sfxState.currentOrder] * 1024;
for (i = 0; i < 4; ++i) {
snd_handlePattern(i,
@@ -253,8 +253,8 @@ void snd_handleEvents() {
}
}
-void snd_handlePattern(int channelNum, const u8 *patternData) {
- u16 instrNum = patternData[2] >> 4;
+void snd_handlePattern(int channelNum, const uint8 *patternData) {
+ uint16 instrNum = patternData[2] >> 4;
snd_adlibInstrumentsTable[channelNum] = snd_nullInstrument;
if (instrNum != 0) {
if (snd_sfxState.currentInstrumentChannel[channelNum] !=
@@ -278,7 +278,7 @@ void snd_handlePattern(int channelNum, const u8 *patternData) {
if (snd_mute != 0)
(*snd_driver.stopChannel) (channelNum);
else {
- s16 freq = (s16) readU16BE(patternData);
+ int16 freq = (int16) readU16BE(patternData);
if (freq > 0) {
(*snd_driver.stopChannel) (channelNum);
(*snd_driver.setChannelFrequency) (channelNum, freq);
diff --git a/engines/cine/sfx_player.h b/engines/cine/sfx_player.h
index e7a3e68e1e..9224774101 100644
--- a/engines/cine/sfx_player.h
+++ b/engines/cine/sfx_player.h
@@ -27,23 +27,23 @@
typedef struct {
char name[14];
- u32 offset;
- u32 size;
- u32 unpackedSize;
+ uint32 offset;
+ uint32 size;
+ uint32 unpackedSize;
} BasesonEntryStruct;
typedef struct {
- u8 *songData;
+ uint8 *songData;
int currentInstrumentChannel[4];
- u8 *instruments[15];
+ uint8 *instruments[15];
int currentOrder;
int currentPos;
int numOrders;
} sfxStateStruct;
-extern u16 snd_eventsDelay;
+extern uint16 snd_eventsDelay;
extern int snd_songIsPlaying;
-extern u8 snd_nullInstrument[];
+extern uint8 snd_nullInstrument[];
extern sfxStateStruct snd_sfxState;
extern int snd_loadBasesonEntries(const char *fileName);
@@ -54,6 +54,6 @@ extern int snd_loadSong(const char *songName);
extern void snd_fadeOutSong();
extern void snd_playSong();
extern void snd_handleEvents();
-extern void snd_handlePattern(int channelNum, const u8 *patternData);
+extern void snd_handlePattern(int channelNum, const uint8 *patternData);
#endif /* _SFXPLAYER_H_ */
diff --git a/engines/cine/sound_driver.cpp b/engines/cine/sound_driver.cpp
index b027c76ec0..98176782a9 100644
--- a/engines/cine/sound_driver.cpp
+++ b/engines/cine/sound_driver.cpp
@@ -28,32 +28,32 @@
#include "sound/mixer.h"
#include "sound/fmopl.h"
-u8 snd_useAdlib = 0;
-u16 snd_fadeOutCounter = 0;
-u16 snd_songTicksCounter = 0;
-u8 *snd_adlibInstrumentsTable[4];
+uint8 snd_useAdlib = 0;
+uint16 snd_fadeOutCounter = 0;
+uint16 snd_songTicksCounter = 0;
+uint8 *snd_adlibInstrumentsTable[4];
sndDriverStruct snd_driver;
-static u8 snd_adlibVibrato = 0;
-static s16 snd_adlibChannelVolume[4];
+static uint8 snd_adlibVibrato = 0;
+static int16 snd_adlibChannelVolume[4];
-static const u16 snd_adlibFreqTable[] = {
+static const uint16 snd_adlibFreqTable[] = {
0x0157, 0x016C, 0x0181, 0x0198, 0x01B1, 0x01CB, 0x01E6, 0x0203,
0x0222, 0x0243, 0x0266, 0x028A
};
-static const u8 snd_adlibOpTable[] = {
+static const uint8 snd_adlibOpTable[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15
};
-static const u8 snd_adlibNoteTable[] = {
+static const uint8 snd_adlibNoteTable[] = {
0x00, 0x03, 0x01, 0x04, 0x02, 0x05, 0x06, 0x09, 0x07,
0x0A, 0x08, 0x0B, 0x0C, 0x0F, 0x10, 0x10, 0x0E, 0x0E,
0x11, 0x11, 0x0D, 0x0D, 0x00, 0x00
};
-static const s16 snd_adlibNoteFreqTable[] = {
+static const int16 snd_adlibNoteFreqTable[] = {
0x0EEE, 0x0E17, 0x0D4D, 0x0C8C, 0x0BD9, 0x0B2F, 0x0A8E, 0x09F7,
0x0967, 0x08E0, 0x0861, 0x07E8, 0x0777, 0x070B, 0x06A6, 0x0647,
0x05EC, 0x0597, 0x0547, 0x04FB, 0x04B3, 0x0470, 0x0430, 0x03F4,
@@ -73,16 +73,16 @@ static void snd_adlibWriteData(int port, int value)
OPLWriteReg(g_cine_adlib->getOPL(), port, value);
}
-static void snd_adlibDriverSetupInstrument(const u8 *instrumentData, int channelNum) {
- s16 tmp;
+static void snd_adlibDriverSetupInstrument(const uint8 *instrumentData, int channelNum) {
+ int16 tmp;
- u8 waveSelect1 = instrumentData[54] & 3; /* var2 */
- u8 waveSelect2 = instrumentData[56] & 3; /* var1 */
+ uint8 waveSelect1 = instrumentData[54] & 3; /* var2 */
+ uint8 waveSelect2 = instrumentData[56] & 3; /* var1 */
- u8 fl = *instrumentData++; /* varB */
- u8 ch = *instrumentData++; /* var4 */
+ uint8 fl = *instrumentData++; /* varB */
+ uint8 ch = *instrumentData++; /* var4 */
- u8 adlibOp1, adlibOp2; /* _di, varA */
+ uint8 adlibOp1, adlibOp2; /* _di, varA */
if (fl != 0) {
adlibOp1 = snd_adlibOpTable[snd_adlibNoteTable[ch * 2 + 0]];
@@ -192,7 +192,7 @@ static void snd_adlibDriverSetupInstrument(const u8 *instrumentData, int channel
snd_adlibWriteData(ADLIB_REG_WAVE_SELECT + adlibOp2, waveSelect2);
}
-static void snd_adlibInterrupt(void *param, s16 *buf, int len) {
+static void snd_adlibInterrupt(void *param, int16 *buf, int len) {
int16 *origData = buf;
uint origLen = len;
static int samplesLeft = 0;
@@ -227,9 +227,9 @@ static void snd_adlibInterrupt(void *param, s16 *buf, int len) {
}
}
-static void snd_adlibDriverSetupChannel(int channelNum, const u8 *data,
+static void snd_adlibDriverSetupChannel(int channelNum, const uint8 *data,
int instrumentNum) {
- s16 vol = snd_sfxState.songData[instrumentNum];
+ int16 vol = snd_sfxState.songData[instrumentNum];
if (vol != 0 && vol < 0x50)
vol = 0x50;
@@ -258,15 +258,15 @@ static void snd_getAdlibFrequency(int frequency, int *adlibFreq) {
}
static void snd_adlibDriverSetChannelFrequency(int channelNum, int frequency) {
- const u8 *instr = snd_adlibInstrumentsTable[channelNum];
- u8 fl = *instr++; /* var2 */
- u8 ch = *instr++; /* var1 */
+ const uint8 *instr = snd_adlibInstrumentsTable[channelNum];
+ uint8 fl = *instr++; /* var2 */
+ uint8 ch = *instr++; /* var1 */
if (fl != 0 && ch == 6)
channelNum = 6;
if (fl == 0 || channelNum == 6) {
- u16 freqLow, freqHigh; /* var8 */
+ uint16 freqLow, freqHigh; /* var8 */
int adlibFreq;
snd_getAdlibFrequency(frequency, &adlibFreq);
@@ -291,9 +291,9 @@ static void snd_adlibDriverSetChannelFrequency(int channelNum, int frequency) {
}
static void snd_adlibDriverStopChannel(int channelNum) {
- const u8 *instr = snd_adlibInstrumentsTable[channelNum];
- u8 fl = *instr++; /* var2 */
- u8 ch = *instr++; /* var1 */
+ const uint8 *instr = snd_adlibInstrumentsTable[channelNum];
+ uint8 fl = *instr++; /* var2 */
+ uint8 ch = *instr++; /* var1 */
if (fl != 0 && ch == 6)
channelNum = 6;
@@ -309,9 +309,9 @@ static void snd_adlibDriverStopChannel(int channelNum) {
}
}
-static void snd_adlibDriverPlaySound(u8 * data, int channelNum, int volume) {
+static void snd_adlibDriverPlaySound(uint8 * data, int channelNum, int volume) {
/* if (_snd_mute) return;*/
- u8 fl, ch; /* var2, var1 */
+ uint8 fl, ch; /* var2, var1 */
assert(channelNum < 4);
data += 257;
@@ -326,7 +326,7 @@ static void snd_adlibDriverPlaySound(u8 * data, int channelNum, int volume) {
channelNum = 6;
if (fl == 0 || channelNum == 6) {
- u16 freqLow, freqHigh;
+ uint16 freqLow, freqHigh;
freqLow = snd_adlibFreqTable[0];
snd_adlibWriteData(ADLIB_REG_FREQUENCY_0 + channelNum,
freqLow);
diff --git a/engines/cine/sound_driver.h b/engines/cine/sound_driver.h
index 85a94b4fe0..ad4d98611f 100644
--- a/engines/cine/sound_driver.h
+++ b/engines/cine/sound_driver.h
@@ -38,15 +38,15 @@
#define ADLIB_REG_WAVE_SELECT 0xE0
typedef struct {
- void (*setupChannel) (int channelNum, const u8 * data,
+ void (*setupChannel) (int channelNum, const uint8 * data,
int instrumentNum);
void (*setChannelFrequency) (int channelNum, int frequency);
void (*stopChannel) (int channelNum);
- void (*playSound) (u8 * data, int channelNum, int volume);
+ void (*playSound) (uint8 * data, int channelNum, int volume);
} sndDriverStruct;
-extern u16 snd_fadeOutCounter, snd_songTicksCounter;
-extern u8 *snd_adlibInstrumentsTable[4];
+extern uint16 snd_fadeOutCounter, snd_songTicksCounter;
+extern uint8 *snd_adlibInstrumentsTable[4];
extern sndDriverStruct snd_driver;
extern void snd_adlibDriverInit();
diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp
index 1714411962..816583b4c8 100644
--- a/engines/cine/texte.cpp
+++ b/engines/cine/texte.cpp
@@ -24,19 +24,19 @@
#include "cine/cine.h"
-u8 *textDataPtr;
+uint8 *textDataPtr;
-u8 textTable[256][2][16 * 8];
+uint8 textTable[256][2][16 * 8];
-void generateMask(u8 *sprite, u8 *mask, u16 size, u8 transparency);
+void generateMask(uint8 *sprite, uint8 *mask, uint16 size, uint8 transparency);
-void loadTextData(const char *pFileName, u8 *pDestinationBuffer) {
+void loadTextData(const char *pFileName, uint8 *pDestinationBuffer) {
Common::File pFileHandle;
- u16 entrySize;
- u16 numEntry;
- u16 i;
- u8 *tempBuffer;
- u16 dataSize;
+ uint16 entrySize;
+ uint16 numEntry;
+ uint16 i;
+ uint8 *tempBuffer;
+ uint16 dataSize;
assert(pFileName);
assert(pDestinationBuffer);
diff --git a/engines/cine/texte.h b/engines/cine/texte.h
index 71ef23509c..73a65afde2 100644
--- a/engines/cine/texte.h
+++ b/engines/cine/texte.h
@@ -25,9 +25,9 @@
#ifndef CINE_TEXTE_H_
#define CINE_TEXTE_H_
-extern u8 *textDataPtr;
-extern u8 textTable[256][2][16 * 8];
+extern uint8 *textDataPtr;
+extern uint8 textTable[256][2][16 * 8];
-void loadTextData(const char *pFileName, u8 *pDestinationBuffer);
+void loadTextData(const char *pFileName, uint8 *pDestinationBuffer);
#endif
diff --git a/engines/cine/unpack.cpp b/engines/cine/unpack.cpp
index 652e0bf7f0..b16c2a2275 100644
--- a/engines/cine/unpack.cpp
+++ b/engines/cine/unpack.cpp
@@ -24,10 +24,10 @@
#include "cine/cine.h"
-u32 crc; // variable at 5C5A
-u32 bitbucket; // dx:bx
+uint32 crc; // variable at 5C5A
+uint32 bitbucket; // dx:bx
-u16 swap16(u16 r) {
+uint16 swap16(uint16 r) {
return (r >> 8) | (r << 8);
}
@@ -60,14 +60,14 @@ u16 swap16(u16 r) {
} while (nbits);\
}
-int decomp(u8 *in, u8 *out, int size) {
- u8 bit; // Carry flag
- u8 nbits; // cl
- u8 byte = 0; // ch
- u16 counter; // bp
- u16 var = 0; // variable at 5C58
- u16 ptr;
- u16 flags;
+int decomp(uint8 *in, uint8 *out, int size) {
+ uint8 bit; // Carry flag
+ uint8 nbits; // cl
+ uint8 byte = 0; // ch
+ uint16 counter; // bp
+ uint16 var = 0; // variable at 5C58
+ uint16 ptr;
+ uint16 flags;
enum {
DO_COPY,
diff --git a/engines/cine/unpack.h b/engines/cine/unpack.h
index 0e0fd2594a..d3bff480ce 100644
--- a/engines/cine/unpack.h
+++ b/engines/cine/unpack.h
@@ -25,6 +25,6 @@
#ifndef CINE_UNPACK_H_
#define CINE_UNPACK_H_
-int decomp(u8 *in, u8 *out, int size);
+int decomp(uint8 *in, uint8 *out, int size);
#endif
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index ed8a2aa72b..1fe2d424f9 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -24,31 +24,31 @@
#include "cine/cine.h"
-s16 allowSystemMenu = 0;
+int16 allowSystemMenu = 0;
-s16 commandVar3[4];
-s16 commandVar1;
-s16 commandVar2;
+int16 commandVar3[4];
+int16 commandVar1;
+int16 commandVar2;
unk1Struct messageTable[NUM_MAX_MESSAGE];
-u32 var6;
-u32 var8;
-u8 *var9;
+uint32 var6;
+uint32 var8;
+uint8 *var9;
-u16 var2;
-u16 var3;
-u16 var4;
-u16 var5;
+uint16 var2;
+uint16 var3;
+uint16 var4;
+uint16 var5;
-void drawString(char *string, u8 param) {
+void drawString(char *string, uint8 param) {
}
-void blitRawScreen(u8 *frontBuffer) {
+void blitRawScreen(uint8 *frontBuffer) {
gfxFlipRawPage(frontBuffer);
}
-void processPendingUpdates(s16 param) {
+void processPendingUpdates(int16 param) {
}
Common::File partFileHandle;
@@ -62,17 +62,17 @@ void closeEngine3(void) {
void mainLoopSub1(void) {
}
-void mainLoopSub2(u16 param1, u16 param2, u16 param3, u16 param4) {
+void mainLoopSub2(uint16 param1, uint16 param2, uint16 param3, uint16 param4) {
}
-u16 errorVar;
-u8 menuVar;
+uint16 errorVar;
+uint8 menuVar;
-void gfxFuncGen1(u8 *param1, u8 *param2, u8 *param3, u8 *param4,
- s16 param5) {
+void gfxFuncGen1(uint8 *param1, uint8 *param2, uint8 *param3, uint8 *param4,
+ int16 param5) {
}
-u8 *page0c;
+uint8 *page0c;
void ptrGfxFunc13(void) {
}
@@ -80,25 +80,25 @@ void ptrGfxFunc13(void) {
void gfxFuncGen2(void) {
}
-u16 allowPlayerInput;
+uint16 allowPlayerInput;
-u16 checkForPendingDataLoadSwitch;
+uint16 checkForPendingDataLoadSwitch;
-u16 fadeRequired;
-u16 isDrawCommandEnabled;
-u16 waitForPlayerClick;
-u16 var16;
-u16 var17;
-u16 var18;
-u16 var19;
-u16 var20;
-u8 var21;
+uint16 fadeRequired;
+uint16 isDrawCommandEnabled;
+uint16 waitForPlayerClick;
+uint16 var16;
+uint16 var17;
+uint16 var18;
+uint16 var19;
+uint16 var20;
+uint8 var21;
-s16 playerCommand;
+int16 playerCommand;
char commandBuffer[80];
-u16 palette_[256];
+uint16 palette_[256];
char currentPrcName[20];
char currentRelName[20];
@@ -114,16 +114,16 @@ char currentCtName[15];
char currentPartName[15];
char currentDatName[30];
-s16 saveVar2;
+int16 saveVar2;
-u8 isInPause = 0;
+uint8 isInPause = 0;
-u16 defaultMenuBoxColor;
+uint16 defaultMenuBoxColor;
-u8 inputVar1 = 0;
+uint8 inputVar1 = 0;
-u16 inputVar2;
-u16 inputVar3;
+uint16 inputVar2;
+uint16 inputVar3;
commandeType defaultActionCommand[] = {
"EXAMINE",
@@ -154,7 +154,7 @@ void stopSample(void) {
void mainLoopSub3(void) {
}
-s16 stopObjectScript(s16 entryIdx) {
+int16 stopObjectScript(int16 entryIdx) {
prcLinkedListStruct *currentHead = &objScriptList;
prcLinkedListStruct *tempHead = currentHead;
@@ -173,8 +173,8 @@ s16 stopObjectScript(s16 entryIdx) {
return (-1);
}
-void runObjectScript(s16 entryIdx) {
- u16 i;
+void runObjectScript(int16 entryIdx) {
+ uint16 i;
prcLinkedListStruct *pNewElement;
prcLinkedListStruct *currentHead = &objScriptList;
prcLinkedListStruct *tempHead = currentHead;
@@ -216,10 +216,10 @@ void runObjectScript(s16 entryIdx) {
relTable[entryIdx].var4);
}
-s16 getRelEntryForObject(u16 param1, u16 param2,
+int16 getRelEntryForObject(uint16 param1, uint16 param2,
selectedObjStruct *pSelectedObject) {
- s16 i;
- s16 di = -1;
+ int16 i;
+ int16 di = -1;
for (i = 0; i < NUM_MAX_REL; i++) {
if (relTable[i].ptr0 && relTable[i].var6 == param1
@@ -240,26 +240,26 @@ s16 getRelEntryForObject(u16 param1, u16 param2,
return di;
}
-s16 getObjectUnderCursor(u16 x, u16 y) {
+int16 getObjectUnderCursor(uint16 x, uint16 y) {
overlayHeadElement *currentHead = overlayHead.previous;
while (currentHead) {
if (currentHead->type < 2) {
if (objectTable[currentHead->objIdx].name[0]) {
- s16 objX;
- s16 objY;
- s16 frame;
- s16 part;
- s16 treshold;
- s16 height;
- s16 xdif;
- s16 ydif;
+ int16 objX;
+ int16 objY;
+ int16 frame;
+ int16 part;
+ int16 treshold;
+ int16 height;
+ int16 xdif;
+ int16 ydif;
objX = objectTable[currentHead->objIdx].x;
objY = objectTable[currentHead->objIdx].y;
frame =
- abs((s16) (objectTable[currentHead->
+ abs((int16) (objectTable[currentHead->
objIdx].frame));
part = objectTable[currentHead->objIdx].part;
@@ -337,7 +337,7 @@ const commandeType confirmMenu[] = {
commandeType currentSaveName[10];
-s16 loadSaveDirectory(void) {
+int16 loadSaveDirectory(void) {
Common::File fHandle;
if (gameType == Cine::GID_FW)
@@ -355,10 +355,10 @@ s16 loadSaveDirectory(void) {
return 1;
}
-s16 currentDisk;
+int16 currentDisk;
void loadObjectScritpFromSave(Common::File *fHandle) {
- s16 i;
+ int16 i;
prcLinkedListStruct *newElement;
prcLinkedListStruct *currentHead = &globalScriptsHead;
@@ -379,12 +379,12 @@ void loadObjectScritpFromSave(Common::File *fHandle) {
fHandle->read(&newElement->stack, 100);
for (i = 0; i < SCRIPT_STACK_SIZE; i++) {
- flipU16((u16 *) & newElement->stack[i]);
+ flipU16((uint16 *) & newElement->stack[i]);
}
fHandle->read(&newElement->localVars, 100);
for (i = 0; i < 50; i++) {
- flipU16((u16 *) & newElement->localVars[i]);
+ flipU16((uint16 *) & newElement->localVars[i]);
}
fHandle->read(&newElement->compareResult, 2);
@@ -394,13 +394,13 @@ void loadObjectScritpFromSave(Common::File *fHandle) {
flipU16(&newElement->scriptPosition);
fHandle->read(&newElement->scriptIdx, 2);
- flipU16((u16 *) & newElement->scriptIdx);
+ flipU16((uint16 *) & newElement->scriptIdx);
newElement->scriptPtr = (byte *) relTable[newElement->scriptIdx].ptr0;
}
void loadGlobalScritpFromSave(Common::File *fHandle) {
- s16 i;
+ int16 i;
prcLinkedListStruct *newElement;
prcLinkedListStruct *currentHead = &globalScriptsHead;
@@ -421,12 +421,12 @@ void loadGlobalScritpFromSave(Common::File *fHandle) {
fHandle->read(&newElement->stack, 100);
for (i = 0; i < SCRIPT_STACK_SIZE; i++) {
- flipU16((u16 *) & newElement->stack[i]);
+ flipU16((uint16 *) & newElement->stack[i]);
}
fHandle->read(&newElement->localVars, 100);
for (i = 0; i < 50; i++) {
- flipU16((u16 *) & newElement->localVars[i]);
+ flipU16((uint16 *) & newElement->localVars[i]);
}
fHandle->read(&newElement->compareResult, 2);
@@ -436,7 +436,7 @@ void loadGlobalScritpFromSave(Common::File *fHandle) {
flipU16(&newElement->scriptPosition);
fHandle->read(&newElement->scriptIdx, 2);
- flipU16((u16 *) & newElement->scriptIdx);
+ flipU16((uint16 *) & newElement->scriptIdx);
newElement->scriptPtr = scriptTable[newElement->scriptIdx].ptr;
}
@@ -459,10 +459,10 @@ void loadOverlayFromSave(Common::File *fHandle) {
flipU16(&newElement->objIdx);
flipU16(&newElement->type);
- flipU16((u16 *) & newElement->x);
- flipU16((u16 *) & newElement->y);
- flipU16((u16 *) & newElement->var10);
- flipU16((u16 *) & newElement->var12);
+ flipU16((uint16 *) & newElement->x);
+ flipU16((uint16 *) & newElement->y);
+ flipU16((uint16 *) & newElement->var10);
+ flipU16((uint16 *) & newElement->var12);
newElement->next = tempHead->next;
tempHead->next = newElement;
@@ -498,9 +498,9 @@ void setupObjectScriptList(void) {
}
}
-s16 makeLoad(char *saveName) {
- s16 i;
- s16 size;
+int16 makeLoad(char *saveName) {
+ int16 i;
+ int16 size;
Common::File fHandle;
fHandle.open(saveName, Common::File::kFileReadMode, savePath);
@@ -594,13 +594,13 @@ s16 makeLoad(char *saveName) {
checkForPendingDataLoadSwitch = 0;
fHandle.read(&currentDisk, 2);
- flipU16((u16 *) & currentDisk);
+ flipU16((uint16 *) & currentDisk);
fHandle.read(currentPartName, 13);
fHandle.read(currentDatName, 13);
fHandle.read(&saveVar2, 2);
- flipU16((u16 *) & saveVar2);
+ flipU16((uint16 *) & saveVar2);
fHandle.read(currentPrcName, 13);
fHandle.read(currentRelName, 13);
@@ -610,16 +610,16 @@ s16 makeLoad(char *saveName) {
fHandle.read(&i, 2);
fHandle.read(&i, 2);
- flipU16((u16 *) & i);
+ flipU16((uint16 *) & i);
fHandle.read(objectTable, i * 255);
for (i = 0; i < NUM_MAX_OBJECT; i++) {
- flipU16((u16 *) & objectTable[i].x);
- flipU16((u16 *) & objectTable[i].y);
+ flipU16((uint16 *) & objectTable[i].x);
+ flipU16((uint16 *) & objectTable[i].y);
flipU16(&objectTable[i].mask);
- flipU16((u16 *) & objectTable[i].frame);
- flipU16((u16 *) & objectTable[i].costume);
+ flipU16((uint16 *) & objectTable[i].frame);
+ flipU16((uint16 *) & objectTable[i].costume);
flipU16(&objectTable[i].part);
}
@@ -645,7 +645,7 @@ s16 makeLoad(char *saveName) {
fHandle.read(&commandVar3, 8);
for (i = 0; i < 4; i++) {
- flipU16((u16 *) & commandVar3[i]);
+ flipU16((uint16 *) & commandVar3[i]);
}
fHandle.read(commandBuffer, 0x50);
@@ -660,10 +660,10 @@ s16 makeLoad(char *saveName) {
flipU16(&allowPlayerInput);
fHandle.read(&playerCommand, 2);
- flipU16((u16 *) & playerCommand);
+ flipU16((uint16 *) & playerCommand);
fHandle.read(&commandVar1, 2);
- flipU16((u16 *) & commandVar1);
+ flipU16((uint16 *) & commandVar1);
fHandle.read(&isDrawCommandEnabled, 2);
flipU16(&isDrawCommandEnabled);
@@ -681,46 +681,46 @@ s16 makeLoad(char *saveName) {
flipU16(&var2);
fHandle.read(&commandVar2, 2);
- flipU16((u16 *) & commandVar2);
+ flipU16((uint16 *) & commandVar2);
fHandle.read(&defaultMenuBoxColor2, 2);
flipU16(&defaultMenuBoxColor2);
fHandle.read(&i, 2);
fHandle.read(&i, 2);
- flipU16((u16 *) & i);
+ flipU16((uint16 *) & i);
fHandle.read(animDataTable, i * 255);
for (i = 0; i < NUM_MAX_ANIMDATA; i++) {
flipU16(&animDataTable[i].width);
flipU16(&animDataTable[i].var1);
flipU16(&animDataTable[i].field_4);
flipU16(&animDataTable[i].var2);
- flipU16((u16 *) & animDataTable[i].fileIdx);
- flipU16((u16 *) & animDataTable[i].frameIdx);
+ flipU16((uint16 *) & animDataTable[i].fileIdx);
+ flipU16((uint16 *) & animDataTable[i].frameIdx);
}
fHandle.seek(12, SEEK_CUR); // TODO: handle screen params (realy required ?)
fHandle.read(&size, 2);
- flipU16((u16 *) & size);
+ flipU16((uint16 *) & size);
for (i = 0; i < size; i++) {
loadGlobalScritpFromSave(&fHandle);
}
fHandle.read(&size, 2);
- flipU16((u16 *) & size);
+ flipU16((uint16 *) & size);
for (i = 0; i < size; i++) {
loadObjectScritpFromSave(&fHandle);
}
fHandle.read(&size, 2);
- flipU16((u16 *) & size);
+ flipU16((uint16 *) & size);
for (i = 0; i < size; i++) {
loadOverlayFromSave(&fHandle);
}
fHandle.read(&size, 2);
- flipU16((u16 *) & size);
+ flipU16((uint16 *) & size);
for (i = 0; i < size; i++) {
// loadBgIncrustFromSave(fHandle);
}
@@ -773,13 +773,13 @@ s16 makeLoad(char *saveName) {
return (0);
}
-void saveU16(u16 var, Common::File * fHandle) {
+void saveU16(uint16 var, Common::File * fHandle) {
flipU16(&var);
fHandle->write(&var, 2);
}
void makeSave(char *saveFileName) {
- s16 i;
+ int16 i;
Common::File fHandle;
fHandle.open(saveFileName, Common::File::kFileWriteMode, savePath);
@@ -849,8 +849,8 @@ void makeSave(char *saveFileName) {
flipU16(&animDataTable[i].var1);
flipU16(&animDataTable[i].field_4);
flipU16(&animDataTable[i].var2);
- flipU16((u16 *) & animDataTable[i].fileIdx);
- flipU16((u16 *) & animDataTable[i].frameIdx);
+ flipU16((uint16 *) & animDataTable[i].fileIdx);
+ flipU16((uint16 *) & animDataTable[i].frameIdx);
fHandle.write(&animDataTable[i], sizeof(animDataStruct));
@@ -858,8 +858,8 @@ void makeSave(char *saveFileName) {
flipU16(&animDataTable[i].var1);
flipU16(&animDataTable[i].field_4);
flipU16(&animDataTable[i].var2);
- flipU16((u16 *) & animDataTable[i].fileIdx);
- flipU16((u16 *) & animDataTable[i].frameIdx);
+ flipU16((uint16 *) & animDataTable[i].fileIdx);
+ flipU16((uint16 *) & animDataTable[i].frameIdx);
}
saveU16(0, &fHandle); // Screen params, unhandled
@@ -870,7 +870,7 @@ void makeSave(char *saveFileName) {
saveU16(0, &fHandle);
{
- s16 numScript = 0;
+ int16 numScript = 0;
prcLinkedListStruct *currentHead = globalScriptsHead.next;
while (currentHead) {
@@ -884,7 +884,7 @@ void makeSave(char *saveFileName) {
currentHead = globalScriptsHead.next;
while (currentHead) {
- s16 i;
+ int16 i;
for (i = 0; i < SCRIPT_STACK_SIZE; i++) {
saveU16(currentHead->stack[i], &fHandle);
@@ -904,7 +904,7 @@ void makeSave(char *saveFileName) {
}
{
- s16 numScript = 0;
+ int16 numScript = 0;
prcLinkedListStruct *currentHead = objScriptList.next;
while (currentHead) {
@@ -918,7 +918,7 @@ void makeSave(char *saveFileName) {
currentHead = objScriptList.next;
while (currentHead) {
- s16 i;
+ int16 i;
for (i = 0; i < SCRIPT_STACK_SIZE; i++) {
saveU16(currentHead->stack[i], &fHandle);
@@ -938,7 +938,7 @@ void makeSave(char *saveFileName) {
}
{
- s16 numScript = 0;
+ int16 numScript = 0;
overlayHeadElement *currentHead = overlayHead.next;
while (currentHead) {
@@ -955,19 +955,19 @@ void makeSave(char *saveFileName) {
while (currentHead) {
flipU16(&currentHead->objIdx);
flipU16(&currentHead->type);
- flipU16((u16 *) & currentHead->x);
- flipU16((u16 *) & currentHead->y);
- flipU16((u16 *) & currentHead->var10);
- flipU16((u16 *) & currentHead->var12);
+ flipU16((uint16 *) & currentHead->x);
+ flipU16((uint16 *) & currentHead->y);
+ flipU16((uint16 *) & currentHead->var10);
+ flipU16((uint16 *) & currentHead->var12);
fHandle.write(currentHead, 0x14);
flipU16(&currentHead->objIdx);
flipU16(&currentHead->type);
- flipU16((u16 *) & currentHead->x);
- flipU16((u16 *) & currentHead->y);
- flipU16((u16 *) & currentHead->var10);
- flipU16((u16 *) & currentHead->var12);
+ flipU16((uint16 *) & currentHead->x);
+ flipU16((uint16 *) & currentHead->y);
+ flipU16((uint16 *) & currentHead->var10);
+ flipU16((uint16 *) & currentHead->var12);
currentHead = currentHead->next;
}
@@ -981,21 +981,21 @@ void makeSave(char *saveFileName) {
}
void makeSystemMenu(void) {
- s16 numEntry;
- s16 mouseButton;
- s16 mouseX;
- s16 mouseY;
- s16 systemCommand;
+ int16 numEntry;
+ int16 mouseButton;
+ int16 mouseX;
+ int16 mouseY;
+ int16 systemCommand;
if (!allowSystemMenu) {
manageEvents();
- getMouseData(mouseUpdateStatus, (u16 *) & mouseButton,
- (u16 *) & mouseX, (u16 *) & mouseY);
+ getMouseData(mouseUpdateStatus, (uint16 *) & mouseButton,
+ (uint16 *) & mouseX, (uint16 *) & mouseY);
while (mouseButton) {
manageEvents();
- getMouseData(mouseUpdateStatus, (u16 *) & mouseButton,
- (u16 *) & mouseX, (u16 *) & mouseY);
+ getMouseData(mouseUpdateStatus, (uint16 *) & mouseButton,
+ (uint16 *) & mouseX, (uint16 *) & mouseY);
}
numEntry = 6;
@@ -1017,8 +1017,8 @@ void makeSystemMenu(void) {
case 1:
{
getMouseData(mouseUpdateStatus,
- (u16 *) & mouseButton, (u16 *) & mouseX,
- (u16 *) & mouseY);
+ (uint16 *) & mouseButton, (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
if (!makeMenuChoice(confirmMenu, 2, mouseX,
mouseY + 8, 100)) {
//reinitEngine();
@@ -1028,8 +1028,8 @@ void makeSystemMenu(void) {
case 2:
{
getMouseData(mouseUpdateStatus,
- (u16 *) & mouseButton, (u16 *) & mouseX,
- (u16 *) & mouseY);
+ (uint16 *) & mouseButton, (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
if (!makeMenuChoice(confirmMenu, 2, mouseX,
mouseY + 8, 100)) {
exitEngine = 1;
@@ -1043,12 +1043,12 @@ void makeSystemMenu(void) {
case 4: // load game
{
if (loadSaveDirectory()) {
- s16 selectedSave;
+ int16 selectedSave;
getMouseData(mouseUpdateStatus,
- (u16 *) & mouseButton,
- (u16 *) & mouseX,
- (u16 *) & mouseY);
+ (uint16 *) & mouseButton,
+ (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
selectedSave =
makeMenuChoice(currentSaveName, 10,
mouseX, mouseY + 8, 180);
@@ -1065,9 +1065,9 @@ void makeSystemMenu(void) {
selectedSave);
getMouseData(mouseUpdateStatus,
- (u16 *) & mouseButton,
- (u16 *) & mouseX,
- (u16 *) & mouseY);
+ (uint16 *) & mouseButton,
+ (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
if (!makeMenuChoice
(confirmMenu, 2, mouseX,
mouseY + 8, 100)) {
@@ -1107,7 +1107,7 @@ void makeSystemMenu(void) {
}
case 5:
{
- s16 selectedSave;
+ int16 selectedSave;
loadSaveDirectory();
selectedSave =
@@ -1128,9 +1128,9 @@ void makeSystemMenu(void) {
selectedSave);
getMouseData(mouseUpdateStatus,
- (u16 *) & mouseButton,
- (u16 *) & mouseX,
- (u16 *) & mouseY);
+ (uint16 *) & mouseButton,
+ (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
if (!makeMenuChoice(confirmMenu, 2,
mouseX, mouseY + 8, 100)) {
char saveString[256];
@@ -1175,7 +1175,7 @@ void makeSystemMenu(void) {
}
}
-const s16 choiceResultTable[] = {
+const int16 choiceResultTable[] = {
1,
1,
1,
@@ -1185,7 +1185,7 @@ const s16 choiceResultTable[] = {
1
};
-const s16 subObjectUseTable[] = {
+const int16 subObjectUseTable[] = {
3,
3,
3,
@@ -1195,7 +1195,7 @@ const s16 subObjectUseTable[] = {
0
};
-const s16 canUseOnItemTable[] = {
+const int16 canUseOnItemTable[] = {
1,
0,
0,
@@ -1206,15 +1206,15 @@ const s16 canUseOnItemTable[] = {
};
commandeType objectListCommand[20];
-s16 objListTab[20];
+int16 objListTab[20];
-s16 processInventory(s16 x, s16 y) {
+int16 processInventory(int16 x, int16 y) {
return 0;
}
-s16 buildObjectListCommand(void) {
- s16 i;
- s16 j;
+int16 buildObjectListCommand(void) {
+ int16 i;
+ int16 j;
ASSERT(gameType == Cine::GID_FW);
@@ -1235,9 +1235,9 @@ s16 buildObjectListCommand(void) {
return (j);
}
-s16 buildObjectListCommand2(s16 param) {
- s16 i;
- s16 j;
+int16 buildObjectListCommand2(int16 param) {
+ int16 i;
+ int16 j;
ASSERT(gameType == Cine::GID_OS);
@@ -1258,9 +1258,9 @@ s16 buildObjectListCommand2(s16 param) {
return (j);
}
-s16 selectSubObject(s16 x, s16 y) {
- s16 listSize = buildObjectListCommand();
- s16 selectedObject;
+int16 selectSubObject(int16 x, int16 y) {
+ int16 listSize = buildObjectListCommand();
+ int16 selectedObject;
if (!listSize) {
return -2;
@@ -1275,9 +1275,9 @@ s16 selectSubObject(s16 x, s16 y) {
return objListTab[selectedObject];
}
-s16 selectSubObject2(s16 x, s16 y, s16 param) {
- s16 listSize = buildObjectListCommand2(param);
- s16 selectedObject;
+int16 selectSubObject2(int16 x, int16 y, int16 param) {
+ int16 listSize = buildObjectListCommand2(param);
+ int16 selectedObject;
if (!listSize) {
return -2;
@@ -1296,11 +1296,11 @@ s16 selectSubObject2(s16 x, s16 y, s16 param) {
return objListTab[selectedObject];
}
-s16 canUseOnObject = 0;
+int16 canUseOnObject = 0;
void makeCommandLine(void) {
- u16 x;
- u16 y;
+ uint16 x;
+ uint16 y;
commandVar1 = 0;
commandVar2 = -10;
@@ -1313,7 +1313,7 @@ void makeCommandLine(void) {
if ((playerCommand != -1) && (choiceResultTable[playerCommand] == 2)) // need object selection ?
{
- s16 si;
+ int16 si;
getMouseData(mouseUpdateStatus, &dummyU16, &x, &y);
@@ -1359,7 +1359,7 @@ void makeCommandLine(void) {
if (gameType == Cine::GID_OS) {
if (playerCommand != -1 && canUseOnObject != 0) // call use on sub object
{
- s16 si;
+ int16 si;
getMouseData(mouseUpdateStatus, &dummyU16, &x, &y);
@@ -1383,7 +1383,7 @@ void makeCommandLine(void) {
if (playerCommand != -1
&& choiceResultTable[playerCommand] ==
commandVar1) {
- s16 di =
+ int16 di =
getRelEntryForObject(playerCommand,
commandVar1,
(selectedObjStruct *) & commandVar3);
@@ -1400,30 +1400,30 @@ void makeCommandLine(void) {
}
}
-u16 needMouseSave = 0;
-
-u16 menuVar4 = 0;
-u16 menuVar5 = 0;
-
-s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
- u16 width) {
- u8 color = 2;
- u8 color2;
- s16 paramY;
- s16 currentX;
- s16 currentY;
- s16 i;
- u16 button;
- s16 var_A;
- s16 di;
- u16 j;
- s16 mouseX;
- s16 mouseY;
- s16 var_16;
- s16 var_14;
- s16 currentSelection;
- s16 oldSelection;
- s16 var_4;
+uint16 needMouseSave = 0;
+
+uint16 menuVar4 = 0;
+uint16 menuVar5 = 0;
+
+int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X, uint16 Y,
+ uint16 width) {
+ uint8 color = 2;
+ uint8 color2;
+ int16 paramY;
+ int16 currentX;
+ int16 currentY;
+ int16 i;
+ uint16 button;
+ int16 var_A;
+ int16 di;
+ uint16 j;
+ int16 mouseX;
+ int16 mouseY;
+ int16 var_16;
+ int16 var_14;
+ int16 currentSelection;
+ int16 oldSelection;
+ int16 var_4;
if (allowSystemMenu)
return -1;
@@ -1454,16 +1454,16 @@ s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
currentX = X + 4;
for (j = 0; j < strlen(commandList[i]); j++) {
- u8 currentChar = commandList[i][j];
+ uint8 currentChar = commandList[i][j];
if (currentChar == ' ') {
currentX += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable[currentChar].
characterIdx;
drawSpriteRaw(textTable[characterIdx]
@@ -1505,16 +1505,16 @@ s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
currentX = X + 4;
for (j = 0; j < strlen(commandList[currentSelection]); j++) {
- u8 currentChar = commandList[currentSelection][j];
+ uint8 currentChar = commandList[currentSelection][j];
if (currentChar == ' ') {
currentX += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable[currentChar].characterIdx;
drawSpriteRaw(textTable[characterIdx][0],
textTable[characterIdx][1], 2, 8, page1Raw,
@@ -1527,8 +1527,8 @@ s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
blitRawScreen(page1Raw);
manageEvents();
- getMouseData(mouseUpdateStatus, &button, (u16 *) & mouseX,
- (u16 *) & mouseY);
+ getMouseData(mouseUpdateStatus, &button, (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
var_16 = mouseX;
var_14 = mouseY;
@@ -1537,8 +1537,8 @@ s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
do {
manageEvents();
- getMouseData(mouseUpdateStatus, &button, (u16 *) & mouseX,
- (u16 *) & mouseY);
+ getMouseData(mouseUpdateStatus, &button, (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
if (button) {
var_A = 1;
@@ -1588,17 +1588,17 @@ s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
currentX = X + 4;
for (j = 0; j < strlen(commandList[oldSelection]); j++) {
- u8 currentChar = commandList[oldSelection][j];
+ uint8 currentChar = commandList[oldSelection][j];
if (currentChar == ' ') {
currentX += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].
characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable
[currentChar].characterIdx;
drawSpriteRaw(textTable
@@ -1619,18 +1619,18 @@ s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
for (j = 0; j < strlen(commandList[currentSelection]);
j++) {
- u8 currentChar =
+ uint8 currentChar =
commandList[currentSelection][j];
if (currentChar == ' ') {
currentX += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].
characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable
[currentChar].characterIdx;
drawSpriteRaw(textTable
@@ -1673,25 +1673,25 @@ s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
return currentSelection;
}
-s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
- u16 width) {
- u8 color = 2;
- u8 color2;
- s16 paramY;
- s16 currentX;
- s16 currentY;
- s16 i;
- u16 button;
- s16 var_A;
- s16 di;
- u16 j;
- s16 mouseX;
- s16 mouseY;
- s16 var_16;
- s16 var_14;
- s16 currentSelection;
- s16 oldSelection;
- s16 var_4;
+int16 makeMenuChoice2(const commandeType commandList[], uint16 height, uint16 X, uint16 Y,
+ uint16 width) {
+ uint8 color = 2;
+ uint8 color2;
+ int16 paramY;
+ int16 currentX;
+ int16 currentY;
+ int16 i;
+ uint16 button;
+ int16 var_A;
+ int16 di;
+ uint16 j;
+ int16 mouseX;
+ int16 mouseY;
+ int16 var_16;
+ int16 var_14;
+ int16 currentSelection;
+ int16 oldSelection;
+ int16 var_4;
if (allowSystemMenu)
return -1;
@@ -1722,16 +1722,16 @@ s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
currentX = X + 4;
for (j = 0; j < strlen(commandList[i]); j++) {
- u8 currentChar = commandList[i][j];
+ uint8 currentChar = commandList[i][j];
if (currentChar == ' ') {
currentX += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable[currentChar].
characterIdx;
drawSpriteRaw(textTable[characterIdx]
@@ -1773,16 +1773,16 @@ s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
currentX = X + 4;
for (j = 0; j < strlen(commandList[currentSelection]); j++) {
- u8 currentChar = commandList[currentSelection][j];
+ uint8 currentChar = commandList[currentSelection][j];
if (currentChar == ' ') {
currentX += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable[currentChar].characterIdx;
drawSpriteRaw(textTable[characterIdx][0],
textTable[characterIdx][1], 2, 8, page1Raw,
@@ -1795,8 +1795,8 @@ s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
blitRawScreen(page1Raw);
manageEvents();
- getMouseData(mouseUpdateStatus, &button, (u16 *) & mouseX,
- (u16 *) & mouseY);
+ getMouseData(mouseUpdateStatus, &button, (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
var_16 = mouseX;
var_14 = mouseY;
@@ -1805,8 +1805,8 @@ s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
do {
manageEvents();
- getMouseData(mouseUpdateStatus, &button, (u16 *) & mouseX,
- (u16 *) & mouseY);
+ getMouseData(mouseUpdateStatus, &button, (uint16 *) & mouseX,
+ (uint16 *) & mouseY);
if (button) {
var_A = 1;
@@ -1856,17 +1856,17 @@ s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
currentX = X + 4;
for (j = 0; j < strlen(commandList[oldSelection]); j++) {
- u8 currentChar = commandList[oldSelection][j];
+ uint8 currentChar = commandList[oldSelection][j];
if (currentChar == ' ') {
currentX += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].
characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable
[currentChar].characterIdx;
drawSpriteRaw(textTable
@@ -1887,18 +1887,18 @@ s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
for (j = 0; j < strlen(commandList[currentSelection]);
j++) {
- u8 currentChar =
+ uint8 currentChar =
commandList[currentSelection][j];
if (currentChar == ' ') {
currentX += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].
characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable
[currentChar].characterIdx;
drawSpriteRaw(textTable
@@ -1941,9 +1941,9 @@ s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
return currentSelection;
}
-void drawMenuBox(char *command, s16 x, s16 y) {
- u8 j;
- u8 lColor = 2;
+void drawMenuBox(char *command, int16 x, int16 y) {
+ uint8 j;
+ uint8 lColor = 2;
hideMouse();
@@ -1958,16 +1958,16 @@ void drawMenuBox(char *command, s16 x, s16 y) {
y += 2;
for (j = 0; j < strlen(command); j++) {
- u8 currentChar = command[j];
+ uint8 currentChar = command[j];
if (currentChar == ' ') {
x += 5;
} else {
- u8 characterWidth =
+ uint8 characterWidth =
fontParamTable[currentChar].characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable[currentChar].characterIdx;
drawSpriteRaw(textTable[characterIdx][0],
textTable[characterIdx][1], 2, 8, page2Raw,
@@ -1980,12 +1980,12 @@ void drawMenuBox(char *command, s16 x, s16 y) {
gfxFuncGen2();
}
-u16 executePlayerInput(void) {
- u16 var_5E;
- u16 var_2;
- u16 mouseButton;
- u16 mouseX;
- u16 mouseY;
+uint16 executePlayerInput(void) {
+ uint16 var_5E;
+ uint16 var_2;
+ uint16 mouseButton;
+ uint16 mouseX;
+ uint16 mouseY;
canUseOnObject = 0;
@@ -1996,8 +1996,8 @@ u16 executePlayerInput(void) {
}
if (allowPlayerInput) {
- u16 currentEntry = 0;
- u16 di = 0;
+ uint16 currentEntry = 0;
+ uint16 di = 0;
if (isDrawCommandEnabled) {
drawMenuBox(commandBuffer, 10, defaultMenuBoxColor);
@@ -2032,7 +2032,7 @@ u16 executePlayerInput(void) {
if (mouseButton & 2) {
makeSystemMenu();
} else {
- s16 si;
+ int16 si;
do {
manageEvents();
getMouseData(mouseUpdateStatus,
@@ -2056,7 +2056,7 @@ u16 executePlayerInput(void) {
if (choiceResultTable
[playerCommand] ==
commandVar1) {
- s16 relEntry;
+ int16 relEntry;
drawMenuBox
(commandBuffer, 10,
@@ -2113,7 +2113,7 @@ u16 executePlayerInput(void) {
makeCommandLine();
} else {
- s16 objIdx;
+ int16 objIdx;
objIdx =
getObjectUnderCursor(mouseX,
@@ -2169,8 +2169,8 @@ u16 executePlayerInput(void) {
} else {
if (mouseButton & 1) {
if (!(mouseButton & 2)) {
- s16 objIdx;
- s16 relEntry;
+ int16 objIdx;
+ int16 relEntry;
globalVars[249] = mouseX;
if (!mouseX) {
@@ -2206,7 +2206,7 @@ u16 executePlayerInput(void) {
}
}
} else {
- u16 di = 0;
+ uint16 di = 0;
getMouseData(mouseUpdateStatus, &mouseButton, &mouseX,
&mouseY);
@@ -2387,24 +2387,24 @@ u16 executePlayerInput(void) {
return var_5E;
}
-void drawSprite(overlayHeadElement *currentOverlay, u8 *spritePtr,
- u8 *maskPtr, u16 width, u16 height, u8 *page, s16 x, s16 y) {
- u8 *ptr = NULL;
- u8 i = 0;
- u16 si = 0;
+void drawSprite(overlayHeadElement *currentOverlay, uint8 *spritePtr,
+ uint8 *maskPtr, uint16 width, uint16 height, uint8 *page, int16 x, int16 y) {
+ uint8 *ptr = NULL;
+ uint8 i = 0;
+ uint16 si = 0;
overlayHeadElement *pCurrentOverlay = currentOverlay;
#if 0
while(pCurrentOverlay) { // unfinished, probably for mask handling..
if (pCurrentOverlay->type == 5) {
- s16 maskX;
- s16 maskY;
- s16 maskWidth;
- s16 maskHeight;
- u16 maskSpriteIdx;
+ int16 maskX;
+ int16 maskY;
+ int16 maskWidth;
+ int16 maskHeight;
+ uint16 maskSpriteIdx;
if (!si) {
- ptr = (u8 *)malloc(width * height);
+ ptr = (uint8 *)malloc(width * height);
si = 1;
}
@@ -2438,11 +2438,11 @@ void drawSprite(overlayHeadElement *currentOverlay, u8 *spritePtr,
}
-s16 additionalBgVScroll = 0;
+int16 additionalBgVScroll = 0;
void backupOverlayPage(void) {
- u8 *bgPage;
- u8 *scrollBg;
+ uint8 *bgPage;
+ uint8 *scrollBg;
bgPage = additionalBgTable[currentAdditionalBgIdx];
@@ -2450,7 +2450,7 @@ void backupOverlayPage(void) {
if (!additionalBgVScroll) {
memcpy(page1Raw, bgPage, 320 * 200);
} else {
- s16 i;
+ int16 i;
scrollBg = additionalBgTable[currentAdditionalBgIdx2];
@@ -2470,22 +2470,22 @@ void backupOverlayPage(void) {
}
}
-u16 computeMessageLength(u8 *ptr, u16 width, u16 *numWords,
- u16 *messageWidth, u16 *lineResult) {
- u8 *localPtr = ptr;
+uint16 computeMessageLength(uint8 *ptr, uint16 width, uint16 *numWords,
+ uint16 *messageWidth, uint16 *lineResult) {
+ uint8 *localPtr = ptr;
- u16 var_2 = 0;
- u16 localLineResult = 0;
- u16 var_6 = 0;
- u16 var_8 = 0;
- u16 localMessageWidth = 0;
- u16 var_16 = 0;
- u16 finished = 0;
- u16 si = 0;
- u16 di = 0;
+ uint16 var_2 = 0;
+ uint16 localLineResult = 0;
+ uint16 var_6 = 0;
+ uint16 var_8 = 0;
+ uint16 localMessageWidth = 0;
+ uint16 var_16 = 0;
+ uint16 finished = 0;
+ uint16 si = 0;
+ uint16 di = 0;
while (!finished) {
- u8 character = *(localPtr++);
+ uint8 character = *(localPtr++);
if (character == ' ') {
var_8 = var_16;
@@ -2504,7 +2504,7 @@ u16 computeMessageLength(u8 *ptr, u16 width, u16 *numWords,
si = 0;
} else {
if (fontParamTable[character].characterWidth) {
- u16 var_C =
+ uint16 var_C =
fontParamTable[character].characterWidth;
if (si + var_C < width) {
@@ -2533,12 +2533,12 @@ u16 computeMessageLength(u8 *ptr, u16 width, u16 *numWords,
return (di);
}
-void drawDialogueMessage(u8 msgIdx, s16 x, s16 y, s16 width, s16 color) {
- u8 color2 = 2;
- u8 endOfMessageReached = 0;
- s16 localX;
- s16 localY;
- s16 localWidth;
+void drawDialogueMessage(uint8 msgIdx, int16 x, int16 y, int16 width, int16 color) {
+ uint8 color2 = 2;
+ uint8 endOfMessageReached = 0;
+ int16 localX;
+ int16 localY;
+ int16 localWidth;
char *messagePtr = (char *)messageTable[msgIdx].ptr;
@@ -2555,16 +2555,16 @@ void drawDialogueMessage(u8 msgIdx, s16 x, s16 y, s16 width, s16 color) {
localWidth = width - 8;
do {
- u16 messageLength = 0;
- u16 numWords;
- u16 messageWidth;
- u16 lineResult;
+ uint16 messageLength = 0;
+ uint16 numWords;
+ uint16 messageWidth;
+ uint16 lineResult;
char *endOfMessagePtr;
- u16 fullLineWidth;
- u16 interWordSize;
- u16 interWordSizeRemain;
- u8 currentChar;
- u8 characterWidth;
+ uint16 fullLineWidth;
+ uint16 interWordSize;
+ uint16 interWordSizeRemain;
+ uint8 currentChar;
+ uint8 characterWidth;
while (messagePtr[messageLength] == ' ') {
messageLength++;
@@ -2573,7 +2573,7 @@ void drawDialogueMessage(u8 msgIdx, s16 x, s16 y, s16 width, s16 color) {
messagePtr += messageLength;
messageLength =
- computeMessageLength((u8 *) messagePtr, localWidth,
+ computeMessageLength((uint8 *) messagePtr, localWidth,
&numWords, &messageWidth, &lineResult);
endOfMessagePtr = messagePtr + messageLength;
@@ -2611,7 +2611,7 @@ void drawDialogueMessage(u8 msgIdx, s16 x, s16 y, s16 width, s16 color) {
fontParamTable[currentChar].characterWidth;
if (characterWidth) {
- u8 characterIdx =
+ uint8 characterIdx =
fontParamTable[currentChar].
characterIdx;
drawSpriteRaw(textTable[characterIdx]
@@ -2658,8 +2658,8 @@ void drawOverlays(void) {
case 0: // sprite
{
objectStruct *objPtr;
- s16 x;
- s16 y;
+ int16 x;
+ int16 y;
ASSERT(currentOverlay->objIdx >= 0
&& currentOverlay->objIdx <=
@@ -2672,8 +2672,8 @@ void drawOverlays(void) {
if (objPtr->frame >= 0) {
if (gameType == Cine::GID_OS) {
- u16 partVar1;
- u16 partVar2;
+ uint16 partVar1;
+ uint16 partVar2;
animDataStruct *pPart;
pPart =
&animDataTable[objPtr->
@@ -2691,10 +2691,10 @@ void drawOverlays(void) {
page1Raw, x, y);
}
} else {
- u16 partVar1;
- u16 partVar2;
+ uint16 partVar1;
+ uint16 partVar2;
animDataStruct *pPart;
- s16 part = objPtr->part;
+ int16 part = objPtr->part;
ASSERT(part >= 0
&& part <=
@@ -2721,11 +2721,11 @@ void drawOverlays(void) {
}
case 2: // text
{
- u8 messageIdx;
- s16 x;
- s16 y;
- u16 partVar1;
- u16 partVar2;
+ uint8 messageIdx;
+ int16 x;
+ int16 y;
+ uint16 partVar1;
+ uint16 partVar2;
/* gfxWaitVSync();
* hideMouse(); */
@@ -2756,8 +2756,8 @@ void drawOverlays(void) {
case 4:
{
objectStruct *objPtr;
- s16 x;
- s16 y;
+ int16 x;
+ int16 y;
ASSERT(currentOverlay->objIdx >= 0
&& currentOverlay->objIdx <=
@@ -2769,10 +2769,10 @@ void drawOverlays(void) {
y = objPtr->y;
if (objPtr->frame >= 0) {
- u16 partVar1;
- u16 partVar2;
+ uint16 partVar1;
+ uint16 partVar2;
animDataStruct *pPart;
- s16 part = objPtr->part;
+ int16 part = objPtr->part;
ASSERT(part >= 0
&& part <= NUM_MAX_PARTDATA);
@@ -2793,8 +2793,8 @@ void drawOverlays(void) {
case 20:
{
objectStruct *objPtr;
- s16 x;
- s16 y;
+ int16 x;
+ int16 y;
var5 = currentOverlay->x;
@@ -2813,8 +2813,8 @@ void drawOverlays(void) {
if (animDataTable
[objPtr->frame].
field_4 == 1) {
- s16 x2;
- s16 y2;
+ int16 x2;
+ int16 y2;
x2 = animDataTable[objPtr->frame].width / 2;
y2 = animDataTable[objPtr->frame].var2;
@@ -2838,7 +2838,7 @@ void flip(void) {
blitRawScreen(page1Raw);
}
-u16 processKeyboard(u16 param) {
+uint16 processKeyboard(uint16 param) {
return 0;
}
@@ -2886,7 +2886,7 @@ void checkForPendingDataLoad(void) {
}
}
-u16 exitEngine;
+uint16 exitEngine;
void hideMouse(void) {
}
@@ -2895,24 +2895,24 @@ void closeEngine7(void) {
}
void removeExtention(char *dest, const char *source) {
- u8 *ptr;
+ uint8 *ptr;
strcpy(dest, source);
- ptr = (u8 *) strchr(dest, '.');
+ ptr = (uint8 *) strchr(dest, '.');
if (ptr) {
*ptr = 0;
}
}
-u16 var22;
+uint16 var22;
-u16 defaultMenuBoxColor2;
+uint16 defaultMenuBoxColor2;
-u16 zoneData[NUM_MAX_ZONE];
+uint16 zoneData[NUM_MAX_ZONE];
-void addMessage(u8 param1, s16 param2, s16 param3, s16 param4, s16 param5) {
+void addMessage(uint8 param1, int16 param2, int16 param3, int16 param4, int16 param5) {
overlayHeadElement *currentHead = &overlayHead;
overlayHeadElement *tempHead = currentHead;
overlayHeadElement *newElement;
@@ -2947,8 +2947,8 @@ void addMessage(u8 param1, s16 param2, s16 param3, s16 param4, s16 param5) {
unkListElementStruct unkList;
-void addUnkListElement(s16 param0, s16 param1, s16 param2, s16 param3,
- s16 param4, s16 param5, s16 param6, s16 param7, s16 param8) {
+void addUnkListElement(int16 param0, int16 param1, int16 param2, int16 param3,
+ int16 param4, int16 param5, int16 param6, int16 param7, int16 param8) {
unkListElementStruct *currentHead = &unkList;
unkListElementStruct *tempHead = currentHead;
unkListElementStruct *newElement;
@@ -2986,8 +2986,8 @@ void resetUnkList() {
unkList.next = NULL;
}
-void computeMove1(unkListElementStruct *element, s16 x, s16 y, s16 param1,
- s16 param2, s16 x2, s16 y2) {
+void computeMove1(unkListElementStruct *element, int16 x, int16 y, int16 param1,
+ int16 param2, int16 x2, int16 y2) {
element->var16 = 0;
element->var14 = 0;
@@ -3012,8 +3012,8 @@ void computeMove1(unkListElementStruct *element, s16 x, s16 y, s16 param1,
}
}
-u16 computeMove2(unkListElementStruct *element) {
- s16 returnVar = 0;
+uint16 computeMove2(unkListElementStruct *element) {
+ int16 returnVar = 0;
if (element->var16 == 1) {
returnVar = 4;
@@ -3032,14 +3032,14 @@ u16 computeMove2(unkListElementStruct *element) {
// sort all the gfx stuff...
-void resetGfxEntityEntry(u16 objIdx) {
+void resetGfxEntityEntry(uint16 objIdx) {
#if 0
overlayHeadElement* tempHead = &overlayHead;
- u8* var_16 = NULL;
- u16 var_10 = 0;
- u16 var_12 = 0;
+ uint8* var_16 = NULL;
+ uint16 var_10 = 0;
+ uint16 var_12 = 0;
overlayHeadElement* currentHead = tempHead->next;
- u8* var_1A = NULL;
+ uint8* var_1A = NULL;
overlayHeadElement* var1E = &overlayHead;
while(currentHead) {
@@ -3102,18 +3102,18 @@ void resetGfxEntityEntry(u16 objIdx) {
#endif
}
-u16 addAni(u16 param1, u16 param2, u8 *ptr, unkListElementStruct *element,
- u16 param3, s16 *param4) {
- u8 *currentPtr = ptr;
- u8 *ptrData;
- u8 *ptr2;
- s16 di;
+uint16 addAni(uint16 param1, uint16 param2, uint8 *ptr, unkListElementStruct *element,
+ uint16 param3, int16 *param4) {
+ uint8 *currentPtr = ptr;
+ uint8 *ptrData;
+ uint8 *ptr2;
+ int16 di;
ASSERT_PTR(ptr);
ASSERT_PTR(element);
ASSERT_PTR(param4);
- dummyU16 = *(u16 *) ((currentPtr + param1 * 2) + 8);
+ dummyU16 = *(uint16 *) ((currentPtr + param1 * 2) + 8);
flipU16(&dummyU16);
ptrData = ptr + dummyU16;
@@ -3127,9 +3127,9 @@ u16 addAni(u16 param1, u16 param2, u8 *ptr, unkListElementStruct *element,
return 0;
}
- objectTable[param2].x += (s8) ptr2[4];
- objectTable[param2].y += (s8) ptr2[5];
- objectTable[param2].mask += (s8) ptr2[6];
+ objectTable[param2].x += (int8) ptr2[4];
+ objectTable[param2].y += (int8) ptr2[5];
+ objectTable[param2].mask += (int8) ptr2[6];
if (objectTable[param2].frame) {
resetGfxEntityEntry(param2);
@@ -3147,12 +3147,12 @@ u16 addAni(u16 param1, u16 param2, u8 *ptr, unkListElementStruct *element,
}
void processUnkListElement(unkListElementStruct *element) {
- s16 x;
- s16 y;
- u8 *ptr1;
- s16 var_10;
- s16 var_4;
- s16 var_2;
+ int16 x;
+ int16 y;
+ uint8 *ptr1;
+ int16 var_10;
+ int16 var_4;
+ int16 var_2;
if (element->var12 < element->var10) {
element->var12++;
@@ -3166,8 +3166,8 @@ void processUnkListElement(unkListElementStruct *element) {
ptr1 = animDataTable[element->varA].ptr1;
if (ptr1) {
- u16 param1;
- u16 param2;
+ uint16 param1;
+ uint16 param2;
param1 = ptr1[1];
param2 = ptr1[2];
@@ -3238,7 +3238,7 @@ void processUnkListElement(unkListElementStruct *element) {
}
addAni(element->var1C + 3, element->var6, ptr1,
- element, 1, (s16 *) & var2);
+ element, 1, (int16 *) & var2);
}
}
diff --git a/engines/cine/various.h b/engines/cine/various.h
index a8864ea9f2..3121f35806 100644
--- a/engines/cine/various.h
+++ b/engines/cine/various.h
@@ -31,16 +31,16 @@ extern int gameType;
typedef char commandeType[20];
-s16 makeMenuChoice(const commandeType commandList[], u16 height, u16 X, u16 Y,
- u16 width);
-s16 makeMenuChoice2(const commandeType commandList[], u16 height, u16 X, u16 Y,
- u16 width);
+int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X, uint16 Y,
+ uint16 width);
+int16 makeMenuChoice2(const commandeType commandList[], uint16 height, uint16 X, uint16 Y,
+ uint16 width);
-extern s16 allowSystemMenu;
+extern int16 allowSystemMenu;
typedef struct {
- u8 *ptr;
- u16 len;
+ uint8 *ptr;
+ uint16 len;
} unk1Struct;
#define NUM_MAX_MESSAGE 255
@@ -49,74 +49,74 @@ extern unk1Struct messageTable[NUM_MAX_MESSAGE];
struct unkListElementStruct {
struct unkListElementStruct *next;
- s16 var4;
- s16 var6;
- s16 var8;
- s16 varA;
- s16 varC;
- s16 varE;
- s16 var10;
- s16 var12;
- s16 var14;
- s16 var16;
- s16 var18;
- s16 var1A;
- s16 var1C;
- s16 var1E;
+ int16 var4;
+ int16 var6;
+ int16 var8;
+ int16 varA;
+ int16 varC;
+ int16 varE;
+ int16 var10;
+ int16 var12;
+ int16 var14;
+ int16 var16;
+ int16 var18;
+ int16 var1A;
+ int16 var1C;
+ int16 var1E;
};
typedef struct unkListElementStruct unkListElementStruct;
extern unkListElementStruct unkList;
-extern u32 var6;
-extern u32 var8;
-extern u8 *var9;
+extern uint32 var6;
+extern uint32 var8;
+extern uint8 *var9;
-extern u16 var2;
-extern u16 var3;
-extern u16 var4;
-extern u16 var5;
+extern uint16 var2;
+extern uint16 var3;
+extern uint16 var4;
+extern uint16 var5;
extern Common::File palFileHandle;
extern Common::File partFileHandle;
-void processPendingUpdates(s16 param);
+void processPendingUpdates(int16 param);
void closeEngine3(void);
void mainLoopSub1(void);
-void mainLoopSub2(u16 param1, u16 param2, u16 param3, u16 param4);
+void mainLoopSub2(uint16 param1, uint16 param2, uint16 param3, uint16 param4);
-extern u16 errorVar;
-extern u8 menuVar;
+extern uint16 errorVar;
+extern uint8 menuVar;
-void gfxFuncGen1(u8 *param1, u8 *param2, u8 *param3, u8 *param4,
- s16 param5);
+void gfxFuncGen1(uint8 *param1, uint8 *param2, uint8 *param3, uint8 *param4,
+ int16 param5);
-extern u8 *page0;
-extern u8 *page0c;
+extern uint8 *page0;
+extern uint8 *page0c;
void ptrGfxFunc13(void);
void gfxFuncGen2(void);
-extern u16 allowPlayerInput;
+extern uint16 allowPlayerInput;
-extern u16 checkForPendingDataLoadSwitch;
+extern uint16 checkForPendingDataLoadSwitch;
-extern u16 fadeRequired;
-extern u16 isDrawCommandEnabled;
-extern u16 waitForPlayerClick;
-extern u16 var16;
-extern u16 var17;
-extern u16 var18;
-extern u16 var19;
-extern u16 var20;
-extern u8 var21;
+extern uint16 fadeRequired;
+extern uint16 isDrawCommandEnabled;
+extern uint16 waitForPlayerClick;
+extern uint16 var16;
+extern uint16 var17;
+extern uint16 var18;
+extern uint16 var19;
+extern uint16 var20;
+extern uint8 var21;
-extern s16 playerCommand;
+extern int16 playerCommand;
extern char commandBuffer[80];
-extern u16 c_palette[256];
+extern uint16 c_palette[256];
extern char currentPrcName[20];
extern char currentRelName[20];
@@ -133,47 +133,47 @@ extern char currentPartName[15];
void stopSample(void);
void mainLoopSub3(void);
-u16 executePlayerInput(void);
+uint16 executePlayerInput(void);
void drawOverlays(void);
void flip(void);
-extern u16 mouseUpdateStatus;
-extern u16 dummyU16;
+extern uint16 mouseUpdateStatus;
+extern uint16 dummyU16;
-void getMouseData(u16 param, u16 *pButton, u16 *pX, u16 *pY);
+void getMouseData(uint16 param, uint16 *pButton, uint16 *pX, uint16 *pY);
-u16 processKeyboard(u16 param);
+uint16 processKeyboard(uint16 param);
void mainLoopSub6(void);
void checkForPendingDataLoad(void);
-extern u16 exitEngine;
+extern uint16 exitEngine;
void hideMouse(void);
void closeEngine7(void);
-extern u16 var22;
+extern uint16 var22;
void removeExtention(char *dest, const char *source);
struct selectedObjStruct {
- s16 idx;
- s16 param;
+ int16 idx;
+ int16 param;
};
typedef struct selectedObjStruct selectedObjStruct;
-extern u16 defaultMenuBoxColor;
-extern u16 defaultMenuBoxColor2;
+extern uint16 defaultMenuBoxColor;
+extern uint16 defaultMenuBoxColor2;
#define NUM_MAX_ZONE 16
-extern u16 zoneData[NUM_MAX_ZONE];
+extern uint16 zoneData[NUM_MAX_ZONE];
-void addMessage(u8 param1, s16 param2, s16 param3, s16 param4, s16 param5);
+void addMessage(uint8 param1, int16 param2, int16 param3, int16 param4, int16 param5);
-void blitScreen(u8 *frontBuffer, u8 *backbuffer);
+void blitScreen(uint8 *frontBuffer, uint8 *backbuffer);
struct mouseStatusStruct {
int left;
@@ -184,10 +184,10 @@ struct mouseStatusStruct {
typedef struct mouseStatusStruct mouseStatusStruct;
-extern s16 additionalBgVScroll;
+extern int16 additionalBgVScroll;
-void addUnkListElement(s16 param0, s16 param1, s16 param2, s16 param3,
- s16 param4, s16 param5, s16 param6, s16 param7, s16 param8);
+void addUnkListElement(int16 param0, int16 param1, int16 param2, int16 param3,
+ int16 param4, int16 param5, int16 param6, int16 param7, int16 param8);
void resetUnkList();
void processUnkList(void);
#endif