[Scummvm-cvs-logs] CVS: scummvm gameDetector.cpp,1.3,1.4 gameDetector.h,1.2,1.3 object.cpp,1.51,1.52 script.cpp,1.44,1.45 script_v1.cpp,1.71,1.72 script_v2.cpp,1.39,1.40 scummvm.cpp,1.102,1.103 sdl.cpp,1.76,1.77 vars.cpp,1.4,1.5
James Brown
ender at users.sourceforge.net
Sun Apr 7 00:10:45 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv5619
Modified Files:
gameDetector.cpp gameDetector.h object.cpp script.cpp
script_v1.cpp script_v2.cpp scummvm.cpp sdl.cpp vars.cpp
Log Message:
Fix Indy4 bootparam, some more Zak256 work, and a few minor things.
Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gameDetector.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** gameDetector.cpp 3 Apr 2002 16:09:56 -0000 1.3
--- gameDetector.cpp 7 Apr 2002 04:29:14 -0000 1.4
***************
*** 42,46 ****
"\tr - emulate roland mt32 instruments\n" \
"\tf - fullscreen mode\n" \
! "\tg - graphics mode. 1 for 2xSai anti-aliasing\n"
void GameDetector::parseCommandLine(int argc, char **argv) {
--- 42,47 ----
"\tr - emulate roland mt32 instruments\n" \
"\tf - fullscreen mode\n" \
! "\tg - graphics mode. 1 for 2xSai anti-aliasing\n" \
! "\ta - load autosave game (for recovering from crashes)\n"
void GameDetector::parseCommandLine(int argc, char **argv) {
***************
*** 64,72 ****
while (*s) {
switch(tolower(*s)) {
case 'b':
! if (*(s+1) == '\0')
! goto ShowHelpAndExit;
! _bootParam = atoi(s+1);
! goto NextArg;
case 'f':
_fullScreen = true;
--- 65,76 ----
while (*s) {
switch(tolower(*s)) {
+ case 'a':
+ _restore = true;
+ break;
case 'b':
! if (*(s+1) == '\0')
! goto ShowHelpAndExit;
! _bootParam = atoi(s+1);
! goto NextArg;
case 'f':
_fullScreen = true;
Index: gameDetector.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gameDetector.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** gameDetector.h 25 Mar 2002 08:51:34 -0000 1.2
--- gameDetector.h 7 Apr 2002 04:29:14 -0000 1.3
***************
*** 45,48 ****
--- 45,49 ----
int _scummVersion;
+ bool _restore;
};
Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/object.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** object.cpp 4 Apr 2002 04:38:18 -0000 1.51
--- object.cpp 7 Apr 2002 04:29:14 -0000 1.52
***************
*** 131,142 ****
int Scumm::getObjectOrActorXY(int object) {
! if (object < NUM_ACTORS) {
return getActorXYPos(derefActorSafe(object, "getObjectOrActorXY"));
! }
switch(whereIsObject(object)) {
case WIO_NOT_FOUND:
return -1;
! case WIO_INVENTORY:
! return getActorXYPos(derefActorSafe(_objectOwnerTable[object],"getObjectOrActorXY(2)"));
}
getObjectXYPos(object);
--- 131,145 ----
int Scumm::getObjectOrActorXY(int object) {
! if (object < NUM_ACTORS)
return getActorXYPos(derefActorSafe(object, "getObjectOrActorXY"));
!
switch(whereIsObject(object)) {
case WIO_NOT_FOUND:
return -1;
! case WIO_INVENTORY:
! if (_objectOwnerTable[object] < NUM_ACTORS)
! return getActorXYPos(derefActorSafe(_objectOwnerTable[object],"getObjectOrActorXY(2)"));
! else
! return 0xFF;
}
getObjectXYPos(object);
***************
*** 206,210 ****
if (acta && actb && acta->room==actb->room && acta->room &&
acta->room != _currentRoom)
! return 0xFF;
if (getObjectOrActorXY(a)==-1)
--- 209,213 ----
if (acta && actb && acta->room==actb->room && acta->room &&
acta->room != _currentRoom)
! return 0;
if (getObjectOrActorXY(a)==-1)
Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** script.cpp 6 Apr 2002 03:43:54 -0000 1.44
--- script.cpp 7 Apr 2002 04:29:14 -0000 1.45
***************
*** 262,267 ****
_opcode = fetchScriptByte();
_scriptPointerStart = _scriptPointer;
! vm.slot[_currentScript].didexec = 1;
! //debug(1, "[%X] %s()", _opcode, _opcodes_lookup[_opcode]);
op = getOpcode(_opcode);
(this->*op)();
--- 262,267 ----
_opcode = fetchScriptByte();
_scriptPointerStart = _scriptPointer;
! vm.slot[_currentScript].didexec = 1;
! //debug(1, "Script %d: [%X] %s()", vm.slot[_currentScript].number, _opcode, _opcodes_lookup[_opcode]);
op = getOpcode(_opcode);
(this->*op)();
***************
*** 679,683 ****
offs = getVerbEntrypoint(object, entry);
! if (offs==0)
return;
--- 679,683 ----
offs = getVerbEntrypoint(object, entry);
! if (offs==0)
return;
Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v1.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** script_v1.cpp 7 Apr 2002 01:40:38 -0000 1.71
--- script_v1.cpp 7 Apr 2002 04:29:14 -0000 1.72
***************
*** 693,703 ****
byte convertTable[20] = {1,0,0,2,0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20};
int act = getVarOrDirectByte(0x80);
! Actor *a = derefActorSafe(act, "actorSet");
int i,j;
while ( (_opcode = fetchScriptByte()) != 0xFF) {
! if(_features & GF_SMALL_HEADER)
! _opcode = (_opcode&0xE0) | convertTable[(_opcode&0x1F)-1];
if (!a) return;
switch(_opcode&0x1F) {
case 0: /* dummy case */
--- 693,710 ----
byte convertTable[20] = {1,0,0,2,0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20};
int act = getVarOrDirectByte(0x80);
! Actor *a;
int i,j;
+ if (act == 0)
+ act = 1;
+
+ a = derefActorSafe(act, "actorSet");
+
while ( (_opcode = fetchScriptByte()) != 0xFF) {
! if(_features & GF_SMALL_HEADER)
! _opcode = (_opcode&0xE0) | convertTable[(_opcode&0x1F)-1];
!
if (!a) return;
+
switch(_opcode&0x1F) {
case 0: /* dummy case */
***************
*** 1243,1248 ****
void Scumm::o5_getActorX() {
getResultPos();
! setResult(getObjX(getVarOrDirectWord(0x80)));
}
--- 1250,1257 ----
void Scumm::o5_getActorX() {
+ int actor;
getResultPos();
! actor = getVarOrDirectWord(0x80);
! setResult(getObjX(actor));
}
***************
*** 1260,1264 ****
int obj;
int act;
! int closobj=-1, closnum=-1;
int dist;
--- 1269,1273 ----
int obj;
int act;
! int closest_obj=0xFF, closest_dist=0xFF;
int dist;
***************
*** 1267,1280 ****
act = getVarOrDirectWord(0x80);
obj = _vars[VAR_V5_OBJECT_HI];
!
! do {
! dist = getObjActToObjActDist(obj,act);
! if (dist < closnum) {
! closnum = dist;
! closobj = obj;
}
} while (--obj >= _vars[VAR_V5_OBJECT_LO]);
!
! setResult(closnum);
}
--- 1276,1289 ----
act = getVarOrDirectWord(0x80);
obj = _vars[VAR_V5_OBJECT_HI];
!
! do {
! dist = getObjActToObjActDist(act,obj);
! if (dist < closest_dist) {
! closest_dist = dist;
! closest_obj = obj;
}
} while (--obj >= _vars[VAR_V5_OBJECT_LO]);
!
! setResult(closest_dist);
}
***************
*** 1306,1313 ****
void Scumm::o5_getObjectState() {
if(_features & GF_SMALL_HEADER) {
! if((getState(getVarOrDirectWord(0x80)) &0xF0 >>4) != (int)getVarOrDirectByte(0x40))
o5_jumpRelative();
else
! ignoreScriptWord();
} else {
getResultPos();
--- 1315,1325 ----
void Scumm::o5_getObjectState() {
if(_features & GF_SMALL_HEADER) {
! int a = getVarOrDirectWord(0x80);
! int b = getVarOrDirectByte(0x40);
!
! if((getState(a) &0xF0 >>4) != b)
o5_jumpRelative();
else
! ignoreScriptWord();
} else {
getResultPos();
***************
*** 1403,1406 ****
--- 1415,1419 ----
int16 a = readVar(fetchScriptWord());
int16 b = getVarOrDirectWord(0x80);
+
if (b < a) ignoreScriptWord();
else o5_jumpRelative();
***************
*** 1462,1466 ****
void Scumm::o5_loadRoom() {
! int room = getVarOrDirectByte(0x80);
startScene(room, 0, 0);
_fullRedraw = 1;
--- 1475,1488 ----
void Scumm::o5_loadRoom() {
! int room;
!
! /* Begin: Autosave
! _saveLoadSlot = 0;
! sprintf(_saveLoadName, "Autosave", _saveLoadSlot);
! _saveLoadFlag = 1;
! _saveLoadCompatible = false;
! End: Autosave */
!
! room = getVarOrDirectByte(0x80);
startScene(room, 0, 0);
_fullRedraw = 1;
***************
*** 1471,1474 ****
--- 1493,1503 ----
Actor *a;
+ /* Begin: Autosave
+ _saveLoadSlot = 0;
+ sprintf(_saveLoadName, "Autosave", _saveLoadSlot);
+ _saveLoadFlag = 1;
+ _saveLoadCompatible = false;
+ End: Autosave */
+
obj = getVarOrDirectWord(0x80);
room = getVarOrDirectByte(0x40);
***************
*** 2395,2399 ****
Actor *a;
! warning("walk object to object");
a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorToObject");
--- 2424,2428 ----
Actor *a;
! // warning("walk object to object");
a = derefActorSafe(getVarOrDirectByte(0x80), "o5_walkActorToObject");
***************
*** 2535,2538 ****
--- 2564,2570 ----
if(getObjectIndex(obj) == -1)
return;
+
+ if(whereIsObject(obj) == WIO_INVENTORY) /* Don't take an */
+ return; /* object twice */
// warning("adding %d from %d to inventoryOld", obj, _currentRoom);
Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** script_v2.cpp 25 Mar 2002 12:26:36 -0000 1.39
--- script_v2.cpp 7 Apr 2002 04:29:15 -0000 1.40
***************
*** 1225,1229 ****
void Scumm::o6_loadRoom() {
! int room = pop();
startScene(room, 0, 0);
_fullRedraw = 1;
--- 1225,1237 ----
void Scumm::o6_loadRoom() {
! int room;
! /* Begin: Autosave
! _saveLoadSlot = 0;
! sprintf(_saveLoadName, "Autosave", _saveLoadSlot);
! _saveLoadFlag = 1;
! _saveLoadCompatible = false;
! End: Autosave */
!
! room = pop();
startScene(room, 0, 0);
_fullRedraw = 1;
***************
*** 1381,1384 ****
--- 1389,1399 ----
Actor *a;
int room,obj,x,y;
+
+ /* Begin: Autosave
+ _saveLoadSlot = 0;
+ sprintf(_saveLoadName, "Autosave", _saveLoadSlot);
+ _saveLoadFlag = 1;
+ _saveLoadCompatible = false;
+ End: Autosave */
y = pop();
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** scummvm.cpp 7 Apr 2002 01:40:38 -0000 1.102
--- scummvm.cpp 7 Apr 2002 04:29:15 -0000 1.103
***************
*** 864,868 ****
Actor *Scumm::derefActorSafe(int id, const char *errmsg) {
if (id<1 || id>=NUM_ACTORS) {
! warning("Invalid actor %d in %s (script %d) - This is potentially a BIG problem.", id, errmsg, vm.slot[_curExecScript].number);
return NULL;
}
--- 864,868 ----
Actor *Scumm::derefActorSafe(int id, const char *errmsg) {
if (id<1 || id>=NUM_ACTORS) {
! warning("Invalid actor %d in %s (script %d, opcode 0x%x) - This is potentially a BIG problem.", id, errmsg, vm.slot[_curExecScript].number, _opcode);
return NULL;
}
***************
*** 1065,1068 ****
--- 1065,1072 ----
// if (_gameId==GID_MONKEY2 && _bootParam == 0)
// _bootParam = 10001;
+
+ if (_gameId==GID_INDY4 && _bootParam==0) {
+ _bootParam = -7873;
+ }
readIndexFile();
Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** sdl.cpp 7 Apr 2002 01:58:59 -0000 1.76
--- sdl.cpp 7 Apr 2002 04:29:15 -0000 1.77
***************
*** 966,970 ****
scumm->delta=6;
!
scumm->_gui = &gui;
// gui.init(scumm);
--- 966,975 ----
scumm->delta=6;
! if (detector._restore) {
! scumm->_saveLoadSlot = 0;
! scumm->_saveLoadFlag = 2;
! scumm->_saveLoadCompatible = false;
! }
!
scumm->_gui = &gui;
// gui.init(scumm);
Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/vars.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** vars.cpp 24 Mar 2002 00:48:14 -0000 1.4
--- vars.cpp 7 Apr 2002 04:29:15 -0000 1.5
***************
*** 96,101 ****
VAR_V5_DRAWFLAGS = 9;
VAR_MI1_TIMER = 14;
! VAR_V5_OBJECT_LO = 15;
! VAR_V5_OBJECT_HI = 16;
VAR_V5_TALK_STRING_Y = 54;
VAR_V5_CHARFLAG = 60;
--- 96,108 ----
VAR_V5_DRAWFLAGS = 9;
VAR_MI1_TIMER = 14;
!
! //if (_features & GF_OLD256) {
! VAR_V5_OBJECT_LO = 15;
! VAR_V5_OBJECT_HI = 16;
! /*} else {
! VAR_V5_OBJECT_LO = 16;
! VAR_V5_OBJECT_HI = 15;
! } */
!
VAR_V5_TALK_STRING_Y = 54;
VAR_V5_CHARFLAG = 60;
More information about the Scummvm-git-logs
mailing list