diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 4 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 115 |
2 files changed, 112 insertions, 7 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 930fb7c395..814e5ffdc8 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -878,8 +878,10 @@ protected: void o90_dup(); void o90_getLT(); void o90_getGT(); + void o90_unknown1F(); + void o90_unknown20(); void o90_startLocalScript(); - void o90_unknown1C(); + void o90_wizImageOps(); void o90_unknown25(); void o90_unknown26(); void o90_unknown27(); diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 38a8f77a2d..263fb2f530 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -79,12 +79,12 @@ void ScummEngine_v90he::setupOpcodes() { OPCODE(o6_pop), OPCODE(o72_isAnyOf), /* 1C */ - OPCODE(o90_unknown1C), + OPCODE(o90_wizImageOps), OPCODE(o90_getLT), OPCODE(o90_getGT), - OPCODE(o6_invalid), + OPCODE(o90_unknown1F), /* 20 */ - OPCODE(o6_invalid), + OPCODE(o90_unknown20), OPCODE(o6_invalid), OPCODE(o6_invalid), OPCODE(o6_invalid), @@ -410,6 +410,109 @@ void ScummEngine_v90he::o90_getGT() { } } +const int16 tableUnk[360] = { +0x0000, 0x0000, 0x06D1, 0x0000, 0x0DA1, 0x0000, 0x1471, 0x0000, 0x1B3F, 0x0000, +0x220B, 0x0000, 0x28D4, 0x0000, 0x2F9A, 0x0000, 0x365D, 0x0000, 0x3D1B, 0x0000, +0x43D4, 0x0000, 0x4A88, 0x0000, 0x5137, 0x0000, 0x57DF, 0x0000, 0x5E80, 0x0000, +0x6519, 0x0000, 0x6BAB, 0x0000, 0x7235, 0x0000, 0x78B5, 0x0000, 0x7F2C, 0x0000, +0x859A, 0x0000, 0x8BFC, 0x0000, 0x9254, 0x0000, 0x98A1, 0x0000, 0x9EE1, 0x0000, +0xA515, 0x0000, 0xAB3D, 0x0000, 0xB157, 0x0000, 0xB763, 0x0000, 0xBD60, 0x0000, +0xC350, 0x0000, 0xC92F, 0x0000, 0xCEFF, 0x0000, 0xD4BF, 0x0000, 0xDA6F, 0x0000, +0xE00D, 0x0000, 0xE59A, 0x0000, 0xEB15, 0x0000, 0xF0D8, 0x0000, 0xF5D4, 0x0000, +0xFB16, 0x0000, 0x0045, 0x0001, 0x0561, 0x0001, 0x0A67, 0x0001, 0x0F59, 0x0001, +0x1436, 0x0001, 0x18FD, 0x0001, 0x1DAF, 0x0001, 0x224A, 0x0001, 0x26CE, 0x0001, +0x2B3C, 0x0001, 0x2F92, 0x0001, 0x33D1, 0x0001, 0x37F7, 0x0001, 0x3C05, 0x0001, +0x3FFB, 0x0001, 0x43D7, 0x0001, 0x479B, 0x0001, 0x4B44, 0x0001, 0x4ED4, 0x0001, +0x524A, 0x0001, 0x55A5, 0x0001, 0x58E6, 0x0001, 0x5C0C, 0x0001, 0x5F17, 0x0001, +0x6206, 0x0001, 0x64DA, 0x0001, 0x6792, 0x0001, 0x6A2E, 0x0001, 0x6CAE, 0x0001, +0x6F11, 0x0001, 0x7157, 0x0001, 0x7381, 0x0001, 0x758E, 0x0001, 0x777E, 0x0001, +0x7950, 0x0001, 0x7B05, 0x0001, 0x7C9D, 0x0001, 0x7E16, 0x0001, 0x7F72, 0x0001, +0x80B0, 0x0001, 0x81D0, 0x0001, 0x82D2, 0x0001, 0x83B6, 0x0001, 0x847C, 0x0001, +0x8523, 0x0001, 0x85AC, 0x0001, 0x8616, 0x0001, 0x8663, 0x0001, 0x8690, 0x0001, +0x86A0, 0x0001, 0x8690, 0x0001, 0x8663, 0x0001, 0x8616, 0x0001, 0x85AC, 0x0001, +0x8523, 0x0001, 0x847C, 0x0001, 0x83B6, 0x0001, 0x82D2, 0x0001, 0x81D0, 0x0001, +0x80B0, 0x0001, 0x7F72, 0x0001, 0x7E16, 0x0001, 0x7C9D, 0x0001, 0x7B05, 0x0001, +0x7950, 0x0001, 0x777E, 0x0001, 0x758E, 0x0001, 0x7381, 0x0001, 0x7157, 0x0001, +0x6F11, 0x0001, 0x6CAE, 0x0001, 0x6A2E, 0x0001, 0x6792, 0x0001, 0x64DA, 0x0001, +0x6206, 0x0001, 0x5F17, 0x0001, 0x5C0C, 0x0001, 0x58E6, 0x0001, 0x55A5, 0x0001, +0x524A, 0x0001, 0x4ED4, 0x0001, 0x4B44, 0x0001, 0x479B, 0x0001, 0x43D7, 0x0001, +0x3FFB, 0x0001, 0x3C05, 0x0001, 0x37F7, 0x0001, 0x33D1, 0x0001, 0x2F92, 0x0001, +0x2B3C, 0x0001, 0x26CE, 0x0001, 0x224A, 0x0001, 0x1DAF, 0x0001, 0x18FD, 0x0001, +0x1436, 0x0001, 0x0F59, 0x0001, 0x0A67, 0x0001, 0x0561, 0x0001, 0x0045, 0x0001, +0xFB16, 0x0000, 0xF5D4, 0x0000, 0xF0D8, 0x0000, 0xEB15, 0x0000, 0xE59A, 0x0000, +0xE00D, 0x0000, 0xDA6F, 0x0000, 0xD4BF, 0x0000, 0xCEFF, 0x0000, 0xC92F, 0x0000, +0xC350, 0x0000, 0xBD60, 0x0000, 0xB763, 0x0000, 0xB157, 0x0000, 0xAB3D, 0x0000, +0xA515, 0x0000, 0x9EE1, 0x0000, 0x98A1, 0x0000, 0x9254, 0x0000, 0x8BFC, 0x0000, +0x859A, 0x0000, 0x7F2C, 0x0000, 0x78B5, 0x0000, 0x7235, 0x0000, 0x6BAB, 0x0000, +0x6519, 0x0000, 0x5E80, 0x0000, 0x57DF, 0x0000, 0x5137, 0x0000, 0x4A88, 0x0000, +0x43D4, 0x0000, 0x3D1B, 0x0000, 0x365D, 0x0000, 0x2F9A, 0x0000, 0x28D4, 0x0000, +0x220B, 0x0000, 0x1B3F, 0x0000, 0x1471, 0x0000, 0x0DA1, 0x0000, 0x06D1, 0x0000, +}; + +void ScummEngine_v90he::o90_unknown1F() { + int eax, ecx, edx; + eax = pop(); + + if (eax == 0) { + push(0); + return; + } + + ecx = (eax > 0) ? 0 : 1; + + edx = eax / 360; + eax = edx; + eax |= edx; + eax -= edx; + + if (eax > 360) { + if (ecx == 1) + ecx = !ecx; + eax -= 180; + ecx = -ecx; + + } + + eax = tableUnk[eax * 4]; + + if (ecx) + push(eax); + else + push(-eax); +} + +void ScummEngine_v90he::o90_unknown20() { + int eax, ecx, edx; + eax = pop() + 90; + + if (eax == 0) { + push(0); + return; + } + + ecx = (eax > 0) ? 0 : 1; + + edx = eax / 360; + eax = edx; + eax |= edx; + eax -= edx; + + if (eax > 360) { + if (ecx == 1) + ecx = !ecx; + eax -= 180; + ecx = -ecx; + + } + + eax = tableUnk[eax * 4]; + + if (ecx) + push(eax); + else + push(-eax); +} + void ScummEngine_v90he::o90_startLocalScript() { int args[16]; int script, entryp; @@ -439,7 +542,7 @@ void ScummEngine_v90he::wizDraw(const WizParameters *params) { } } -void ScummEngine_v90he::o90_unknown1C() { +void ScummEngine_v90he::o90_wizImageOps() { int a, b; int subOp = fetchScriptByte(); subOp -= 46; @@ -577,10 +680,10 @@ void ScummEngine_v90he::o90_unknown1C() { wizDraw(&_wizParams); break; default: - error("o90_unknown1C: unhandled case %d", subOp); + error("o90_wizImageOps: unhandled case %d", subOp); } - debug(1,"o90_unknown1C stub (%d)", subOp); + debug(1,"o90_wizImageOps stub (%d)", subOp); } void ScummEngine_v90he::o90_unknown25() { |