mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-17 07:07:10 +00:00
added script opcode for dig minigame
svn-id: r6834
This commit is contained in:
parent
52bf93a8aa
commit
4cdfd9c2be
@ -377,6 +377,7 @@ protected:
|
||||
void o6_pickVarRandom();
|
||||
void o6_getDateTime();
|
||||
void o6_unknownE0();
|
||||
void o6_unknownE1();
|
||||
void o6_unknownE4();
|
||||
void o6_localizeArray();
|
||||
void o6_shuffle();
|
||||
|
@ -323,7 +323,7 @@ void Scumm_v6::setupOpcodes() {
|
||||
OPCODE(o6_invalid),
|
||||
/* E0 */
|
||||
OPCODE(o6_unknownE0),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_unknownE1),
|
||||
OPCODE(o6_localizeArray),
|
||||
OPCODE(o6_pickVarRandom),
|
||||
/* E4 */
|
||||
@ -2922,6 +2922,39 @@ void Scumm_v6::o6_getDateTime() {
|
||||
_vars[VAR_TIMEDATE_SECOND] = t->tm_sec;
|
||||
}
|
||||
|
||||
void Scumm_v6::o6_unknownE1() {
|
||||
// this opcode check ground area in minigame in the dig
|
||||
int x = pop();
|
||||
int y = pop();
|
||||
|
||||
if (x > _realWidth - 1) {
|
||||
push(-1);
|
||||
return;
|
||||
}
|
||||
if (x < 0) {
|
||||
push(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
push(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
VirtScreen *vs = findVirtScreen(y);
|
||||
|
||||
if (vs == NULL) {
|
||||
push(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: something is wrong, it take wrong position or wrong buffer check
|
||||
int offset = (y - vs->topline) * _realWidth + x + vs->tdirty[0];
|
||||
|
||||
byte area = *(getResourceAddress(rtBuffer, vs->number + 1) + offset);
|
||||
push(area);
|
||||
}
|
||||
|
||||
void Scumm_v6::o6_unknownE0() {
|
||||
int a = fetchScriptByte();
|
||||
warning("o6_unknownEO(%d) stub", a);
|
||||
|
Loading…
Reference in New Issue
Block a user