diff options
author | Travis Howell | 2009-10-27 09:17:09 +0000 |
---|---|---|
committer | Travis Howell | 2009-10-27 09:17:09 +0000 |
commit | e49065c8214e409226ce9ab9e72f09fa3fb6ee02 (patch) | |
tree | c329c8d099c421b3e12e76cf578cb6e4ebb12dae | |
parent | b132c65ff3b6e374c94bb57187284740d75a5fb8 (diff) | |
download | scummvm-rg350-e49065c8214e409226ce9ab9e72f09fa3fb6ee02.tar.gz scummvm-rg350-e49065c8214e409226ce9ab9e72f09fa3fb6ee02.tar.bz2 scummvm-rg350-e49065c8214e409226ce9ab9e72f09fa3fb6ee02.zip |
Add support for distaff images in PCE version of Loom.
svn-id: r45433
-rw-r--r-- | engines/scumm/gfx.cpp | 24 | ||||
-rw-r--r-- | engines/scumm/gfx.h | 9 | ||||
-rw-r--r-- | engines/scumm/scumm-md5.h | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 16 | ||||
-rw-r--r-- | engines/scumm/vars.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/verbs.cpp | 8 | ||||
-rw-r--r-- | tools/scumm-md5.txt | 2 |
7 files changed, 53 insertions, 14 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 8254efe477..9a141ef610 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -210,6 +210,7 @@ Gdi::Gdi(ScummEngine *vm) : _vm(vm) { _vertStripNextInc = 0; _zbufferDisabled = false; _objectMode = false; + _distaff = false; } Gdi::~Gdi() { @@ -224,7 +225,8 @@ GdiPCEngine::GdiPCEngine(ScummEngine *vm) : Gdi(vm) { } GdiPCEngine::~GdiPCEngine() { - free(_PCE.tiles); + free(_PCE.roomTiles); + free(_PCE.staffTiles); free(_PCE.masks); } @@ -271,6 +273,13 @@ void GdiPCEngine::roomChanged(byte *roomptr) { decodePCEngineGfx(roomptr); } +void Gdi::loadTiles(byte *roomptr) { +} + +void GdiPCEngine::loadTiles(byte *roomptr) { + decodePCEngineTileData(_vm->findResourceData(MKID_BE('TILE'), roomptr)); +} + void GdiV1::roomChanged(byte *roomptr) { for (int i = 0; i < 4; i++){ _C64.colors[i] = roomptr[6 + i]; @@ -2801,11 +2810,16 @@ void GdiPCEngine::decodePCEngineTileData(const byte *ptr) { readOffsetTable(ptr, &tileOffsets, &_PCE.numTiles); - free(_PCE.tiles); - _PCE.tiles = (byte*)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); + if (_distaff) { + free(_PCE.staffTiles); + _PCE.staffTiles = (byte*)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); + } else { + free(_PCE.roomTiles); + _PCE.roomTiles = (byte*)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); + } for (int i = 0; i < _PCE.numTiles; ++i) { - tile = &_PCE.tiles[i * 64]; + tile = (_distaff) ? &_PCE.staffTiles[i * 64] : &_PCE.roomTiles[i * 64]; tilePtr = ptr + tileOffsets[i]; int index = 0; @@ -2880,7 +2894,7 @@ void GdiPCEngine::drawStripPCEngine(byte *dst, byte *mask, int dstPitch, int str for (int y = 0; y < height; y++) { tileIdx = (_objectMode ? _PCE.nametableObj : _PCE.nametable)[stripnr * height + y]; - tile = &_PCE.tiles[tileIdx * 64]; + tile = (_distaff) ? &_PCE.staffTiles[tileIdx * 64] : &_PCE.roomTiles[tileIdx * 64]; paletteIdx = (_objectMode ? _PCE.colortableObj : _PCE.colortable)[stripnr * height + y]; paletteOffset = paletteIdx * 16; for (int row = 0; row < 8; row++) { diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index bb9acbeef8..c93d8d717a 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -193,6 +193,9 @@ protected: bool _objectMode; public: + /** Flag which is true when loading objects or titles for distaff, in PCEngine version of Loom. */ + bool _distaff; + int _numZBuffer; int _imgBufOffs[8]; int32 _numStrips; @@ -243,6 +246,7 @@ public: virtual void init(); virtual void roomChanged(byte *roomptr); + virtual void loadTiles(byte *roomptr); void setTransparentColor(byte transparentColor) { _transparentColor = transparentColor; } void drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height, @@ -310,8 +314,8 @@ protected: int maskIDSize; int numTiles; int numMasks; - byte* tiles; - byte* masks; + byte *roomTiles, *staffTiles; + byte *masks; } _PCE; protected: @@ -340,6 +344,7 @@ public: GdiPCEngine(ScummEngine *vm); ~GdiPCEngine(); + virtual void loadTiles(byte *roomptr); virtual void roomChanged(byte *roomptr); }; diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h index a2f76c120a..bf58faa4a4 100644 --- a/engines/scumm/scumm-md5.h +++ b/engines/scumm/scumm-md5.h @@ -1,5 +1,5 @@ /* - This file was generated by the md5table tool on Thu Oct 22 01:22:29 2009 + This file was generated by the md5table tool on Tue Oct 27 08:40:31 2009 DO NOT EDIT MANUALLY! */ @@ -337,7 +337,6 @@ static const MD5Table md5table[] = { { "7f45ddd6dbfbf8f80c0c0efea4c295bc", "maniac", "V1", "V1", 1972, Common::EN_ANY, Common::kPlatformPC }, { "7f945525abcd48015adf1632637a44a1", "pajama", "", "Demo", -1, Common::FR_FRA, Common::kPlatformUnknown }, { "7fc6cdb46b4c9d384c52327f4bca6416", "football", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, - { "80ee753bd2c0e99394e207ef9d0eff31", "loom", "PC-Engine", "", -1, Common::EN_ANY, Common::kPlatformPCEngine }, { "810a9da887aefa597b0cf3c77d262897", "BluesABCTime", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "81bbfa181184cb494e7a81dcfa94fbd9", "maniac", "NES", "", 262144, Common::FR_FRA, Common::kPlatformNES }, { "822807c3cd3b43a925cab2767ca6b453", "BluesTreasureHunt", "", "Disc 1", -1, Common::EN_ANY, Common::kPlatformUnknown }, @@ -485,6 +484,7 @@ static const MD5Table md5table[] = { { "c3df37df9d3b481b45f75283a9907c47", "loom", "EGA", "EGA", -1, Common::IT_ITA, Common::kPlatformPC }, { "c4787c3e8b5e2dfda90850ee800af00f", "zak", "V2", "V2", -1, Common::FR_FRA, Common::kPlatformPC }, { "c4a7f7398ac9ae588940f9912ea5fd8f", "maniac", "C64", "", -1, Common::DE_DEU, Common::kPlatformC64 }, + { "c4aa4f972813334a1068f8c755004c0a", "loom", "PC-Engine", "", -1, Common::EN_ANY, Common::kPlatformPCEngine }, { "c4ffae9fac495475d6bc3343ccc8faf9", "Soccer2004", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "c5cc7cba02a2fbd539c4439e775b0536", "puttzoo", "HE 99", "Updated", 43470, Common::DE_DEU, Common::kPlatformWindows }, { "c5d10e190d4b4d59114b824f2fdbd00e", "loom", "FM-TOWNS", "", -1, Common::EN_ANY, Common::kPlatformFMTowns }, diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 7cfa813f70..3732703262 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1486,8 +1486,20 @@ void ScummEngine_v2::resetScumm() { void ScummEngine_v3::resetScumm() { ScummEngine_v4::resetScumm(); - _16BitPalette = (uint16 *)malloc(512); - memset(_16BitPalette, 0, 512); + + if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) { + _16BitPalette = (uint16 *)calloc(512, sizeof(uint16)); + + // Load tile set and palette for the distaff + byte *roomptr = getResourceAddress(rtRoom, 90); + assert(roomptr); + const byte *palPtr = findResourceData(MKID_BE('CLUT'), roomptr); + assert(palPtr - 4); + setPCEPaletteFromPtr(palPtr); + _gdi->_distaff = true; + _gdi->loadTiles(roomptr); + _gdi->_distaff = false; + } delete _savePreparedSavegame; _savePreparedSavegame = NULL; diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 69da7f3e09..e1614ecda5 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -82,6 +82,10 @@ void ScummEngine::setupScummVars() { VAR_SOUNDCARD = 48; VAR_VIDEOMODE = 49; + if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) { + VAR_MAINMENU_KEY = 50; + } + if (_game.version >= 4) { VAR_SCROLL_SCRIPT = 27; VAR_DEBUGMODE = 39; diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index e5fac901bf..bfb1642d88 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -1331,8 +1331,8 @@ void ScummEngine::restoreVerbBG(int verb) { } void ScummEngine::drawVerbBitmap(int verb, int x, int y) { + VerbSlot *vst = &_verbs[verb]; VirtScreen *vs; - VerbSlot *vst; bool twobufs; const byte *imptr = 0; int ydiff, xstrip; @@ -1381,12 +1381,16 @@ void ScummEngine::drawVerbBitmap(int verb, int x, int y) { imptr = getObjectImage(obim, 1); } assert(imptr); + + if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) { + _gdi->_distaff = (vst->verbid != 54); + } + for (i = 0; i < imgw; i++) { tmp = xstrip + i; _gdi->drawBitmap(imptr, vs, tmp, ydiff, imgw * 8, imgh * 8, i, 1, Gdi::dbAllowMaskOr | Gdi::dbObjectMode); } - vst = &_verbs[verb]; vst->curRect.right = vst->curRect.left + imgw * 8; vst->curRect.bottom = vst->curRect.top + imgh * 8; vst->oldRect = vst->curRect; diff --git a/tools/scumm-md5.txt b/tools/scumm-md5.txt index d0cfcb4a38..3dafcf1b18 100644 --- a/tools/scumm-md5.txt +++ b/tools/scumm-md5.txt @@ -178,7 +178,7 @@ loom Loom c5d10e190d4b4d59114b824f2fdbd00e -1 en FM-TOWNS FM-TOWNS - - dhewg, Andrea Petrucci 31b8fda4c8c7413fa6b39997e776eba4 -1 jp FM-TOWNS FM-TOWNS - - khalek, Andrea Petrucci - 80ee753bd2c0e99394e207ef9d0eff31 -1 en PC-Engine PC-Engine - - Kirben + c4aa4f972813334a1068f8c755004c0a -1 en PC-Engine PC-Engine - - Kirben 431ae44609321acc46e6f064dec962a5 -1 jp PC-Engine PC-Engine - - clone2727 5a35e36fd777e9c37a49c5b2faca52f9 6108 en DOS EGA EGA Demo non-interactive Fingolfin |