aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorFlorian Kagerer2008-10-13 06:29:14 +0000
committerFlorian Kagerer2008-10-13 06:29:14 +0000
commite25265425d76537c634947e5ac661aed371a9df4 (patch)
treed50b5fef39f8d7430bad3325a150e5556106f1cb /engines/kyra
parentdc75da434848ecd90e5a65077d55ccc610fd335f (diff)
downloadscummvm-rg350-e25265425d76537c634947e5ac661aed371a9df4.tar.gz
scummvm-rg350-e25265425d76537c634947e5ac661aed371a9df4.tar.bz2
scummvm-rg350-e25265425d76537c634947e5ac661aed371a9df4.zip
- fix installer file support for Kyra 2 and 3
- fix bug in pc98 audio driver svn-id: r34791
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/resource_intern.cpp8
-rw-r--r--engines/kyra/sound_towns.cpp17
2 files changed, 15 insertions, 10 deletions
diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp
index 3525718f95..fbbfe69186 100644
--- a/engines/kyra/resource_intern.cpp
+++ b/engines/kyra/resource_intern.cpp
@@ -84,6 +84,7 @@ CachedArchive::CachedArchive(const FileInputList &files)
entry.data = i->data;
entry.size = i->size;
+ i->name.toLowercase();
_files[i->name] = entry;
}
}
@@ -348,6 +349,7 @@ Common::Archive *ResLoaderInsMalcolm::load(Common::SharedPtr<Common::ArchiveMemb
entry.size = stream.readUint32LE();
entry.offset = stream.pos();
entry.name = *file;
+ entry.name.toLowercase();
stream.seek(entry.size, SEEK_CUR);
files.push_back(entry);
@@ -696,9 +698,9 @@ bool FileExpander::process(uint8 *dst, const uint8 *src, uint32 outsize, uint32
}
void FileExpander::generateTables(uint8 srcIndex, uint8 dstIndex, uint8 dstIndex2, int cnt) {
- const uint8 *tbl1 = _tables[srcIndex];
+ uint8 *tbl1 = _tables[srcIndex];
uint8 *tbl2 = _tables[dstIndex];
- const uint8 *tbl3 = dstIndex2 == 0xff ? 0 : _tables[dstIndex2];
+ uint8 *tbl3 = dstIndex2 == 0xff ? 0 : _tables[dstIndex2];
if (!cnt)
return;
@@ -845,7 +847,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
uint32 bytesleft = 0;
bool startFile = true;
- Common::String filenameBase =filename;
+ Common::String filenameBase = filename;
Common::String filenameTemp;
char filenameExt[4];
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index 5bb09e5dc9..f547d0c801 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -1528,7 +1528,7 @@ private:
uint8 _noiseGenerator;
uint8 _chanEnable;
- uint8 *const *_reg;
+ uint8 **_reg;
bool _ready;
};
@@ -1536,7 +1536,7 @@ private:
class TownsPC98_OpnPercussionSource {
public:
TownsPC98_OpnPercussionSource(const uint32 timerbase);
- ~TownsPC98_OpnPercussionSource() {}
+ ~TownsPC98_OpnPercussionSource() { delete [] _reg; }
void init(const uint8 *instrData = 0);
void reset();
@@ -1577,7 +1577,7 @@ private:
const uint32 _tickLength;
uint32 _timer;
- uint8 *const *_reg;
+ uint8 **_reg;
bool _ready;
};
@@ -2554,7 +2554,7 @@ TownsPC98_OpnSquareSineSource::TownsPC98_OpnSquareSineSource(const uint32 timerb
_tleTable(0), _updateRequest(-1), _tickLength(timerbase * 27), _ready(0) {
memset(_channels, 0, sizeof(Channel) * 3);
- static uint8 *const reg [] = {
+ uint8 *reg[] = {
&_channels[0].frqL,
&_channels[0].frqH,
&_channels[1].frqL,
@@ -2568,7 +2568,8 @@ TownsPC98_OpnSquareSineSource::TownsPC98_OpnSquareSineSource(const uint32 timerb
&_channels[2].vol,
};
- _reg = reg;
+ _reg = new uint8 *[ARRAYSIZE(reg)];
+ memcpy (_reg, reg, sizeof(uint8*) * ARRAYSIZE(reg));;
reset();
}
@@ -2576,6 +2577,7 @@ TownsPC98_OpnSquareSineSource::TownsPC98_OpnSquareSineSource(const uint32 timerb
TownsPC98_OpnSquareSineSource::~TownsPC98_OpnSquareSineSource() {
delete [] _tlTable;
delete [] _tleTable;
+ delete [] _reg;
}
void TownsPC98_OpnSquareSineSource::init(const int *rsTable, const int *rseTable) {
@@ -2726,7 +2728,7 @@ TownsPC98_OpnPercussionSource::TownsPC98_OpnPercussionSource(const uint32 timerb
_tickLength(timerbase * 2), _timer(0), _ready(false) {
memset(_rhChan, 0, sizeof(RhtChannel) * 6);
- static uint8 *const reg [] = {
+ uint8 *reg[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
&_rhChan[0].startPosL,
@@ -2755,7 +2757,8 @@ TownsPC98_OpnPercussionSource::TownsPC98_OpnPercussionSource(const uint32 timerb
&_rhChan[5].endPosH,
};
- _reg = reg;
+ _reg = new uint8 *[ARRAYSIZE(reg)];
+ memcpy (_reg, reg, sizeof(uint8*) * ARRAYSIZE(reg));
}
void TownsPC98_OpnPercussionSource::init(const uint8 *instrData) {