aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorD G Turner2012-07-16 14:06:27 +0100
committerD G Turner2012-07-16 14:06:27 +0100
commit28c3aa3024e37e4c7921665863981973c6455eae (patch)
tree1a0e565ac40f4b94d0158334f940e5e8ac5ddd70 /engines/teenagent
parentdad5258c793ade7fd02aea4cbce489ab3d7e1833 (diff)
downloadscummvm-rg350-28c3aa3024e37e4c7921665863981973c6455eae.tar.gz
scummvm-rg350-28c3aa3024e37e4c7921665863981973c6455eae.tar.bz2
scummvm-rg350-28c3aa3024e37e4c7921665863981973c6455eae.zip
TEENAGENT: Migrate two more dseg regions to symbolic addresses.
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/resources.h7
-rw-r--r--engines/teenagent/scene.cpp6
-rw-r--r--engines/teenagent/teenagent.cpp6
3 files changed, 12 insertions, 7 deletions
diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h
index e1540f8500..7426b45248 100644
--- a/engines/teenagent/resources.h
+++ b/engines/teenagent/resources.h
@@ -31,7 +31,7 @@ struct ADGameDescription;
namespace TeenAgent {
-// Code Segment Addresses
+// Code Segment Addresses (Read Only)
// Intro function : 0x024c
const uint16 csAddr_intro = 0x024c;
// Display Message function : 0xa055
@@ -40,6 +40,8 @@ const uint16 csAddr_displayMsg = 0xa055;
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;
@@ -47,6 +49,9 @@ const uint16 dsAddr_rejectMsg = 0x339e;
const uint16 dsAddr_saveState = 0x6478;
const uint16 saveStateSize = 0x777a;
+// Current Music Id Playing : 0xdb90
+const uint16 dsAddr_currentMusic = 0xdb90;
+
class Resources {
public:
void deinit();
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index fdb0acb59d..6bcc606df5 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -413,8 +413,8 @@ void Scene::init(int id, const Common::Point &pos) {
// check music
int now_playing = _vm->music->getId();
- if (now_playing != _vm->res->dseg.get_byte(0xdb90))
- _vm->music->load(_vm->res->dseg.get_byte(0xdb90));
+ if (now_playing != _vm->res->dseg.get_byte(dsAddr_currentMusic))
+ _vm->music->load(_vm->res->dseg.get_byte(dsAddr_currentMusic));
_vm->_system->copyRectToScreen(background.pixels, background.pitch, 0, 0, background.w, background.h);
setPalette(0);
@@ -1065,7 +1065,7 @@ bool Scene::processEventQueue() {
case SceneEvent::kPlayMusic:
debugC(0, kDebugScene, "setting music %u", current_event.music);
_vm->setMusic(current_event.music);
- _vm->res->dseg.set_byte(0xdb90, current_event.music);
+ _vm->res->dseg.set_byte(dsAddr_currentMusic, current_event.music);
current_event.clear();
break;
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index bf626e2aff..08c436bf25 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -248,7 +248,7 @@ Common::Error TeenAgentEngine::loadGameState(int slot) {
inventory->activate(false);
inventory->reload();
- setMusic(res->dseg.get_byte(0xdb90));
+ setMusic(res->dseg.get_byte(dsAddr_currentMusic));
int id = res->dseg.get_byte(0xb4f3);
uint16 x = res->dseg.get_word(0x64af), y = res->dseg.get_word(0x64b1);
@@ -542,7 +542,7 @@ Common::Error TeenAgentEngine::run() {
init();
- CursorMan.pushCursor(res->dseg.ptr(0x00da), 8, 12, 0, 0, 1);
+ CursorMan.pushCursor(res->dseg.ptr(dsAddr_cursor), 8, 12, 0, 0, 1);
syncSoundSettings();
@@ -1042,7 +1042,7 @@ void TeenAgentEngine::setMusic(byte id) {
debugC(0, kDebugMusic, "starting music %u", id);
if (id != 1) // intro music
- *res->dseg.ptr(0xdb90) = id;
+ res->dseg.set_byte(dsAddr_currentMusic, id);
if (_gameDescription->flags & ADGF_CD) {
byte track2cd[] = {7, 2, 0, 9, 3, 6, 8, 10, 4, 5, 11};