diff options
author | D G Turner | 2012-07-11 19:28:36 +0100 |
---|---|---|
committer | D G Turner | 2012-07-11 19:28:36 +0100 |
commit | 53a7e522eafe0a39abca00ba82033c80c973bbe6 (patch) | |
tree | 83d9e8a97ca1b05d8011bdf5e9e3671f6b65e337 /engines/teenagent | |
parent | 923c05faf5de95b3b80b1cbc4f9b6675f61bc9aa (diff) | |
download | scummvm-rg350-53a7e522eafe0a39abca00ba82033c80c973bbe6.tar.gz scummvm-rg350-53a7e522eafe0a39abca00ba82033c80c973bbe6.tar.bz2 scummvm-rg350-53a7e522eafe0a39abca00ba82033c80c973bbe6.zip |
TEENAGENT: Start replacing hardcoded addresses with symbols.
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/callbacks.cpp | 12 | ||||
-rw-r--r-- | engines/teenagent/resources.h | 12 |
2 files changed, 17 insertions, 7 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index b8007509a4..fa4a4719b6 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -37,11 +37,10 @@ namespace TeenAgent { 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(0x339e + 2 * i))); - displayMessage(res->dseg.get_word(0x339e + 2 * i)); + 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)); } - bool TeenAgentEngine::processCallback(uint16 addr) { if (addr == 0) return false; @@ -56,8 +55,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { uint16 func = 6 + addr + READ_LE_UINT16(code + 4); debugC(0, kDebugCallbacks, "call %04x", func); debugC(0, kDebugCallbacks, "trivial callback, showing message %s", (const char *)res->dseg.ptr(addr)); - switch (func) { - case 0xa055: + if (func == csAddr_displayMsg) { displayMessage(msg); return true; } @@ -66,7 +64,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { if (code[0] == 0xe8 && code[3] == 0xc3) { uint func = 3 + addr + READ_LE_UINT16(code + 1); debugC(0, kDebugCallbacks, "call %04x and return", func); - if (func == 0xa4d6) { + if (func == csAddr_rejectMsg) { rejectMessage(); return true; } @@ -84,7 +82,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { switch (addr) { - case 0x024c: //intro + case csAddr_intro: //intro hideActor(); loadScene(41, 139, 156, 3); diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h index 1f14f2cbea..cc0d1ebe79 100644 --- a/engines/teenagent/resources.h +++ b/engines/teenagent/resources.h @@ -31,6 +31,18 @@ struct ADGameDescription; namespace TeenAgent { +// Code Segment Addresses +// Intro function : 0x024c +const uint16 csAddr_intro = 0x024c; +// Display Message function : 0xa055 +const uint16 csAddr_displayMsg = 0xa055; +// Reject Message function : 0xa4d6 +const uint16 csAddr_rejectMsg = 0xa4d6; + +// Data Segment Addresses +// Reject Messages Address Pointers : (4 * 2-byte) = 0x339e to 0x33a5 +const uint16 dsAddr_rejectMsg = 0x339e; + class Resources { public: void deinit(); |