From a9cc1f78b4aad2f2cc22647d22bc478f5d545b75 Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 28 Jun 2013 11:35:19 +0200 Subject: AVALANCHE: Gyro: Replace namespace with class. --- engines/avalanche/gyro2.cpp | 689 +++++++++++++++++++++++-------------- engines/avalanche/gyro2.h | 806 +++++++++++++++++++------------------------- 2 files changed, 779 insertions(+), 716 deletions(-) diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index fba155af59..a96249d67b 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -25,6 +25,8 @@ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. */ +/* GYRO It all revolves around this bit! */ + #include "avalanche/gyro2.h" #include "common/textconsole.h" @@ -41,289 +43,476 @@ namespace Avalanche { - namespace Gyro { - - const Common::String things[numobjs] = { - "Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt", - "Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key", - "Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion" - }; +const char *Gyro::vernum = "1.30"; - const char thingchar[] = "WMBParCLguKeSnIohn"; /* V=Vinegar */ +const char *Gyro::copyright = "1995"; - const Common::String better[numobjs] = { - "some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt", - "a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom", - "a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit", - "an onion" - }; - const char betterchar[] = "WMBParCLguKeSnIohn"; +const mp Gyro::mps[9] = { + { + /* 1 - up-arrow */ + { {65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575}, + {0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0} + }, + 8, + 0 + }, - void newpointer(byte m) { - warning("STUB: Gyro::newpointer()"); - } + { + /* 2 - screwdriver */ + { {8191, 4095, 2047, 34815, 50175, 61951, 63743, 64543, 65039, 65031, 65027, 65281, 65408, 65472, 65505, 65523}, + {0, 24576, 28672, 12288, 2048, 1024, 512, 256, 224, 176, 216, 96, 38, 10, 12, 0} - void wait() { /* makes hourglass */ - newpointer(5); - } + }, + 0, + 0 + }, - void on() { - warning("STUB: Gyro::on()"); - } + { + /* 3 - right-arrow */ + { {65535, 65535, 64639, 64543, 7, 1, 0, 1, 7, 64543, 64639, 65535, 65535, 65535, 65535, 65535}, + {0, 0, 0, 384, 480, 32760, 32766, 32760, 480, 384, 0, 0, 0, 0, 0, 0} + }, + 15, + 6 + }, - void on_virtual() { - switch (visible) { - case m_virtual: - return; - break; - case m_yes: - off(); - break; + { + /* 4 - fletch */ + { {255, 511, 1023, 2047, 1023, 4607, 14591, 31871, 65031, 65283, 65281, 65280, 65280, 65409, 65473, 65511}, + {0, 10240, 20480, 24576, 26624, 17408, 512, 256, 128, 88, 32, 86, 72, 20, 16, 0} + }, + 0, + 0 + }, + + { + /* 5 - hourglass */ + { {0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0}, + {0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0} + }, + 8, + 7 + }, + + { + /* 6 - TTHand */ + { {62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443}, + {3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092} + }, + 4, + 0 + }, + + { + /* 7- Mark's crosshairs */ + { {65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535}, + {0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0} + }, + 8, + 5 + }, + + { + /* 8- I-beam. */ + { {65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535}, + {0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0} + }, + 8, + 7 + }, + + { + /* 9- Question mark. */ + { {511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695}, + {65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840} + }, + 0, + 0 } - - visible = m_virtual; - } - - void off() { - warning("STUB: Gyro::off()"); - } - - void off_virtual() { - warning("STUB: Gyro::off_virtual()"); - } - - void xycheck() { /* only updates mx & my, not all other mouse vars */ - warning("STUB: Gyro::xycheck()"); - } - - void hopto(int16 x, int16 y) { /* Moves mouse void *to x,y */ - warning("STUB: Gyro::hopto()"); - } - - void check() { - warning("STUB: Gyro::check()"); - } - - void note(uint16 hertz) { - warning("STUB: Gyro::note()"); - } - - void blip() { - warning("STUB: Gyro::blip()"); - } - - Common::String strf(int32 x) { - Common::String q = Common::String::format("%d", x); - return q; - } - - void shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) { - warning("STUB: Gyro::shadow()"); - } - - void shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) { - warning("STUB: Gyro::shbox()"); - } - - void newgame() { /* This sets up the DNA for a completely new game. */ - warning("STUB: Gyro::newgame()"); - } - - void click() { /* "Audio keyboard feedback" */ - warning("STUB: Gyro::click()"); - } - - void slowdown() { - warning("STUB: Gyro::slowdown()"); - } - - bool flagset(char x) { - for (uint16 i = 0; i < flags.size(); i++) - if (flags[i] == x) - return true; - return false; - } - - void force_numlock() { - if ((locks & num) > 0) locks -= num; - } - - bool pennycheck(uint16 howmuchby) { - warning("STUB: Gyro::pennycheck()"); - return true; - } - - // There'll may be problems with calling these functions becouse of the conversion of the arrays!!! - // Keep an eye open! - Common::String getname(byte whose) { - Common::String getname_result; - if (whose < 17) - getname_result = lads[whose]; - else - getname_result = lasses[whose-17]; - return getname_result; - } - - // Keep an eye open! ^ - char getnamechar(byte whose) { - char getnamechar_result; - if (whose < 16) - getnamechar_result = ladchar[whose]; - else - getnamechar_result = lasschar[whose-16]; - return getnamechar_result; - } - - // Keep an eye open! ^^ - Common::String get_thing(byte which) { - Common::String get_thing_result; - switch (which) { - case wine: - switch (dna.winestate) { - case 1: - case 4: - get_thing_result = things[which]; - break; - case 3: - get_thing_result = "Vinegar"; - break; - } +}; + +const Common::String Gyro::lads[17] = { + "Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck", + "Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood", + "A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques" +}; + +const Common::String Gyro::lasses[4] = +{"Arkata", "Geida", "±", "the Wise Woman"}; + +const char Gyro::ladchar[] = "ASCDMTRwLfgeIyPu"; + +const char Gyro::lasschar[] = "kG±o"; + +const int32 Gyro::catamap[8][8] = { + /* Geida's room */ + /* 1 2 3 | 4 5 6 7 8*/ + {0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200}, + {0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210}, + {0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f}, + {0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, /* >> Oubliette */ + {0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260}, + {0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f}, + {0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, /* <<< In here */ + {0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062} +}; +/* vv Stairs trap. */ + +const char Gyro::spludwick_order[3] = {onion, ink, mushroom}; + +const quasiped_type Gyro::quasipeds[16] = { + {2, lightgray, 19, brown, pdogfood}, /* A: Dogfood (screen 19). */ + {3, green, 19, white, pibythneth}, /* B: Ibythneth (screen 19). */ + {3, white, 1, magenta, parkata}, /* C: Arkata (screen 1). */ + {3, black, 23, red, 177}, /* D: Hawk (screen 23). */ + {3, lightgreen, 50, brown, ptrader}, /* E: Trader (screen 50). */ + {6, yellow, 42, red, pavalot}, /* F: Avvy, tied up (scr.42) */ + {2, blue, 16, white, payles}, /* G: Ayles (screen 16). */ + {2, brown, 7, white, pjacques}, /* H: Jacques (screen 7). */ + {2, lightgreen, 47, green, pspurge}, /* I: Spurge (screen 47). */ + {3, yellow, 47, red, pavalot}, /* J: Avalot (screen 47). */ + {2, lightgray, 23, black, pdulustie}, /* K: du Lustie (screen 23). */ + {2, yellow, 27, red, pavalot}, /* L: Avalot (screen 27). */ + {3, white, 27, red, 177}, /* M: Avaroid (screen 27). */ + {4, lightgray, 19, darkgray, pmalagauche}, /*N: Malagauche (screen 19). */ + {5, lightmagenta, 47, red, pport}, /* O: Port (screen 47). */ + {2, lightgreen, 51, darkgray, pdrduck} +}; /*P: Duck (screen 51). */ + +const char Gyro::keys[] = "QWERTYUIOP[]"; + +const uint16 Gyro::notes[12] = +{196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587}; + +const tunetype Gyro::tune = { + higher, higher, lower, same, higher, higher, lower, higher, higher, higher, + lower, higher, higher, + same, higher, lower, lower, lower, lower, higher, higher, lower, lower, lower, + lower, same, lower, higher, same, lower, higher +}; + +const byte Gyro::static_const_whereis[29] = { + /* The Lads */ + r__yours, /* Avvy */ + r__spludwicks, /* Spludwick */ + r__outsideyours, /* Crapulus */ + r__ducks, /* Duck - r__DucksRoom's not defined yet. */ + r__argentpub, /* Malagauche */ + r__robins, /* Friar Tuck. */ + 177, /* Robin Hood - can't meet him at the start. */ + r__brummieroad, /* Cwytalot */ + r__lustiesroom, /* Baron du Lustie. */ + r__outsidecardiffcastle, /* The Duke of Cardiff. */ + r__argentpub, /* Dogfood */ + r__outsideducks, /* Trader */ + r__argentpub, /* Ibythneth */ + r__aylesoffice, /* Ayles */ + r__nottspub, /* Port */ + r__nottspub, /* Spurge */ + r__musicroom, /* Jacques */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* The Lasses */ + r__yours, /* Arkata */ + r__geidas, /* Geida */ + 177, /* nobody allocated here! */ + r__wisewomans /* The Wise Woman. */ +}; + + + + + +const Common::String Gyro::things[numobjs] = { + "Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt", + "Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key", + "Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion" +}; + +const char Gyro::thingchar[] = "WMBParCLguKeSnIohn"; /* V=Vinegar */ + +const Common::String Gyro::better[numobjs] = { + "some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt", + "a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom", + "a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit", + "an onion" +}; + +const char Gyro::betterchar[] = "WMBParCLguKeSnIohn"; + + + +Gyro::Gyro() : interrogation(0), oncandopageswap(true) { + for (int i = 0; i < 29; i++) + whereis[i] = static_const_whereis[i]; +} + +void Gyro::setParent(AvalancheEngine *vm) { + _vm = vm; +} + +void Gyro::newpointer(byte m) { + warning("STUB: Gyro::newpointer()"); +} + +void Gyro::wait() { /* makes hourglass */ + newpointer(5); +} + +void Gyro::on() { + warning("STUB: Gyro::on()"); +} + +void Gyro::on_virtual() { + switch (visible) { + case m_virtual: + return; + break; + case m_yes: + off(); + break; + } + + visible = m_virtual; +} + +void Gyro::off() { + warning("STUB: Gyro::off()"); +} + +void Gyro::off_virtual() { + warning("STUB: Gyro::off_virtual()"); +} + +void Gyro::xycheck() { /* only updates mx & my, not all other mouse vars */ + warning("STUB: Gyro::xycheck()"); +} + +void Gyro::hopto(int16 x, int16 y) { /* Moves mouse void *to x,y */ + warning("STUB: Gyro::hopto()"); +} + +void Gyro::check() { + warning("STUB: Gyro::check()"); +} + +void Gyro::note(uint16 hertz) { + warning("STUB: Gyro::note()"); +} + +void Gyro::blip() { + warning("STUB: Gyro::blip()"); +} + +Common::String Gyro::strf(int32 x) { + Common::String q = Common::String::format("%d", x); + return q; +} + +void Gyro::shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) { + warning("STUB: Gyro::shadow()"); +} + +void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) { + warning("STUB: Gyro::shbox()"); +} + +void Gyro::newgame() { /* This sets up the DNA for a completely new game. */ + warning("STUB: Gyro::newgame()"); +} + +void Gyro::click() { /* "Audio keyboard feedback" */ + warning("STUB: Gyro::click()"); +} + +void Gyro::slowdown() { + warning("STUB: Gyro::slowdown()"); +} + +bool Gyro::flagset(char x) { + for (uint16 i = 0; i < flags.size(); i++) + if (flags[i] == x) + return true; + return false; +} + +void Gyro::force_numlock() { + if ((locks & num) > 0) locks -= num; +} + +bool Gyro::pennycheck(uint16 howmuchby) { + warning("STUB: Gyro::pennycheck()"); + return true; +} + +// There'll may be problems with calling these functions becouse of the conversion of the arrays!!! +// Keep an eye open! +Common::String Gyro::getname(byte whose) { + Common::String getname_result; + if (whose < 17) + getname_result = lads[whose]; + else + getname_result = lasses[whose-17]; + return getname_result; +} + +// Keep an eye open! ^ +char Gyro::getnamechar(byte whose) { + char getnamechar_result; + if (whose < 16) + getnamechar_result = ladchar[whose]; + else + getnamechar_result = lasschar[whose-16]; + return getnamechar_result; +} + +// Keep an eye open! ^^ +Common::String Gyro::get_thing(byte which) { + Common::String get_thing_result; + switch (which) { + case wine: + switch (dna.winestate) { + case 1: + case 4: + get_thing_result = things[which]; break; - case onion: - if (dna.rotten_onion) - get_thing_result = "rotten onion"; - else get_thing_result = things[which]; + case 3: + get_thing_result = "Vinegar"; break; - default: - get_thing_result = things[which]; } - return get_thing_result; - } - - // Keep an eye open! ^^^ - char get_thingchar(byte which) { - char get_thingchar_result; - switch (which) { - case wine: - if (dna.winestate == 3) - get_thingchar_result = 'V'; /* Vinegar */ - else - get_thingchar_result = thingchar[which]; - break; - default: + break; + case onion: + if (dna.rotten_onion) + get_thing_result = "rotten onion"; + else get_thing_result = things[which]; + break; + default: + get_thing_result = things[which]; + } + return get_thing_result; +} + +// Keep an eye open! ^^^ +char Gyro::get_thingchar(byte which) { + char get_thingchar_result; + switch (which) { + case wine: + if (dna.winestate == 3) + get_thingchar_result = 'V'; /* Vinegar */ + else get_thingchar_result = thingchar[which]; - } - return get_thingchar_result; - } - - // Keep an eye open! ^^^^ - Common::String get_better(byte which) { - Common::String get_better_result; - if (which > 150) which -= 149; - switch (which) { - case wine: - switch (dna.winestate) { - case 0: - case 1: - case 4: - get_better_result = better[which]; - break; - case 3: - get_better_result = "some vinegar"; - break; - } + break; + default: + get_thingchar_result = thingchar[which]; + } + return get_thingchar_result; +} + +// Keep an eye open! ^^^^ +Common::String Gyro::get_better(byte which) { + Common::String get_better_result; + if (which > 150) which -= 149; + switch (which) { + case wine: + switch (dna.winestate) { + case 0: + case 1: + case 4: + get_better_result = better[which]; break; - case onion: - if (dna.rotten_onion) - get_better_result = "a rotten onion"; - else if (dna.onion_in_vinegar) - get_better_result = "a pickled onion (in the vinegar)"; - else get_better_result = better[which]; + case 3: + get_better_result = "some vinegar"; break; - default: - if ((which < numobjs) && (which > '\0')) - get_better_result = better[which]; - else - get_better_result = ""; } - return get_better_result; + break; + case onion: + if (dna.rotten_onion) + get_better_result = "a rotten onion"; + else if (dna.onion_in_vinegar) + get_better_result = "a pickled onion (in the vinegar)"; + else get_better_result = better[which]; + break; + default: + if ((which < numobjs) && (which > '\0')) + get_better_result = better[which]; + else + get_better_result = ""; } + return get_better_result; +} - // Get back here after finished with acci.pas, where vb_-s are resided. - Common::String f5_does() - /* This procedure determines what f5 does. */ - { - warning("STUB: Gyro::f5_does()"); - return "STUB: Gyro::f5_does()"; - } +// Get back here after finished with acci.pas, where vb_-s are resided. +Common::String Gyro::f5_does() +/* This procedure determines what f5 does. */ +{ + warning("STUB: Gyro::f5_does()"); + return "STUB: Gyro::f5_does()"; +} - // Pobably vmc functions will deal with the mouse cursor. - void plot_vmc(int16 xx, int16 yy, byte page_) { - warning("STUB: Gyro::plot_vmc()"); - } +// Pobably vmc functions will deal with the mouse cursor. +void Gyro::plot_vmc(int16 xx, int16 yy, byte page_) { + warning("STUB: Gyro::plot_vmc()"); +} - void wipe_vmc(byte page_) { - warning("STUB: Gyro::wipe_vmc()"); - } +void Gyro::wipe_vmc(byte page_) { + warning("STUB: Gyro::wipe_vmc()"); +} - void setup_vmc() { - warning("STUB: Gyro::setup_vmc()"); - } +void Gyro::setup_vmc() { + warning("STUB: Gyro::setup_vmc()"); +} - void clear_vmc() { - warning("STUB: Gyro::clear_vmc()"); - } +void Gyro::clear_vmc() { + warning("STUB: Gyro::clear_vmc()"); +} - void setminmaxhorzcurspos(uint16 min, uint16 max) { /* phew */ - warning("STUB: Gyro::setminmaxhorzcurspos()"); - } +void Gyro::setminmaxhorzcurspos(uint16 min, uint16 max) { /* phew */ + warning("STUB: Gyro::setminmaxhorzcurspos()"); +} - void setminmaxvertcurspos(uint16 min, uint16 max) { - warning("STUB: Gyro::setminmaxvertcurspos()"); - } +void Gyro::setminmaxvertcurspos(uint16 min, uint16 max) { + warning("STUB: Gyro::setminmaxvertcurspos()"); +} - void load_a_mouse(byte which) { - warning("STUB: Gyro::load_a_mouse()"); - } +void Gyro::load_a_mouse(byte which) { + warning("STUB: Gyro::load_a_mouse()"); +} - void background(byte x) { - warning("STUB: Gyro::background()"); - } +void Gyro::background(byte x) { + warning("STUB: Gyro::background()"); +} - void hang_around_for_a_while() { - byte fv; +void Gyro::hang_around_for_a_while() { + byte fv; - for (fv = 1; fv <= 28; fv ++) slowdown(); - } + for (fv = 1; fv <= 28; fv ++) slowdown(); +} - bool mouse_near_text() { - bool mouse_near_text_result; - mouse_near_text_result = (my > 144) && (my < 188); - return mouse_near_text_result; - } - - /* Super_Off and Super_On are two very useful procedures. Super_Off switches - the mouse cursor off, WHATEVER it's like. Super_On restores it again - afterwards. */ +/* Super_Off and Super_On are two very useful procedures. Super_Off switches + the mouse cursor off, WHATEVER it's like. Super_On restores it again + afterwards. */ - void super_off() { - super_was_off = visible == m_no; - if (super_was_off) return; +void Gyro::super_off() { + super_was_off = visible == m_no; + if (super_was_off) return; - super_was_virtual = visible == m_virtual; + super_was_virtual = visible == m_virtual; - if (visible == m_virtual) off_virtual(); - else off(); - } + if (visible == m_virtual) off_virtual(); + else off(); +} - void super_on() { - if ((visible != m_no) || (super_was_off)) return; +void Gyro::super_on() { + if ((visible != m_no) || (super_was_off)) return; - if (super_was_virtual) on_virtual(); - else on(); - } + if (super_was_virtual) on_virtual(); + else on(); +} - } // End of namespace Gyro +bool Gyro::mouse_near_text() { + bool mouse_near_text_result; + mouse_near_text_result = (my > 144) && (my < 188); + return mouse_near_text_result; +} } // End of namespace Avalanche diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index 0836dfbb6c..ecea597c8e 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -25,490 +25,392 @@ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. */ +/* GYRO It all revolves around this bit! */ + #ifndef GYRO2_H #define GYRO2_H #include "common/system.h" #include "common/str.h" #include "common/scummsys.h" +#include "avalanche/avalanche.h" #include "avalanche/roomnums.h" #include "avalanche/color.h" namespace Avalanche { - namespace Gyro { - - ///////////////////////////// CONSTANTS ///////////////////////////// +static const char numobjs = 18; /* always preface with a # */ +static const int16 maxobjs = 12; /* carry limit */ +static const byte howlong = 1/*8*/; /* 18 ticks. */ - const char numobjs = 18; /* always preface with a # */ - const int16 maxobjs = 12; /* carry limit */ - const byte howlong = 1/*8*/; /* 18 ticks. */ +static const int16 num = 32; /* Code for Num Lock */ - const int16 num = 32; /* Code for Num Lock */ +static const int16 mouse_size = 134; - const int16 mouse_size = 134; +typedef void (*proc)(); - ///////////////////////////// TYPEDEFS ///////////////////////////// +struct postype { + uint16 x, y, datapos; + byte length; +}; - typedef void (*proc)(); +struct mp { /* mouse-void **/ + uint16 mask[2][16]; + int16 horzhotspot, verthotspot; +}; - struct postype { - uint16 x, y, datapos; - byte length; - }; +struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */ + byte rw; /* Realway- just for convenience! */ + byte carrying; /* how many objects you're carrying... */ + bool obj[numobjs]; /* ...and which ones they are. */ + int16 score; /* your score, of course */ + int32 pence; /* your current amount of dosh */ + byte room; /* your current room */ + char wearing; /* what you're wearing */ + byte swore; /* number of times you've sworn */ + byte saves; /* number of times this game has been saved */ + byte rooms[100]; /* Add one to each every time + you enter a room */ + byte alcohol; /* Your blood alcohol level. */ + byte playednim; /* How many times you've played Nim. */ + bool wonnim; /* Have you *won* Nim? (That's harder.) */ + byte winestate; /* 0=good (Notts), 1=passable(Argent) ... 3=vinegar.*/ + bool cwytalot_gone; /* Has Cwytalot rushed off to Jerusalem yet?*/ - struct mp { /* mouse-void **/ - uint16 mask[2][16]; - int16 horzhotspot, verthotspot; - }; + byte pass_num; /* Number of the passuint16 for this game. */ + bool ayles_is_awake; /* pretty obvious! */ + byte drawbridge_open; /* Between 0 (shut) and 4 (open). */ + byte avaricius_talk; /* How much Avaricius has said to you. */ + bool bought_onion; /* Have you bought an onion yet? */ + bool rotten_onion; /* And has it rotted? */ + bool onion_in_vinegar; /* Is the onion in the vinegar? */ - struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */ - byte rw; /* Realway- just for convenience! */ - byte carrying; /* how many objects you're carrying... */ - bool obj[numobjs]; /* ...and which ones they are. */ - int16 score; /* your score, of course */ - int32 pence; /* your current amount of dosh */ - byte room; /* your current room */ - char wearing; /* what you're wearing */ - byte swore; /* number of times you've sworn */ - byte saves; /* number of times this game has been saved */ - byte rooms[100]; /* Add one to each every time - you enter a room */ - byte alcohol; /* Your blood alcohol level. */ - byte playednim; /* How many times you've played Nim. */ - bool wonnim; /* Have you *won* Nim? (That's harder.) */ - byte winestate; /* 0=good (Notts), 1=passable(Argent) ... 3=vinegar.*/ - bool cwytalot_gone; /* Has Cwytalot rushed off to Jerusalem yet?*/ + byte given2spludwick; /* 0 = nothing given, 1 = onion... */ + byte brummie_stairs; /* Progression through the stairs trick. */ + byte cardiff_things; /* Things you get asked in Cardiff. */ - byte pass_num; /* Number of the passuint16 for this game. */ - bool ayles_is_awake; /* pretty obvious! */ - byte drawbridge_open; /* Between 0 (shut) and 4 (open). */ - byte avaricius_talk; /* How much Avaricius has said to you. */ - bool bought_onion; /* Have you bought an onion yet? */ - bool rotten_onion; /* And has it rotted? */ - bool onion_in_vinegar; /* Is the onion in the vinegar? */ + bool cwytalot_in_herts; /* Have you passed Cwytalot in Herts?*/ - byte given2spludwick; /* 0 = nothing given, 1 = onion... */ - byte brummie_stairs; /* Progression through the stairs trick. */ - byte cardiff_things; /* Things you get asked in Cardiff. */ + bool avvy_is_awake; /* Well? Is Avvy awake? (Screen 1 only.) */ + bool avvy_in_bed; /* True if Avvy's in bed, but awake. */ - bool cwytalot_in_herts; /* Have you passed Cwytalot in Herts?*/ + bool user_moves_avvy; /* If this is false, the user has no + control over Avvy's movements. */ - bool avvy_is_awake; /* Well? Is Avvy awake? (Screen 1 only.) */ - bool avvy_in_bed; /* True if Avvy's in bed, but awake. */ + byte dogfoodpos; /* Which way Dogfood's looking in the pub. */ - bool user_moves_avvy; /* If this is false, the user has no - control over Avvy's movements. */ + bool givenbadgetoiby; /* Have you given the badge to Iby yet? */ - byte dogfoodpos; /* Which way Dogfood's looking in the pub. */ + bool friar_will_tie_you_up; /* If you're going to get tied up. */ + bool tied_up; /* You ARE tied up! */ - bool givenbadgetoiby; /* Have you given the badge to Iby yet? */ + char box_contents; /* 0 = money (sixpence), 254 = empty, any + other number implies the contents of the box. */ - bool friar_will_tie_you_up; /* If you're going to get tied up. */ - bool tied_up; /* You ARE tied up! */ + bool talked_to_crapulus; /* Pretty self-explanatory. */ - char box_contents; /* 0 = money (sixpence), 254 = empty, any - other number implies the contents of the box. */ + byte jacques_awake; /* 0=asleep, 1=awake, 2=gets up, 3=gone. */ - bool talked_to_crapulus; /* Pretty self-explanatory. */ + bool ringing_bells; /* Is Jacques ringing the bells? */ - byte jacques_awake; /* 0=asleep, 1=awake, 2=gets up, 3=gone. */ + bool standing_on_dais; /* In room 71, inside Cardiff Castle. */ + bool taken_pen; /* Have you taken the pen (in Cardiff?) */ + bool arrow_triggered; /* And has the arrow been triggered? */ + bool arrow_in_the_door; /* Did the arrow hit the wall? */ - bool ringing_bells; /* Is Jacques ringing the bells? */ + Common::String like2drink, + favourite_song, + worst_place_on_earth, + spare_evening; /* Personalisation str's */ - bool standing_on_dais; /* In room 71, inside Cardiff Castle. */ - bool taken_pen; /* Have you taken the pen (in Cardiff?) */ - bool arrow_triggered; /* And has the arrow been triggered? */ - bool arrow_in_the_door; /* Did the arrow hit the wall? */ + int32 total_time; /* Your total time playing this game, in ticks.*/ - Common::String like2drink, - favourite_song, - worst_place_on_earth, - spare_evening; /* Personalisation str's */ + byte jumpstatus; /* Fixes how high you're jumping. */ - int32 total_time; /* Your total time playing this game, in ticks.*/ + bool mushroom_growing; /* Is the mushroom growing in 42? */ - byte jumpstatus; /* Fixes how high you're jumping. */ + bool spludwicks_here; /* Is Spludwick at home? */ - bool mushroom_growing; /* Is the mushroom growing in 42? */ + byte last_room; + byte last_room_not_map; - bool spludwicks_here; /* Is Spludwick at home? */ + bool crapulus_will_tell; /* Will Crapulus tell you about + Spludwick being away? */ - byte last_room; - byte last_room_not_map; + bool enter_catacombs_from_lusties_room; + bool teetotal; /* Are we touching any more drinks? */ + byte malagauche; /* Position of Malagauche. See Celer for more info. */ + char drinking; /* What's he getting you? */ - bool crapulus_will_tell; /* Will Crapulus tell you about - Spludwick being away? */ + bool entered_lusties_room_as_monk; - bool enter_catacombs_from_lusties_room; - bool teetotal; /* Are we touching any more drinks? */ - byte malagauche; /* Position of Malagauche. See Celer for more info. */ - char drinking; /* What's he getting you? */ + byte cat_x, cat_y; /* XY coords in the catacombs. */ - bool entered_lusties_room_as_monk; + bool avvys_in_the_cupboard; /* On screen 22. */ - byte cat_x, cat_y; /* XY coords in the catacombs. */ + bool geida_follows; /* Is Geida following you? */ - bool avvys_in_the_cupboard; /* On screen 22. */ + byte geida_spin, geida_time; /* For the making "Geida dizzy" joke. */ - bool geida_follows; /* Is Geida following you? */ + byte nextbell; /* For the ringing. */ - byte geida_spin, geida_time; /* For the making "Geida dizzy" joke. */ + bool geida_given_potion; /* Does Geida have the potion? */ + bool lustie_is_asleep; /* Is BDL asleep? */ - byte nextbell; /* For the ringing. */ + byte flip_to_where, flip_to_ped; /* For the sequencer. */ - bool geida_given_potion; /* Does Geida have the potion? */ - bool lustie_is_asleep; /* Is BDL asleep? */ + bool been_tied_up; /* In r__Robins. */ - byte flip_to_where, flip_to_ped; /* For the sequencer. */ + bool sitting_in_pub; /* Are you sitting down in the pub? */ + byte spurge_talk; /* Count for talking to Spurge. */ - bool been_tied_up; /* In r__Robins. */ + bool met_avaroid; - bool sitting_in_pub; /* Are you sitting down in the pub? */ - byte spurge_talk; /* Count for talking to Spurge. */ + bool taken_mushroom, + given_pen_to_ayles, + asked_dogfood_about_nim; +}; - bool met_avaroid; +struct pedtype { + int16 x, y; + byte dir; +}; - bool taken_mushroom, - given_pen_to_ayles, - asked_dogfood_about_nim; - }; +struct magictype { + byte op; /* one of the operations */ + uint16 data; /* data for them */ +}; - struct pedtype { - int16 x, y; - byte dir; - }; +class fieldtype { +public: + int16 x1, y1, x2, y2; +}; - struct magictype { - byte op; /* one of the operations */ - uint16 data; /* data for them */ - }; +struct bytefield { + byte x1, y1, x2, y2; +}; - class fieldtype { - public: - int16 x1, y1, x2, y2; - }; +class linetype : public fieldtype { +public: + byte col; +}; - struct bytefield { - byte x1, y1, x2, y2; - }; +struct adxtype { + Common::String name; /* name of character */ + byte num; /* number of pictures */ + byte xl, yl; /* x & y lengths of pictures */ + byte seq; /* how many in one stride */ + uint16 size; /* the size of one picture */ + byte fgc, bgc; /* foreground & background bubble colours */ +}; - class linetype : public fieldtype { - public: - byte col; - }; +typedef byte raw[256][16]; /* raw_font_type */ - struct adxtype { - Common::String name; /* name of character */ - byte num; /* number of pictures */ - byte xl, yl; /* x & y lengths of pictures */ - byte seq; /* how many in one stride */ - uint16 size; /* the size of one picture */ - byte fgc, bgc; /* foreground & background bubble colours */ - }; +enum controllers {cjoy, ckey}; - typedef byte raw[256][16]; /* raw_font_type */ +typedef Common::String previoustype[20]; - enum controllers {cjoy, ckey}; +struct corridor_type { /* Decarations for the corridors. */ + uint16 doors; /* Door styles are calc'ed from this uint16. + Assign a different number to each one! */ +}; - typedef Common::String previoustype[20]; +struct demo_type { + uint16 delay; + char key, extd; +}; - struct corridor_type { /* Decarations for the corridors. */ - uint16 doors; /* Door styles are calc'ed from this uint16. - Assign a different number to each one! */ - }; +struct quasiped_type { + byte whichped, fgc, room, bgc; + uint16 who; +}; +/* A quasiped defines how people who aren't sprites talk. For example, + quasiped "A" is Dogfood. The rooms aren't stored because I'm leaving + that to context. */ - struct demo_type { - uint16 delay; - char key, extd; - }; +typedef byte tunetype[31]; - struct quasiped_type { - byte whichped, fgc, room, bgc; - uint16 who; - }; - /* A quasiped defines how people who aren't sprites talk. For example, - quasiped "A" is Dogfood. The rooms aren't stored because I'm leaving - that to context. */ +struct vmctype { /* Virtual Mouse Cursor */ + void *andpic, *xorpic; + void *backpic[2]; + void* wherewas[2]; + byte picnumber; + int8 ofsx, ofsy; +}; - typedef byte tunetype[31]; +struct sundry { + /* Things which must be saved over a backtobootstrap, + outside DNA. */ + Common::String qenid_filename; + bool qsoundfx; + char qthinks; + bool qthinkthing; +}; - struct vmctype { /* Virtual Mouse Cursor */ - void *andpic, *xorpic; - void *backpic[2]; - void* wherewas[2]; - byte picnumber; - int8 ofsx, ofsy; - }; +struct joysetup { + uint16 xmid, ymid, xmin, ymin, xmax, ymax; + byte centre; /* Size of centre in tenths */ +}; - struct sundry { - /* Things which must be saved over a backtobootstrap, - outside DNA. */ - Common::String qenid_filename; - bool qsoundfx; - char qthinks; - bool qthinkthing; - }; - - struct joysetup { - uint16 xmid, ymid, xmin, ymin, xmax, ymax; - byte centre; /* Size of centre in tenths */ - }; - - struct ednahead { /* Edna header */ - /* This header starts at byte offset 177 in the .ASG file. */ - char id[9]; /* signature */ - uint16 revision; /* EDNA revision, here 2 (1=dna256) */ - Common::String game; /* Long name, eg Lord Avalot D'Argent */ - Common::String shortname; /* Short name, eg Avalot */ - uint16 number; /* Game's code number, here 2 */ - uint16 ver; /* Version number as int16 (eg 1.00 = 100) */ - Common::String verstr; /* Vernum as Common::String (eg 1.00 = "1.00" */ - Common::String filename; /* Filename, eg AVALOT.EXE */ - byte osbyte; /* Saving OS (here 1=DOS. See below for others.*/ - Common::String os; /* Saving OS in text format. */ - - /* Info on this particular game */ - - Common::String fn; /* Filename (not extension ('cos that's .ASG)) */ - byte d, m; /* D, M, Y are the Day, Month & Year this game was... */ - uint16 y; /* ...saved on. */ - Common::String desc; /* Description of game (same as in Avaricius!) */ - uint16 len; /* Length of DNA (it's not going to be above 65535!) */ - - /* Quick reference & miscellaneous */ - - uint16 saves; /* no. of times this game has been saved */ - int16 cash; /* contents of your wallet in numerical form */ - Common::String money; /* ditto in Common::String form (eg 5/-, or 1 denarius)*/ - uint16 points; /* your score */ - - /* DNA values follow, then footer (which is ignored) */ - }; - - /* Possible values of edhead.os: - 1 = DOS 4 = Mac - 2 = Windows 5 = Amiga - 3 = OS/2 6 = ST - 7 = Archimedes */ - - - - ///////////////////////////// CONSTANTS ///////////////////////////// - - const char vernum[] = "1.30"; - const char copyright[] = "1995"; - const int16 thisvercode = 130; +struct ednahead { /* Edna header */ + /* This header starts at byte offset 177 in the .ASG file. */ + char id[9]; /* signature */ + uint16 revision; /* EDNA revision, here 2 (1=dna256) */ + Common::String game; /* Long name, eg Lord Avalot D'Argent */ + Common::String shortname; /* Short name, eg Avalot */ + uint16 number; /* Game's code number, here 2 */ + uint16 ver; /* Version number as int16 (eg 1.00 = 100) */ + Common::String verstr; /* Vernum as Common::String (eg 1.00 = "1.00" */ + Common::String filename; /* Filename, eg AVALOT.EXE */ + byte osbyte; /* Saving OS (here 1=DOS. See below for others.*/ + Common::String os; /* Saving OS in text format. */ + + /* Info on this particular game */ + + Common::String fn; /* Filename (not extension ('cos that's .ASG)) */ + byte d, m; /* D, M, Y are the Day, Month & Year this game was... */ + uint16 y; /* ...saved on. */ + Common::String desc; /* Description of game (same as in Avaricius!) */ + uint16 len; /* Length of DNA (it's not going to be above 65535!) */ + + /* Quick reference & miscellaneous */ + + uint16 saves; /* no. of times this game has been saved */ + int16 cash; /* contents of your wallet in numerical form */ + Common::String money; /* ditto in Common::String form (eg 5/-, or 1 denarius)*/ + uint16 points; /* your score */ + + /* DNA values follow, then footer (which is ignored) */ +}; + +/* Possible values of edhead.os: + 1 = DOS 4 = Mac + 2 = Windows 5 = Amiga + 3 = OS/2 6 = ST + 7 = Archimedes */ + + + + + + +class Gyro { + +public: + + static const char *vernum; + static const char *copyright; + static const int16 thisvercode = 130; /* as "vernum", but numerically & without the ".". */ - const int16 thisgamecode = 2; /* Avalot's code number */ + static const int16 thisgamecode = 2; /* Avalot's code number */ /* Objects you can hold: */ - const char wine = 1; - const char money = 2; - const char bodkin = 3; - const char potion = 4; - const char chastity = 5; - const char bolt = 6; - const char crossbow = 7; - const char lute = 10; - const char badge = 11; - const char mushroom = 12; - const char key = 13; - const char bell = 14; - const char prescription = 15; - const char pen = 16; - const char ink = 17; - const char clothes = 20; - const char habit = 21; - const char onion = 22; + static const char wine = 1; + static const char money = 2; + static const char bodkin = 3; + static const char potion = 4; + static const char chastity = 5; + static const char bolt = 6; + static const char crossbow = 7; + static const char lute = 10; + static const char badge = 11; + static const char mushroom = 12; + static const char key = 13; + static const char bell = 14; + static const char prescription = 15; + static const char pen = 16; + static const char ink = 17; + static const char clothes = 20; + static const char habit = 21; + static const char onion = 22; /* People who hang around this game. */ /* Boys: */ - const uint16 pavalot = 226; - const uint16 pspludwick = 227; - const uint16 pcrapulus = 230; - const uint16 pdrduck = 231; - const uint16 pmalagauche = 232; - const uint16 pfriartuck = 233; - const uint16 probinhood = 234; - const uint16 pcwytalot = 235; - const uint16 pdulustie = 236; - const uint16 pduke = 237; - const uint16 pdogfood = 240; - const uint16 ptrader = 241; - const uint16 pibythneth = 242; - const uint16 payles = 243; - const uint16 pport = 244; - const uint16 pspurge = 245; - const uint16 pjacques = 246; + static const uint16 pavalot = 226; + static const uint16 pspludwick = 227; + static const uint16 pcrapulus = 230; + static const uint16 pdrduck = 231; + static const uint16 pmalagauche = 232; + static const uint16 pfriartuck = 233; + static const uint16 probinhood = 234; + static const uint16 pcwytalot = 235; + static const uint16 pdulustie = 236; + static const uint16 pduke = 237; + static const uint16 pdogfood = 240; + static const uint16 ptrader = 241; + static const uint16 pibythneth = 242; + static const uint16 payles = 243; + static const uint16 pport = 244; + static const uint16 pspurge = 245; + static const uint16 pjacques = 246; /* Girls: */ - const uint16 parkata = 257; - const uint16 pgeida = 260; - const uint16 pwisewoman = 262; - - const int16 xw = 30; - const int16 yw = 36; /* x width & y whatsit */ - - const int16 margin = 5; - - const mp mps[9] = { - { - /* 1 - up-arrow */ - { {65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575}, - {0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0} - }, - 8, - 0 - }, - - { - /* 2 - screwdriver */ - { {8191, 4095, 2047, 34815, 50175, 61951, 63743, 64543, 65039, 65031, 65027, 65281, 65408, 65472, 65505, 65523}, - {0, 24576, 28672, 12288, 2048, 1024, 512, 256, 224, 176, 216, 96, 38, 10, 12, 0} - - }, - 0, - 0 - }, - - { - /* 3 - right-arrow */ - { {65535, 65535, 64639, 64543, 7, 1, 0, 1, 7, 64543, 64639, 65535, 65535, 65535, 65535, 65535}, - {0, 0, 0, 384, 480, 32760, 32766, 32760, 480, 384, 0, 0, 0, 0, 0, 0} - }, - 15, - 6 - }, - - { - /* 4 - fletch */ - { {255, 511, 1023, 2047, 1023, 4607, 14591, 31871, 65031, 65283, 65281, 65280, 65280, 65409, 65473, 65511}, - {0, 10240, 20480, 24576, 26624, 17408, 512, 256, 128, 88, 32, 86, 72, 20, 16, 0} - }, - 0, - 0 - }, - - { - /* 5 - hourglass */ - { {0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0}, - {0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0} - }, - 8, - 7 - }, - - { - /* 6 - TTHand */ - { {62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443}, - {3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092} - }, - 4, - 0 - }, - - { - /* 7- Mark's crosshairs */ - { {65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535}, - {0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0} - }, - 8, - 5 - }, - - { - /* 8- I-beam. */ - { {65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535}, - {0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0} - }, - 8, - 7 - }, - - { - /* 9- Question mark. */ - { {511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695}, - {65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840} - }, - 0, - 0 - } - - }; - - const Common::String lads[17] = { - "Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck", - "Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood", - "A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques" - }; - - const Common::String lasses[4] = - {"Arkata", "Geida", "±", "the Wise Woman"}; - - const char ladchar[] = "ASCDMTRwLfgeIyPu"; - - const char lasschar[] = "kG±o"; - - const int16 numtr = 2; /* current max no. of sprites */ - - const bool a_thing = true; - const bool a_person = false; /* for Thinkabout */ + static const uint16 parkata = 257; + static const uint16 pgeida = 260; + static const uint16 pwisewoman = 262; + + static const int16 xw = 30; + static const int16 yw = 36; /* x width & y whatsit */ + + static const int16 margin = 5; + + static const mp mps[9]; + + static const Common::String lads[17]; + + static const Common::String lasses[4]; + + static const char ladchar[]; + + static const char lasschar[]; + + static const int16 numtr = 2; /* current max no. of sprites */ + + static const bool a_thing = true; + static const bool a_person = false; /* for Thinkabout */ /* Magic/portal commands are */ - /*N*/ const int16 nix = 0; /* ignore it if this line is touched */ - /*B*/ const int16 bounces = 1; /* bounce off this line. Not valid for portals. */ - /*E*/ const int16 exclaim = 2; /* put up a chain of scrolls */ - /*T*/ const int16 transport = 3; /* enter new room */ - /*U*/ const int16 unfinished = 4; /* unfinished connection */ - /*S*/ const int16 special = 5; /* special function. */ - /*O*/ const int16 mopendoor = 6; /* opening door. */ + /*N*/ static const int16 nix = 0; /* ignore it if this line is touched */ + /*B*/ static const int16 bounces = 1; /* bounce off this line. Not valid for portals. */ + /*E*/ static const int16 exclaim = 2; /* put up a chain of scrolls */ + /*T*/ static const int16 transport = 3; /* enter new room */ + /*U*/ static const int16 unfinished = 4; /* unfinished connection */ + /*S*/ static const int16 special = 5; /* special function. */ + /*O*/ static const int16 mopendoor = 6; /* opening door. */ - /* These following constants should be included in CFG when it's written. */ + /* These following static constants should be included in CFG when it's written. */ - const bool slow_computer = false; /* stops walking when mouse touches toolbar */ + static const bool slow_computer = false; /* stops walking when mouse touches toolbar */ /* --- */ - const int16 border = 1; /* size of border on shadowboxes */ + static const int16 border = 1; /* size of border on shadowboxes */ - const int32 pagetop = 81920; + static const int32 pagetop = 81920; - const int16 up = 0; - const int16 right = 1; - const int16 down = 2; - const int16 left = 3; - const int16 ur = 4; - const int16 dr = 5; - const int16 dl = 6; - const int16 ul = 7; - const int16 stopped = 8; + static const int16 up = 0; + static const int16 right = 1; + static const int16 down = 2; + static const int16 left = 3; + static const int16 ur = 4; + static const int16 dr = 5; + static const int16 dl = 6; + static const int16 ul = 7; + static const int16 stopped = 8; - const int16 walk = 3; - const int16 run = 5; + static const int16 walk = 3; + static const int16 run = 5; /* Art gallery at 2,1; notice about this at 2,2. */ - const int32 catamap[8][8] = { - /* Geida's room */ - /* 1 2 3 | 4 5 6 7 8*/ - {0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200}, - {0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210}, - {0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f}, - {0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, /* >> Oubliette */ - {0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260}, - {0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f}, - {0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, /* <<< In here */ - {0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062} - }; - /* vv Stairs trap. */ + static const int32 catamap[8][8]; /* Explanation: $NSEW. - Nibble N: North. + Nibble N: North. 0 = no connection, 2 = (left,) middle(, right) door with left-hand handle, 5 = (left,) middle(, right) door with right-hand handle, @@ -519,11 +421,11 @@ namespace Avalanche { E = no connection + TORCH, F = recessed door (to Geida's room.) - Nibble S: South. + Nibble S: South. 0 = no connection, 1,2,3 = left, middle, right door. - Nibble E: East. + Nibble E: East. 0 = no connection (wall), 1 = no connection (wall + window), 2 = wall with door, @@ -532,7 +434,7 @@ namespace Avalanche { 7 = wall with door and candles, F = straight-through corridor. - Nibble W: West. + Nibble W: West. 0 = no connection (wall), 1 = no connection (wall + shield), 2 = wall with door, @@ -543,86 +445,42 @@ namespace Avalanche { 7 = wall with door and candles, F = straight-through corridor. */ - const bool demo = false; /* If this is true, we're in a demo of the game. */ + static const bool demo = false; /* If this is true, we're in a demo of the game. */ - const char spludwick_order[3] = {onion, ink, mushroom}; + static const char spludwick_order[3]; - const quasiped_type quasipeds[16] = { - {2, lightgray, 19, brown, pdogfood}, /* A: Dogfood (screen 19). */ - {3, green, 19, white, pibythneth}, /* B: Ibythneth (screen 19). */ - {3, white, 1, magenta, parkata}, /* C: Arkata (screen 1). */ - {3, black, 23, red, 177}, /* D: Hawk (screen 23). */ - {3, lightgreen, 50, brown, ptrader}, /* E: Trader (screen 50). */ - {6, yellow, 42, red, pavalot}, /* F: Avvy, tied up (scr.42) */ - {2, blue, 16, white, payles}, /* G: Ayles (screen 16). */ - {2, brown, 7, white, pjacques}, /* H: Jacques (screen 7). */ - {2, lightgreen, 47, green, pspurge}, /* I: Spurge (screen 47). */ - {3, yellow, 47, red, pavalot}, /* J: Avalot (screen 47). */ - {2, lightgray, 23, black, pdulustie}, /* K: du Lustie (screen 23). */ - {2, yellow, 27, red, pavalot}, /* L: Avalot (screen 27). */ - {3, white, 27, red, 177}, /* M: Avaroid (screen 27). */ - {4, lightgray, 19, darkgray, pmalagauche}, /*N: Malagauche (screen 19). */ - {5, lightmagenta, 47, red, pport}, /* O: Port (screen 47). */ - {2, lightgreen, 51, darkgray, pdrduck} - }; /*P: Duck (screen 51). */ - - const int16 lower = 0; - const int16 same = 1; - const int16 higher = 2; - - const char keys[] = "QWERTYUIOP[]"; - const uint16 notes[12] = - {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587}; - - const tunetype tune = { - higher, higher, lower, same, higher, higher, lower, higher, higher, higher, - lower, higher, higher, - same, higher, lower, lower, lower, lower, higher, higher, lower, lower, lower, - lower, same, lower, higher, same, lower, higher - }; + static const quasiped_type quasipeds[16]; + + static const int16 lower = 0; + static const int16 same = 1; + static const int16 higher = 2; + + static const char keys[]; + static const uint16 notes[12]; + + static const tunetype tune; /* special run-time errors */ - const int16 runerr_getset_overflow = 50; + static const int16 runerr_getset_overflow = 50; + + static const byte static_const_whereis[29]; + - ///////////////////////////// VARIABLES ///////////////////////////// - byte interrogation = 0; + + + byte interrogation; /* If this is greater than zero, the next line you type is stored in - the DNA in a position dictated by the value. If a scroll comes up, - or you leave the room, it's automatically set to zero. */ - - byte whereis[29] = { - /* The Lads */ - r__yours, /* Avvy */ - r__spludwicks, /* Spludwick */ - r__outsideyours, /* Crapulus */ - r__ducks, /* Duck - r__DucksRoom's not defined yet. */ - r__argentpub, /* Malagauche */ - r__robins, /* Friar Tuck. */ - 177, /* Robin Hood - can't meet him at the start. */ - r__brummieroad, /* Cwytalot */ - r__lustiesroom, /* Baron du Lustie. */ - r__outsidecardiffcastle, /* The Duke of Cardiff. */ - r__argentpub, /* Dogfood */ - r__outsideducks, /* Trader */ - r__argentpub, /* Ibythneth */ - r__aylesoffice, /* Ayles */ - r__nottspub, /* Port */ - r__nottspub, /* Spurge */ - r__musicroom, /* Jacques */ - 0, 0, 0, 0, 0, 0, 0, 0, - /* The Lasses */ - r__yours, /* Arkata */ - r__geidas, /* Geida */ - 177, /* nobody allocated here! */ - r__wisewomans - }; /* The Wise Woman. */ - - bool oncandopageswap = true; - /* Variable constant for overriding the ability of On to switch pages. - * You may know better than On which page to switch to. */ + the DNA in a position dictated by the value. If a scroll comes up, + or you leave the room, it's automatically set to zero. */ + + byte whereis[29]; + + bool oncandopageswap; + /* Variable static constant for overriding the ability of On to switch pages. + * You may know better than On which page to switch to. */ @@ -757,8 +615,9 @@ namespace Avalanche { bool use_joy_a; + Gyro(); - ///////////////////////////// FUNCTIONS ///////////////////////////// + void Gyro::setParent(AvalancheEngine *vm); void newpointer(byte m); @@ -830,9 +689,24 @@ namespace Avalanche { bool mouse_near_text(); +private: + AvalancheEngine *_vm; + + static const Common::String things[numobjs]; + + static const char thingchar[]; + + static const Common::String better[numobjs]; + + static const char betterchar[]; + + void shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc); + + void setminmaxhorzcurspos(uint16 min, uint16 max); + void setminmaxvertcurspos(uint16 min, uint16 max); - } // End of namespace Gyro +}; } // End of namespace Avalanche -- cgit v1.2.3