mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 08:55:45 +00:00
DREAMWEB: Ported 'sparky' to C++
This commit is contained in:
parent
ba12c02a75
commit
24c355e04f
@ -340,6 +340,7 @@ generator = cpp(context, "DreamGen", blacklist = [
|
|||||||
'barwoman',
|
'barwoman',
|
||||||
'gamer',
|
'gamer',
|
||||||
'eden',
|
'eden',
|
||||||
|
'sparky',
|
||||||
], skip_output = [
|
], skip_output = [
|
||||||
# These functions are processed but not output
|
# These functions are processed but not output
|
||||||
'dreamweb',
|
'dreamweb',
|
||||||
|
@ -1742,44 +1742,6 @@ nocopper:
|
|||||||
addtopeoplelist();
|
addtopeoplelist();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DreamGenContext::sparky() {
|
|
||||||
STACK_CHECK;
|
|
||||||
_cmp(data.word(kCard1money), 0);
|
|
||||||
if (flags.z())
|
|
||||||
goto animsparky;
|
|
||||||
es.byte(bx+7) = 3;
|
|
||||||
goto animsparky;
|
|
||||||
animsparky:
|
|
||||||
checkspeed();
|
|
||||||
if (!flags.z())
|
|
||||||
goto finishsparky;
|
|
||||||
_cmp(es.word(bx+3), 34);
|
|
||||||
if (!flags.z())
|
|
||||||
goto notsparky1;
|
|
||||||
randomnumber();
|
|
||||||
_cmp(al, 30);
|
|
||||||
if (flags.c())
|
|
||||||
goto dosparky;
|
|
||||||
es.word(bx+3) = 27;
|
|
||||||
goto finishsparky;
|
|
||||||
notsparky1:
|
|
||||||
_cmp(es.word(bx+3), 48);
|
|
||||||
if (!flags.z())
|
|
||||||
goto dosparky;
|
|
||||||
es.word(bx+3) = 27;
|
|
||||||
goto finishsparky;
|
|
||||||
dosparky:
|
|
||||||
_inc(es.word(bx+3));
|
|
||||||
finishsparky:
|
|
||||||
showgamereel();
|
|
||||||
addtopeoplelist();
|
|
||||||
al = es.byte(bx+7);
|
|
||||||
_and(al, 128);
|
|
||||||
if (flags.z())
|
|
||||||
return /* (nottalkedsparky) */;
|
|
||||||
data.byte(kTalkedtosparky) = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DreamGenContext::train() {
|
void DreamGenContext::train() {
|
||||||
STACK_CHECK;
|
STACK_CHECK;
|
||||||
return;
|
return;
|
||||||
|
@ -429,7 +429,6 @@ public:
|
|||||||
static const uint16 addr_checkforexit = 0xc148;
|
static const uint16 addr_checkforexit = 0xc148;
|
||||||
static const uint16 addr_mainman = 0xc138;
|
static const uint16 addr_mainman = 0xc138;
|
||||||
static const uint16 addr_train = 0xc104;
|
static const uint16 addr_train = 0xc104;
|
||||||
static const uint16 addr_sparky = 0xc100;
|
|
||||||
static const uint16 addr_copper = 0xc0fc;
|
static const uint16 addr_copper = 0xc0fc;
|
||||||
static const uint16 addr_advisor = 0xc0f8;
|
static const uint16 addr_advisor = 0xc0f8;
|
||||||
static const uint16 addr_drunk = 0xc0f4;
|
static const uint16 addr_drunk = 0xc0f4;
|
||||||
@ -1309,7 +1308,6 @@ public:
|
|||||||
void showmonk();
|
void showmonk();
|
||||||
void diarykeyn();
|
void diarykeyn();
|
||||||
void set16colpalette();
|
void set16colpalette();
|
||||||
void sparky();
|
|
||||||
void interviewer();
|
void interviewer();
|
||||||
void purgeanitem();
|
void purgeanitem();
|
||||||
void madman();
|
void madman();
|
||||||
|
@ -570,7 +570,7 @@ void DreamGenContext::showrain() {
|
|||||||
static void (DreamGenContext::*reelCallbacks[57])() = {
|
static void (DreamGenContext::*reelCallbacks[57])() = {
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
NULL, &DreamGenContext::edeninbath,
|
NULL, &DreamGenContext::edeninbath,
|
||||||
&DreamGenContext::sparky, &DreamGenContext::smokebloke,
|
NULL, &DreamGenContext::smokebloke,
|
||||||
&DreamGenContext::manasleep, &DreamGenContext::drunk,
|
&DreamGenContext::manasleep, &DreamGenContext::drunk,
|
||||||
&DreamGenContext::receptionist, &DreamGenContext::malefan,
|
&DreamGenContext::receptionist, &DreamGenContext::malefan,
|
||||||
&DreamGenContext::femalefan, &DreamGenContext::louis,
|
&DreamGenContext::femalefan, &DreamGenContext::louis,
|
||||||
@ -602,7 +602,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
|
|||||||
static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
|
static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
|
||||||
&DreamGenContext::gamer, &DreamGenContext::sparkydrip,
|
&DreamGenContext::gamer, &DreamGenContext::sparkydrip,
|
||||||
&DreamGenContext::eden, /*&DreamGenContext::edeninbath*/NULL,
|
&DreamGenContext::eden, /*&DreamGenContext::edeninbath*/NULL,
|
||||||
/*&DreamGenContext::sparky*/NULL, /*&DreamGenContext::smokebloke*/NULL,
|
&DreamGenContext::sparky, /*&DreamGenContext::smokebloke*/NULL,
|
||||||
/*&DreamGenContext::manasleep*/NULL, /*&DreamGenContext::drunk*/NULL,
|
/*&DreamGenContext::manasleep*/NULL, /*&DreamGenContext::drunk*/NULL,
|
||||||
/*&DreamGenContext::receptionist*/NULL, /*&DreamGenContext::malefan*/NULL,
|
/*&DreamGenContext::receptionist*/NULL, /*&DreamGenContext::malefan*/NULL,
|
||||||
/*&DreamGenContext::femalefan*/NULL, /*&DreamGenContext::louis*/NULL,
|
/*&DreamGenContext::femalefan*/NULL, /*&DreamGenContext::louis*/NULL,
|
||||||
@ -1107,5 +1107,27 @@ void DreamGenContext::eden(ReelRoutine &routine) {
|
|||||||
addtopeoplelist(&routine);
|
addtopeoplelist(&routine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DreamGenContext::sparky(ReelRoutine &routine) {
|
||||||
|
if (data.word(kCard1money))
|
||||||
|
routine.b7 = 3;
|
||||||
|
if (checkspeed(&routine)) {
|
||||||
|
if (routine.reelPointer() != 34) {
|
||||||
|
if (engine->randomNumber() < 30)
|
||||||
|
routine.incReelPointer();
|
||||||
|
else
|
||||||
|
routine.setReelPointer(27);
|
||||||
|
} else {
|
||||||
|
if (routine.reelPointer() != 48)
|
||||||
|
routine.incReelPointer();
|
||||||
|
else
|
||||||
|
routine.setReelPointer(27);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
showgamereel(&routine);
|
||||||
|
addtopeoplelist(&routine);
|
||||||
|
if (routine.b7 & 128)
|
||||||
|
data.byte(kTalkedtosparky) = 1;
|
||||||
|
}
|
||||||
|
|
||||||
} /*namespace dreamgen */
|
} /*namespace dreamgen */
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@ struct ReelRoutine {
|
|||||||
uint8 b4;
|
uint8 b4;
|
||||||
uint16 reelPointer() const { return READ_LE_UINT16(&b3); }
|
uint16 reelPointer() const { return READ_LE_UINT16(&b3); }
|
||||||
void setReelPointer(uint16 v) { WRITE_LE_UINT16(&b3, v); }
|
void setReelPointer(uint16 v) { WRITE_LE_UINT16(&b3, v); }
|
||||||
|
void incReelPointer() { setReelPointer(reelPointer() + 1); }
|
||||||
uint8 period;
|
uint8 period;
|
||||||
uint8 counter;
|
uint8 counter;
|
||||||
uint8 b7;
|
uint8 b7;
|
||||||
|
@ -381,4 +381,5 @@
|
|||||||
void othersmoker(ReelRoutine &routine);
|
void othersmoker(ReelRoutine &routine);
|
||||||
void gamer(ReelRoutine &routine);
|
void gamer(ReelRoutine &routine);
|
||||||
void eden(ReelRoutine &routine);
|
void eden(ReelRoutine &routine);
|
||||||
|
void sparky(ReelRoutine &routine);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user