a few fix for Zak256

svn-id: r3575
This commit is contained in:
Vincent Hamm 2002-02-13 17:33:52 +00:00
parent bb52e5c73e
commit d9ddef19aa
7 changed files with 59 additions and 21 deletions

View file

@ -322,7 +322,7 @@ void Scumm::setupActorScale(Actor *a) {
} }
if (scale>255) if (scale>255)
error("Actor %d at %d, scale %d out of range", a->number, a->y, scale); warning("Actor %d at %d, scale %d out of range", a->number, a->y, scale);
a->scalex = (byte)scale; a->scalex = (byte)scale;
a->scaley = (byte)scale; a->scaley = (byte)scale;

View file

@ -1305,7 +1305,7 @@ void Gdi::unkDecode9() { /* FIXME: This one doesn't work.. */
for (i=0; i<((c&3)+1); i++) { for (i=0; i<((c&3)+1); i++) {
color = 0; color = 0;
for (z=0; z < 4; z++) {READ_256BIT; color+=bits<<i;} for (z=0; z < 4; z++) {READ_256BIT; color+=bits<<i;}
*dst = (run * 16 + color); *dst = (run *16 + color);
NEXT_ROW // y++; if (y>=height) {y=0; x++;}} NEXT_ROW // y++; if (y>=height) {y=0; x++;}}
} }
break; break;
@ -1337,7 +1337,7 @@ void Gdi::unkDecode10() {
*dst = local_palette[color]; *dst = local_palette[color];
NEXT_ROW NEXT_ROW
} else { } else {
uint run = color - numcolors + 1; uint run = color - numcolors +1;
color = *src++; color = *src++;
do { do {
*dst = color; *dst = color;

View file

@ -32,7 +32,7 @@ bool Scumm::getClass(int obj, int cls) {
} }
void Scumm::putClass(int obj, int cls, bool set) { void Scumm::putClass(int obj, int cls, bool set) {
checkRange(_numGlobalObjects-1, 0, obj, "Object %d out of range in getClass"); checkRange(_numGlobalObjects-1, 0, obj, "Object %d out of range in putClass");
cls &= 0x7F; cls &= 0x7F;
checkRange(32,1,cls,"Class %d out of range in getClass"); checkRange(32,1,cls,"Class %d out of range in getClass");

View file

@ -416,11 +416,11 @@ void Scumm::readIndexFileSmall() {
num = fileReadWordLE(); num = fileReadWordLE();
assert(num == _numGlobalObjects); assert(num == _numGlobalObjects);
for (i=0; i<num; i++) { /* not too sure about all that */ for (i=0; i<num; i++) { /* not too sure about all that */
_classData[i] = fileReadWordLE(); //+ fileReadByte(); _classData[i] = fileReadByte() + 256*fileReadByte()+ 256*256*fileReadByte();
fileReadByte(); // fileReadByte();
_objectOwnerTable[i] = fileReadByte(); _objectOwnerTable[i] = fileReadByte();
_objectStateTable[i] = _objectOwnerTable[i]>>OF_STATE_SHL; // _objectStateTable[i] = _objectOwnerTable[i]>>OF_STATE_SHL;
_objectOwnerTable[i] &= OF_OWNER_MASK; // _objectOwnerTable[i] &= OF_OWNER_MASK;
} }
#if defined(SCUMM_BIG_ENDIAN) #if defined(SCUMM_BIG_ENDIAN)

View file

@ -126,7 +126,7 @@ void Scumm::setupOpcodes() {
&Scumm::o5_putActorAtObject, &Scumm::o5_putActorAtObject,
&Scumm::o5_badOpcode, &Scumm::o5_badOpcode,
/* 50 */ /* 50 */
&Scumm::o5_badOpcode, &Scumm::o5_pickupObjectOld,
&Scumm::o5_animateActor, &Scumm::o5_animateActor,
&Scumm::o5_actorFollowCamera, &Scumm::o5_actorFollowCamera,
&Scumm::o5_actorSet, &Scumm::o5_actorSet,
@ -286,7 +286,7 @@ void Scumm::setupOpcodes() {
&Scumm::o5_putActorAtObject, &Scumm::o5_putActorAtObject,
&Scumm::o5_badOpcode, &Scumm::o5_badOpcode,
/* D0 */ /* D0 */
&Scumm::o5_badOpcode, &Scumm::o5_pickupObjectOld,
&Scumm::o5_animateActor, &Scumm::o5_animateActor,
&Scumm::o5_actorFollowCamera, &Scumm::o5_actorFollowCamera,
&Scumm::o5_actorSet, &Scumm::o5_actorSet,
@ -373,6 +373,9 @@ void Scumm::o5_actorSet() {
_opcode = (_opcode&0xE0) | convertTable[(_opcode&0x1F)-1]; _opcode = (_opcode&0xE0) | convertTable[(_opcode&0x1F)-1];
switch(_opcode&0x1F) { switch(_opcode&0x1F) {
case 0: /* dummy case */
getVarOrDirectByte(0x80);
break;
case 1: /* costume */ case 1: /* costume */
setActorCostume(a, getVarOrDirectByte(0x80)); setActorCostume(a, getVarOrDirectByte(0x80));
break; break;
@ -439,6 +442,8 @@ void Scumm::o5_actorSet() {
case 17: /* scale */ case 17: /* scale */
a->scalex = getVarOrDirectByte(0x80); a->scalex = getVarOrDirectByte(0x80);
a->scaley = getVarOrDirectByte(0x40); a->scaley = getVarOrDirectByte(0x40);
if(a->scalex>255 || a->scaley>255)
error("Setting an bad actor scale!");
a->needRedraw = true; a->needRedraw = true;
a->needBgReset = true; a->needBgReset = true;
break; break;
@ -475,18 +480,18 @@ FixRoom:
void Scumm::o5_actorSetClass() { void Scumm::o5_actorSetClass() {
int act = getVarOrDirectWord(0x80); int act = getVarOrDirectWord(0x80);
int i; int newClass;
while ( (_opcode=fetchScriptByte()) != 0xFF) { while ( (_opcode=fetchScriptByte()) != 0xFF) {
i = getVarOrDirectWord(0x80); newClass = getVarOrDirectWord(0x80);
if (i==0) { if (newClass==0) {
_classData[act] = 0; _classData[act] = 0;
continue; continue;
} }
if (i&0x80) if (newClass&0x80)
putClass(act, i, 1); putClass(act, newClass, 1);
else else
putClass(act, i, 0); putClass(act, newClass, 0);
} }
} }
@ -582,8 +587,8 @@ void Scumm::o5_cursorCommand() {
case 10: /* set cursor img */ case 10: /* set cursor img */
i = getVarOrDirectByte(0x80); i = getVarOrDirectByte(0x80);
j = getVarOrDirectByte(0x40); j = getVarOrDirectByte(0x40);
if (!(_gameId==GID_LOOM256)) if(_gameId != GID_LOOM256)
setCursorImg(i, j, 1); setCursorImg(i, j, 1);
break; break;
case 11: /* set cursor hotspot */ case 11: /* set cursor hotspot */
i = getVarOrDirectByte(0x80); i = getVarOrDirectByte(0x80);
@ -1403,9 +1408,8 @@ void Scumm::o5_roomOps() {
a = getVarOrDirectWord(0x80); a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40); b = getVarOrDirectWord(0x40);
checkRange(256, 0, a, "o5_roomOps: 2: Illegal room color slot (%d)"); checkRange(256, 0, a, "o5_roomOps: 2: Illegal room color slot (%d)");
_currentPalette[a]=b; _currentPalette[a]=b; /*FIXME: should be shadow palette */
_fullRedraw = 1; _fullRedraw = 1;
setDirtyColors(a,a);
} else { } else {
a = getVarOrDirectWord(0x80); a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40); b = getVarOrDirectWord(0x40);
@ -1421,6 +1425,15 @@ void Scumm::o5_roomOps() {
case 6: /* shake off */ case 6: /* shake off */
setShake(0); setShake(0);
break; break;
case 7: /* room scale for old games */
a = getVarOrDirectByte(0x80);
b = getVarOrDirectByte(0x40);
_opcode=fetchScriptByte();
c = getVarOrDirectByte(0x80);
d = getVarOrDirectByte(0x40);
_opcode=fetchScriptByte();
e = getVarOrDirectByte(0x40);
setScaleItem(e-1,b,a,d,c);
case 8: /* room scale? */ case 8: /* room scale? */
a = getVarOrDirectByte(0x80); a = getVarOrDirectByte(0x80);
b = getVarOrDirectByte(0x40); b = getVarOrDirectByte(0x40);
@ -2076,3 +2089,18 @@ void Scumm::o5_oldRoomEffect() {
} }
warning("Unsupported oldRoomEffect"); warning("Unsupported oldRoomEffect");
} }
void Scumm::o5_pickupObjectOld() {
int obj;
obj = getVarOrDirectByte(0x80);
if(getObjectIndex(obj) != 1)
return;
warning("Unsupported pickupObjectOld");
}

View file

@ -302,11 +302,17 @@ enum ScummVars {
VAR_HAVE_MSG = 3, VAR_HAVE_MSG = 3,
VAR_ROOM = 4, VAR_ROOM = 4,
VAR_OVERRIDE = 5, VAR_OVERRIDE = 5,
VAR_MACHINE_SPEED = 6,
VAR_ME = 7,
VAR_NUM_ACTOR = 8, VAR_NUM_ACTOR = 8,
VAR_CURRENT_LIGHTS = 9,
VAR_CURRENTDRIVE = 10, VAR_CURRENTDRIVE = 10,
VAR_TMR_1 = 11, VAR_TMR_1 = 11,
VAR_TMR_2 = 12, VAR_TMR_2 = 12,
VAR_TMR_3 = 13, VAR_TMR_3 = 13,
VAR_MUSIC_FLAG = 14,
VAR_ACTOR_RANGE_MIN = 15,
VAR_ACTOR_RANGE_MAX = 16,
VAR_CAMERA_MIN_X = 17, VAR_CAMERA_MIN_X = 17,
VAR_CAMERA_MAX_X = 18, VAR_CAMERA_MAX_X = 18,
VAR_TIMER_NEXT = 19, VAR_TIMER_NEXT = 19,
@ -1503,7 +1509,8 @@ struct Scumm {
void o5_walkActorToActor(); void o5_walkActorToActor();
void o5_walkActorToObject(); void o5_walkActorToObject();
void o5_oldRoomEffect(); void o5_oldRoomEffect();
void o5_pickupObjectOld();
void o6_pushByte(); void o6_pushByte();
void o6_pushWord(); void o6_pushWord();
void o6_pushByteVar(); void o6_pushByteVar();

View file

@ -185,6 +185,9 @@ void Scumm::CHARSET_1() {
Actor *a; Actor *a;
byte *buffer; byte *buffer;
if(_gameId==GID_ZAK256)
return;
#if !defined(FULL_THROTTLE) #if !defined(FULL_THROTTLE)
if (!_haveMsg || (camera._dest.x>>3) != (camera._cur.x>>3) || if (!_haveMsg || (camera._dest.x>>3) != (camera._cur.x>>3) ||
camera._cur.x != camera._last.x camera._cur.x != camera._last.x