aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'scumm')
-rw-r--r--scumm/intern.h4
-rw-r--r--scumm/script_v90he.cpp109
2 files changed, 10 insertions, 103 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 292f03e403..8cfa0daf3d 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -866,8 +866,8 @@ protected:
void o90_dup();
void o90_getLT();
void o90_getGT();
- void o90_unknown1F();
- void o90_unknown20();
+ void o90_sin();
+ void o90_cos();
void o90_startLocalScript();
void o90_wizImageOps();
void o90_unknown25();
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index 6557a04897..ca47c5513e 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -82,9 +82,9 @@ void ScummEngine_v90he::setupOpcodes() {
OPCODE(o90_wizImageOps),
OPCODE(o90_getLT),
OPCODE(o90_getGT),
- OPCODE(o90_unknown1F),
+ OPCODE(o90_sin),
/* 20 */
- OPCODE(o90_unknown20),
+ OPCODE(o90_cos),
OPCODE(o6_invalid),
OPCODE(o6_invalid),
OPCODE(o6_invalid),
@@ -410,107 +410,14 @@ 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];
-
- if (ecx)
- push(eax);
- else
- push(-eax);
+void ScummEngine_v90he::o90_sin() {
+ double a = pop() * M_PI / 180.;
+ push((int)(sin(a) * 100000));
}
-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];
-
- if (ecx)
- push(eax);
- else
- push(-eax);
+void ScummEngine_v90he::o90_cos() {
+ double a = pop() * M_PI / 180.;
+ push((int)(cos(a) * 100000));
}
void ScummEngine_v90he::o90_startLocalScript() {