diff options
author | D G Turner | 2012-07-23 04:04:42 +0100 |
---|---|---|
committer | D G Turner | 2012-07-23 04:04:42 +0100 |
commit | 88a1989a79be31f862dee3b0278687ae674e1fae (patch) | |
tree | e0262a33d909ae497a6a75aa53000c918ebf9a88 | |
parent | af7fca1a7e532fec53edd6027c8ae94206915ad6 (diff) | |
download | scummvm-rg350-88a1989a79be31f862dee3b0278687ae674e1fae.tar.gz scummvm-rg350-88a1989a79be31f862dee3b0278687ae674e1fae.tar.bz2 scummvm-rg350-88a1989a79be31f862dee3b0278687ae674e1fae.zip |
TEENAGENT: Replace reject message table lookup with explicit values.
Also, this adds explicit offset indexes for indexed message tables
contents.
-rw-r--r-- | engines/teenagent/callbacks.cpp | 22 | ||||
-rw-r--r-- | engines/teenagent/resources.h | 28 |
2 files changed, 44 insertions, 6 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index 78681fbcaa..1a9697cf72 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -184,10 +184,24 @@ void TeenAgentEngine::fnPutRockInHole() { } void TeenAgentEngine::rejectMessage() { - //random reject message: uint i = _rnd.getRandomNumber(3); - debugC(0, kDebugCallbacks, "reject message: %s", (const char *)res->dseg.ptr(res->dseg.get_word(dsAddr_rejectMsg + 2 * i))); - displayMessage(res->dseg.get_word(dsAddr_rejectMsg + 2 * i)); + switch (i) { + case 0: + displayMessage(dsAddr_rejectMsg0); // "I have no idea what to do with it" + break; + case 1: + displayMessage(dsAddr_rejectMsg1); // "I can't imagine what I could do with this" + break; + case 2: + displayMessage(dsAddr_rejectMsg2); // "I can't figure out what I should do with this" + break; + case 3: + displayMessage(dsAddr_rejectMsg3); // "I can't find any reason to mess with it" + break; + default: + error("rejectMessage() index out of range"); + break; + } } bool TeenAgentEngine::processCallback(uint16 addr) { @@ -3461,7 +3475,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { case 0x79eb: // color of the book // FIXME - Replace with internal lookup and switch - displayMessage(res->dseg.get_word(0x5f3c + GET_FLAG(0xdbc1) * 2 - 2)); + displayMessage(res->dseg.get_word(dsAddr_bookColorMsgPtr + GET_FLAG(0xdbc1) * 2 - 2)); break; case 0x79fd: diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h index eec6b2b373..69b3634f0b 100644 --- a/engines/teenagent/resources.h +++ b/engines/teenagent/resources.h @@ -48,8 +48,17 @@ const uint16 csAddr_rejectMsg = 0xa4d6; // Data Segment Addresses // Cursor Graphic 8*12px : 0x00da to 0x0139 (Read Only) const uint16 dsAddr_cursor = 0x00da; -// Reject Messages Address Pointers : (4 * 2-byte) = 0x339e to 0x33a5 -const uint16 dsAddr_rejectMsg = 0x339e; + +// Reject Message Address Pointers : (4 * 2-byte) = 0x339e to 0x33a5 +const uint16 dsAddr_rejectMsgPtr = 0x339e; +// Reject Message #0 : 0x33a6 to 0x33c9 +const uint16 dsAddr_rejectMsg0 = 0x33a6; // "I have no idea what to do with it" +// Reject Message #1 : 0x33ca to 0x33f5 +const uint16 dsAddr_rejectMsg1 = 0x33ca; // "I can't imagine what I could do with this" +// Reject Message #2 : 0x33f6 to 0x3425 +const uint16 dsAddr_rejectMsg2 = 0x33f6; // "I can't figure out what I should do with this" +// Reject Message #3 : 0x3426 to 0x344f +const uint16 dsAddr_rejectMsg3 = 0x3426; // "I can't find any reason to mess with it" // Object Usage Error Message : 0x3457 to 0x3467 const uint16 dsAddr_objErrorMsg = 0x3457; // "That's no good" @@ -549,6 +558,21 @@ const uint16 dsAddr_captainWatchingMsg = 0x5de2; // "with captain watching? Bett // First Business Message : 0x5e25 to 0x5e53 const uint16 dsAddr_firstBusinessMsg = 0x5e25; // "First I've got some business to take care of" +// Book Color Message Address Pointers : (6 * 2-byte) = 0x5f3c to 0x5f47 +const uint16 dsAddr_bookColorMsgPtr = 0x5f3c; +// Book Color Message #0 : 0x5f48 to 0x5f60 +const uint16 dsAddr_bookColorMsg0 = 0x5f48; // ""The history of blues"" +// Book Color Message #1 : 0x5f61 to 0x5f8f +const uint16 dsAddr_bookColorMsg1 = 0x5f61; // ""Manchester United, or the Red Devils story"" +// Book Color Message #2 : 0x5f90 to 0x5fb5 +const uint16 dsAddr_bookColorMsg2 = 0x5f90; // ""Greyhounds and other hunting dogs"" +// Book Color Message #3 : 0x5fb6 to 0x5fe6 +const uint16 dsAddr_bookColorMsg3 = 0x5fb6; // ""Greenhorn, or my adventures in the Wild West"" +// Book Color Message #4 : 0x5fe7 to 0x6008 +const uint16 dsAddr_bookColorMsg4 = 0x5fe7; // ""Charlie Brown and his company"" +// Book Color Message #5 : 0x6009 to 0x6034 +const uint16 dsAddr_bookColorMsg5 = 0x6009; // ""Pink Panther: an unauthorised biography"" + // Save State Region : 0x6478 to 0xdbf1 const uint16 dsAddr_saveState = 0x6478; const uint16 saveStateSize = 0x777a; |