DREAMWEB: 'clearendpal' ported to C++

This commit is contained in:
Bertrand Augereau 2011-11-16 17:56:06 +01:00
parent 1ef77a580f
commit 6e90f9e693
5 changed files with 7 additions and 12 deletions

View File

@ -213,6 +213,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'initrain',
'checkbasemem',
'clearstartpal',
'clearendpal',
'paltostartpal',
'endpaltostart',
'startpaltoend',

View File

@ -2560,15 +2560,6 @@ void DreamGenContext::dofade() {
fadecalculation();
}
void DreamGenContext::clearendpal() {
STACK_CHECK;
es = data.word(kBuffers);
di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768);
cx = 768;
al = 0;
_stosb(cx, true);
}
void DreamGenContext::clearpalette() {
STACK_CHECK;
data.byte(kFadedirection) = 0;
@ -16137,7 +16128,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_transfermap: transfermap(); break;
case addr_fadedos: fadedos(); break;
case addr_dofade: dofade(); break;
case addr_clearendpal: clearendpal(); break;
case addr_clearpalette: clearpalette(); break;
case addr_fadescreenup: fadescreenup(); break;
case addr_fadetowhite: fadetowhite(); break;

View File

@ -514,7 +514,6 @@ public:
static const uint16 addr_fadetowhite = 0xc25c;
static const uint16 addr_fadescreenup = 0xc258;
static const uint16 addr_clearpalette = 0xc254;
static const uint16 addr_clearendpal = 0xc250;
static const uint16 addr_dofade = 0xc24c;
static const uint16 addr_fadedos = 0xc248;
static const uint16 addr_transfermap = 0xc244;
@ -1291,7 +1290,7 @@ public:
void drawfloor();
void loadkeypad();
//void findsource();
void clearendpal();
//void clearendpal();
void findtext1();
void isryanholding();
void showslots();

View File

@ -259,6 +259,7 @@
uint8 *startPalette();
uint8 *endPalette();
void clearstartpal();
void clearendpal();
void paltostartpal();
void endpaltostart();
void startpaltoend();

View File

@ -40,6 +40,10 @@ void DreamGenContext::clearstartpal() {
memset(startPalette(), 0, 256*3);
}
void DreamGenContext::clearendpal() {
memset(endPalette(), 0, 256*3);
}
void DreamGenContext::paltostartpal() {
memcpy(startPalette(), mainPalette(), 256*3);
}