Add missing opcode details

Fix regression (Fields not initied)

svn-id: r17938
This commit is contained in:
Travis Howell 2005-05-07 07:57:59 +00:00
parent 8ce20af137
commit 8de4c596a0
9 changed files with 82 additions and 14 deletions

View File

@ -932,7 +932,7 @@ protected:
void o72_getPixel();
void o72_pickVarRandom();
void o72_redimArray();
void o72_checkGlobQueue();
void o72_isResourceLoaded();
void o72_readINI();
void o72_writeINI();
void o72_getResourceSize();
@ -1300,6 +1300,7 @@ protected:
void o100_cursorCommand();
void o100_wait();
void o100_writeFile();
void o100_isResourceLoaded();
void o100_getResourceSize();
void o100_getSpriteGroupInfo();
void o100_getPaletteData();

View File

@ -875,7 +875,7 @@ void ScummEngine_v70he::clearDrawQueues() {
void ScummEngine_v80he::clearDrawQueues() {
ScummEngine_v70he::clearDrawQueues();
_wiz.imageNumClear();
_wiz.clearWizBuffer();
}

View File

@ -269,7 +269,7 @@ void ScummEngine_v100he::setupOpcodes() {
/* B4 */
OPCODE(o72_getNumFreeArrays),
OPCODE(o72_getArrayDimSize),
OPCODE(o72_checkGlobQueue),
OPCODE(o100_isResourceLoaded),
OPCODE(o100_getResourceSize),
/* B8 */
OPCODE(o100_getSpriteGroupInfo),
@ -2198,6 +2198,36 @@ void ScummEngine_v100he::o100_writeFile() {
debug(1, "o100_writeFile: slot %d, subOp %d", slot, subOp);
}
void ScummEngine_v100he::o100_isResourceLoaded() {
// Reports percentage of resource loaded by queue
int type;
byte subOp = fetchScriptByte();
int idx = pop();
switch (subOp) {
case 25:
type = rtCostume;
break;
case 41:
type = rtImage;
break;
case 62:
type = rtRoom;
break;
case 66:
type = rtScript;
break;
case 72:
type = rtSound;
break;
default:
error("o100_isResourceLoaded: default case %d", subOp);
}
push (res.isResourceLoaded(type, idx) ? 100 : 0);
}
void ScummEngine_v100he::o100_getResourceSize() {
const byte *ptr;
int size, type;

View File

@ -346,7 +346,7 @@ void ScummEngine_v72he::setupOpcodes() {
/* F0 */
OPCODE(o70_concatString),
OPCODE(o70_compareString),
OPCODE(o72_checkGlobQueue),
OPCODE(o72_isResourceLoaded),
OPCODE(o72_readINI),
/* F4 */
OPCODE(o72_writeINI),
@ -2107,12 +2107,34 @@ void ScummEngine_v72he::copyArrayHelper(ArrayHeader *ah, int idx2, int idx1, int
}
}
void ScummEngine_v72he::o72_checkGlobQueue() {
void ScummEngine_v72he::o72_isResourceLoaded() {
// Reports percentage of resource loaded by queue
int type;
byte subOp = fetchScriptByte();
int idx = pop();
debug(1,"o72_checkGlobQueue stub (%d, %d)", subOp, idx);
push(100);
switch (subOp) {
case 18:
type = rtImage;
break;
case 226:
type = rtRoom;
break;
case 227:
type = rtCostume;
break;
case 228:
type = rtSound;
break;
case 229:
type = rtScript;
break;
default:
error("o72_isResourceLoaded: default case %d", subOp);
}
push (res.isResourceLoaded(type, idx) ? 100 : 0);
}
void ScummEngine_v72he::o72_readINI() {

View File

@ -512,6 +512,7 @@ void ScummEngine_v70he::o70_resourceRoutines() {
subOp = fetchScriptByte();
debug(0, "o70_resourceRoutines: case %d", subOp);
switch (subOp) {
case 100: // SO_LOAD_SCRIPT
resid = pop();
@ -605,22 +606,27 @@ void ScummEngine_v70he::o70_resourceRoutines() {
case 120:
// Queue load script
resid = pop();
ensureResourceLoaded(rtScript, resid);
break;
case 121:
// Queue load sound
resid = pop();
ensureResourceLoaded(rtSound, resid);
break;
case 122:
// Queue load costume
resid = pop();
ensureResourceLoaded(rtCostume, resid);
break;
case 123:
// Queue load room image
resid = pop();
ensureResourceLoaded(rtRoomImage, resid);
break;
case 203:
// Queue load image
resid = pop();
ensureResourceLoaded(rtImage, resid);
break;
case 159:
resid = pop();

View File

@ -346,7 +346,7 @@ void ScummEngine_v80he::setupOpcodes() {
/* F0 */
OPCODE(o70_concatString),
OPCODE(o70_compareString),
OPCODE(o72_checkGlobQueue),
OPCODE(o72_isResourceLoaded),
OPCODE(o72_readINI),
/* F4 */
OPCODE(o72_writeINI),

View File

@ -344,7 +344,7 @@ void ScummEngine_v90he::setupOpcodes() {
/* F0 */
OPCODE(o70_concatString),
OPCODE(o70_compareString),
OPCODE(o72_checkGlobQueue),
OPCODE(o72_isResourceLoaded),
OPCODE(o72_readINI),
/* F4 */
OPCODE(o72_writeINI),

View File

@ -36,7 +36,7 @@ Wiz::Wiz() {
_rectOverrideEnabled = false;
}
void Wiz::imageNumClear() {
void Wiz::clearWizBuffer() {
_imagesNum = 0;
}
@ -948,13 +948,22 @@ void ScummEngine_v72he::getWizImageDim(int resNum, int state, int32 &w, int32 &h
void ScummEngine_v72he::displayWizImage(WizImage *pwi) {
if (_fullRedraw) {
assert(_wiz._imagesNum < ARRAYSIZE(_wiz._images));
memcpy(&_wiz._images[_wiz._imagesNum], pwi, sizeof(WizImage));
WizImage *wi = &_wiz._images[_wiz._imagesNum];
wi->resNum = pwi->resNum;
wi->x1 = pwi->x1;
wi->y1 = pwi->y1;
wi->zorder = 0;
wi->state = pwi->state;
wi->flags = pwi->flags;
wi->xmapNum = 0;
wi->field_390 = 0;
wi->paletteNum = 0;
++_wiz._imagesNum;
} else if (pwi->flags & kWIFIsPolygon) {
drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, pwi->xmapNum, 0, 0);
drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, 0, 0, 0);
} else {
const Common::Rect *r = NULL;
drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->zorder, pwi->xmapNum, pwi->field_390, r, pwi->flags, 0, 0);
drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, 0, 0, 0, r, pwi->flags, 0, 0);
}
}

View File

@ -144,7 +144,7 @@ struct Wiz {
WizPolygon _polygons[NUM_POLYGONS];
Wiz();
void imageNumClear();
void clearWizBuffer();
Common::Rect _rectOverride;
bool _rectOverrideEnabled;