Skip to content

Commit

Permalink
DREAMWEB: 'deallocatemem' overload that takes a parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tramboi committed Nov 18, 2011
1 parent 8651e0f commit 055464c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
20 changes: 10 additions & 10 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions engines/dreamweb/stubs.h
Expand Up @@ -20,6 +20,7 @@
*
*/
uint16 allocatemem(uint16 paragraphs);
void deallocatemem(uint16 segment);
uint8 *workspace();
uint8 *textUnder();
void allocatework();
Expand Down

0 comments on commit 055464c

Please sign in to comment.