aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/cge/cge_main.cpp25
-rw-r--r--engines/cge/cge_main.h3
-rw-r--r--engines/cge/general.cpp2
-rw-r--r--engines/cge/gettext.cpp2
-rw-r--r--engines/cge/mixer.cpp13
-rw-r--r--engines/cge/snail.cpp10
-rw-r--r--engines/cge/snddrv.h36
-rw-r--r--engines/cge/sound.h4
-rw-r--r--engines/cge/talk.cpp13
-rw-r--r--engines/cge/talk.h17
-rw-r--r--engines/cge/text.cpp4
-rw-r--r--engines/cge/vga13h.cpp5
-rw-r--r--engines/cge/vga13h.h10
-rw-r--r--engines/cge/vmenu.cpp2
-rw-r--r--engines/cge/vol.h2
-rw-r--r--engines/cge/walk.cpp42
-rw-r--r--engines/cge/walk.h6
17 files changed, 64 insertions, 132 deletions
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index b6f342edff..98de57597d 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -317,8 +317,11 @@ void CGEEngine::syncGame(Common::SeekableReadStream *readStream, Common::WriteSt
_pocref[i] = (s) ? s->_ref : -1;
}
- _volume[0] = _sndDrvInfo.Vol2._d;
- _volume[1] = _sndDrvInfo.Vol2._m;
+ warning("STUB: CGEEngine::syncGame Digital and Midi volume");
+// _volume[0] = _sndDrvInfo.Vol2._d;
+// _volume[1] = _sndDrvInfo.Vol2._m;
+ _volume[0] = 0;
+ _volume[1] = 0;
}
// Synchronise header data
@@ -336,8 +339,9 @@ void CGEEngine::syncGame(Common::SeekableReadStream *readStream, Common::WriteSt
_music = false;
if (Startup::_soundOk == 1 && Startup::_mode == 0) {
- _sndDrvInfo.Vol2._d = _volume[0];
- _sndDrvInfo.Vol2._m = _volume[1];
+// _sndDrvInfo.Vol2._d = _volume[0];
+// _sndDrvInfo.Vol2._m = _volume[1];
+ warning("STUB: CGEEngine::syncGame Digital and Midi volume");
sndSetVolume();
}
@@ -587,12 +591,11 @@ void CGEEngine::caveUp() {
}
spr = n;
}
- if (_sndDrvInfo._dDev) {
- _sound.stop();
- _fx.clear();
- _fx.preload(0);
- _fx.preload(BakRef);
- }
+
+ _sound.stop();
+ _fx.clear();
+ _fx.preload(0);
+ _fx.preload(BakRef);
if (_hero) {
_hero->gotoxy(_heroXY[_now - 1]._x, _heroXY[_now - 1]._y);
@@ -1265,7 +1268,7 @@ void CGEEngine::loadSprite(const char *fname, int ref, int cav, int col = 0, int
break;
}
case 2 : { // WALK
- WALK *w = new WALK(this, NULL);
+ Walk *w = new Walk(this, NULL);
if (w && ref == 1) {
w->gotoxy(col, row);
if (_hero)
diff --git a/engines/cge/cge_main.h b/engines/cge/cge_main.h
index 2a467761b3..8586d84d50 100644
--- a/engines/cge/cge_main.h
+++ b/engines/cge/cge_main.h
@@ -72,6 +72,9 @@ namespace CGE {
#define kGetNamePrompt 50
#define kGetNameTitle 51
#define kTSeq 96
+//Useless?
+//#define kBadSnd 97
+//#define kBadMidi 98
#define kNoMusic 98
#define kBadSVG 99
#define kSeqHTalk (kTSeq + 4)
diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp
index 909c517c32..46df263b93 100644
--- a/engines/cge/general.cpp
+++ b/engines/cge/general.cpp
@@ -93,8 +93,6 @@ Dac _stdPal[] = {// R G B
{ 255, 255, 255}, // 255
};
-DrvInfo _sndDrvInfo;
-
void _fqsort(void *base, uint16 nelem, uint16 width, int (*fcmp)(const void *, const void *)) {
warning("STUB: _fqsort");
}
diff --git a/engines/cge/gettext.cpp b/engines/cge/gettext.cpp
index 7a8cff3cb2..fa30b3a9d1 100644
--- a/engines/cge/gettext.cpp
+++ b/engines/cge/gettext.cpp
@@ -39,7 +39,7 @@ GetText::GetText(CGEEngine *vm, const char *info, char *text, int size)
_cntr(kGetTextBlink), _oldKeybClient(_keyboard->setClient(this)), _vm(vm) {
int i = 2 * kTextHMargin + _font->width(info);
_ptr = this;
- _mode = RECT;
+ _mode = kTBRect;
_ts = new BMP_PTR[2];
_ts[0] = box((i + 3) & ~3, 2 * kTextVMargin + 2 * kFontHigh + kTextLineSpace);
diff --git a/engines/cge/mixer.cpp b/engines/cge/mixer.cpp
index aeaaa86593..36f7a8e2f7 100644
--- a/engines/cge/mixer.cpp
+++ b/engines/cge/mixer.cpp
@@ -86,12 +86,14 @@ Mixer::Mixer(CGEEngine *vm, int x, int y) : Sprite(vm, NULL), _fall(kMixFall), _
_vga->_showQ->insert(_led[i]);
//--- reset balance
- i = (_sndDrvInfo.Vol4._ml + _sndDrvInfo.Vol4._mr) / 2;
+ warning("STUB: MIXER::MIXER() reset balance of digital and midi volumes");
+/* i = (_sndDrvInfo.Vol4._ml + _sndDrvInfo.Vol4._mr) / 2;
_sndDrvInfo.Vol4._ml = i;
_sndDrvInfo.Vol4._mr = i;
i = (_sndDrvInfo.Vol4._dl + _sndDrvInfo.Vol4._dr) / 2;
_sndDrvInfo.Vol4._dl = i;
_sndDrvInfo.Vol4._dr = i;
+*/
update();
_time = kMixDelay;
}
@@ -104,8 +106,10 @@ Mixer::~Mixer() {
#pragma argsused
void Mixer::touch(uint16 mask, int x, int y) {
Sprite::touch(mask, x, y);
+
if (mask & L_UP) {
- uint8 *vol = (&_sndDrvInfo.Vol2._d) + (x < _w / 2);
+ warning("STUB: Mixer::touch(): Digital Volume");
+/* uint8 *vol = (&_sndDrvInfo.Vol2._d) + (x < _w / 2);
if (y < kMixButtonHigh) {
if (*vol < 0xFF)
*vol += 0x11;
@@ -114,6 +118,7 @@ void Mixer::touch(uint16 mask, int x, int y) {
*vol -= 0x11;
}
update();
+*/
}
}
@@ -139,9 +144,11 @@ void Mixer::tick() {
void Mixer::update() {
+ warning("STUB: Mixer::Update");
+/*
_led[0]->step(_sndDrvInfo.Vol4._ml);
_led[1]->step(_sndDrvInfo.Vol4._dl);
-
+*/
_snail_->addCom2(kSnExec, -1, 0, kSndSetVolume);
}
diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp
index d2ed77d755..697e70bf8e 100644
--- a/engines/cge/snail.cpp
+++ b/engines/cge/snail.cpp
@@ -797,12 +797,10 @@ void CGEEngine::snKill(Sprite *spr) {
void CGEEngine::snSound(Sprite *spr, int wav, int cnt) {
debugC(1, kCGEDebugEngine, "CGEEngine::snSound(spr, %d, %d)", wav, cnt);
- if (_sndDrvInfo._dDev) {
- if (wav == -1)
- _sound.stop();
- else
- _sound.play(_fx[wav], (spr) ? ((spr->_x + spr->_w / 2) / (kScrWidth / 16)) : 8, cnt);
- }
+ if (wav == -1)
+ _sound.stop();
+ else
+ _sound.play(_fx[wav], (spr) ? ((spr->_x + spr->_w / 2) / (kScrWidth / 16)) : 8, cnt);
}
diff --git a/engines/cge/snddrv.h b/engines/cge/snddrv.h
index 0ea776b784..07c4ccd0dd 100644
--- a/engines/cge/snddrv.h
+++ b/engines/cge/snddrv.h
@@ -42,40 +42,6 @@ namespace CGE {
// ******************************************************
// * Constants *
// ******************************************************
-// available devices
-
-enum DEV_TYPE { DEV_AUTO = -1, // auto-detect mode
- DEV_QUIET, // disable sound
- DEV_SB, // sb/pro/16/awe32
- DEV_GUS, // gus/max
- DEV_GM // general midi
- };
-
-#define SERR_OK 0 // no error
-#define SERR_INITFAIL 1 // couldn't initialize
-#define SERR_BADDDEV 128 // bad device
-
-// driver info
-struct DrvInfo {
- DEV_TYPE _dDev; // digi device
- DEV_TYPE _mDev; // midi device
- uint16 _dBase; // digi base port
- uint16 _dDma; // digi dma no
- uint16 _dIrq; // digi irq no
- uint16 _mBase; // midi base port
- union {
- struct {
- uint16 _dr : 4;
- uint16 _dl : 4;
- uint16 _mr : 4;
- uint16 _ml : 4;
- } Vol4;
- struct {
- uint8 _d; // digi volume
- uint8 _m; // midi volume
- } Vol2;
- };
-};
// sample info
struct SmpInfo {
@@ -88,8 +54,6 @@ struct SmpInfo {
// ******************************************************
// * Data *
// ******************************************************
-// driver info
-extern DrvInfo _sndDrvInfo;
// midi player flag (1 means we are playing)
extern uint16 _midiPlayFlag;
diff --git a/engines/cge/sound.h b/engines/cge/sound.h
index fda8d4f128..5e1af71307 100644
--- a/engines/cge/sound.h
+++ b/engines/cge/sound.h
@@ -33,10 +33,6 @@
namespace CGE {
-#define BAD_SND_TEXT 97
-#define BAD_MIDI_TEXT 98
-
-
class Sound {
public:
SmpInfo _smpinf;
diff --git a/engines/cge/talk.cpp b/engines/cge/talk.cpp
index a164a69f99..4e367e3318 100644
--- a/engines/cge/talk.cpp
+++ b/engines/cge/talk.cpp
@@ -87,7 +87,7 @@ void Font::save() {
*/
-Talk::Talk(CGEEngine *vm, const char *tx, TBOX_STYLE mode)
+Talk::Talk(CGEEngine *vm, const char *tx, TextBoxStyle mode)
: Sprite(vm, NULL), _mode(mode), _vm(vm) {
_ts = NULL;
@@ -97,7 +97,7 @@ Talk::Talk(CGEEngine *vm, const char *tx, TBOX_STYLE mode)
Talk::Talk(CGEEngine *vm)
- : Sprite(vm, NULL), _mode(PURE), _vm(vm) {
+ : Sprite(vm, NULL), _mode(kTBPure), _vm(vm) {
_ts = NULL;
_flags._syst = true;
}
@@ -179,20 +179,17 @@ void Talk::update(const char *tx) {
setShapeList(_ts);
}
-
-
-
Bitmap *Talk::box(uint16 w, uint16 h) {
uint8 *b, * p, * q;
- uint16 n, r = (_mode == ROUND) ? kTextRoundCorner : 0;
+ uint16 r = (_mode == kTBRound) ? kTextRoundCorner : 0;
if (w < 8)
w = 8;
if (h < 8)
h = 8;
- n = w * h;
+ uint16 n = w * h;
b = (uint8 *) malloc(sizeof(uint8) * n);
- if (! b)
+ if (!b)
error("No core");
memset(b, kTextColBG, n);
diff --git a/engines/cge/talk.h b/engines/cge/talk.h
index 5eab6672e3..d9c29261f6 100644
--- a/engines/cge/talk.h
+++ b/engines/cge/talk.h
@@ -46,18 +46,14 @@ namespace CGE {
#define kFontHigh 8
#define kFontExt ".CFT"
-
-
-
#define kPathMax 128
+enum TextBoxStyle { kTBPure, kTBRect, kTBRound };
+
class Font {
char _path[kPathMax];
void load();
public:
-// static uint8 _wid[256];
-// static uint16 _pos[256];
-// static uint8 _map[256*8];
uint8 *_wid;
uint16 *_pos;
uint8 *_map;
@@ -67,17 +63,13 @@ public:
void save();
};
-
-enum TBOX_STYLE { PURE, RECT, ROUND };
-
-
class Talk : public Sprite {
protected:
- TBOX_STYLE _mode;
+ TextBoxStyle _mode;
BMP_PTR *_ts;
Bitmap *box(uint16 w, uint16 h);
public:
- Talk(CGEEngine *vm, const char *tx, TBOX_STYLE mode);
+ Talk(CGEEngine *vm, const char *tx, TextBoxStyle mode);
Talk(CGEEngine *vm);
//~TALK();
@@ -92,7 +84,6 @@ private:
CGEEngine *_vm;
};
-
class InfoLine : public Talk {
const char *_oldTxt;
public:
diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp
index edf7931278..f688546810 100644
--- a/engines/cge/text.cpp
+++ b/engines/cge/text.cpp
@@ -178,7 +178,7 @@ char *Text::getText(int ref) {
void Text::say(const char *txt, Sprite *spr) {
killText();
- _talk = new Talk(_vm, txt, ROUND);
+ _talk = new Talk(_vm, txt, kTBRound);
if (_talk) {
bool east = spr->_flags._east;
int x = (east) ? (spr->_x + spr->_w - 2) : (spr->_x + 2);
@@ -221,7 +221,7 @@ void CGEEngine::inf(const char *txt) {
debugC(1, kCGEDebugEngine, "CGEEngine::inf(%s)", txt);
killText();
- _talk = new Talk(this, txt, RECT);
+ _talk = new Talk(this, txt, kTBRect);
if (_talk) {
_talk->_flags._kill = true;
_talk->_flags._bDel = true;
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index 94a4963a5e..f5a3fdd22f 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -37,11 +37,6 @@
namespace CGE {
-#define FADE_STEP 2
-#define TMR_DIV ((0x8000/TMR_RATE)*2)
-#define NREP 9
-#define FREP 24
-
static VgaRegBlk VideoMode[] = {
{ 0x04, VGASEQ, 0x08, 0x04 }, // memory mode
{ 0x03, VGAGRA, 0xFF, 0x00 }, // data rotate = 0
diff --git a/engines/cge/vga13h.h b/engines/cge/vga13h.h
index 4884ae104e..f192d962ff 100644
--- a/engines/cge/vga13h.h
+++ b/engines/cge/vga13h.h
@@ -37,6 +37,11 @@
namespace CGE {
+#define FADE_STEP 2
+#define TMR_DIV ((0x8000/TMR_RATE)*2)
+#define NREP 9
+#define FREP 24
+
#define TMR_RATE1 16
#define TMR_RATE2 4
#define TMR_RATE (TMR_RATE1 * TMR_RATE2)
@@ -60,11 +65,6 @@ namespace CGE {
#define SPR_EXT ".SPR"
-#define IsFile(s) (access(s, 0) == 0)
-#define IsWrit(s) (access(s, 2) == 0)
-
-
-
struct Rgb {
uint16 _r : 2;
uint16 _R : 6;
diff --git a/engines/cge/vmenu.cpp b/engines/cge/vmenu.cpp
index 2c22625ae3..f846b3d061 100644
--- a/engines/cge/vmenu.cpp
+++ b/engines/cge/vmenu.cpp
@@ -90,7 +90,7 @@ int Vmenu::_recent = -1;
Vmenu::Vmenu(CGEEngine *vm, Choice *list, int x, int y)
- : Talk(vm, VMGather(list), RECT), _menu(list), _bar(NULL), _vm(vm) {
+ : Talk(vm, VMGather(list), kTBRect), _menu(list), _bar(NULL), _vm(vm) {
Choice *cp;
_addr = this;
diff --git a/engines/cge/vol.h b/engines/cge/vol.h
index e975cc34e6..f64e7eec54 100644
--- a/engines/cge/vol.h
+++ b/engines/cge/vol.h
@@ -36,9 +36,7 @@ namespace CGE {
#define CAT_NAME "VOL.CAT"
#define DAT_NAME "VOL.DAT"
-#ifndef CRP
#define CRP XCrypt
-#endif
#define XMASK 0xA5
diff --git a/engines/cge/walk.cpp b/engines/cge/walk.cpp
index f9c542ec92..9bcc2be23d 100644
--- a/engines/cge/walk.cpp
+++ b/engines/cge/walk.cpp
@@ -25,32 +25,14 @@
* Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon
*/
-#include "common/scummsys.h"
#include "cge/walk.h"
-#include "cge/cge.h"
-#include "cge/sound.h"
-#include "cge/startup.h"
-#include "cge/config.h"
-#include "cge/vga13h.h"
-#include "cge/snail.h"
-#include "cge/text.h"
-#include "cge/game.h"
-#include "cge/events.h"
-#include "cge/cfile.h"
-#include "cge/vol.h"
-#include "cge/talk.h"
-#include "cge/vmenu.h"
-#include "cge/gettext.h"
-#include "cge/mixer.h"
#include "cge/cge_main.h"
-#include "cge/cge.h"
-#include "common/str.h"
namespace CGE {
extern Bar _barriers[];
-WALK *_hero;
+Walk *_hero;
uint8 Cluster::_map[MAP_ZCNT][MAP_XCNT];
CGEEngine *Cluster::_vm;
@@ -89,12 +71,12 @@ Cluster XZ(Couple xy) {
return XZ(x, y);
}
-WALK::WALK(CGEEngine *vm, BMP_PTR *shpl)
+Walk::Walk(CGEEngine *vm, BMP_PTR *shpl)
: Sprite(vm, shpl), Dir(NO_DIR), _tracePtr(-1), _level(0), _vm(vm) {
}
-void WALK::tick() {
+void Walk::tick() {
if (_flags._hide)
return;
@@ -141,7 +123,7 @@ void WALK::tick() {
}
-int WALK::distance(Sprite *spr) {
+int Walk::distance(Sprite *spr) {
int dx, dz;
dx = spr->_x - (_x + _w - kWalkSide);
if (dx < 0)
@@ -163,7 +145,7 @@ int WALK::distance(Sprite *spr) {
}
-void WALK::turn(DIR d) {
+void Walk::turn(DIR d) {
DIR dir = (Dir == NO_DIR) ? SS : Dir;
if (d != Dir) {
step((d == dir) ? (1 + dir + dir) : (9 + 4 * dir + d));
@@ -172,7 +154,7 @@ void WALK::turn(DIR d) {
}
-void WALK::park() {
+void Walk::park() {
if (_time == 0)
++_time;
@@ -184,7 +166,7 @@ void WALK::park() {
}
-void WALK::findWay(Cluster c) {
+void Walk::findWay(Cluster c) {
if (c != _here) {
for (_findLevel = 1; _findLevel <= MAX_FIND_LEVEL; _findLevel++) {
signed char x, z;
@@ -203,7 +185,7 @@ void WALK::findWay(Cluster c) {
}
-void WALK::findWay(Sprite *spr) {
+void Walk::findWay(Sprite *spr) {
if (spr && spr != this) {
int x = spr->_x;
int z = spr->_z;
@@ -218,12 +200,12 @@ void WALK::findWay(Sprite *spr) {
}
-bool WALK::lower(Sprite *spr) {
+bool Walk::lower(Sprite *spr) {
return (spr->_y > _y + (_h * 3) / 5);
}
-void WALK::reach(Sprite *spr, int mode) {
+void Walk::reach(Sprite *spr, int mode) {
if (spr) {
_hero->findWay(spr);
if (mode < 0) {
@@ -243,11 +225,11 @@ void WALK::reach(Sprite *spr, int mode) {
// now it is just at sprite appear (disappear) point
}
-void WALK::noWay() {
+void Walk::noWay() {
_vm->trouble(kSeqNoWay, kNoWay);
}
-bool WALK::find1Way(Cluster c) {
+bool Walk::find1Way(Cluster c) {
Cluster start = c;
const Cluster tab[4] = { Cluster(-1, 0), Cluster(1, 0), Cluster(0, -1), Cluster(0, 1)};
const int tabLen = 4;
diff --git a/engines/cge/walk.h b/engines/cge/walk.h
index 52f372c363..15ea9ee0ce 100644
--- a/engines/cge/walk.h
+++ b/engines/cge/walk.h
@@ -97,7 +97,7 @@ public:
};
-class WALK : public Sprite {
+class Walk : public Sprite {
private:
CGEEngine *_vm;
public:
@@ -109,7 +109,7 @@ public:
Cluster _trace[MAX_FIND_LEVEL];
enum DIR { NO_DIR = -1, NN, EE, SS, WW } Dir;
- WALK(CGEEngine *vm, BMP_PTR *shpl);
+ Walk(CGEEngine *vm, BMP_PTR *shpl);
void tick();
void findWay(Cluster c);
void findWay(Sprite *spr);
@@ -126,7 +126,7 @@ public:
Cluster XZ(int x, int y);
Cluster XZ(Couple xy);
-extern WALK *_hero;
+extern Walk *_hero;
} // End of namespace CGE