aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2014-06-01 11:50:04 +0200
committerStrangerke2014-06-01 11:50:49 +0200
commit0b4beb59b647b5ae6c2f783ad0031635bb6fcddc (patch)
tree64748dc2b41ecceaeb339a50897293e8db8edc0a /engines
parent6b8348a6bdf8b33008a2320adb10ab8c44779503 (diff)
downloadscummvm-rg350-0b4beb59b647b5ae6c2f783ad0031635bb6fcddc.tar.gz
scummvm-rg350-0b4beb59b647b5ae6c2f783ad0031635bb6fcddc.tar.bz2
scummvm-rg350-0b4beb59b647b5ae6c2f783ad0031635bb6fcddc.zip
CRUISE: Start renaming opcodes in the Decompiler, some rework
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/decompiler.cpp125
1 files changed, 53 insertions, 72 deletions
diff --git a/engines/cruise/decompiler.cpp b/engines/cruise/decompiler.cpp
index 1e8b56139a..daedfbc504 100644
--- a/engines/cruise/decompiler.cpp
+++ b/engines/cruise/decompiler.cpp
@@ -697,46 +697,39 @@ int decompSwapStack() {
int decompFunction() {
currentScriptOpcodeType = getByteFromDecompScriptReal();
-// addDecomp("OP_%X", currentScriptOpcodeType);
switch (currentScriptOpcodeType) {
- case 0x1: {
- pushDecomp("_setdoFade()");
+ case 0x1:
+ pushDecomp("Op_FadeIn()");
break;
- }
- case 0x2: {
- pushDecomp("_prepareFade()");
+
+ case 0x2:
+ pushDecomp("Op_FadeOut()");
break;
- }
- case 0x3: {
- sprintf(tempbuffer, "_loadBackground(%s,%s)",
- popDecomp(), popDecomp());
+
+ case 0x3:
+ sprintf(tempbuffer, "Op_loadBackground(%s,%s)", popDecomp(), popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0x4: {
- sprintf(tempbuffer, "_loadFullBundle(%s,%s)",
- popDecomp(), popDecomp());
+
+ case 0x4:
+ sprintf(tempbuffer, "Op_LoadAbs(%s,%s)", popDecomp(), popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0x5: {
- sprintf(tempbuffer, "_addCell(%s,%s,%s)", popDecomp(),
- popDecomp(), popDecomp());
+
+ case 0x5:
+ sprintf(tempbuffer, "Op_AddCell(%s,%s,%s)", popDecomp(), popDecomp(), popDecomp());
pushDecomp(tempbuffer);
break;
- }
+
case 0x6: {
unsigned long int numArg = atoi(popDecomp());
- char *ovlStr;
- char *idxStr;
char functionName[100];
- idxStr = popDecomp();
- ovlStr = popDecomp();
+ char *idxStr = popDecomp();
+ char *ovlStr = popDecomp();
resolveVarName(ovlStr, 0x20, idxStr, functionName);
-
- sprintf(tempbuffer, "_startASync(%s", functionName);
+ sprintf(tempbuffer, "Op_AddProc(%s", functionName);
for (int i = 0; i < numArg; i++) {
strcatuint8(tempbuffer, ",");
@@ -747,74 +740,62 @@ int decompFunction() {
pushDecomp(tempbuffer);
break;
- }
- case 0x7: {
- char *var1;
- char *objIdxStr;
- char *ovlStr;
+ }
- var1 = popDecomp();
- objIdxStr = popDecomp();
- ovlStr = popDecomp();
+ case 0x7: {
+ char *var1 = popDecomp();
+ char *objIdxStr = popDecomp();
+ char *ovlStr = popDecomp();
- sprintf(tempbuffer,
- "_createObjectFromOvlData(ovl:%s,dataIdx:%s,%s)",
- ovlStr, objIdxStr, var1);
+ sprintf(tempbuffer, "Op_InitializeState(ovl:%s,dataIdx:%s,%s)", ovlStr, objIdxStr, var1);
pushDecomp(tempbuffer);
break;
- }
- case 0x8: {
- sprintf(tempbuffer, "_removeCell(%s,%s,%s)",
- popDecomp(), popDecomp(), popDecomp());
+ }
+
+ case 0x8:
+ sprintf(tempbuffer, "Op_RemoveCell(%s,%s,%s)", popDecomp(), popDecomp(), popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0x9: {
- pushDecomp("_freeobjectList()");
+
+ case 0x9:
+ pushDecomp("Op_FreeCell()");
break;
- }
- case 0xA: {
- sprintf(tempbuffer, "_removeScript(ovl(%s),%s)",
- popDecomp(), popDecomp());
+
+ case 0xA:
+ sprintf(tempbuffer, "Op_RemoveProc(ovl(%s),%s)", popDecomp(), popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0xB: {
- sprintf(tempbuffer, "_resetFilesEntries(%s,%s)",
- popDecomp(), popDecomp());
+
+ case 0xB:
+ sprintf(tempbuffer, "Op_RemoveFrame(%s,%s)", popDecomp(), popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0xC: {
- sprintf(tempbuffer, "_loadOverlay(%s)", popDecomp());
+
+ case 0xC:
+ sprintf(tempbuffer, "Op_LoadOverlay(%s)", popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0xD: {
- sprintf(tempbuffer, "_palManipulation(%s,%s,%s,%s,%s)",
- popDecomp(), popDecomp(), popDecomp(), popDecomp(),
- popDecomp());
+
+ case 0xD:
+ sprintf(tempbuffer, "Op_SetColor(%s,%s,%s,%s,%s)", popDecomp(), popDecomp(), popDecomp(), popDecomp(), popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0xE: {
- sprintf(tempbuffer, "_playSample(%s,%s,%s,%s)",
- popDecomp(), popDecomp(), popDecomp(),
- popDecomp());
+
+ case 0xE:
+ sprintf(tempbuffer, "Op_PlayFX(%s,%s,%s,%s)", popDecomp(), popDecomp(), popDecomp(), popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0x10: {
- sprintf(tempbuffer, "_releaseScript2(%s)",
- popDecomp());
+
+ case 0x10:
+ sprintf(tempbuffer, "Op_FreeOverlay(%s)", popDecomp());
pushDecomp(tempbuffer);
break;
- }
- case 0x11: {
- sprintf(tempbuffer, "_getOverlayIdx(%s)", popDecomp());
+
+ case 0x11:
+ sprintf(tempbuffer, "Op_FindOverlay(%s)", popDecomp());
pushDecomp(tempbuffer);
break;
- }
+
case 0x13: {
sprintf(tempbuffer,
"_displayMessage(%s,\"%s\",%s,%s,%s,%s)",