recompile not needed when switching games

debugger skeleton implemented

svn-id: r3442
This commit is contained in:
Ludvig Strigeus 2001-10-23 19:51:50 +00:00
parent a8fac8f5ab
commit 9fdc578af0
16 changed files with 1546 additions and 1382 deletions

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.6 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.5 2001/10/16 10:01:44 strigeus
* preliminary DOTT support
*
@ -54,10 +58,8 @@ void Scumm::initActor(Actor *a, int mode) {
a->elevation = 0;
a->width = 0x18;
a->talkColor = 0xF;
#if defined(DOTT)
a->new_2 = 0;
a->new_1 = -80;
#endif
a->scaley = a->scalex = 0xFF;
a->charset = 0;
a->sound[0] = 0;
@ -75,9 +77,7 @@ void Scumm::initActor(Actor *a, int mode) {
a->ignoreBoxes = 0;
a->neverZClip = 0;
#if defined(DOTT)
a->new_3 = 0;
#endif
a->initFrame = 1;
a->walkFrame = 2;
a->standFrame = 3;
@ -636,7 +636,7 @@ void Scumm::walkActors() {
}
}
#if !defined(DOTT)
/* Used in Scumm v5 only. Play sounds associated with actors */
void Scumm::playActorSounds() {
int i;
Actor *a;
@ -654,7 +654,6 @@ void Scumm::playActorSounds() {
}
}
}
#endif
void Scumm::walkActor(Actor *a) {
int j;

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.5 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.4 2001/10/16 20:31:27 strigeus
* misc fixes
*
@ -112,7 +116,6 @@ byte CostumeRenderer::mainRoutine(Actor *a, int slot, int frame) {
_ymove -= (int16)READ_LE_UINT16(_srcptr+10);
_srcptr += 12;
#if defined(DOTT)
switch(_ptr[7]&0x7F) {
case 0x60: case 0x61:
ex1 = _srcptr[0];
@ -123,7 +126,6 @@ byte CostumeRenderer::mainRoutine(Actor *a, int slot, int frame) {
_srcptr = _ptr + READ_LE_UINT16(_ptr + ex1 + ex2*2) + 14;
}
}
#endif
_xpos = _actorX;
_ypos = _actorY;
@ -686,12 +688,15 @@ StartPos:;
}
void CostumeRenderer::loadCostume(int id) {
_ptr = _vm->getResourceAddress(3, id)
#if defined(DOTT)
+ 8;
#else
+ 2;
#endif
_ptr = _vm->getResourceAddress(3, id);
if (_vm->_majorScummVersion == 6) {
_ptr += 8;
} else {
_ptr += 2;
}
switch(_ptr[7]&0x7F) {
case 0x58:
_numColors = 16;
@ -699,14 +704,12 @@ void CostumeRenderer::loadCostume(int id) {
case 0x59:
_numColors = 32;
break;
#if defined(DOTT)
case 0x60:
case 0x60: /* New since version 6 */
_numColors = 16;
break;
case 0x61:
case 0x61: /* New since version 6 */
_numColors = 32;
break;
#endif
default:
error("Costume %d is invalid", id);
}

143
debug.cpp Normal file
View File

@ -0,0 +1,143 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Change Log:
* $Log$
* Revision 1.1 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
*
*/
#include "stdafx.h"
#include "scumm.h"
enum {
CMD_INVALID,
CMD_HELP,
CMD_QUIT,
CMD_GO,
};
void ScummDebugger::attach(Scumm *s) {
if (_s)
deattach();
_welcome = true;
_s = s;
s->_debugger = this;
_go_amount = 1;
}
bool ScummDebugger::do_command() {
int cmd;
switch(get_command()) {
case CMD_HELP:
printf("Debugger commands:\n"
"help -> display this help text\n"
"quit -> quit the debugger\n"
"step -> increase one frame\n"
);
return true;
case CMD_QUIT:
detach();
return false;
case CMD_GO:
if (!_parameters[0])
_go_amount = 1;
else
_go_amount = atoi(_parameters);
return false;
}
}
void ScummDebugger::enter() {
if (_welcome) {
_welcome = false;
printf("Debugging Mode entered!, please switch to this console for input.\n"
"Enter h to list all the debug commands\n");
}
while(do_command()) {}
}
void ScummDebugger::on_frame() {
if (_go_amount==0)
return;
if (!--_go_amount)
enter();
}
void ScummDebugger::detach() {
_s->_debugger = NULL;
_s = NULL;
}
struct DebuggerCommands {
char text[8];
byte len;
byte id;
};
static const DebuggerCommands debugger_commands[] = {
{ "h", 1, CMD_HELP },
{ "q", 1, CMD_QUIT },
{ "g", 1, CMD_GO },
{ 0, 0, 0 },
};
int ScummDebugger::get_command() {
const DebuggerCommands *dc;
char *s;
int i;
do {
printf("debug> ");
if (!fgets(_cmd_buffer, sizeof(_cmd_buffer), stdin))
return CMD_QUIT;
i = strlen(_cmd_buffer);
while (i>0 && _cmd_buffer[i-1]==10)
_cmd_buffer[--i] = 0;
if (i==0)
continue;
dc = debugger_commands;
do {
if (!strncmp(_cmd_buffer, dc->text, dc->len)) {
for(s=_cmd_buffer;*s;s++) {
if (*s==32) { s++; break; }
}
_parameters = s;
return _command = dc->id;
}
} while ((++dc)->text[0]);
for(s=_cmd_buffer;*s;s++)
if (*s==32) { *s=0; break; }
printf("Invalid command '%s'. Type 'help' for a list of available commands.\n", _cmd_buffer);
} while (1);
}

19
gfx.cpp
View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.8 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.7 2001/10/17 10:07:39 strigeus
* fixed verbs not saved in non dott games,
* implemented a screen effect
@ -788,20 +792,20 @@ void Scumm::decompressBitmap() {
GDI_UnkDecode3();
break;
#if defined(DOTT)
/* New since version 6 */
case 104: case 105: case 106: case 107: case 108:
gdi.decomp_shr = code - 100;
gdi.decomp_mask = decompress_table[code - 100];
GDI_UnkDecode1();
break;
/* New since version 6 */
case 124: case 125: case 126: case 127: case 128:
dseg_4E3B = 1;
gdi.decomp_shr = code - 120;
gdi.decomp_mask = decompress_table[code - 120];
GDI_UnkDecode3();
break;
#endif
default:
error("decompressBitmap: default case %d", code);
@ -965,7 +969,6 @@ void Scumm::redrawBGStrip(int start, int num) {
#define READ_BIT (cl--,bit = bits&1, bits>>=1,bit)
#define FILL_BITS if (cl <= 8) { bits |= (*src++ << cl); cl += 8;}
#if defined(DOTT)
void Scumm::GDI_UnkDecode1() {
byte *src = gdi.smap_ptr;
byte *dst = gdi.where_to_draw_ptr;
@ -1017,7 +1020,8 @@ againPos:;
dst += 312;
} while (--gdi.tempNumLines);
}
#else
#if 0
void Scumm::GDI_UnkDecode1() {
byte *src = gdi.smap_ptr;
byte *dst = gdi.where_to_draw_ptr;
@ -1086,7 +1090,6 @@ void Scumm::GDI_UnkDecode2() {
} while (--gdi.tempNumLines);
}
#if defined(DOTT)
void Scumm::GDI_UnkDecode3() {
byte *src = gdi.smap_ptr;
byte *dst = gdi.where_to_draw_ptr;
@ -1153,7 +1156,7 @@ againPos:;
} while (--gdi.tempNumLines);
}
#else
#if 0
void Scumm::GDI_UnkDecode3() {
byte *src = gdi.smap_ptr;
byte *dst = gdi.where_to_draw_ptr;
@ -1318,10 +1321,8 @@ void Scumm::restoreCharsetBg() {
restoreBG(string[0].mask_left, string[0].mask_top, string[0].mask_right, string[0].mask_bottom);
charset._hasMask = false;
string[0].mask_left = -1;
#if defined(DOTT)
charset._strLeft = -1;
charset._left = -1;
#endif
}
string[0].xpos2 = string[0].xpos;

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.6 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.5 2001/10/17 12:37:50 strigeus
* fixed big endian bug
*
@ -133,7 +137,6 @@ int Scumm::getObjectOrActorXY(int object) {
return 0;
}
#if defined(DOTT)
void Scumm::getObjectXYPos(int object) {
ObjectData *od = &_objs[getObjectIndex(object)];
int state;
@ -142,37 +145,32 @@ void Scumm::getObjectXYPos(int object) {
int x,y;
AdjustBoxResult abr;
state = getState(object)-1;
if (state<0)
state = 0;
if (_majorScummVersion==6) {
state = getState(object)-1;
if (state<0)
state = 0;
if (od->fl_object_index) {
ptr = getResourceAddress(0xD, od->fl_object_index);
ptr = findResource(MKID('OBIM'), ptr);
if (od->fl_object_index) {
ptr = getResourceAddress(0xD, od->fl_object_index);
ptr = findResource(MKID('OBIM'), ptr);
} else {
ptr = getResourceAddress(1, _roomResource);
ptr += od->offs_obim_to_room;
}
imhd = (ImageHeader*)findResource2(MKID('IMHD'), ptr);
x = od->x_pos*8 + (int16)READ_LE_UINT16(&imhd->hotspot[state].x);
y = od->y_pos*8 + (int16)READ_LE_UINT16(&imhd->hotspot[state].y);
} else {
ptr = getResourceAddress(1, _roomResource);
ptr += od->offs_obim_to_room;
x = od->cdhd_10;
y = od->cdhd_12;
}
imhd = (ImageHeader*)findResource2(MKID('IMHD'), ptr);
x = od->x_pos*8 + (int16)READ_LE_UINT16(&imhd->hotspot[state].x);
y = od->y_pos*8 + (int16)READ_LE_UINT16(&imhd->hotspot[state].y);
abr = adjustXYToBeInBox(0, x, y);
_xPos = abr.x;
_yPos = abr.y;
_dir = od->actordir&3;
}
#else
void Scumm::getObjectXYPos(int object) {
ObjectData *od = &_objs[getObjectIndex(object)];
AdjustBoxResult abr;
abr = adjustXYToBeInBox(0, od->cdhd_10, od->cdhd_12);
_xPos = abr.x;
_yPos = abr.y;
_dir = od->actordir&3;
}
#endif
int Scumm::getObjActToObjActDist(int a, int b) {
int x,y;
@ -406,28 +404,33 @@ void Scumm::loadRoomObjects() {
cdhd = (CodeHeader*)findResource2(MKID('CDHD'), ptr);
_objs[i].obj_nr = READ_LE_UINT16(&cdhd->obj_id);
#if defined(DOTT)
_objs[i].numstrips = READ_LE_UINT16(&cdhd->w)>>3;
_objs[i].height = READ_LE_UINT16(&cdhd->h)>>3;
_objs[i].x_pos = ((int16)READ_LE_UINT16(&cdhd->x))>>3;
_objs[i].y_pos = ((int16)READ_LE_UINT16(&cdhd->y))>>3;
#else
_objs[i].numstrips = cdhd->w;
_objs[i].height = cdhd->h;
_objs[i].x_pos = cdhd->x;
_objs[i].y_pos = cdhd->y;
#endif
if (cdhd->flags == 0x80) {
_objs[i].parentstate = 1<<4;
if (_majorScummVersion == 6) {
_objs[i].numstrips = READ_LE_UINT16(&cdhd->v6.w)>>3;
_objs[i].height = READ_LE_UINT16(&cdhd->v6.h)>>3;
_objs[i].x_pos = ((int16)READ_LE_UINT16(&cdhd->v6.x))>>3;
_objs[i].y_pos = ((int16)READ_LE_UINT16(&cdhd->v6.y))>>3;
if (cdhd->v6.flags == 0x80) {
_objs[i].parentstate = 1<<4;
} else {
_objs[i].parentstate = (cdhd->v6.flags&0xF)<<4;
}
_objs[i].parent = cdhd->v6.parent;
_objs[i].actordir = cdhd->v6.actordir;
} else {
_objs[i].parentstate = (cdhd->flags&0xF)<<4;
_objs[i].numstrips = cdhd->v5.w;
_objs[i].height = cdhd->v5.h;
_objs[i].x_pos = cdhd->v5.x;
_objs[i].y_pos = cdhd->v5.y;
if (cdhd->v5.flags == 0x80) {
_objs[i].parentstate = 1<<4;
} else {
_objs[i].parentstate = (cdhd->v5.flags&0xF)<<4;
}
_objs[i].parent = cdhd->v5.parent;
_objs[i].cdhd_10 = READ_LE_UINT16(&cdhd->v5.unk2);
_objs[i].cdhd_12 = READ_LE_UINT16(&cdhd->v5.unk3);
_objs[i].actordir = cdhd->v5.actordir;
}
_objs[i].parent = cdhd->parent;
#if !defined(DOTT)
_objs[i].cdhd_10 = READ_LE_UINT16(&cdhd->unk2);
_objs[i].cdhd_12 = READ_LE_UINT16(&cdhd->unk3);
#endif
_objs[i].actordir = cdhd->actordir;
_objs[i].fl_object_index = 0;
}
@ -705,7 +708,6 @@ int Scumm::getInventoryCount(int owner) {
return count;
}
#if defined(DOTT)
void Scumm::setObjectState(int obj, int state, int x, int y) {
int i;
@ -730,7 +732,6 @@ static int getDist(int x, int y, int x2, int y2) {
return b;
}
int Scumm::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f) {
int i,j;
int x,y;
@ -764,4 +765,3 @@ int Scumm::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e,
return getDist(x,y,x2,y2) * 0xFF / ((i + j)>>1);
}
#endif

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.5 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.4 2001/10/16 12:20:20 strigeus
* made files compile on unix
*
@ -91,7 +95,7 @@ void Scumm::openRoom(int room) {
error("Room %d not in %s", room, buf);
return;
}
askForDisk();
askForDisk(buf);
}
do {
@ -99,7 +103,7 @@ void Scumm::openRoom(int room) {
_encbyte = 0;
if (openResourceFile(buf))
break;
askForDisk();
askForDisk(buf);
} while(1);
deleteRoomOffsets();
@ -165,14 +169,11 @@ bool Scumm::openResourceFile(const char *filename) {
return _fileHandle != NULL;
}
void Scumm::askForDisk() {
/* TODO: Not yet implemented */
error("askForDisk: not yet implemented");
void Scumm::askForDisk(const char *filename) {
error("Cannot find '%s'", filename);
}
#if !defined(DOTT)
void Scumm::readIndexFile(int mode) {
void Scumm::readIndexFileV5(int mode) {
uint32 blocktype,itemsize;
int numblock = 0;
#if defined(SCUMM_BIG_ENDIAN)
@ -263,10 +264,8 @@ void Scumm::readIndexFile(int mode) {
_numGlobalScripts = _maxScripts;
_dynamicRoomOffsets = true;
}
#else
void Scumm::readIndexFile() {
void Scumm::readIndexFileV6() {
uint32 blocktype,itemsize;
int numblock = 0;
int num, i;
@ -342,10 +341,8 @@ void Scumm::readIndexFile() {
openRoom(-1);
}
#endif
#if defined(DOTT)
void Scumm::readArrayFromIndexFile() {
int num;
int a,b,c;
@ -361,31 +358,6 @@ void Scumm::readArrayFromIndexFile() {
}
}
#endif
#if defined(DOTT)
void Scumm::readResTypeList(int id, uint32 tag, const char *name) {
int num,i;
debug(9, "readResTypeList(%d,%x,%s)",id,FROM_LE_32(tag),name);
num = fileReadWordLE();
assert(num == res.num[id]);
fileRead(_fileHandle, res.roomno[id], num*sizeof(uint8));
fileRead(_fileHandle, res.roomoffs[id], num*sizeof(uint32));
#if defined(SCUMM_BIG_ENDIAN)
for (i=0; i<num; i++)
res.roomoffs[id][i] = FROM_LE_32(res.roomoffs[id][i]);
#endif
}
#else
void Scumm::readResTypeList(int id, uint32 tag, const char *name) {
int num;
int i;
@ -394,11 +366,16 @@ void Scumm::readResTypeList(int id, uint32 tag, const char *name) {
num = fileReadWordLE();
if (num>=0xFF) {
error("Too many %ss (%d) in directory", name, num);
if (_majorScummVersion == 6) {
if (num != res.num[id]) {
error("Invalid number of %ss (%d) in directory", name, num);
}
} else {
if (num>=0xFF) {
error("Too many %ss (%d) in directory", name, num);
}
allocResTypeData(id, tag, num, name, 1);
}
allocResTypeData(id, tag, num, name, 1);
fileRead(_fileHandle, res.roomno[id], num*sizeof(uint8));
fileRead(_fileHandle, res.roomoffs[id], num*sizeof(uint32));
@ -409,7 +386,6 @@ void Scumm::readResTypeList(int id, uint32 tag, const char *name) {
#endif
}
#endif
void Scumm::allocResTypeData(int id, uint32 tag, int num, const char *name, int mode) {
debug(9, "allocResTypeData(%d,%x,%d,%s,%d)",id,FROM_LE_32(tag),num,name,mode);
@ -774,7 +750,6 @@ void Scumm::unkResProc(int a, int b) {
}
#if defined(DOTT)
void Scumm::readMAXS() {
_numVariables = fileReadWordLE();
fileReadWordLE();
@ -821,6 +796,5 @@ void Scumm::readMAXS() {
_numGlobalScripts = 200;
_dynamicRoomOffsets = 1;
}
#endif

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.4 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.3 2001/10/16 10:01:47 strigeus
* preliminary DOTT support
*
@ -314,32 +318,6 @@ void Scumm::ignoreScriptByte() {
}
#if defined(DOTT)
int Scumm::readVar(uint var) {
int a;
if (!(var&0xF000)) {
checkRange(_numVariables-1, 0, var, "Variable %d out of range(r)");
return _vars[var];
}
if (var&0x8000) {
var &= 0x7FFF;
checkRange(_numBitVariables-1, 0, var, "Bit variable %d out of range(r)");
return (_bitVars[var>>3] & (1<<(var&7))) ? 1 : 0;
}
if (var&0x4000) {
var &= 0xFFF;
checkRange(0x10, 0, var, "Local variable %d out of range(r)");
return vm.localvar[_currentScript * 17 + var];
}
error("Illegal varbits (r)");
}
#else
int Scumm::readVar(uint var) {
int a;
#ifdef BYPASS_COPY_PROT
@ -351,7 +329,7 @@ int Scumm::readVar(uint var) {
return _vars[var];
}
if (var&0x2000) {
if (var&0x2000 && _majorScummVersion==5) {
a = fetchScriptWord();
if (a&0x2000)
var = (var+readVar(a&~0x2000))&~0x2000;
@ -373,7 +351,7 @@ int Scumm::readVar(uint var) {
checkRange(0x10, 0, var, "Local variable %d out of range(r)");
#ifdef BYPASS_COPY_PROT
if (!copyprotbypassed && _currentScript==1) {
if (!copyprotbypassed && _currentScript==1 && _gameId==GID_MONKEY2) {
copyprotbypassed=1;
return 1;
}
@ -384,8 +362,6 @@ int Scumm::readVar(uint var) {
error("Illegal varbits (r)");
}
#endif
void Scumm::writeVar(uint var, int value) {
int a;
@ -714,9 +690,7 @@ void Scumm::runVerbCode(int object, int entry, int a, int b, int16 *vars) {
vm.slot[slot].unk1 = a;
vm.slot[slot].unk2 = b;
vm.slot[slot].freezeCount = 0;
#if defined(DOTT)
vm.slot[slot].newfield = 0;
#endif
if (!vars) {
for(i=0; i<16; i++)
@ -906,7 +880,6 @@ void Scumm::endOverride() {
}
#if defined(DOTT)
int Scumm::defineArray(int array, int type, int dim2, int dim1) {
int id;
int size;
@ -975,7 +948,6 @@ void Scumm::copyString(byte *dst, byte *src, int len) {
*dst++ = *src++;
}
}
#endif
int Scumm::getStringLen(byte *ptr) {
int len;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

607
scumm.h
View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.12 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.11 2001/10/17 10:07:40 strigeus
* fixed verbs not saved in non dott games,
* implemented a screen effect
@ -160,7 +164,6 @@ struct ResHeader {
uint32 size;
};
#if defined(DOTT)
class ObjectData {
public:
uint32 offs_obim_to_room;
@ -178,25 +181,6 @@ public:
byte fl_object_index;
byte unk_3;
};
#else
class ObjectData {
public:
uint32 offs_obim_to_room;
uint32 offs_obcd_to_room;
uint16 cdhd_10, cdhd_12;
uint16 obj_nr;
byte x_pos;
byte y_pos;
uint16 numstrips;
uint16 height;
byte actordir;
byte parent;
byte parentstate;
byte ownerstate;
byte fl_object_index;
byte unk_3;
};
#endif
struct RoomHeader {
uint32 tag, size;
@ -204,31 +188,31 @@ struct RoomHeader {
uint16 numObjects;
};
#if !defined(DOTT)
struct CodeHeader { /* file format */
struct CodeHeader {
uint32 id;
uint32 size;
uint16 obj_id;
byte x,y,w,h;
byte flags;
byte parent;
uint16 unk2;
uint16 unk3;
byte actordir;
union {
struct {
byte x,y,w,h;
byte flags;
byte parent;
uint16 unk2;
uint16 unk3;
byte actordir;
} v5;
struct {
int16 x, y;
uint16 w,h;
byte flags, parent;
uint16 unk2;
uint16 unk3;
byte actordir;
} v6;
};
};
#else
struct CodeHeader { /* file format */
uint32 id;
uint32 size;
uint16 obj_id;
int16 x, y;
uint16 w,h;
byte flags, parent;
uint16 unk2;
uint16 unk3;
byte actordir;
};
#endif
struct ImageHeader { /* file format */
uint32 id;
@ -344,9 +328,7 @@ enum ScummVars {
VAR_TALKSTOP_KEY = 57,
VAR_SAVELOADDIALOG_KEY = 50,
#if defined(DOTT)
VAR_RANDOM_NR = 118,
#endif
VAR_V6_RANDOM_NR = 118,
};
#define _maxRooms res.num[1]
@ -534,7 +516,25 @@ struct StringTab {
int16 mask_top, mask_bottom, mask_right, mask_left;
};
enum GameId {
GID_TENTACLE = 1,
GID_MONKEY2 = 2,
GID_INDY4 = 3,
GID_MONKEY = 4,
};
struct ScummDebugger;
struct Scumm {
const char *_gameText;
byte _gameId;
byte _majorScummVersion;
byte _middleScummVersion;
byte _minorScummVersion;
ScummDebugger *_debugger;
int _lastLoadedRoom;
int _roomResource;
byte _encbyte;
@ -889,7 +889,7 @@ struct Scumm {
void openRoom(int room);
void deleteRoomOffsets();
void readRoomsOffsets();
void askForDisk();
void askForDisk(const char *filename);
bool openResourceFile(const char *filename);
@ -917,7 +917,8 @@ struct Scumm {
void readResTypeList(int id, uint32 tag, const char *name);
void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode);
void initThings();
void initThingsV5();
void initThingsV6();
void initRandSeeds();
@ -1020,249 +1021,249 @@ struct Scumm {
int getObjectIndex(int object);
void o_actorFollowCamera();
void o_actorFromPos();
void o_actorSet();
void o_actorSetClass();
void o_add();
void o_and();
void o_animateActor();
void o_badOpcode();
void o_breakHere();
void o_chainScript();
void o_cursorCommand();
void o_cutscene();
void o_debug();
void o_decrement();
void o_delay();
void o_delayVariable();
void o_divide();
void o_doSentence();
void o_drawBox();
void o_drawObject();
void o_dummy();
void o_endCutscene();
void o_equalZero();
void o_expression();
void o_faceActor();
void o_findInventory();
void o_findObject();
void o_freezeScripts();
void o_getActorCostume();
void o_getActorElevation();
void o_getActorFacing();
void o_getActorMoving();
void o_getActorRoom();
void o_getActorScale();
void o_getActorWalkBox();
void o_getActorWidth();
void o_getActorX();
void o_getActorY();
void o_getAnimCounter();
void o_getClosestObjActor();
void o_getDist();
void o_getInventoryCount();
void o_getObjectOwner();
void o_getObjectState();
void o_getRandomNr();
void o_getScriptRunning();
void o_getVerbEntrypoint();
void o_ifClassOfIs();
void o_increment();
void o_isActorInBox();
void o_isEqual();
void o_isGreater();
void o_isGreaterEqual();
void o_isLess();
void o_isNotEqual();
void o_isSoundRunning();
void o_jumpRelative();
void o_lessOrEqual();
void o_lights();
void o_loadRoom();
void o_loadRoomWithEgo();
void o_matrixOps();
void o_move();
void o_multiply();
void o_notEqualZero();
void o_or();
void o_overRide();
void o_panCameraTo();
void o_pickupObject();
void o_print();
void o_printEgo();
void o_pseudoRoom();
void o_putActor();
void o_putActorAtObject();
void o_putActorInRoom();
void o_quitPauseRestart();
void o_resourceRoutines();
void o_roomOps();
void o_saveRestoreVerbs();
void o_setCameraAt();
void o_setObjectName();
void o_setOwnerOf();
void o_setState();
void o_setVarRange();
void o_soundKludge();
void o_startMusic();
void o_startObject();
void o_startScript();
void o_startSound();
void o_stopMusic();
void o_stopObjectCode();
void o_stopObjectScript();
void o_stopScript();
void o_stopSound();
void o_stringOps();
void o_subtract();
void o_verbOps();
void o_wait();
void o_walkActorTo();
void o_walkActorToActor();
void o_walkActorToObject();
void o5_actorFollowCamera();
void o5_actorFromPos();
void o5_actorSet();
void o5_actorSetClass();
void o5_add();
void o5_and();
void o5_animateActor();
void o5_badOpcode();
void o5_breakHere();
void o5_chainScript();
void o5_cursorCommand();
void o5_cutscene();
void o5_debug();
void o5_decrement();
void o5_delay();
void o5_delayVariable();
void o5_divide();
void o5_doSentence();
void o5_drawBox();
void o5_drawObject();
void o5_dummy();
void o5_endCutscene();
void o5_equalZero();
void o5_expression();
void o5_faceActor();
void o5_findInventory();
void o5_findObject();
void o5_freezeScripts();
void o5_getActorCostume();
void o5_getActorElevation();
void o5_getActorFacing();
void o5_getActorMoving();
void o5_getActorRoom();
void o5_getActorScale();
void o5_getActorWalkBox();
void o5_getActorWidth();
void o5_getActorX();
void o5_getActorY();
void o5_getAnimCounter();
void o5_getClosestObjActor();
void o5_getDist();
void o5_getInventoryCount();
void o5_getObjectOwner();
void o5_getObjectState();
void o5_getRandomNr();
void o5_getScriptRunning();
void o5_getVerbEntrypoint();
void o5_ifClassOfIs();
void o5_increment();
void o5_isActorInBox();
void o5_isEqual();
void o5_isGreater();
void o5_isGreaterEqual();
void o5_isLess();
void o5_isNotEqual();
void o5_isSoundRunning();
void o5_jumpRelative();
void o5_lessOrEqual();
void o5_lights();
void o5_loadRoom();
void o5_loadRoomWithEgo();
void o5_matrixOps();
void o5_move();
void o5_multiply();
void o5_notEqualZero();
void o5_or();
void o5_overRide();
void o5_panCameraTo();
void o5_pickupObject();
void o5_print();
void o5_printEgo();
void o5_pseudoRoom();
void o5_putActor();
void o5_putActorAtObject();
void o5_putActorInRoom();
void o5_quitPauseRestart();
void o5_resourceRoutines();
void o5_roomOps();
void o5_saveRestoreVerbs();
void o5_setCameraAt();
void o5_setObjectName();
void o5_setOwnerOf();
void o5_setState();
void o5_setVarRange();
void o5_soundKludge();
void o5_startMusic();
void o5_startObject();
void o5_startScript();
void o5_startSound();
void o5_stopMusic();
void o5_stopObjectCode();
void o5_stopObjectScript();
void o5_stopScript();
void o5_stopSound();
void o5_stringOps();
void o5_subtract();
void o5_verbOps();
void o5_wait();
void o5_walkActorTo();
void o5_walkActorToActor();
void o5_walkActorToObject();
void o2_pushByte();
void o2_pushWord();
void o2_pushByteVar();
void o2_pushWordVar();
void o2_invalid();
void o2_byteArrayRead();
void o2_wordArrayRead();
void o2_byteArrayIndexedRead();
void o2_wordArrayIndexedRead();
void o2_dup();
void o2_zero();
void o2_eq();
void o2_neq();
void o2_gt();
void o2_lt();
void o2_le();
void o2_ge();
void o2_add();
void o2_sub();
void o2_mul();
void o2_div();
void o2_land();
void o2_lor();
void o2_kill();
void o2_writeByteVar();
void o2_writeWordVar();
void o2_byteArrayWrite();
void o2_wordArrayWrite();
void o2_byteArrayIndexedWrite();
void o2_wordArrayIndexedWrite();
void o2_byteVarInc();
void o2_wordVarInc();
void o2_byteArrayInc();
void o2_wordArrayInc();
void o2_byteVarDec();
void o2_wordVarDec();
void o2_byteArrayDec();
void o2_wordArrayDec();
void o2_jumpTrue();
void o2_jumpFalse();
void o2_jump();
void o2_startScriptEx();
void o2_startScript();
void o2_startObject();
void o2_setObjectState();
void o2_setObjectXY();
void o2_stopObjectCode();
void o2_endCutscene();
void o2_cutScene();
void o2_stopMusic();
void o2_freezeUnfreeze();
void o2_cursorCommand();
void o2_breakHere();
void o2_ifClassOfIs();
void o2_setClass();
void o2_getState();
void o2_setState();
void o2_setOwner();
void o2_getOwner();
void o2_startSound();
void o2_stopSound();
void o2_startMusic();
void o2_stopObjectScript();
void o2_panCameraTo();
void o2_actorFollowCamera();
void o2_setCameraAt();
void o2_loadRoom();
void o2_stopScript();
void o2_walkActorToObj();
void o2_walkActorTo();
void o2_putActorInRoom();
void o2_putActorAtObject();
void o2_faceActor();
void o2_animateActor();
void o2_doSentence();
void o2_pickupObject();
void o2_loadRoomWithEgo();
void o2_getRandomNumber();
void o2_getRandomNumberRange();
void o2_getActorMoving();
void o2_getScriptRunning();
void o2_getActorRoom();
void o2_getObjectX();
void o2_getObjectY();
void o2_getObjectDir();
void o2_getActorWalkBox();
void o2_getActorCostume();
void o2_findInventory();
void o2_getInventoryCount();
void o2_getVerbFromXY();
void o2_beginOverride();
void o2_endOverride();
void o2_setObjectName();
void o2_isSoundRunning();
void o2_setBoxFlags();
void o2_createBoxMatrix();
void o2_resourceRoutines();
void o2_roomOps();
void o2_actorSet();
void o2_verbOps();
void o2_getActorFromXY();
void o2_findObject();
void o2_pseudoRoom();
void o2_getActorElevation();
void o2_getVerbEntrypoint();
void o2_arrayOps();
void o2_saveRestoreVerbs();
void o2_drawBox();
void o2_getActorWidth();
void o2_wait();
void o2_getActorScaleX();
void o2_getActorAnimCounter1();
void o2_soundKludge();
void o2_isAnyOf();
void o2_quitPauseRestart();
void o2_isActorInBox();
void o2_delay();
void o2_delayLonger();
void o2_delayVeryLong();
void o2_stopSentence();
void o2_print_0();
void o2_print_1();
void o2_print_2();
void o2_print_3();
void o2_printActor();
void o2_printEgo();
void o2_talkActor();
void o2_talkEgo();
void o2_dim();
void o2_runVerbCodeQuick();
void o2_runScriptQuick();
void o2_dim2();
void o2_abs();
void o2_distObjectObject();
void o2_distObjectPt();
void o2_distPtPt();
void o2_dummy_stacklist();
void o2_miscOps();
void o2_breakMaybe();
void o2_pickOneOf();
void o2_pickOneOfDefault();
void o6_pushByte();
void o6_pushWord();
void o6_pushByteVar();
void o6_pushWordVar();
void o6_invalid();
void o6_byteArrayRead();
void o6_wordArrayRead();
void o6_byteArrayIndexedRead();
void o6_wordArrayIndexedRead();
void o6_dup();
void o6_zero();
void o6_eq();
void o6_neq();
void o6_gt();
void o6_lt();
void o6_le();
void o6_ge();
void o6_add();
void o6_sub();
void o6_mul();
void o6_div();
void o6_land();
void o6_lor();
void o6_kill();
void o6_writeByteVar();
void o6_writeWordVar();
void o6_byteArrayWrite();
void o6_wordArrayWrite();
void o6_byteArrayIndexedWrite();
void o6_wordArrayIndexedWrite();
void o6_byteVarInc();
void o6_wordVarInc();
void o6_byteArrayInc();
void o6_wordArrayInc();
void o6_byteVarDec();
void o6_wordVarDec();
void o6_byteArrayDec();
void o6_wordArrayDec();
void o6_jumpTrue();
void o6_jumpFalse();
void o6_jump();
void o6_startScriptEx();
void o6_startScript();
void o6_startObject();
void o6_setObjectState();
void o6_setObjectXY();
void o6_stopObjectCode();
void o6_endCutscene();
void o6_cutScene();
void o6_stopMusic();
void o6_freezeUnfreeze();
void o6_cursorCommand();
void o6_breakHere();
void o6_ifClassOfIs();
void o6_setClass();
void o6_getState();
void o6_setState();
void o6_setOwner();
void o6_getOwner();
void o6_startSound();
void o6_stopSound();
void o6_startMusic();
void o6_stopObjectScript();
void o6_panCameraTo();
void o6_actorFollowCamera();
void o6_setCameraAt();
void o6_loadRoom();
void o6_stopScript();
void o6_walkActorToObj();
void o6_walkActorTo();
void o6_putActorInRoom();
void o6_putActorAtObject();
void o6_faceActor();
void o6_animateActor();
void o6_doSentence();
void o6_pickupObject();
void o6_loadRoomWithEgo();
void o6_getRandomNumber();
void o6_getRandomNumberRange();
void o6_getActorMoving();
void o6_getScriptRunning();
void o6_getActorRoom();
void o6_getObjectX();
void o6_getObjectY();
void o6_getObjectDir();
void o6_getActorWalkBox();
void o6_getActorCostume();
void o6_findInventory();
void o6_getInventoryCount();
void o6_getVerbFromXY();
void o6_beginOverride();
void o6_endOverride();
void o6_setObjectName();
void o6_isSoundRunning();
void o6_setBoxFlags();
void o6_createBoxMatrix();
void o6_resourceRoutines();
void o6_roomOps();
void o6_actorSet();
void o6_verbOps();
void o6_getActorFromXY();
void o6_findObject();
void o6_pseudoRoom();
void o6_getActorElevation();
void o6_getVerbEntrypoint();
void o6_arrayOps();
void o6_saveRestoreVerbs();
void o6_drawBox();
void o6_getActorWidth();
void o6_wait();
void o6_getActorScaleX();
void o6_getActorAnimCounter1();
void o6_soundKludge();
void o6_isAnyOf();
void o6_quitPauseRestart();
void o6_isActorInBox();
void o6_delay();
void o6_delayLonger();
void o6_delayVeryLong();
void o6_stopSentence();
void o6_print_0();
void o6_print_1();
void o6_print_2();
void o6_print_3();
void o6_printActor();
void o6_printEgo();
void o6_talkActor();
void o6_talkEgo();
void o6_dim();
void o6_runVerbCodeQuick();
void o6_runScriptQuick();
void o6_dim2();
void o6_abs();
void o6_distObjectObject();
void o6_distObjectPt();
void o6_distPtPt();
void o6_dummy_stacklist();
void o6_miscOps();
void o6_breakMaybe();
void o6_pickOneOf();
void o6_pickOneOfDefault();
void soundKludge(int16 *list);
@ -1522,6 +1523,7 @@ struct Scumm {
void showHelpAndExit();
char *getGameName();
bool detectGame();
void setupOpcodes();
void setupOpcodes2();
@ -1555,10 +1557,9 @@ struct Scumm {
int getStringLen(byte *ptr);
#if defined(DOTT)
void readArrayFromIndexFile();
void readMAXS();
void readIndexFile();
void readIndexFileV6();
int readArray(int array, int index, int base);
void writeArray(int array, int index, int base, int value);
@ -1580,11 +1581,31 @@ struct Scumm {
void unkMiscOp4(int a, int b, int c, int d);
void unkMiscOp9();
void startManiac();
#else
void readIndexFile(int i);
#endif
void readIndexFileV5(int i);
};
struct ScummDebugger {
Scumm *_s;
byte _command;
char *_parameters;
bool _welcome;
int _go_amount;
char _cmd_buffer[256];
void on_frame();
bool do_command();
void enter();
int get_command();
void attach(Scumm *s);
void detach();
};
void waitForTimer(Scumm *s);
void outputdisplay2(Scumm *s, int disp);
extern const byte revBitMask[8];

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.5 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.4 2001/10/16 10:01:47 strigeus
* preliminary DOTT support
*
@ -38,6 +42,8 @@
#pragma warning (disable: 4244)
#pragma warning (disable: 4101)
#define scumm_stricmp stricmp
#if defined(CHECK_HEAP)
#undef CHECK_HEAP
@ -65,6 +71,8 @@ typedef signed long int32;
#elif defined(UNIX)
#define scumm_stricmp strcasecmp
#define CHECK_HEAP
/* need this for the SDL_BYTEORDER define */

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.11 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.10 2001/10/17 10:07:40 strigeus
* fixed verbs not saved in non dott games,
* implemented a screen effect
@ -57,9 +61,8 @@
#include "stdafx.h"
#include "scumm.h"
#if !defined(DOTT)
void Scumm::initThings() {
readIndexFile(1);
void Scumm::initThingsV5() {
readIndexFileV5(1);
_numVariables = 800;
_numBitVariables = 2048;
@ -81,20 +84,17 @@ void Scumm::initThings() {
allocResTypeData(7, MKID('NONE'),0x32,"string", 0);
allocResTypeData(13, MKID('NONE'),0x32,"flobject", 0);
allocResTypeData(14, MKID('NONE'),10,"boxes", 0);
readIndexFile(2);
readIndexFileV5(2);
initRandSeeds();
setupOpcodes();
}
#else
void Scumm::initThings() {
void Scumm::initThingsV6() {
setupOpcodes2();
readIndexFile();
readIndexFileV6();
}
#endif
void Scumm::initRandSeeds() {
_randSeed1 = 0xA943DE35;
_randSeed2 = 0x37A9ED27;
@ -242,18 +242,29 @@ void Scumm::scummMain(int argc, char **argv) {
_fileHandle = NULL;
#if defined(INDY4)
_bootParam = -7873;
#else
_bootParam = 0;
#endif
_debugMode = 1;
parseCommandLine(argc, argv);
parseCommandLine(argc, argv);
if (_exe_name==NULL)
error("Specify the name of the game to start on the command line");
if (!detectGame()) {
warning("Game detection failed. Using default settings");
_majorScummVersion = 5;
}
if (_gameId==GID_INDY4 && _bootParam==0) {
_bootParam = -7873;
}
initGraphics(this);
initThings();
if (_majorScummVersion==6)
initThingsV6();
else
initThingsV5();
scummInit();
_vars[VAR_VERSION] = 21;
@ -271,6 +282,9 @@ void Scumm::scummMain(int argc, char **argv) {
CHECK_HEAP
updateScreen(this);
if (_debugger)
_debugger->on_frame();
_vars[VAR_TIMER] = _scummTimer >> 2;
do {
waitForTimer(this);
@ -372,9 +386,9 @@ void Scumm::scummMain(int argc, char **argv) {
unkVirtScreen2();
#if !defined(DOTT)
playActorSounds();
#endif
if (_majorScummVersion==5)
playActorSounds();
unkSoundProc22();
camera._lastPos = camera._curPos;
} while (1);
@ -396,47 +410,68 @@ void Scumm::parseCommandLine(int argc, char **argv) {
_bootParam = atoi(s+1);
goto NextArg;
default:
goto ShowHelpAndExit;
ShowHelpAndExit:;
printf(
"ScummVM - Scumm Interpreter\n"
"Syntax:\n"
"\tscummvm [-b<num>] game\n"
"Flags:\n"
"\tb<num> - start in that room\n");
exit(1);
}
s++;
}
NextArg:;
} else {
ShowHelpAndExit:;
printf(
"ScummVM - Scumm Interpreter\n"
"Syntax:\n"
"\tscummvm [-b<num>]\n"
"Flags:\n"
"\tb<num> - start in that room\n");
exit(1);
if (_exe_name) goto ShowHelpAndExit;
_exe_name = s;
}
}
}
struct GameNameList {
struct VersionSettings {
char *filename;
char *gamename;
byte id,major,minor,middle;
};
static const GameNameList game_list[] = {
{"monkey1", "Monkey Island 1"},
{"monkey2", "Monkey Island 2: LeChuck's revenge"},
{"atlantis", "Indiana Jones 4 and the Fate of Atlantis"},
{"fate", "Indiana Jones 4 and the Fate of Atlantis (Demo)"},
{"tentacle", "Day Of The Tenctacle"},
static const VersionSettings version_settings[] = {
{"monkey", "Monkey Island 1", GID_MONKEY, 5, 2, 2},
{"monkey2", "Monkey Island 2: LeChuck's revenge", GID_MONKEY2, 5, 2, 2},
{"atlantis", "Indiana Jones 4 and the Fate of Atlantis", GID_INDY4, 5, 5, 0},
{"fate", "Indiana Jones 4 and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0},
{"tentacle", "Day Of The Tenctacle", GID_TENTACLE, 6, 4, 2},
{NULL,NULL}
};
char *Scumm::getGameName() {
const GameNameList *gnl = game_list;
char buf[256];
bool Scumm::detectGame() {
const VersionSettings *gnl = version_settings;
_gameId = 0;
_gameText = NULL;
do {
if (!strcmp(_exe_name, gnl->filename))
return strdup(gnl->gamename);
if (!scumm_stricmp(_exe_name, gnl->filename)) {
_gameId = gnl->id;
_majorScummVersion = gnl->major;
_middleScummVersion = gnl->middle;
_minorScummVersion = gnl->minor;
_gameText = gnl->gamename;
return true;
}
} while ((++gnl)->filename);
sprintf(buf, "Unknown game: \"%s\"", _exe_name);
return strdup(buf);
return true;
}
char *Scumm::getGameName() {
if (_gameText==NULL) {
char buf[256];
sprintf(buf, "Unknown game: \"%s\"", _exe_name);
return strdup(buf);
}
return strdup(_gameText);
}
void Scumm::startScene(int room, Actor *a, int objectNr) {
@ -645,13 +680,13 @@ void Scumm::initRoomSubBlocks() {
setPaletteFromRes();
}
#if defined(DOTT)
ptr = findResource(MKID('PALS'), roomptr);
if (ptr) {
_PALS_offs = ptr - roomptr;
setPalette(0);
if (_majorScummVersion==6) {
ptr = findResource(MKID('PALS'), roomptr);
if (ptr) {
_PALS_offs = ptr - roomptr;
setPalette(0);
}
}
#endif
initCycl(findResource(MKID('CYCL'), roomptr) + 8);
@ -884,7 +919,6 @@ Actor *Scumm::derefActorSafe(int id, const char *errmsg) {
return derefActor(id);
}
#if defined(DOTT)
void Scumm::new_unk_1(int a) {
error("stub new_unk_1(%d)", a);
}
@ -927,7 +961,6 @@ void Scumm::startManiac() {
warning("stub startManiac()");
}
#endif
extern Scumm scumm;

View File

@ -66,7 +66,8 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "CHECK_HEAP" /D "DUMP_SCRIPTS" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "CHECK_HEAP" /Yu"stdafx.h" /FD /GZ /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x41d /d "_DEBUG"
# ADD RSC /l 0x41d /d "_DEBUG"
BSC32=bscmake.exe
@ -99,6 +100,10 @@ SOURCE=.\costume.cpp
# End Source File
# Begin Source File
SOURCE=.\debug.cpp
# End Source File
# Begin Source File
SOURCE=.\gfx.cpp
# End Source File
# Begin Source File
@ -131,6 +136,10 @@ SOURCE=.\scummvm.cpp
# End Source File
# Begin Source File
SOURCE=.\sdl.cpp
# End Source File
# Begin Source File
SOURCE=.\sound.cpp
# End Source File
# Begin Source File

17
sdl.cpp
View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.11 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.10 2001/10/17 11:30:19 strigeus
* *** empty log message ***
*
@ -58,6 +62,7 @@
#define SCALEUP_2x2
Scumm scumm;
ScummDebugger debugger;
static SDL_Surface *screen;
@ -104,6 +109,9 @@ void waitForTimer(Scumm *s) {
if (event.key.keysym.sym=='f' && event.key.keysym.mod&KMOD_CTRL) {
s->_fastMode ^= 1;
}
if (event.key.keysym.sym=='d' && event.key.keysym.mod&KMOD_CTRL) {
debugger.attach(s);
}
break;
case SDL_MOUSEMOTION: {
@ -345,19 +353,10 @@ void initGraphics(Scumm *s) {
sizeof(ImageHeader),
sizeof(Scumm)
);
}
#undef main
int main(int argc, char* argv[]) {
#if defined(DOTT)
scumm._exe_name = "tentacle";
#elif defined(INDY4)
scumm._exe_name = "atlantis";
#else
scumm._exe_name = "monkey2";
#endif
scumm._videoMode = 0x13;
scumm.scummMain(argc, argv);
return 0;

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.3 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.2 2001/10/16 10:01:48 strigeus
* preliminary DOTT support
*
@ -182,39 +186,38 @@ void Scumm::CHARSET_1() {
if (_vars[VAR_TALK_ACTOR] != 0xFF)
a = derefActorSafe(_vars[VAR_TALK_ACTOR], "CHARSET_1");
#if !defined(DOTT)
if (a && string[0].overhead!=0) {
string[0].xpos = a->x - camera._curPos + 160;
if (_majorScummVersion==5) {
string[0].xpos = a->x - camera._curPos + 160;
if (_vars[VAR_TALK_STRING_Y] < 0) {
s = (a->scaley * (int)_vars[VAR_TALK_STRING_Y]) / 0xFF;
string[0].ypos = ((_vars[VAR_TALK_STRING_Y]-s)>>1) + s - a->elevation + a->y;
if (_vars[VAR_TALK_STRING_Y] < 0) {
s = (a->scaley * (int)_vars[VAR_TALK_STRING_Y]) / 0xFF;
string[0].ypos = ((_vars[VAR_TALK_STRING_Y]-s)>>1) + s - a->elevation + a->y;
} else {
string[0].ypos = _vars[VAR_TALK_STRING_Y];
}
if (string[0].ypos < 1)
string[0].ypos = 1;
if (string[0].xpos < 80)
string[0].xpos = 80;
if (string[0].xpos > 240)
string[0].xpos = 240;
} else {
string[0].ypos = _vars[VAR_TALK_STRING_Y];
s = a->scaley * a->new_1 / 0xFF;
string[0].ypos = ((a->new_1 - s)>>1) + s - a->elevation + a->y;
if (string[0].ypos<1)
string[0].ypos = 1;
s = a->scalex * a->new_2 / 0xFF;
string[0].xpos = ((a->new_2 - s)>>1) + s + a->x - camera._curPos + 160;
if (string[0].xpos < 80)
string[0].xpos = 80;
if (string[0].xpos > 240)
string[0].xpos = 240;
}
if (string[0].ypos < 1)
string[0].ypos = 1;
}
if (string[0].xpos < 80)
string[0].xpos = 80;
if (string[0].xpos > 240)
string[0].xpos = 240;
}
#else
if (a && string[0].overhead!=0) {
s = a->scaley * a->new_1 / 0xFF;
string[0].ypos = ((a->new_1 - s)>>1) + s - a->elevation + a->y;
if (string[0].ypos<1)
string[0].ypos = 1;
s = a->scalex * a->new_2 / 0xFF;
string[0].xpos = ((a->new_2 - s)>>1) + s + a->x - camera._curPos + 160;
if (string[0].xpos < 80)
string[0].xpos = 80;
if (string[0].xpos > 240)
string[0].xpos = 240;
}
#endif
charset._top = string[0].ypos;
charset._left = string[0].xpos;
charset._left2 = string[0].xpos;
@ -489,9 +492,9 @@ byte *Scumm::addMessageToStack(byte *msg) {
num+=2;
break;
case 9:
#if defined(DOTT)
//#if defined(DOTT)
case 10: case 12: case 13: case 14:
#endif
//#endif
*_msgPtrToAdd++ = 0xFF;
*_msgPtrToAdd++ = chr;
*_msgPtrToAdd++ = ptr[num++];

View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.7 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
*
* Revision 1.6 2001/10/16 20:31:27 strigeus
* misc fixes
*
@ -828,13 +832,6 @@ void drawMouse(Scumm *s, int, int, int, byte*, bool) {
int main(int argc, char* argv[]) {
scumm._videoMode = 0x13;
#if defined(DOTT)
scumm._exe_name = "tentacle";
#elif defined(INDY4)
scumm._exe_name = "atlantis";
#else
scumm._exe_name = "monkey2";
#endif
wm->init();
wm->_vgabuf = (byte*)calloc(320,200);