aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/stubs.cpp
diff options
context:
space:
mode:
authorBertrand Augereau2011-11-18 07:29:38 +0100
committerBertrand Augereau2011-11-18 07:29:38 +0100
commit055464cb6f0849915bf359affeeb265cf3f6ae55 (patch)
treede879df0186c8c8b0177aa4c8fbd54f5508e6180 /engines/dreamweb/stubs.cpp
parent8651e0f0d06ad6a687e09eea4b93007bde33064e (diff)
downloadscummvm-rg350-055464cb6f0849915bf359affeeb265cf3f6ae55.tar.gz
scummvm-rg350-055464cb6f0849915bf359affeeb265cf3f6ae55.tar.bz2
scummvm-rg350-055464cb6f0849915bf359affeeb265cf3f6ae55.zip
DREAMWEB: 'deallocatemem' overload that takes a parameter
Diffstat (limited to 'engines/dreamweb/stubs.cpp')
-rw-r--r--engines/dreamweb/stubs.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index b01d16f916..3bb885adcb 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -583,9 +583,12 @@ uint16 DreamGenContext::allocatemem(uint16 paragraphs) {
}
void DreamGenContext::deallocatemem() {
- uint16 id = (uint16)es;
- debug(1, "deallocating segment %04x", id);
- deallocateSegment(id);
+ deallocatemem((uint16)es);
+}
+
+void DreamGenContext::deallocatemem(uint16 segment) {
+ debug(1, "deallocating segment %04x", segment);
+ deallocateSegment(segment);
//fixing invalid entries in the sprite table
es = data;
@@ -599,7 +602,7 @@ void DreamGenContext::deallocatemem() {
for(uint i = 0; i < tsize; i += 32) {
uint16 seg = READ_LE_UINT16(ptr + i + 6);
//debug(1, "sprite segment = %04x", seg);
- if (seg == id)
+ if (seg == segment)
memset(ptr + i, 0xff, 32);
}
}
@@ -2230,12 +2233,9 @@ void DreamGenContext::usemon() {
} while (al == 0);
getridoftemp();
getridoftempcharset();
- es = data.word(kTextfile1);
- deallocatemem();
- es = data.word(kTextfile2);
- deallocatemem();
- es = data.word(kTextfile3);
- deallocatemem();
+ deallocatemem(data.word(kTextfile1));
+ deallocatemem(data.word(kTextfile2));
+ deallocatemem(data.word(kTextfile3));
data.byte(kGetback) = 1;
al = 26;
playchannel1();