DREAMWEB: 'waitframes' ported to C++

This commit is contained in:
Bertrand Augereau 2011-08-25 08:03:27 +02:00
parent 24afa11b35
commit 50fdbd34b8
5 changed files with 15 additions and 26 deletions

View File

@ -160,6 +160,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'readmouse2',
'readmouse3',
'readmouse4',
'waitframes',
], skip_output = [
# These functions are processed but not output
'dreamweb',

View File

@ -3926,26 +3926,6 @@ realcreditsearly:
data.byte(kLasthardkey) = 0;
}
void DreamGenContext::waitframes() {
STACK_CHECK;
push(di);
push(bx);
push(es);
push(si);
push(ds);
readmouse();
showpointer();
vsync();
dumppointer();
delpointer();
ax = data.word(kMousebutton);
ds = pop();
si = pop();
es = pop();
bx = pop();
di = pop();
}
void DreamGenContext::monprint() {
STACK_CHECK;
data.byte(kKerning) = 1;
@ -18109,7 +18089,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_mode640x480: mode640x480(); break;
case addr_set16colpalette: set16colpalette(); break;
case addr_realcredits: realcredits(); break;
case addr_waitframes: waitframes(); break;
case addr_monprint: monprint(); break;
case addr_fillryan: fillryan(); break;
case addr_fillopen: fillopen(); break;

View File

@ -517,7 +517,6 @@ public:
static const uint16 addr_fillopen = 0xc324;
static const uint16 addr_fillryan = 0xc320;
static const uint16 addr_monprint = 0xc314;
static const uint16 addr_waitframes = 0xc308;
static const uint16 addr_realcredits = 0xc2f8;
static const uint16 addr_set16colpalette = 0xc2f4;
static const uint16 addr_mode640x480 = 0xc2f0;
@ -1917,7 +1916,7 @@ public:
void searchforfiles();
void monkspeaking();
void fadecalculation();
void waitframes();
//void waitframes();
void clearrest();
//void getreelframeax();
void barwoman();

View File

@ -112,10 +112,10 @@ uint8 DreamGenContext::printslow(const uint8 *string, uint16 x, uint16 y, uint8
printboth(charSet, &offset2, y, c1, c2);
data.word(kCharshift) = 0;
for (int i=0; i<2; ++i) {
waitframes();
if (ax == 0)
uint16 mouseState = waitframes();
if (mouseState == 0)
continue;
if (ax != data.word(kOldbutton)) {
if (mouseState != data.word(kOldbutton)) {
return 1;
}
}
@ -220,5 +220,14 @@ void DreamGenContext::kernchars() {
cl = kernchars(al, ah, cl);
}
uint16 DreamGenContext::waitframes() {
readmouse();
showpointer();
vsync();
dumppointer();
delpointer();
return data.word(kMousebutton);
}
} /*namespace dreamgen */

View File

@ -190,4 +190,5 @@
void readmouse2();
void readmouse3();
void readmouse4();
uint16 waitframes();