TEENAGENT: Migrate Dialog Stack Address usages to symbols.

This commit is contained in:
D G Turner 2012-08-05 21:47:38 +01:00
parent 2e848941e5
commit 6c06a837ea
4 changed files with 86 additions and 142 deletions

View File

@ -457,7 +457,7 @@ void TeenAgentEngine::fnGivingFlowerToOldLady() {
}
void TeenAgentEngine::fnGiveAnotherFlowerToOldLady() {
dialog->pop(scene, 0xdaf0, 0, 523, textColorMark, textColorOldLady, 0, 1);
dialog->pop(scene, dsAddr_dialogStackOldLady, 0, 523, textColorMark, textColorOldLady, 0, 1);
}
void TeenAgentEngine::fnGivingFlowerToAnne() {
@ -479,7 +479,7 @@ void TeenAgentEngine::fnGivingFlowerToAnne() {
}
void TeenAgentEngine::fnGiveAnotherFlowerToAnne() {
dialog->pop(scene, 0xdb02, 0, 524, textColorMark, textColorAnne, 0, 2);
dialog->pop(scene, dsAddr_dialogStackAnotherFlowerToAnne, 0, 524, textColorMark, textColorAnne, 0, 2);
}
void TeenAgentEngine::rejectMessage() {
@ -548,7 +548,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
case 0x4056:
// FIXME - This is the bird use callback in the first act at
// the mudpool. Current Code based on behaviour. Need to analyse cseg data.
dialog->popMark(scene, 0xdb7a);
dialog->popMark(scene, dsAddr_dialogStackMudpoolBird);
break;
case 0x4060:
@ -589,7 +589,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
SET_FLAG(dsAddr_gotMugOfMudFlag, 1);
} else {
fnPoleClimbFail();
dialog->popMark(scene, 0xdb72);
dialog->popMark(scene, dsAddr_dialogStackFallIntoMudpool);
}
}
break;
@ -779,7 +779,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
SET_FLAG(dsAddr_JailCableAndBowlState, 3);
scene->getObject(4)->setName("body");
} else {
if (dialog->pop(scene, 0xdb5c, 0, 0, textColorMark, textColorMark, 0, 0) == 0x636b) { // 'im getting hungry'
if (dialog->pop(scene, dsAddr_dialogStackJailDoorGrates, 0, 0, textColorMark, textColorMark, 0, 0) == 0x636b) { // 'im getting hungry'
wait(100);
playSound(52, 8);
playSound(52, 13);
@ -977,7 +977,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
SET_FLAG(dsAddr_gotPasswordNeedSpeakBarmanFlag, 0);
}
} else {
dialog->pop(scene, 0xdb68, 0, 857, textColorMark, textColorBarman, 0, 1);
dialog->pop(scene, dsAddr_dialogStackBarman, 0, 857, textColorMark, textColorBarman, 0, 1);
}
}
break;
@ -1043,7 +1043,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
break;
case 0x483a:
dialog->popMark(scene, 0xdb82);
dialog->popMark(scene, dsAddr_dialogStackInterrogateCaptain);
break;
case 0x4844:
@ -1068,7 +1068,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
} else if (CHECK_FLAG(dsAddr_birdOnBarRadioAntennaFlag, 1)) {
displayMessage(dsAddr_barmanTooCloseMsg); // "The barman is too close"
} else {
dialog->pop(scene, 0xdb8a, 0, 857, textColorMark, textColorBarman, 0, 1);
dialog->pop(scene, dsAddr_dialogStackBarCellarDoor, 0, 857, textColorMark, textColorBarman, 0, 1);
}
break;
@ -1132,9 +1132,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
case 0x4c70:
if (CHECK_FLAG(dsAddr_act1GuardState, 0)) {
if (CHECK_FLAG(dsAddr_ShownPassToGuardFlag, 1)) { // papers are shown
dialog->pop(scene, 0xdb4c, 0, 809, textColorMark, textColorCampGuard, 0, 1);
dialog->pop(scene, dsAddr_dialogStackCampGuardReadingNews, 0, 809, textColorMark, textColorCampGuard, 0, 1);
} else {
dialog->pop(scene, 0xdb40, 0, 809, textColorMark, textColorCampGuard, 0, 1);
dialog->pop(scene, dsAddr_dialogStackCampGuardWantsDocuments, 0, 809, textColorMark, textColorCampGuard, 0, 1);
}
} else {
displayMessage(dsAddr_helloQMsg); // "Hello?"
@ -1158,13 +1158,13 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
} else {
dialog->show(144, scene, 0, 809, textColorMark, textColorCampGuard, 0, 1);
moveTo(269, 175, 4);
dialog->pop(scene, 0xdb56, 0, 809, textColorMark, textColorCampGuard, 0, 1);
dialog->pop(scene, dsAddr_dialogStackCampGuardShowPass, 0, 809, textColorMark, textColorCampGuard, 0, 1);
}
break;
case 0x4cf1: // talking with mansion guard
SET_FLAG(dsAddr_spokenWithMansionGuardFlag, 1);
if (dialog->pop(scene, 0xdaa6, 0, 529, textColorMark, textColorMansionGuard, 0, 1) == 0x1b4) {
if (dialog->pop(scene, dsAddr_dialogStackPleadingToMansionGuard, 0, 529, textColorMark, textColorMansionGuard, 0, 1) == 0x01b4) { // 2nd try
Common::Point p = scene->getPosition();
moveTo(189, 159, 0);
//waitLanAnimationFrame(1, 1);
@ -1177,7 +1177,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
moveTo(p, 2);
inventory->add(invItemChocCandy);
dialog->pop(scene, 0xdaa6, 0, 529, textColorMark, textColorMansionGuard, 0, 1);
dialog->pop(scene, dsAddr_dialogStackPleadingToMansionGuard, 0, 529, textColorMark, textColorMansionGuard, 0, 1);
}
break;
@ -1434,8 +1434,8 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
case 0x55a8:
{
uint16 d = dialog->popMark(scene, 0xdb08);
if (d == 0x2c5d) {
uint16 d = dialog->popMark(scene, dsAddr_dialogStackSquirrel);
if (d == 0x2c5d) { // 4th try - Throw Nut
waitLanAnimationFrame(1, 0x23);
setOns(0, 0);
playSound(52, 9);
@ -1447,7 +1447,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
displayMessage(dsAddr_ThanksMsg); // "Thanks."
disableObject(5);
SET_FLAG(dsAddr_squirrelNutState, 1);
} else if (d != 0x2c9b) {
} else if (d != 0x2c9b) { // 5th (last) try
waitLanAnimationFrame(1, 0x23);
playSound(52, 9);
playSound(52, 11);
@ -1653,8 +1653,8 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
playAnimation(605, 0);
dialog->show(47, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
} else {
uint16 d = dialog->pop(scene, 0xdada, 0, 523, textColorMark, textColorOldLady, 0, 1);
if (d == 0x1913) {
uint16 d = dialog->pop(scene, dsAddr_dialogStackAskOldLadyOK, 0, 523, textColorMark, textColorOldLady, 0, 1);
if (d == 0x1913) { // 3rd time
wait(100);
moveRel(0, 0, 3);
wait(50);
@ -1686,7 +1686,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
case 0x5ff3: // get duster
if (CHECK_FLAG(dsAddr_givenFlowerToOldLadyAlreadyFlag, 0)) {
dialog->pop(scene, 0xdaf6, 0, 523, textColorMark, textColorOldLady, 0, 1);
dialog->pop(scene, dsAddr_dialogStackBorrowDusterFromOldLady, 0, 523, textColorMark, textColorOldLady, 0, 1);
} else {
dialog->show(43, scene, 0, 523, textColorMark, textColorOldLady, 0, 1);
wait(50);
@ -2421,7 +2421,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
break;
case 0x58a2:
dialog->pop(scene, 0xdaba, 0, 502, textColorMark, textColorSonny, 0, 1);
dialog->pop(scene, dsAddr_dialogStackSonny, 0, 502, textColorMark, textColorSonny, 0, 1);
scene->getObject(13)->setName((const char *)res->dseg.ptr(dsAddr_scnObjNameSonny));
break;
@ -2488,7 +2488,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
break;
case 0x5b3a: // Click on dog
dialog->popMark(scene, 0xdb14);
dialog->popMark(scene, dsAddr_dialogStackDog);
break;
case 0x5b59: // picking up the rope
@ -2510,7 +2510,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
break;
case 0x5be1: // Talk to grandpa
dialog->pop(scene, 0xdac4, 0, 522, textColorMark, textColorGrandpa, 0, 1);
dialog->pop(scene, dsAddr_dialogStackGrandpa, 0, 522, textColorMark, textColorGrandpa, 0, 1);
break;
case 0x5bee:
@ -2544,7 +2544,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
setOns(0, 0);
playActorAnimation(520);
} else {
dialog->pop(scene, 0xdace, 0, 522, textColorMark, textColorGrandpa, 0, 1);
dialog->pop(scene, dsAddr_dialogStackGrandpaShotgun, 0, 522, textColorMark, textColorGrandpa, 0, 1);
}
break;
@ -2562,7 +2562,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
disableObject(13);
inventory->add(invItemFan);
} else {
dialog->pop(scene, 0xdad4, 0, 522, textColorMark, textColorGrandpa, 0, 1);
dialog->pop(scene, dsAddr_dialogStackGrandpaFan, 0, 522, textColorMark, textColorGrandpa, 0, 1);
}
break;
@ -2608,7 +2608,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
if (CHECK_FLAG(dsAddr_nutSwappedForAppleFlag, 1)) {
displayMessage(dsAddr_noFruitMsg); // "There are no more interesting fruits here"
} else {
dialog->pop(scene, 0xdafc, 0, 523, textColorMark, textColorOldLady, 0, 1);
dialog->pop(scene, dsAddr_dialogStackGetAppleOldLady, 0, 523, textColorMark, textColorOldLady, 0, 1);
}
break;
@ -2657,7 +2657,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
case 0x61e9:
if (CHECK_FLAG(dsAddr_lightOnFlag, 1))
dialog->popMark(scene, 0xdb1e);
dialog->popMark(scene, dsAddr_dialogStackTakeAxe);
else
fnTooDark();
break;
@ -2843,7 +2843,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
break;
case 0x70bb:
dialog->pop(scene, 0xdb24, 0, 709, textColorMark, textColorCook, 0, 1);
dialog->pop(scene, dsAddr_dialogStackBusyCook, 0, 709, textColorMark, textColorCook, 0, 1);
break;
case 0x71ae:
@ -3104,7 +3104,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
break;
case 0x783d:
dialog->pop(scene, 0xdb36, 0, 797, textColorMark, textColorJohnNoty, 0, 1);
dialog->pop(scene, dsAddr_dialogStackJohnNotyEndgame, 0, 797, textColorMark, textColorJohnNoty, 0, 1);
break;
case 0x7966:
@ -3589,6 +3589,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
inventory->remove(invItemWrappedCandy);
playSound(5, 6);
dialog->show(60, scene, 0, 524, textColorMark, textColorAnne, 0, 2);
// FIXME - Dialog #61 not explicitly called. Does Dialog #60 run on somehow?
playActorAnimation(555, true);
playAnimation(556, 1, true);
waitAnimation();
@ -4094,7 +4095,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
case 0x6c83:
waitLanAnimationFrame(1, 1);
dialog->pop(scene, 0xdb2e, 0, 727, textColorMark, textColorMike, 0, 1);
dialog->pop(scene, dsAddr_dialogStackRobotSafe, 0, 727, textColorMark, textColorMike, 0, 1);
scene->getObject(1)->setName((const char *)res->dseg.ptr(dsAddr_scnObjNameMike));
SET_FLAG(dsAddr_MansionRobotSafeUnlockedFlag, 1);
break;

View File

@ -32,6 +32,8 @@ void Dialog::show(uint16 dialogNum, Scene *scene, uint16 animation1, uint16 anim
// starting offset used is two bytes early, thus implicitly changing the first command of this dialog
// from NEW_LINE to CHANGE_CHARACTER.
// FIXME: Unsure if this is correct behaviour or if this is a regression from the original. Check this.
// Similar issue occurs with Dialog 190 which is used from dialogue stack at 0x7403, rather than start of 0x7405
// Similar issue occurs with Dialog 0 which is used from dialogue stack at 0x0001, rather than start of 0x0000
if (dialogNum == 163)
addr -= 2;
show(scene, addr, animation1, animation2, color1, color2, slot1, slot2);

View File

@ -1,112 +0,0 @@
// Dialogs Not Directly Used...
// Probably used via dseg dialog lookup i.e. pop
// Dialog #0: Offset 0x0000
// Dialog #1: Offset 0x01b4
// Dialog #2: Offset 0x046f
// Dialog #3: Offset 0x07cb
// Dialog #4: Offset 0x0901
// Dialog #6: Offset 0x0936
// Dialog #7: Offset 0x0a02
// Dialog #8: Offset 0x0a2d
// Dialog #13: Offset 0x0c43
// Dialog #14: Offset 0x0d75
// Dialog #15: Offset 0x0f0e
// Dialog #16: Offset 0x0fb8
// Dialog #18: Offset 0x10db
// Dialog #19: Offset 0x11ac
// Dialog #20: Offset 0x12d9
// Dialog #21: Offset 0x1468
// Dialog #22: Offset 0x1485
// Dialog #23: Offset 0x1528
// Dialog #25: Offset 0x16de
// Dialog #26: Offset 0x1726
// Dialog #27: Offset 0x1752
// Dialog #28: Offset 0x178c
// Dialog #29: Offset 0x1913
// Dialog #30: Offset 0x1a3e
// Dialog #31: Offset 0x1a63
// Dialog #32: Offset 0x1a84
// Dialog #33: Offset 0x1ac9
// Dialog #34: Offset 0x1af7
// Dialog #35: Offset 0x1b27
// Dialog #36: Offset 0x1b4a
// Dialog #39: Offset 0x1c97
// Dialog #40: Offset 0x1cec
// Dialog #41: Offset 0x1d2c
// Dialog #42: Offset 0x1dd8
// Dialog #48: Offset 0x2041
// Dialog #49: Offset 0x215f
// Dialog #58: Offset 0x2582
// Dialog #59: Offset 0x25fe
// Dialog #61: Offset 0x280a
// Dialog #65: Offset 0x2b6f
// Dialog #66: Offset 0x2bb2
// Dialog #67: Offset 0x2bdd
// Dialog #68: Offset 0x2c5d
// Dialog #69: Offset 0x2c9b
// Dialog #78: Offset 0x3102
// Dialog #79: Offset 0x311b
// Dialog #80: Offset 0x3137
// Dialog #81: Offset 0x316f
// Dialog #82: Offset 0x317d
// Dialog #83: Offset 0x3215
// Dialog #101: Offset 0x3e41
// Dialog #102: Offset 0x3ea3
// Dialog #103: Offset 0x3f08
// Dialog #104: Offset 0x3fea
// Dialog #105: Offset 0x400d
// Dialog #106: Offset 0x4439
// Dialog #107: Offset 0x446a
// Dialog #131: Offset 0x58e2
// Dialog #132: Offset 0x59c5
// Dialog #133: Offset 0x5a9d
// Dialog #134: Offset 0x5ad7
// Dialog #135: Offset 0x5af3
// Dialog #136: Offset 0x5ba9
// Dialog #137: Offset 0x5c53
// Dialog #138: Offset 0x5c99
// Dialog #139: Offset 0x5d3e
// Dialog #140: Offset 0x5d5b
// Dialog #141: Offset 0x5f0a
// Dialog #142: Offset 0x5fae
// Dialog #143: Offset 0x5fcf
// Dialog #145: Offset 0x5ffe
// Dialog #146: Offset 0x6088
// Dialog #151: Offset 0x62f0
// Dialog #152: Offset 0x6318
// Dialog #153: Offset 0x6347
// Dialog #154: Offset 0x636b
// Dialog #155: Offset 0x6382
// Dialog #158: Offset 0x64fc
// Dialog #159: Offset 0x654c
// Dialog #160: Offset 0x65ab
// Dialog #169: Offset 0x6bf7
// Dialog #170: Offset 0x6d7f
// Dialog #171: Offset 0x6e7b
// Dialog #172: Offset 0x6ea4
// Dialog #173: Offset 0x6ec0
// Dialog #174: Offset 0x6ee9
// Dialog #175: Offset 0x6f03
// Dialog #187: Offset 0x735e
// Dialog #188: Offset 0x73b3
// Dialog #189: Offset 0x73e8
// Dialog #190: Offset 0x7405
// Dialog #191: Offset 0x7459

View File

@ -877,9 +877,62 @@ const uint16 dsAddr_spokenWithMansionGuardFlag = 0xda96; // 1 byte
// doesn't now appear to be read.
const uint16 dsAddr_haveNotSpokenWithMansionGuardFlag = 0xda97; // 1 byte
// Dialog Stack - Pleading with Mansion Guard : 0xdaa6 to 0xdab1
const uint16 dsAddr_dialogStackPleadingToMansionGuard = 0xdaa6;
// Dialog Stack - Mansion Guard Drinking : 0xdab2 to 0xdab9
// FIXME - Can't find where this is used...
const uint16 dsAddr_dialogStackMansionGuardDrinking = 0xdab2;
// Dialog Stack - Talking To Sonny : 0xdaba to 0xdac3
const uint16 dsAddr_dialogStackSonny = 0xdaba;
// Dialog Stack - Talking To Grandpa : 0xdac4 to 0xdacd
const uint16 dsAddr_dialogStackGrandpa = 0xdac4;
// Cave Thorns Cut Down Flag : 0xdaca
// FIXME - Cave Thorns Flag overlap with dsAddr_dialogStackGrandpa. Bug or typo?
const uint16 dsAddr_caveThornsCutDownFlag = 0xdaca; // 1 byte
// Dialog Stack - Trying To Borrow Shotgun From Grandpa : 0xdace to 0xdad3
const uint16 dsAddr_dialogStackGrandpaShotgun = 0xdace;
// Dialog Stack - Trying To Borrow Fan From Grandpa : 0xdad4 to 0xdad9
const uint16 dsAddr_dialogStackGrandpaFan = 0xdad4;
// Dialog Stack - Ask Old Lady if OK : 0xdada to 0xdaef
const uint16 dsAddr_dialogStackAskOldLadyOK = 0xdada;
// Dialog Stack - Talking To Old Lady : 0xdaf0 to 0xdaf5
const uint16 dsAddr_dialogStackOldLady = 0xdaf0;
// Dialog Stack - Borrow Duster From Old Lady : 0xdaf6 to 0xdafb
const uint16 dsAddr_dialogStackBorrowDusterFromOldLady = 0xdaf6;
// Dialog Stack - Get Old Lady's Apple : 0xdafc to 0xdb01
const uint16 dsAddr_dialogStackGetAppleOldLady = 0xdafc;
// Dialog Stack - Giving Another Flower To Anne : 0xdb02 to 0xdb07
const uint16 dsAddr_dialogStackAnotherFlowerToAnne = 0xdb02;
// Dialog Stack - Talking To Squirrel : 0xdb08 to 0xdb13
const uint16 dsAddr_dialogStackSquirrel = 0xdb08;
// Dialog Stack - Talking To Dog : 0xdb14 to 0xdb1d
const uint16 dsAddr_dialogStackDog = 0xdb14;
// Dialog Stack - Take Axe : 0xdb1e to 0xdb23
const uint16 dsAddr_dialogStackTakeAxe = 0xdb1e;
// Dialog Stack - Talking To Busy Cook : 0xdb24 to 0xdb2d
const uint16 dsAddr_dialogStackBusyCook = 0xdb24;
// Dialog Stack - Talking To Mike the Robot Safe : 0xdb2e to 0xdb35
const uint16 dsAddr_dialogStackRobotSafe = 0xdb2e;
// Dialog Stack - Talking To John Noty At Endgame : 0xdb36 to 0xdb3f
const uint16 dsAddr_dialogStackJohnNotyEndgame = 0xdb36;
// Dialog Stack - Camp Guard Waiting For Documents : 0xdb40 to 0xdb4b
const uint16 dsAddr_dialogStackCampGuardWantsDocuments = 0xdb40;
// Dialog Stack - Camp Guard Reading Soldier News : 0xdb4c to 0xdb55
const uint16 dsAddr_dialogStackCampGuardReadingNews = 0xdb4c;
// Dialog Stack - Camp Guard Show Pass : 0xdb56 to 0xdb5b
const uint16 dsAddr_dialogStackCampGuardShowPass = 0xdb56;
// Dialog Stack - Jail Door Grates : 0xdb5c to 0xdb67
const uint16 dsAddr_dialogStackJailDoorGrates = 0xdb5c;
// Dialog Stack - Talking to Barman : 0xdb68 to 0xdb71
const uint16 dsAddr_dialogStackBarman = 0xdb68;
// Dialog Stack - Fall Into Mudpool : 0xdb72 to 0xdb79
const uint16 dsAddr_dialogStackFallIntoMudpool = 0xdb72;
// Dialog Stack - Talking To Mudpool Bird : 0xdb7a to 0xdb81
const uint16 dsAddr_dialogStackMudpoolBird = 0xdb7a;
// Dialog Stack - Interrogate Captain : 0xdb82 to 0xdb89
const uint16 dsAddr_dialogStackInterrogateCaptain = 0xdb82;
// Dialog Stack - Bar Cellar Door : 0xdb8a to 0xdb8f
const uint16 dsAddr_dialogStackBarCellarDoor = 0xdb8a;
// Current Music Id Playing : 0xdb90
const uint16 dsAddr_currentMusic = 0xdb90; // 1 byte
// Unused Byte : 0xdb91