DREAMWEB: 'allocatebuffers' ported to C++

This commit is contained in:
Bertrand Augereau 2011-11-30 15:19:41 +01:00
parent 17225e42e3
commit 9edd0f2903
5 changed files with 19 additions and 36 deletions

View File

@ -318,6 +318,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'constant',
'random',
'drawfloor',
'allocatebuffers',
], skip_output = [
# These functions are processed but not output
'dreamweb',

View File

@ -11252,40 +11252,6 @@ void DreamGenContext::checkforemm() {
STACK_CHECK;
}
void DreamGenContext::allocatebuffers() {
STACK_CHECK;
bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16;
allocatemem();
data.word(kExtras) = ax;
trysoundalloc();
bx = (0+(66*60))/16;
allocatemem();
data.word(kMapdata) = ax;
trysoundalloc();
bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+991-534+68-0)/16;
allocatemem();
data.word(kBuffers) = ax;
trysoundalloc();
bx = (16*80)/16;
allocatemem();
data.word(kFreedat) = ax;
trysoundalloc();
bx = (64*128)/16;
allocatemem();
data.word(kSetdat) = ax;
trysoundalloc();
bx = (22*8*20*8)/16;
allocatemem();
data.word(kMapstore) = ax;
allocatework();
bx = 2048/16;
allocatemem();
data.word(kSounddata) = ax;
bx = 2048/16;
allocatemem();
data.word(kSounddata2) = ax;
}
void DreamGenContext::clearbuffers() {
STACK_CHECK;
es = data.word(kBuffers);

View File

@ -94,7 +94,6 @@ public:
static const uint16 addr_clearbeforeload = 0xc978;
static const uint16 addr_clearchanges = 0xc974;
static const uint16 addr_clearbuffers = 0xc970;
static const uint16 addr_allocatebuffers = 0xc96c;
static const uint16 addr_checkforemm = 0xc964;
static const uint16 addr_removeemm = 0xc960;
static const uint16 addr_setupemm = 0xc95c;
@ -1528,7 +1527,6 @@ public:
void findpuztext();
void usechurchgate();
void monkandryan();
void allocatebuffers();
void swapwithinv();
void usecontrol();
void buttonseven();

View File

@ -2522,5 +2522,22 @@ void DreamGenContext::drawfloor() {
data.byte(kNewobs) = 0;
}
void DreamGenContext::allocatebuffers() {
data.word(kExtras) = allocatemem(kLengthofextra/16);
trysoundalloc();
data.word(kMapdata) = allocatemem(kLengthofmap/16);
trysoundalloc();
data.word(kBuffers) = allocatemem(kLengthofbuffer/16);
trysoundalloc();
data.word(kFreedat) = allocatemem(kFreedatlen/16);
trysoundalloc();
data.word(kSetdat) = allocatemem(kSetdatlen/16);
trysoundalloc();
data.word(kMapstore) = allocatemem(kLenofmapstore/16);
allocatework();
data.word(kSounddata) = allocatemem(2048/16);
data.word(kSounddata2) = allocatemem(2048/16);
}
} /*namespace dreamgen */

View File

@ -373,4 +373,5 @@
void loadtemptext(const char *fileName);
void loadtraveltext();
void drawfloor();
void allocatebuffers();