some hacks to get V8 loading further. It now fails because it can't find the SMAP resource

svn-id: r6102
This commit is contained in:
Max Horn 2002-12-24 15:27:27 +00:00
parent 45aec3ef0d
commit 908de40919
3 changed files with 34 additions and 17 deletions

View File

@ -668,7 +668,7 @@ void Scumm::redrawBGStrip(int start, int num)
gfxUsageBits[s + i] |= 0x80000000; gfxUsageBits[s + i] |= 0x80000000;
gdi.drawBitmap(getResourceAddress(rtRoom, _roomResource) + _IM00_offs, gdi.drawBitmap(getResourceAddress(rtRoom, _roomResource) + _IM00_offs,
&virtscr[0], s, 0, virtscr[0].height, s, num, 0); &virtscr[0], s, 0, virtscr[0].height, s, num, 0);
} }
void Scumm::restoreCharsetBg() void Scumm::restoreCharsetBg()
@ -1708,7 +1708,10 @@ void Scumm::setCameraAt(int pos_x, int pos_y)
&& _vars[VAR_SCROLL_SCRIPT]) { && _vars[VAR_SCROLL_SCRIPT]) {
_vars[VAR_CAMERA_POS_X] = camera._cur.x; _vars[VAR_CAMERA_POS_X] = camera._cur.x;
_vars[VAR_CAMERA_POS_Y] = camera._cur.y; _vars[VAR_CAMERA_POS_Y] = camera._cur.y;
runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); // FIXME - HACK - for now disable scroll script in V8, until we figure out
// what value VAR_SCROLL_SCRIPT has.
if (!(_features & GF_AFTER_V8))
runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0);
} }
} else { } else {
int t; int t;

View File

@ -402,7 +402,8 @@ void Scumm::loadRoomObjects()
RoomHeader *roomhdr; RoomHeader *roomhdr;
CodeHeader *cdhd; CodeHeader *cdhd;
CHECK_HEAP room = getResourceAddress(rtRoom, _roomResource); CHECK_HEAP
room = getResourceAddress(rtRoom, _roomResource);
roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room); roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room);
if (_features & GF_AFTER_V8) if (_features & GF_AFTER_V8)
@ -459,8 +460,8 @@ void Scumm::loadRoomObjects()
imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr); imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr);
if (_features & GF_AFTER_V8) if (_features & GF_AFTER_V8)
// FIXME - in v8, IMHD seems to contain no obj_id, but rather a name string // FIXME - in v8, IMHD seems to contain no obj_id, but rather a name string
obim_id = 0; // EVIL HACK to allow loading of the first COMI room
// obim_id = READ_LE_UINT32(&imhd->v8.obj_id); obim_id = 1373 + i;
else if (_features & GF_AFTER_V7) else if (_features & GF_AFTER_V7)
obim_id = READ_LE_UINT16(&imhd->v7.obj_id); obim_id = READ_LE_UINT16(&imhd->v7.obj_id);
else else
@ -473,13 +474,12 @@ void Scumm::loadRoomObjects()
searchptr = NULL; searchptr = NULL;
} }
od = &_objs[1]; for (i = 1; i <= _numObjectsInRoom; i++) {
setupRoomObject(&_objs[i], room);
for (i = 1; i <= _numObjectsInRoom; i++, od++) {
setupRoomObject(od, room);
} }
CHECK_HEAP} CHECK_HEAP
}
void Scumm::loadRoomObjectsSmall() void Scumm::loadRoomObjectsSmall()
{ {
@ -541,7 +541,8 @@ void Scumm::loadRoomObjectsSmall()
setupRoomObject(od, room); setupRoomObject(od, room);
} }
CHECK_HEAP} CHECK_HEAP
}
void Scumm::setupRoomObject(ObjectData *od, byte *room) void Scumm::setupRoomObject(ObjectData *od, byte *room)
{ {
@ -574,15 +575,13 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room)
od->actordir = (*(ptr + 17)) & 7; od->actordir = (*(ptr + 17)) & 7;
od->height = *(ptr + 17); // ok od->height = *(ptr + 17); // ok
return; return;
} }
if (_features & GF_AFTER_V8) if (_features & GF_AFTER_V8)
searchptr = getResourceAddress(rtRoomScripts, _roomResource); searchptr = getResourceAddress(rtRoomScripts, _roomResource);
else else
searchptr = room; searchptr = room;
cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), searchptr + od->offs_obcd_to_room); cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), searchptr + od->offs_obcd_to_room);
if (cdhd == NULL) if (cdhd == NULL)

View File

@ -232,4 +232,19 @@ void Scumm_v8::setupScummVars()
VAR_PAUSE_KEY = 64; // ??? VAR_PAUSE_KEY = 64; // ???
VAR_SAVELOADDIALOG_KEY = 65; // ??? VAR_SAVELOADDIALOG_KEY = 65; // ???
// FIXME - HACK: no clue where these really are located, but we need to put them
// somewhere so that camera clamping works. So for now just assume they are on their
// V6 positions (which is somewhat unlikely, considering most stuff moved...)
VAR_CAMERA_MIN_X = 101;
VAR_CAMERA_MAX_X = 102;
VAR_CAMERA_MIN_Y = 103;
VAR_CAMERA_MAX_Y = 104;
VAR_CAMERA_THRESHOLD_X = 105;
VAR_CAMERA_THRESHOLD_Y = 106;
VAR_CAMERA_SPEED_X = 107;
VAR_CAMERA_SPEED_Y = 108;
VAR_CAMERA_ACCEL_X = 109;
VAR_CAMERA_ACCEL_Y = 110;
} }