[Scummvm-cvs-logs] scummvm master -> a5a531ec9f5c6f6f6d550a4f0d7034110ec1c02a
bluegr
bluegr at gmail.com
Fri Jan 15 01:49:33 CET 2016
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fbc9fe03c0 SCI: Allow null references to kStringGetData, for Torin's Passage
87de93e5f1 SCI: Add a hack in music init for MUMG Deluxe, so that it starts
a5a531ec9f SCI: Use the actual segment in the segment manager for SCI3 games
Commit: fbc9fe03c089d4d5d344370460b7c7ad3afc38be
https://github.com/scummvm/scummvm/commit/fbc9fe03c089d4d5d344370460b7c7ad3afc38be
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-01-15T02:46:35+02:00
Commit Message:
SCI: Allow null references to kStringGetData, for Torin's Passage
Added a TODO for rhis, for now
Changed paths:
engines/sci/engine/kernel_tables.h
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index b1df235..2d0f1c3 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -324,7 +324,9 @@ static const SciKernelMapSubEntry kString_subops[] = {
// =SCI2, SCI2.1 Early and SCI2.1 Middle=
{ SIG_UNTIL_SCI21MID, 8, MAP_CALL(StringDup), "[or]", NULL },
- { SIG_UNTIL_SCI21MID, 9, MAP_CALL(StringGetData), "[or]", NULL },
+ // TODO: This gets called with null references in Torin. Check if this is correct, or it's
+ // caused by missing functionality
+ { SIG_UNTIL_SCI21MID, 9, MAP_CALL(StringGetData), "[or0]", NULL },
{ SIG_UNTIL_SCI21MID, 10, MAP_CALL(StringLen), "[or]", NULL },
{ SIG_UNTIL_SCI21MID, 11, MAP_CALL(StringPrintf), "[or](.*)", NULL },
{ SIG_UNTIL_SCI21MID, 12, MAP_CALL(StringPrintfBuf), "[or](.*)", NULL },
Commit: 87de93e5f13545489ef59cfaa1b0ee06035eebc4
https://github.com/scummvm/scummvm/commit/87de93e5f13545489ef59cfaa1b0ee06035eebc4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-01-15T02:47:22+02:00
Commit Message:
SCI: Add a hack in music init for MUMG Deluxe, so that it starts
Changed paths:
engines/sci/sound/music.cpp
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 31cf27f..5a11ac3 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -131,6 +131,12 @@ void SciMusic::init() {
// HACK: The Fun Seeker's Guide demo doesn't have patch 3 and the version
// of the Adlib driver (adl.drv) that it includes is unsupported. That demo
// doesn't have any sound anyway, so this shouldn't be fatal.
+ } else if (g_sci->getGameId() == GID_MOTHERGOOSEHIRES) {
+ // HACK: Mixed-Up Mother Goose Deluxe does not seem to use synthesized music,
+ // so just set a default tempo (for fading)
+ // TODO: Review this
+ _dwTempo = 1000000 / 250;
+ warning("Temporary music hack for MUMG Deluxe");
} else {
error("Failed to initialize sound driver");
}
Commit: a5a531ec9f5c6f6f6d550a4f0d7034110ec1c02a
https://github.com/scummvm/scummvm/commit/a5a531ec9f5c6f6f6d550a4f0d7034110ec1c02a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-01-15T02:48:37+02:00
Commit Message:
SCI: Use the actual segment in the segment manager for SCI3 games
Changed paths:
engines/sci/engine/seg_manager.cpp
engines/sci/engine/seg_manager.h
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 58c2b8d..23b1fda 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -144,11 +144,21 @@ Script *SegManager::allocateScript(int script_nr, SegmentId *segid) {
return (Script *)mem;
}
+SegmentId SegManager::getActualSegment(SegmentId seg) const {
+ if (getSciVersion() <= SCI_VERSION_2_1_LATE) {
+ return seg;
+ } else {
+ // Return the lower 14 bits of the segment
+ return (seg & 0x3FFF);
+ }
+}
+
void SegManager::deallocate(SegmentId seg) {
- if (seg < 1 || (uint)seg >= _heap.size())
+ SegmentId actualSegment = getActualSegment(seg);
+ if (actualSegment < 1 || (uint)actualSegment >= _heap.size())
error("Attempt to deallocate an invalid segment ID");
- SegmentObj *mobj = _heap[seg];
+ SegmentObj *mobj = _heap[actualSegment];
if (!mobj)
error("Attempt to deallocate an already freed segment");
@@ -169,7 +179,7 @@ void SegManager::deallocate(SegmentId seg) {
}
delete mobj;
- _heap[seg] = NULL;
+ _heap[actualSegment] = NULL;
}
bool SegManager::isHeapObject(reg_t pos) const {
@@ -185,22 +195,24 @@ void SegManager::deallocateScript(int script_nr) {
}
Script *SegManager::getScript(const SegmentId seg) {
- if (seg < 1 || (uint)seg >= _heap.size()) {
- error("SegManager::getScript(): seg id %x out of bounds", seg);
+ SegmentId actualSegment = getActualSegment(seg);
+ if (actualSegment < 1 || (uint)actualSegment >= _heap.size()) {
+ error("SegManager::getScript(): seg id %x out of bounds", actualSegment);
}
- if (!_heap[seg]) {
- error("SegManager::getScript(): seg id %x is not in memory", seg);
+ if (!_heap[actualSegment]) {
+ error("SegManager::getScript(): seg id %x is not in memory", actualSegment);
}
- if (_heap[seg]->getType() != SEG_TYPE_SCRIPT) {
- error("SegManager::getScript(): seg id %x refers to type %d != SEG_TYPE_SCRIPT", seg, _heap[seg]->getType());
+ if (_heap[actualSegment]->getType() != SEG_TYPE_SCRIPT) {
+ error("SegManager::getScript(): seg id %x refers to type %d != SEG_TYPE_SCRIPT", actualSegment, _heap[actualSegment]->getType());
}
- return (Script *)_heap[seg];
+ return (Script *)_heap[actualSegment];
}
Script *SegManager::getScriptIfLoaded(const SegmentId seg) const {
- if (seg < 1 || (uint)seg >= _heap.size() || !_heap[seg] || _heap[seg]->getType() != SEG_TYPE_SCRIPT)
+ SegmentId actualSegment = getActualSegment(seg);
+ if (actualSegment < 1 || (uint)actualSegment >= _heap.size() || !_heap[actualSegment] || _heap[actualSegment]->getType() != SEG_TYPE_SCRIPT)
return 0;
- return (Script *)_heap[seg];
+ return (Script *)_heap[actualSegment];
}
SegmentId SegManager::findSegmentByType(int type) const {
@@ -211,19 +223,22 @@ SegmentId SegManager::findSegmentByType(int type) const {
}
SegmentObj *SegManager::getSegmentObj(SegmentId seg) const {
- if (seg < 1 || (uint)seg >= _heap.size() || !_heap[seg])
+ SegmentId actualSegment = getActualSegment(seg);
+ if (actualSegment < 1 || (uint)actualSegment >= _heap.size() || !_heap[actualSegment])
return 0;
- return _heap[seg];
+ return _heap[actualSegment];
}
SegmentType SegManager::getSegmentType(SegmentId seg) const {
- if (seg < 1 || (uint)seg >= _heap.size() || !_heap[seg])
+ SegmentId actualSegment = getActualSegment(seg);
+ if (actualSegment < 1 || (uint)actualSegment >= _heap.size() || !_heap[actualSegment])
return SEG_TYPE_INVALID;
- return _heap[seg]->getType();
+ return _heap[actualSegment]->getType();
}
SegmentObj *SegManager::getSegment(SegmentId seg, SegmentType type) const {
- return getSegmentType(seg) == type ? _heap[seg] : NULL;
+ SegmentId actualSegment = getActualSegment(seg);
+ return getSegmentType(actualSegment) == type ? _heap[actualSegment] : NULL;
}
Object *SegManager::getObject(reg_t pos) const {
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index 2d6e624..7a68960 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -472,6 +472,7 @@ private:
void createClassTable();
SegmentId findFreeSegment() const;
+ SegmentId getActualSegment(SegmentId seg) const;
};
} // End of namespace Sci
More information about the Scummvm-git-logs
mailing list