DREAMWEB: 'nextfolder' ported to C++

This commit is contained in:
Bertrand Augereau 2011-11-29 10:27:02 +01:00
parent 17d5b0d28d
commit 55d7272197
6 changed files with 36 additions and 44 deletions

View File

@ -305,6 +305,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'showfolder',
'showleftpage',
'showrightpage',
'nextfolder',
'getlocation',
'setlocation',
], skip_output = [

View File

@ -9740,40 +9740,6 @@ void DreamGenContext::loadmenu() {
loadintotemp2();
}
void DreamGenContext::nextfolder() {
STACK_CHECK;
_cmp(data.byte(kFolderpage), 12);
if (!flags.z())
goto cannextf;
blank();
return;
cannextf:
_cmp(data.byte(kCommandtype), 201);
if (flags.z())
goto alreadynextf;
data.byte(kCommandtype) = 201;
al = 16;
commandonly();
alreadynextf:
ax = data.word(kMousebutton);
_cmp(ax, data.word(kOldbutton));
if (flags.z())
return /* (notnextf) */;
_cmp(ax, 1);
if (flags.z())
goto donextf;
return;
donextf:
_inc(data.byte(kFolderpage));
folderhints();
delpointer();
showfolder();
data.word(kMousebutton) = 0;
bx = offset_folderlist;
checkcoords();
worktoscreenm();
}
void DreamGenContext::folderhints() {
STACK_CHECK;
_cmp(data.byte(kFolderpage), 5);

View File

@ -180,7 +180,6 @@ public:
static const uint16 addr_loadfolder = 0xc7c4;
static const uint16 addr_lastfolder = 0xc7c0;
static const uint16 addr_folderhints = 0xc7bc;
static const uint16 addr_nextfolder = 0xc7b8;
static const uint16 addr_loadmenu = 0xc7b0;
static const uint16 addr_showmenu = 0xc7ac;
static const uint16 addr_dumpmenu = 0xc79c;
@ -1341,7 +1340,7 @@ public:
void calledenslift();
void useclearbox();
void entryanims();
void nextfolder();
//void nextfolder();
void getfreead();
void showarrows();
void walkintoroom();

View File

@ -2423,5 +2423,36 @@ const uint8 *DreamGenContext::getTextInFile1(uint16 index) {
return string;
}
void DreamGenContext::checkFolderCoords() {
RectWithCallback folderlist[] = {
{ 280,320,160,200,&DreamGenContext::quitkey },
{ 143,300,6,194,&DreamGenContext::nextfolder },
{ 0,143,6,194,&DreamGenContext::lastfolder },
{ 0,320,0,200,&DreamGenContext::blank },
{ 0xFFFF,0,0,0,0 }
};
checkcoords(folderlist);
}
void DreamGenContext::nextfolder() {
if (data.byte(kFolderpage) == 12) {
blank();
return;
}
if (data.byte(kCommandtype) != 201) {
data.byte(kCommandtype) = 201;
commandonly(16);
}
if ((data.word(kMousebutton) == 1) && (data.word(kMousebutton) != data.word(kOldbutton))) {
++data.byte(kFolderpage);
folderhints();
delpointer();
showfolder();
data.word(kMousebutton) = 0;
checkFolderCoords();
worktoscreenm();
}
}
} /*namespace dreamgen */

View File

@ -355,9 +355,11 @@
void restoreall();
void restorereels();
void viewfolder();
void checkFolderCoords();
void showfolder();
void showleftpage();
void showrightpage();
void nextfolder();
uint8 getlocation(uint8 index);
void getlocation();
void setlocation(uint8 index);

View File

@ -211,14 +211,7 @@ void DreamGenContext::viewfolder() {
vsync();
dumppointer();
dumptextline();
RectWithCallback folderlist[] = {
{ 280,320,160,200,&DreamGenContext::quitkey },
{ 143,300,6,194,&DreamGenContext::nextfolder },
{ 0,143,6,194,&DreamGenContext::lastfolder },
{ 0,320,0,200,&DreamGenContext::blank },
{ 0xFFFF,0,0,0,0 }
};
checkcoords(folderlist);
checkFolderCoords();
} while (data.byte(kGetback) == 0);
data.byte(kManisoffscreen) = 0;
getridoftemp();