aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle
diff options
context:
space:
mode:
authorStrangerke2013-08-11 17:16:30 +0200
committerStrangerke2013-08-11 17:16:30 +0200
commitf621297dc76bb545ed5312fb941eea1da26a7052 (patch)
treedea076beee13d6be3800cfd01529d0fab5ce335c /engines/mortevielle
parent62e4945ec4638ad66c90a5363d71166f07914b8e (diff)
downloadscummvm-rg350-f621297dc76bb545ed5312fb941eea1da26a7052.tar.gz
scummvm-rg350-f621297dc76bb545ed5312fb941eea1da26a7052.tar.bz2
scummvm-rg350-f621297dc76bb545ed5312fb941eea1da26a7052.zip
MORTEVIELLE: Get rid of the 640Kb _mem buffer
Diffstat (limited to 'engines/mortevielle')
-rw-r--r--engines/mortevielle/mortevielle.cpp1
-rw-r--r--engines/mortevielle/mortevielle.h2
-rw-r--r--engines/mortevielle/sound.cpp10
-rw-r--r--engines/mortevielle/speech.cpp9
-rw-r--r--engines/mortevielle/speech.h5
5 files changed, 13 insertions, 14 deletions
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 3fcd8b663a..1296e645e2 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -100,7 +100,6 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
_caff = -1;
_day = 0;
- memset(_mem, 0, sizeof(_mem));
_curPict = nullptr;
_curAnim = nullptr;
_rightFramePict = nullptr;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 6211914b57..e849138dd1 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -434,8 +434,6 @@ public:
int _resolutionScaler;
byte _destinationArray[7][25];
- // TODO: Replace the following with proper implementations, or refactor out the code using them
- byte _mem[65536 * 16];
byte *_curPict;
byte *_curAnim;
byte *_rightFramePict;
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index f96aae4357..3198de6ee8 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -142,11 +142,11 @@ void SoundManager::litph(tablint &t, int typ, int tempo) {
int freq = tempo * 252; // 25.2 * 10
int i = 0;
while (i < _vm->_speechManager._ptr_oct) {
- int idx = _vm->_mem[(kAdrTroct * 16) + i];
+ int idx = _vm->_speechManager._troctBuf[i];
i++;
switch(idx) {
case 0: {
- int val = _vm->_mem[(kAdrTroct * 16) + i];
+ int val = _vm->_speechManager._troctBuf[i];
i++;
if (_vm->_speechManager._soundType == 0)
warning("TODO: vclas");
@@ -187,10 +187,10 @@ void SoundManager::litph(tablint &t, int typ, int tempo) {
break;
}
case 2: {
- int val = _vm->_mem[(kAdrTroct * 16) + i];
+ int val = _vm->_speechManager._troctBuf[i];
i++;
int tmpidx = (val * 12) + 268;
- val = _vm->_mem[(kAdrTroct * 16) + i];
+ val = _vm->_speechManager._troctBuf[i];
i++;
warning("TODO: reech %d %d", tmpidx, val);
}
@@ -200,7 +200,7 @@ void SoundManager::litph(tablint &t, int typ, int tempo) {
i += 2;
} else {
// Speech
- warning("TODO: Interphoneme: consonne:%d voyelle:%d", _vm->_mem[(kAdrTroct * 16) + i], _vm->_mem[(kAdrTroct * 16) + i + 1]);
+ warning("TODO: Interphoneme: consonne:%d voyelle:%d", _vm->_speechManager._troctBuf[i], _vm->_speechManager._troctBuf[i + 1]);
i += 2;
}
break;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 6ea43ad54a..6c90c8ea26 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -88,7 +88,8 @@ void SpeechManager::spfrac(int wor) {
}
void SpeechManager::charg_car(int &currWordNumb) {
- int wor = READ_BE_UINT16(&_vm->_mem[(kAdrWord * 16) + currWordNumb]);
+ assert(currWordNumb < 1712);
+ int wor = READ_BE_UINT16(&_wordBuf[currWordNumb]);
int int_ = wor & 0x3f; // 63
if ((int_ >= 0) && (int_ <= 13)) {
@@ -128,7 +129,8 @@ void SpeechManager::charg_car(int &currWordNumb) {
void SpeechManager::entroct(byte o) {
- _vm->_mem[(kAdrTroct * 16) + _ptr_oct] = o;
+ assert(_ptr_oct < 10576);
+ _troctBuf[_ptr_oct] = o;
++_ptr_oct;
}
@@ -497,8 +499,9 @@ void SpeechManager::handlePhoneme() {
startPos /= 2;
endPos /= 2;
+ assert((endPos - startPos) < 1711);
for (int i = startPos, currWord = 0; i < endPos; i++, currWord += 2)
- WRITE_BE_UINT16(&_vm->_mem[(kAdrWord * 16) + currWord], _cfiphBuffer[i]);
+ WRITE_BE_UINT16(&_wordBuf[currWord], _cfiphBuffer[i]);
_ptr_oct = 0;
int currWord = 0;
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 43cdbd5326..c21d3a44c8 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -34,9 +34,6 @@
namespace Mortevielle {
-const int kAdrTroct = 0x406b;
-const int kAdrWord = 0x4000;
-
const float kfreq0 = 1.19318e6;
const int kNullValue = 255;
const int kTempoMusic = 71;
@@ -58,7 +55,9 @@ private:
int _phonemeNumb;
SpeechQueue _queue[3];
+ byte _wordBuf[1712];
public:
+ byte _troctBuf[10576];
int _soundType;
bool _buildingSentence;