DREAMWEB: Convert fadeScreenDownHalf to C++

This commit is contained in:
Max Horn 2011-12-16 17:20:53 +01:00
parent 010714ce5b
commit 8cb92c2367
6 changed files with 25 additions and 33 deletions

View File

@ -399,6 +399,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'fadescreenuphalf',
'fadescreendown',
'fadescreendowns',
'fadescreendownhalf',
'fadetowhite',
'fadeupmonfirst',
'fadeupyellows',

View File

@ -356,6 +356,8 @@ public:
void fadeScreenUpHalf();
void fadeScreenDown();
void fadeScreenDowns();
void fadeScreenDownHalf();
void clearPalette();
void greyscaleSum();
void allPalette();
void dumpCurrent();

View File

@ -285,36 +285,6 @@ void DreamGenContext::transferMap() {
_add(data.word(kExframepos), cx);
}
void DreamGenContext::fadeScreenDownHalf() {
STACK_CHECK;
palToStartPal();
palToEndPal();
cx = 768;
es = data.word(kBuffers);
bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768);
halfend:
al = es.byte(bx);
_shr(al, 1);
es.byte(bx) = al;
_inc(bx);
if (--cx)
goto halfend;
ds = data.word(kBuffers);
es = data.word(kBuffers);
si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(56*3);
di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(56*3);
cx = 3*5;
_movsb(cx, true);
si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(77*3);
di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(77*3);
cx = 3*2;
_movsb(cx, true);
data.byte(kFadedirection) = 1;
data.byte(kFadecount) = 31;
data.byte(kColourpos) = 0;
data.byte(kNumtofade) = 32;
}
void DreamGenContext::rollEm() {
STACK_CHECK;
cl = 160;

View File

@ -487,7 +487,6 @@ public:
void doSomeTalk();
void resetLocation();
void adjustUp();
void fadeScreenDownHalf();
void outOfOpen();
void dirCom();
void findFirstPath();

View File

@ -382,7 +382,6 @@
void obsThatDoThings();
void makeMainScreen();
void delEverything();
void clearPalette();
void errorMessage1();
void errorMessage2();
void errorMessage3();

View File

@ -184,7 +184,28 @@ void DreamBase::fadeScreenDowns() {
data.byte(kNumtofade) = 64;
}
void DreamGenContext::clearPalette() {
void DreamBase::fadeScreenDownHalf() {
palToStartPal();
palToEndPal();
const uint8 *startPal = startPalette();
uint8 *endPal = endPalette();
for (int i = 0; i < 256 * 3; ++i) {
*endPal >>= 1;
endPal++;
}
memcpy(endPal + (56*3), startPal + (56*3), 3*5);
memcpy(endPal + (77*3), startPal + (77*3), 3*2);
data.byte(kFadedirection) = 1;
data.byte(kFadecount) = 31;
data.byte(kColourpos) = 0;
data.byte(kNumtofade) = 32;
}
void DreamBase::clearPalette() {
data.byte(kFadedirection) = 0;
clearStartPal();
dumpCurrent();