aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/cruise/cruise_main.cpp8
-rw-r--r--engines/cruise/font.cpp2
-rw-r--r--engines/cruise/function.cpp51
-rw-r--r--engines/cruise/mainDraw.cpp8
-rw-r--r--engines/cruise/saveload.cpp6
-rw-r--r--engines/cruise/vars.cpp2
-rw-r--r--engines/cruise/vars.h2
7 files changed, 43 insertions, 36 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 14cc4e9baa..9d00c5a543 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -440,7 +440,7 @@ int initAllData(void) {
initOverlayTable();
stateID = 0;
- currentActiveBackgroundPlane = 0;
+ masterScreen = 0;
freeDisk();
@@ -1266,11 +1266,11 @@ void callRelation(menuElementSubStruct *pMenuElement, int nObj2) {
if(currentScriptPtr)
{
- createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
+ createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
}
else
{
- createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), currentActiveBackgroundPlane, 0, 0);
+ createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), masterScreen, 0, 0);
}
userWait = 1;
@@ -1882,7 +1882,7 @@ void mainLoop(void) {
userEnabled = false;
}
} else if (autoMsg != -1) {
- removeCell(&cellHead, autoOvl, autoMsg, 5, currentActiveBackgroundPlane );
+ removeCell(&cellHead, autoOvl, autoMsg, 5, masterScreen );
autoMsg = -1;
}
}
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp
index 38ef0e9f89..8be6543eb1 100644
--- a/engines/cruise/font.cpp
+++ b/engines/cruise/font.cpp
@@ -186,7 +186,7 @@ void initSystem(void) {
fadeFlag = 0;
scroll = 0;
switchPal = 0;
- currentActiveBackgroundPlane = 0;
+ masterScreen = 0;
changeCursor(CURSOR_NORMAL);
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 87dd78e0cf..9960500ebf 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -273,7 +273,7 @@ int16 Op_RemoveMessage(void) {
overlay = currentScriptPtr->overlayNumber;
}
- removeCell(&cellHead, overlay, idx, 5, currentActiveBackgroundPlane);
+ removeCell(&cellHead, overlay, idx, 5, masterScreen);
return (0);
}
@@ -538,16 +538,16 @@ int16 Op_FadeOut(void) {
for(long int i=0; i< 256; i+=32) {
for(long int j=0; j<256; j++) {
int offsetTable[3];
- offsetTable[0] = -i;
- offsetTable[1] = -i;
- offsetTable[2] = -i;
+ offsetTable[0] = -32;
+ offsetTable[1] = -32;
+ offsetTable[2] = -32;
calcRGB(&workpal[3*j], &workpal[3*j], offsetTable);
}
gfxModuleData_setPal256(workpal);
gfxModuleData_flipScreen();
}
- //gfxModuleData_gfxClearFrameBuffer(backgroundPtrtable[currentActiveBackgroundPlane]);
+ //gfxModuleData_gfxClearFrameBuffer(backgroundPtrtable[masterScreen]);
fadeFlag = 1;
PCFadeFlag = 1;
@@ -631,7 +631,7 @@ int16 Op_AddCell(void) {
if (!overlayIdx)
overlayIdx = currentScriptPtr->overlayNumber;
- addCell(&cellHead, overlayIdx, objIdx, objType, currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, currentScriptPtr->type);
+ addCell(&cellHead, overlayIdx, objIdx, objType, masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, currentScriptPtr->type);
return 0;
}
@@ -645,7 +645,7 @@ int16 Op_AddBackgroundIncrust(void) {
if (!overlayIdx)
overlayIdx = currentScriptPtr->overlayNumber;
- addBackgroundIncrust(overlayIdx, objIdx, &backgroundIncrustHead, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, currentActiveBackgroundPlane, objType);
+ addBackgroundIncrust(overlayIdx, objIdx, &backgroundIncrustHead, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, masterScreen, objType);
return 0;
}
@@ -659,7 +659,7 @@ int16 Op_RemoveCell(void) {
ovlNumber = currentScriptPtr->overlayNumber;
}
- removeCell(&cellHead, ovlNumber, objectIdx, objType, currentActiveBackgroundPlane);
+ removeCell(&cellHead, ovlNumber, objectIdx, objType, masterScreen);
return 0;
}
@@ -714,7 +714,7 @@ int16 Op_AddMessage(void) {
}
}
- createTextObject(&cellHead, overlayIdx, var_8, var_6, var_4, var_2, color, currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
+ createTextObject(&cellHead, overlayIdx, var_8, var_6, var_4, var_2, color, masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
return 0;
}
@@ -770,7 +770,7 @@ int16 Op_AutoCell(void) {
if (!overlay)
overlay = currentScriptPtr->overlayNumber;
- pObject = addCell(&cellHead, overlay, obj, 4, currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, currentScriptPtr->type);
+ pObject = addCell(&cellHead, overlay, obj, 4, masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, currentScriptPtr->type);
if (!pObject)
return 0;
@@ -822,12 +822,12 @@ int16 Op_Sizeof(void) {
}
int16 Op_SetActiveBackground(void) {
- int currentPlane = currentActiveBackgroundPlane;
+ int currentPlane = masterScreen;
int newPlane = popVar();
if (newPlane >= 0 && newPlane < 8) {
if (backgroundPtrtable[newPlane]) {
- currentActiveBackgroundPlane = newPlane;
+ masterScreen = newPlane;
switchPal = 1;
}
}
@@ -842,8 +842,8 @@ int16 Op_RemoveBackground(void) {
if(backgroundPtrtable[backgroundIdx])
free(backgroundPtrtable[backgroundIdx]);
- if(currentActiveBackgroundPlane == backgroundIdx)
- currentActiveBackgroundPlane = 0;
+ if(masterScreen == backgroundIdx)
+ masterScreen = 0;
strcpy(backgroundTable[backgroundIdx].name, "");
}
@@ -1258,24 +1258,31 @@ int16 Op_StopSong(void) {
}
int16 Op_BgName(void) {
- popPtr();
- popVar();
+ char* bgName = (char*)popPtr();
+ int bgIdx = popVar();
- printf("Partial op 5C\n");
+ if((bgIdx >= 0) && (bgIdx < 8) && bgName) {
+ strcpy(bgName, backgroundTable[bgIdx].name);
+
+ if(strlen(bgName))
+ return 1;
+
+ return 0;
+ }
return 0;
}
int16 Op_StopFX(void) {
- popVar();
+ int fxIdx = popVar();
- printf("Partial op 5E (sound related)\n");
+ printf("StopFX(%d)\n", fxIdx);
return 0;
}
int16 Op_PlaySong(void) {
- printf("Partial op 3E (sound related)\n");
+ printf("PlaySong()\n");
return 0;
}
@@ -1295,12 +1302,12 @@ int16 Op_CTOff(void) {
}
int16 Op_FadeSong(void) {
- printf("Partial op 3F (sound related)\n");
+ printf("FadeSong()\n");
return 0;
}
int16 Op_FreeSong(void) {
- printf("Partial op 40 (sound related)\n");
+ printf("FreeSong()\n");
//freeStuff1();
freeStuff2();
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index 5898b032b4..158d4daf60 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -103,7 +103,7 @@ void fadeIn() {
offsetTable[0] = -i;
offsetTable[1] = -i;
offsetTable[2] = -i;
- calcRGB(&palScreen[currentActiveBackgroundPlane][3*j], &workpal[3*j], offsetTable);
+ calcRGB(&palScreen[masterScreen][3*j], &workpal[3*j], offsetTable);
}
gfxModuleData_setPal256(workpal);
gfxModuleData_flipScreen();
@@ -114,7 +114,7 @@ void fadeIn() {
offsetTable[0] = 0;
offsetTable[1] = 0;
offsetTable[2] = 0;
- calcRGB(&palScreen[currentActiveBackgroundPlane][3*j], &workpal[3*j], offsetTable);
+ calcRGB(&palScreen[masterScreen][3*j], &workpal[3*j], offsetTable);
}
gfxModuleData_setPal256(workpal);
@@ -1392,7 +1392,7 @@ void mainDraw(int16 param) {
return;
}
- bgPtr = backgroundPtrtable[currentActiveBackgroundPlane];
+ bgPtr = backgroundPtrtable[masterScreen];
if (bgPtr) {
gfxModuleData_gfxCopyScreen((char *)bgPtr, (char *)gfxModuleData.pPage10);
@@ -1410,7 +1410,7 @@ void mainDraw(int16 param) {
//-------------------------------------------------- PROCESS SPRITES -----------------------------------------//
while (currentObjPtr) {
- if ((currentActiveBackgroundPlane == currentObjPtr->backgroundPlane) && (currentObjPtr->freeze == 0) && (currentObjPtr->type == OBJ_TYPE_SPRITE)) {
+ if ((masterScreen == currentObjPtr->backgroundPlane) && (currentObjPtr->freeze == 0) && (currentObjPtr->type == OBJ_TYPE_SPRITE)) {
objectParamsQuery params;
currentObjIdx = currentObjPtr->idx;
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index 31721f440f..88567fdee7 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -103,7 +103,7 @@ void initVars(void)
initOverlayTable();
stateID = 0;
- currentActiveBackgroundPlane = 0;
+ masterScreen = 0;
freeDisk();
@@ -537,7 +537,7 @@ int saveSavegameData(int saveGameIdx) {
else
currentSaveFile->writeSint16LE(0);
- currentSaveFile->writeSint16LE(currentActiveBackgroundPlane);
+ currentSaveFile->writeSint16LE(masterScreen);
currentSaveFile->writeSint16LE(switchPal);
currentSaveFile->writeSint16LE(scroll);
currentSaveFile->writeSint16LE(fadeFlag);
@@ -714,7 +714,7 @@ int loadSavegameData(int saveGameIdx) {
else
animationStart = false;
- currentActiveBackgroundPlane = currentSaveFile->readSint16LE();
+ masterScreen = currentSaveFile->readSint16LE();
switchPal = currentSaveFile->readSint16LE();
scroll = currentSaveFile->readSint16LE();
fadeFlag = currentSaveFile->readSint16LE();
diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp
index bcc9ac825d..e584faa97a 100644
--- a/engines/cruise/vars.cpp
+++ b/engines/cruise/vars.cpp
@@ -39,7 +39,7 @@ int16 scroll;
int16 switchPal;
char cmdLine[90];
-int16 currentActiveBackgroundPlane;
+int16 masterScreen;
int16 doFade;
int16 fadeFlag = 0;
diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h
index 44945da1ed..cdf3de072c 100644
--- a/engines/cruise/vars.h
+++ b/engines/cruise/vars.h
@@ -67,7 +67,7 @@ extern int16 scroll;
extern int16 switchPal;
extern char cmdLine[90];
-extern int16 currentActiveBackgroundPlane;
+extern int16 masterScreen;
extern int16 doFade;
extern int16 fadeFlag;