2003-03-05 19:04:34 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2003 The ScummVM project
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SKYMAIN_H
|
|
|
|
#define SKYMAIN_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "common/engine.h"
|
|
|
|
#include "common/util.h"
|
2003-03-11 18:32:58 +00:00
|
|
|
#include "common/timer.h"
|
2003-03-08 12:46:51 +00:00
|
|
|
#include "sound/mixer.h"
|
|
|
|
#include "sky/sound.h"
|
2003-04-07 20:44:52 +00:00
|
|
|
#include "sky/text.h"
|
|
|
|
#include "sky/disk.h"
|
2003-04-25 15:17:53 +00:00
|
|
|
#include "sky/struc.h"
|
2003-05-14 22:33:39 +00:00
|
|
|
#include "sky/screen.h"
|
2003-05-28 23:31:43 +00:00
|
|
|
#include "sky/music/musicbase.h"
|
|
|
|
#include "sky/music/adlibmusic.h"
|
|
|
|
#include "sky/music/gmmusic.h"
|
|
|
|
#include "sky/music/mt32music.h"
|
2003-05-05 13:19:59 +00:00
|
|
|
#include "sky/mouse.h"
|
2003-06-22 21:42:59 +00:00
|
|
|
#include "sky/control.h"
|
|
|
|
#include "common/config-file.h"
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2003-06-01 21:21:10 +00:00
|
|
|
struct SystemVars {
|
|
|
|
uint32 systemFlags;
|
|
|
|
uint32 gameVersion;
|
|
|
|
uint32 mouseFlag;
|
|
|
|
uint16 language;
|
2003-06-02 06:42:42 +00:00
|
|
|
uint32 currentPalette; // I guess that's for saving.
|
2003-06-01 21:21:10 +00:00
|
|
|
/* uint16 sfxVolume;
|
|
|
|
uint16 musicVolume;
|
|
|
|
uint16 gameSpeed; */
|
|
|
|
};
|
|
|
|
|
2003-04-25 15:17:53 +00:00
|
|
|
class SkyLogic;
|
2003-05-14 22:33:39 +00:00
|
|
|
class SkyScreen;
|
2003-06-22 21:42:59 +00:00
|
|
|
class SkyControl;
|
2003-04-25 15:17:53 +00:00
|
|
|
|
2003-03-05 19:04:34 +00:00
|
|
|
class SkyState : public Engine {
|
2003-03-07 15:38:11 +00:00
|
|
|
void errorString(const char *buf_input, char *buf_output);
|
2003-03-06 02:33:49 +00:00
|
|
|
protected:
|
2003-03-05 19:04:34 +00:00
|
|
|
byte _game;
|
|
|
|
byte _key_pressed;
|
|
|
|
|
2003-04-28 14:47:39 +00:00
|
|
|
//intro related
|
2003-05-14 22:33:39 +00:00
|
|
|
|
2003-04-28 14:47:39 +00:00
|
|
|
byte *_introTextSpace;
|
|
|
|
byte *_introTextSave;
|
|
|
|
|
2003-03-05 19:04:34 +00:00
|
|
|
uint16 _debugMode;
|
|
|
|
uint16 _debugLevel;
|
|
|
|
|
2003-03-07 14:52:24 +00:00
|
|
|
int _numScreenUpdates;
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2003-03-11 18:32:58 +00:00
|
|
|
Timer *_timer;
|
2003-03-05 19:04:34 +00:00
|
|
|
|
|
|
|
FILE *_dump_file;
|
|
|
|
|
|
|
|
int _number_of_savegames;
|
|
|
|
|
|
|
|
int _sdl_mouse_x, _sdl_mouse_y;
|
2003-03-08 12:46:51 +00:00
|
|
|
|
2003-04-29 20:13:00 +00:00
|
|
|
SkySound *_skySound;
|
2003-04-07 20:44:52 +00:00
|
|
|
SkyDisk *_skyDisk;
|
2003-04-25 15:17:53 +00:00
|
|
|
SkyText *_skyText;
|
|
|
|
SkyLogic *_skyLogic;
|
2003-05-05 13:19:59 +00:00
|
|
|
SkyMouse *_skyMouse;
|
2003-05-14 22:33:39 +00:00
|
|
|
SkyScreen *_skyScreen;
|
2003-06-22 21:42:59 +00:00
|
|
|
SkyControl *_skyControl;
|
2003-05-03 02:59:45 +00:00
|
|
|
|
|
|
|
SkyMusicBase *_skyMusic;
|
|
|
|
GameDetector *_detector; // necessary for music
|
2003-03-05 19:04:34 +00:00
|
|
|
|
2003-03-06 02:33:49 +00:00
|
|
|
public:
|
2003-03-05 19:04:34 +00:00
|
|
|
SkyState(GameDetector *detector, OSystem *syst);
|
|
|
|
virtual ~SkyState();
|
|
|
|
|
2003-06-01 21:21:10 +00:00
|
|
|
static bool isDemo(void);
|
|
|
|
static bool isCDVersion(void);
|
2003-04-25 15:17:53 +00:00
|
|
|
|
|
|
|
static Compact *fetchCompact(uint32 a);
|
2003-05-27 16:42:20 +00:00
|
|
|
static void **fetchItem(uint32 num);
|
2003-04-07 20:44:52 +00:00
|
|
|
|
2003-04-25 15:17:53 +00:00
|
|
|
static void **_itemList[300];
|
|
|
|
|
2003-06-01 21:21:10 +00:00
|
|
|
static SystemVars _systemVars;
|
|
|
|
|
2003-04-28 14:47:39 +00:00
|
|
|
//intro related
|
|
|
|
void prepareText(uint32 *&cmdPtr);
|
|
|
|
void showIntroText(uint32 *&cmdPtr);
|
|
|
|
void removeText(uint32 *&cmdPtr);
|
|
|
|
void introFx(uint32 *&cmdPtr);
|
|
|
|
void introVol(uint32 *&cmdPtr);
|
|
|
|
|
|
|
|
|
2003-03-06 02:33:49 +00:00
|
|
|
protected:
|
2003-04-25 15:17:53 +00:00
|
|
|
void logic_engine();
|
2003-03-05 19:04:34 +00:00
|
|
|
void delay(uint amount);
|
|
|
|
void go();
|
|
|
|
|
2003-04-28 14:47:39 +00:00
|
|
|
//intro related
|
2003-05-29 22:26:45 +00:00
|
|
|
static uint8 fosterImg[297 * 143];
|
|
|
|
static uint8 fosterPal[256 * 3];
|
2003-04-28 14:47:39 +00:00
|
|
|
void checkCommands(uint32 *&cmdPtr);
|
2003-05-14 22:33:39 +00:00
|
|
|
void introFrame(uint8 **diffPtr, uint8 **vgaPtr, uint8 *screenData);
|
2003-06-01 22:53:44 +00:00
|
|
|
void escDelay(uint32 pDelay);
|
2003-04-28 14:47:39 +00:00
|
|
|
|
2003-04-07 20:44:52 +00:00
|
|
|
SkyText *getSkyText();
|
2003-03-05 19:04:34 +00:00
|
|
|
void initialise();
|
2003-04-05 18:01:29 +00:00
|
|
|
void initItemList();
|
2003-05-14 22:33:39 +00:00
|
|
|
|
2003-03-07 14:52:24 +00:00
|
|
|
void initVirgin();
|
2003-03-08 12:46:51 +00:00
|
|
|
void intro();
|
|
|
|
void doCDIntro();
|
2003-03-11 18:32:58 +00:00
|
|
|
void startTimerSequence(byte *sequence);
|
|
|
|
static void timerHandler(void *ptr);
|
2003-05-14 22:33:39 +00:00
|
|
|
void gotTimerTick();
|
2003-05-01 14:10:42 +00:00
|
|
|
void loadFixedItems();
|
|
|
|
void loadBase0();
|
2003-03-11 18:32:58 +00:00
|
|
|
|
2003-03-05 19:04:34 +00:00
|
|
|
static int CDECL game_thread_proc(void *param);
|
|
|
|
|
|
|
|
void shutdown();
|
2003-03-06 07:52:40 +00:00
|
|
|
|
2003-05-27 16:42:20 +00:00
|
|
|
void showQuitMsg(void);
|
2003-03-05 19:04:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|