DREAMWEB: Port 'showslots' to C++

This commit is contained in:
Filippos Karapetis 2011-12-16 22:47:33 +02:00
parent 984010faae
commit 2887686d56
5 changed files with 16 additions and 36 deletions

View File

@ -765,6 +765,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'showryanpage',
'showsaveops',
'showseconduse',
'showslots',
'showsymbol',
'showtime',
'showwatch',

View File

@ -3004,39 +3004,6 @@ gotkeyp:
showDiaryPage();
}
void DreamGenContext::showSlots() {
STACK_CHECK;
di = (60)+7;
bx = (52)+8;
al = 2;
ds = data.word(kTempgraphics);
ah = 0;
showFrame();
di = (60)+10;
bx = (52)+11;
cl = 0;
slotloop:
push(cx);
push(di);
push(bx);
_cmp(cl, data.byte(kCurrentslot));
if (!flags.z())
goto nomatchslot;
al = 3;
ds = data.word(kTempgraphics);
ah = 0;
showFrame();
nomatchslot:
bx = pop();
di = pop();
cx = pop();
_add(bx, 10);
_inc(cl);
_cmp(cl, 7);
if (!flags.z())
goto slotloop;
}
void DreamGenContext::clearBuffers() {
STACK_CHECK;
es = data.word(kBuffers);

View File

@ -479,7 +479,7 @@ public:
void clearBuffers();
void getObTextStart();
void checkObjectSize();
void showSlots();
void fillOpen();
void useCashCard();
void moneyPoke();
void doSomeTalk();
@ -518,7 +518,6 @@ public:
void rollEm();
void lookAtPlace();
void findAllOpen();
void fillOpen();
void deleteExObject();
void getEitherAd();
void setPickup();

View File

@ -3927,7 +3927,6 @@ void DreamGenContext::talk() {
}
}
void DreamGenContext::discOps() {
if (data.byte(kCommandtype) != 249) {
data.byte(kCommandtype) = 249;
@ -4564,4 +4563,17 @@ void DreamGenContext::lookAtCard() {
putBackObStuff();
}
void DreamGenContext::showSlots() {
showFrame(tempGraphics(), kOpsx + 7, kOpsy + 8, 2, 0);
uint16 y = kOpsy + 11;
for (int slot = 0; slot < 7; slot++) {
if (slot == data.byte(kCurrentslot))
showFrame(tempGraphics(), kOpsx + 10, y, 3, 0);
y += 10;
}
}
} // End of namespace DreamGen

View File

@ -393,5 +393,6 @@
void notHeldError();
void useGun();
void identifyOb();
void showSlots();
#endif