diff options
| -rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
| -rw-r--r-- | engines/dreamweb/backdrop.cpp | 49 | ||||
| -rw-r--r-- | engines/dreamweb/dreamgen.cpp | 82 | ||||
| -rw-r--r-- | engines/dreamweb/dreamgen.h | 7 | ||||
| -rw-r--r-- | engines/dreamweb/sprite.cpp | 6 | ||||
| -rw-r--r-- | engines/dreamweb/stubs.cpp | 8 | ||||
| -rw-r--r-- | engines/dreamweb/stubs.h | 3 | ||||
| -rw-r--r-- | engines/dreamweb/vgagrafx.cpp | 5 | ||||
| -rw-r--r-- | engines/scumm/imuse/pcspk.cpp | 6 | ||||
| -rw-r--r-- | engines/scumm/imuse/pcspk.h | 2 | ||||
| -rw-r--r-- | engines/scumm/palette.cpp | 12 |
11 files changed, 80 insertions, 101 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 004a4c8b25..c380bfae4d 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -140,6 +140,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'deletetaken', 'placesetobject', 'removesetobject', + 'showallfree', ], skip_output = [ # These functions are processed but not output 'dreamweb', diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp index e1800bafc0..cba1f14c5e 100644 --- a/engines/dreamweb/backdrop.cpp +++ b/engines/dreamweb/backdrop.cpp @@ -111,12 +111,21 @@ uint8 DreamGenContext::getmapad(const uint8 *setData) { } void DreamGenContext::calcfrframe() { + uint8 width, height; + calcfrframe(&width, &height); + cl = width; + ch = height; +} + +void DreamGenContext::calcfrframe(uint8* width, uint8* height) { const Frame *frame = (const Frame *)segRef(data.word(kFrsegment)).ptr(data.word(kCurrentframe) * sizeof(Frame), sizeof(Frame)); data.word(kSavesource) = data.word(kFramesad) + frame->ptr(); data.byte(kSavesize+0) = frame->width; data.byte(kSavesize+1) = frame->height; data.word(kOffsetx) = frame->x; data.word(kOffsety) = frame->y; + *width = frame->width; + *height = frame->height; } void DreamGenContext::finalframe() { @@ -157,8 +166,7 @@ void DreamGenContext::showallobs() { if ((setEntry->type == 0) && (setEntry->priority != 5) && (setEntry->priority != 6)) { x += data.word(kMapadx); y += data.word(kMapady); - uint8 width, height; - showframe(frames, x, y, data.word(kCurrentframe), 0, &width, &height); + showframe(frames, x, y, data.word(kCurrentframe), 0); } else makebackob(setEntry); @@ -236,5 +244,42 @@ void DreamGenContext::calcmapad() { data.word(kMapady) = data.word(kMapoffsety) - 8 * (mapYsize + 2 * mapYstart - 10); } +void DreamGenContext::showallfree() { + data.word(kListpos) = kFreelist; + ObjPos *listPos = (ObjPos *)segRef(data.word(kBuffers)).ptr(kFreelist, 80 * sizeof(ObjPos)); + memset(listPos, 0xff, 80 * sizeof(ObjPos)); + + data.word(kFrsegment) = data.word(kFreeframes); + data.word(kDataad) = kFrframedata; + data.word(kFramesad) = kFrframes; + data.byte(kCurrentfree) = 0; + const uint8 *mapData = segRef(data.word(kFreedat)).ptr(2, 0); + for(size_t i = 0; i < 80; ++i) { + uint8 mapad = getmapad(mapData); + if (mapad != 0) { + data.word(kCurrentframe) = 3 * data.byte(kCurrentfree); + uint8 width, height; + calcfrframe(&width, &height); + uint16 x, y; + finalframe(&x, &y); + if ((width != 0) || (height != 0)) { + x += data.word(kMapadx); + y += data.word(kMapady); + showframe((Frame *)segRef(data.word(kFrsegment)).ptr(0, 0), x, y, data.word(kCurrentframe) & 0xff, 0); + ObjPos *objPos = (ObjPos *)segRef(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(ObjPos)); + objPos->xMin = data.byte(kSavex); + objPos->yMin = data.byte(kSavey); + objPos->xMax = data.byte(kSavex) + data.byte(kSavesize+0); + objPos->yMax = data.byte(kSavey) + data.byte(kSavesize+1); + objPos->index = i; + data.word(kListpos) += sizeof(ObjPos); + } + } + + ++data.byte(kCurrentfree); + mapData += 16; + } +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 7a48d7313d..ceec7d9049 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -6415,87 +6415,6 @@ _tmp28a: goto _tmp28; } -void DreamGenContext::showallfree() { - STACK_CHECK; - es = data.word(kBuffers); - bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); - data.word(kListpos) = bx; - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); - cx = 80*5; - al = 255; - _stosb(cx, true); - es = data.word(kFreeframes); - data.word(kFrsegment) = es; - ax = (0); - data.word(kDataad) = ax; - ax = (0+2080); - data.word(kFramesad) = ax; - al = 0; - data.byte(kCurrentfree) = al; - ds = data.word(kFreedat); - si = 2; - cx = 0; -loop127: - push(cx); - push(si); - push(si); - es = data.word(kFreedat); - getmapad(); - si = pop(); - _cmp(ch, 0); - if (flags.z()) - goto over138; - al = data.byte(kCurrentfree); - ah = 0; - dx = ax; - _add(ax, ax); - _add(ax, dx); - data.word(kCurrentframe) = ax; - push(es); - push(si); - calcfrframe(); - es = data.word(kMapstore); - ds = data.word(kFrsegment); - finalframe(); - si = pop(); - es = pop(); - _cmp(cx, 0); - if (flags.z()) - goto over138; - ax = data.word(kCurrentframe); - ah = 0; - _add(di, data.word(kMapadx)); - _add(bx, data.word(kMapady)); - showframe(); - si = data.word(kListpos); - es = data.word(kBuffers); - al = data.byte(kSavex); - ah = data.byte(kSavey); - es.word(si) = ax; - cx = ax; - ax = data.word(kSavesize); - _add(al, cl); - _add(ah, ch); - es.word(si+2) = ax; - ax = pop(); - cx = pop(); - push(cx); - push(ax); - es.byte(si+4) = cl; - _add(si, 5); - data.word(kListpos) = si; -over138: - _inc(data.byte(kCurrentfree)); - si = pop(); - cx = pop(); - _add(si, 16); - _inc(cx); - _cmp(cx, 80); - if (flags.z()) - return /* (finfree) */; - goto loop127; -} - void DreamGenContext::showallex() { STACK_CHECK; es = data.word(kBuffers); @@ -18409,7 +18328,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_blockget: blockget(); break; case addr_drawfloor: drawfloor(); break; case addr_drawflags: drawflags(); break; - case addr_showallfree: showallfree(); break; case addr_showallex: showallex(); break; case addr_adjustlen: adjustlen(); break; case addr_autolook: autolook(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index bca9cc634a..62aaf70661 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -467,7 +467,6 @@ public: static const uint16 addr_autolook = 0xc46c; static const uint16 addr_adjustlen = 0xc45c; static const uint16 addr_showallex = 0xc450; - static const uint16 addr_showallfree = 0xc44c; static const uint16 addr_drawflags = 0xc43c; static const uint16 addr_drawfloor = 0xc428; static const uint16 addr_blockget = 0xc424; @@ -1455,7 +1454,7 @@ public: //void cancelch0(); void setbotleft(); void findfirstpath(); - void fadescreenup(); + //void cancelch1(); void loadold(); void loadtempcharset(); void showbyte(); @@ -1709,6 +1708,7 @@ public: void powerlighton(); void savefilewrite(); void printmessage2(); + //void showallfree(); void loadnews(); void rollem(); void makeworn(); @@ -1808,7 +1808,6 @@ public: void pickupob(); void error(); void showopbox(); - //void cancelch1(); void clearbeforeload(); void biblequote(); void doload(); @@ -1958,7 +1957,7 @@ public: void initialmoncols(); void checkforshake(); void usebuttona(); - void showallfree(); + void fadescreenup(); //void getnextword(); void generalerror(); void actualload(); diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index 2f7bfa76cc..c1a47ae5fc 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -66,8 +66,7 @@ void DreamGenContext::printasprite(const Sprite *sprite) { c = 8; else c = 0; - uint8 width, height; - showframe((const Frame *)segRef(sprite->frameData()).ptr(0, 0), x, y, sprite->b15, c, &width, &height); + showframe((const Frame *)segRef(sprite->frameData()).ptr(0, 0), x, y, sprite->b15, c); } void DreamGenContext::clearsprites() { @@ -546,8 +545,7 @@ void DreamGenContext::showreelframe(Reel *reel) { data.word(kCurrentframe) = reel->frame(); Frame *source = findsourceCPP(); uint16 frame = data.word(kCurrentframe) - data.word(kTakeoff); - uint8 width, height; - showframe(source, x, y, frame, 8, &width, &height); + showframe(source, x, y, frame, 8); } void DreamGenContext::showgamereel() { diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 67811f91f9..1439a24de0 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -894,8 +894,7 @@ void DreamGenContext::crosshair() { frame = 29; } const Frame *src = (const Frame *)segRef(data.word(kIcons1)).ptr(0, 0); - uint8 width, height; - showframe(src, kZoomx + 24, kZoomy + 19, frame, 0, &width, &height); + showframe(src, kZoomx + 24, kZoomy + 19, frame, 0); } void DreamGenContext::deltextline() { @@ -1022,9 +1021,8 @@ void DreamGenContext::commandwithob(uint8 command, uint8 type, uint8 index) { void DreamGenContext::showpanel() { Frame *frame = (Frame *)segRef(data.word(kIcons1)).ptr(0, sizeof(Frame)); - uint8 width, height; - showframe(frame, 72, 0, 19, 0, &width, &height); - showframe(frame, 192, 0, 19, 0, &width, &height); + showframe(frame, 72, 0, 19, 0); + showframe(frame, 192, 0, 19, 0); } void DreamGenContext::blocknametext() { diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 61a65a3a80..37b7befe6e 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -69,6 +69,7 @@ Sprite *spritetable(); void showframe(); void showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height); + void showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag); void printasprite(const Sprite *sprite); void width160(); void multiput(const uint8 *src, uint16 x, uint16 y, uint8 width, uint8 height); @@ -142,6 +143,7 @@ uint8 getxad(const uint8 *setData, uint8 *result); uint8 getyad(const uint8 *setData, uint8 *result); void calcfrframe(); + void calcfrframe(uint8* width, uint8* height); void finalframe(); void finalframe(uint16 *x, uint16 *y); void showallobs(); @@ -162,4 +164,5 @@ void placesetobject(uint8 index); void removesetobject(); void removesetobject(uint8 index); + void showallfree(); diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index 5e0e35e8ab..3c92640768 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -312,6 +312,11 @@ void DreamGenContext::frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint } } +void DreamGenContext::showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag) { + uint8 width, height; + showframe(frameData, x, y, frameNumber, effectsFlag, &width, &height); +} + void DreamGenContext::showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) { const Frame *frame = frameData + frameNumber; if ((frame->width == 0) && (frame->height == 0)) { diff --git a/engines/scumm/imuse/pcspk.cpp b/engines/scumm/imuse/pcspk.cpp index 668defefba..cbf3446f10 100644 --- a/engines/scumm/imuse/pcspk.cpp +++ b/engines/scumm/imuse/pcspk.cpp @@ -380,7 +380,7 @@ int16 PcSpkDriver::getEffectModLevel(int16 level, int8 mod) { } } -int16 PcSpkDriver::getRandMultipy(int16 input) { +int16 PcSpkDriver::getRandScale(int16 input) { if (_randBase & 1) _randBase = (_randBase >> 1) ^ 0xB8; else @@ -470,7 +470,7 @@ void PcSpkDriver::initNextEnvelopeState(EffectEnvelope &env) { uint16 stepCount = _effectEnvStepTable[getEffectModifier(((env.stateTargetLevels[lastState] & 0x7F) << 5) + env.modWheelSensitivity)]; if (env.stateTargetLevels[lastState] & 0x80) - stepCount = getRandMultipy(stepCount); + stepCount = getRandScale(stepCount); if (!stepCount) stepCount = 1; @@ -480,7 +480,7 @@ void PcSpkDriver::initNextEnvelopeState(EffectEnvelope &env) { if (lastState != 2) { totalChange = getEffectModLevel(env.maxLevel, (env.stateModWheelLevels[lastState] & 0x7F) - 31); if (env.stateModWheelLevels[lastState] & 0x80) - totalChange = getRandMultipy(totalChange); + totalChange = getRandScale(totalChange); if (totalChange + env.startLevel > env.maxLevel) totalChange = env.maxLevel - env.startLevel; diff --git a/engines/scumm/imuse/pcspk.h b/engines/scumm/imuse/pcspk.h index b87110c412..195bd34b07 100644 --- a/engines/scumm/imuse/pcspk.h +++ b/engines/scumm/imuse/pcspk.h @@ -57,7 +57,7 @@ private: static uint8 getEffectModifier(uint16 level); int16 getEffectModLevel(int16 level, int8 mod); - int16 getRandMultipy(int16 input); + int16 getRandScale(int16 input); struct EffectEnvelope { uint8 state; diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index 51ba2195d7..30096000ce 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -544,6 +544,12 @@ void ScummEngine::palManipulateInit(int resID, int start, int end, int time) { return; #endif + // This function is actually a nullsub in Indy4 Amiga. + // It might very well be a nullsub in other Amiga games, but for now I + // limit this to Indy4 Amiga, since that is the only game I can check. + if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) + return; + byte *string1 = getStringAddress(resID); byte *string2 = getStringAddress(resID + 1); byte *string3 = getStringAddress(resID + 2); @@ -670,6 +676,12 @@ static inline uint colorWeight(int red, int green, int blue) { } void ScummEngine::setShadowPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor, int start, int end) { + // This function is actually a nullsub in Indy4 Amiga. + // It might very well be a nullsub in other Amiga games, but for now I + // limit this to Indy4 Amiga, since that is the only game I can check. + if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) + return; + const byte *basepal = getPalettePtr(_curPalIndex, _roomResource); const byte *compareptr; const byte *pal = basepal + start * 3; |
