Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,287 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ALG_GAME_BOUNTYHUNTER_H
#define ALG_GAME_BOUNTYHUNTER_H
#include "common/hashmap.h"
#include "common/rect.h"
#include "gui/debugger.h"
#include "alg/game.h"
#include "alg/scene.h"
namespace Alg {
typedef Common::Functor1Mem<Scene *, void, GameBountyHunter> BHScriptFunctionScene;
typedef Common::Functor1Mem<Rect *, void, GameBountyHunter> BHScriptFunctionRect;
typedef Common::Functor1Mem<Common::Point *, void, GameJohnnyRock> BHScriptFunctionPoint;
typedef Common::HashMap<Common::String, BHScriptFunctionScene *> BHScriptFunctionSceneMap;
typedef Common::HashMap<Common::String, BHScriptFunctionRect *> BHScriptFunctionRectMap;
typedef Common::HashMap<Common::String, BHScriptFunctionPoint *> BHScriptFunctionPointMap;
class GameBountyHunter : public Game {
enum SceneFuncType {
PREOP = 1,
SHOWMSG = 2,
INSOP = 3,
WEPDWN = 4,
SCNSCR = 5,
NXTFRM = 6,
NXTSCN = 7
};
public:
GameBountyHunter(AlgEngine *vm, const AlgGameDescription *gd);
~GameBountyHunter() override;
Common::Error run() override;
void debugWarpTo(int val);
private:
void init() override;
void registerScriptFunctions();
void verifyScriptFunctions();
BHScriptFunctionRect getScriptFunctionRectHit(Common::String name);
BHScriptFunctionScene getScriptFunctionScene(SceneFuncType type, Common::String name);
void callScriptFunctionRectHit(Common::String name, Rect *rect);
void callScriptFunctionScene(SceneFuncType type, Common::String name, Scene *scene);
BHScriptFunctionRectMap _rectHitFuncs;
BHScriptFunctionSceneMap _scenePreOps;
BHScriptFunctionSceneMap _sceneShowMsg;
BHScriptFunctionSceneMap _sceneInsOps;
BHScriptFunctionSceneMap _sceneWepDwn;
BHScriptFunctionSceneMap _sceneScnScr;
BHScriptFunctionSceneMap _sceneNxtFrm;
BHScriptFunctionSceneMap _sceneNxtScn;
// images
Graphics::Surface *_shotIcon;
Graphics::Surface *_emptyIcon;
Graphics::Surface *_liveIcon;
Graphics::Surface *_deadIcon;
Graphics::Surface *_diffIcon;
Graphics::Surface *_bulletholeIcon;
Graphics::Surface *_playersIcon1;
Graphics::Surface *_playersIcon2;
Graphics::Surface *_textScoreIcon;
Graphics::Surface *_textMenuIcon;
Graphics::Surface *_textBlackBarIcon;
Common::Array<Graphics::Surface *> *_bagsIcons;
Common::Array<Graphics::Surface *> *_shotgun;
// sounds
Audio::SeekableAudioStream *_shotgunSound = nullptr;
// constants
uint16 _randomHarry1[7] = {0x01B9, 0x01B7, 0x01B5, 0x01B3, 0x01AF, 0x01AD, 0};
uint16 _randomHarry2[6] = {0x0194, 0x0190, 0x018E, 0x018C, 0};
uint16 _randomDan1[5] = {0x0173, 0x0171, 0x016F, 0x016D, 0};
uint16 _randomDan1TwoPlayer[6] = {0x0173, 0x0171, 0x016F, 0x016D, 0x016B, 0};
uint16 _randomDan2[7] = {0x0165, 0x0163, 0x0161, 0x015F, 0x015D, 0x015B, 0};
uint16 _randomLoco1[4] = {0xF7, 0xF5, 0xF3, 0};
uint16 _randomLoco2[3] = {0xED, 0xEB, 0};
uint16 _randomKid1[4] = {0xBA, 0xB7, 0xB5, 0};
uint16 _randomKid2[4] = {0xB1, 0xAE, 0xAC, 0};
uint16 *_randomScenes[8] = {_randomHarry1, _randomHarry2, _randomDan1, _randomDan2, _randomLoco1, _randomLoco2, _randomKid1, _randomKid2};
const uint8 _randomScenesPicks[8] = {6, 6, 4, 7, 3, 2, 5, 5};
const uint8 _subLevelOrder[96] = {0, 1, 2, 4, 0, 0, 0, 1, 3, 4, 0, 0, 0, 2, 3, 4, 0, 0, 0, 1, 2, 3, 4, 0,
0, 1, 2, 4, 0, 0, 0, 1, 3, 4, 0, 0, 0, 2, 3, 4, 0, 0, 0, 1, 2, 3, 4, 0,
0, 1, 3, 4, 0, 0, 0, 2, 3, 4, 0, 0, 1, 2, 3, 4, 0, 0, 0, 1, 2, 3, 4, 0,
0, 1, 2, 3, 4, 0, 0, 1, 2, 3, 4, 0, 0, 1, 2, 3, 4, 0, 0, 1, 2, 3, 4, 0};
const uint16 _subLevelSceneIds[20] = {0x01BE, 0x017A, 0x01A2, 0x0198, 0x0183, 0x0178, 0x0167, 0x0159, 0x014B, 0x0147,
0xF1, 0xE1, 0xFF, 0xD8, 0xD0, 0x9B, 0xA8, 0x86, 0xBF, 0x74};
const uint16 _clueLevels[4] = {0x017A, 0x013B, 0xC2, 0x68};
const uint8 _mainLevelMasks[5] = {2, 4, 8, 0x10, 0x80};
const uint8 _gunfightCountDown[15] = {5, 4, 3, 3, 3, 4, 3, 3, 2, 1, 3, 2, 2, 2, 1};
// const uint16 _firstSceneInScenario[4] = {4, 0x36, 0x36, 0x66};
const uint16 _moneyScenes[4] = {0x017D, 0x013C, 0xC3, 0x69};
const uint16 _gunfightScenarios[18] = {0x0116, 0x0118, 0x011B, 0x011D, 0x011F, 0x0121, 0x0123, 0x0125, 0x0127,
0x0129, 0x012B, 0x012D, 0x012F, 0x0131, 0x0133, 0x0135, 0x0137, 0x0139};
const uint16 _innocentScenarios[5] = {0x0110, 0x010F, 0x010C, 0x010B, 0};
const uint16 _deathScenarios[9] = {0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0};
const uint16 _onePlayerOfTwoDead[2] = {0x0109, 0x010A};
const uint16 _allPlayersDead = 0x108;
// gamestate
uint16 _restartScene = 0;
uint8 _numPlayers = 1;
uint8 _player = 0;
uint8 _playerLives[2] = {0, 0};
uint8 _playerGun[2] = {1, 1};
uint8 _playerShots[2] = {0, 0};
uint32 _playerScore[2] = {0, 0};
uint8 _currentLevel = 0;
uint16 _currentSubLevelSceneId = 0;
uint8 _numLevelsDone = 0;
uint8 _levelDoneMask = 0;
uint8 _numSubLevelsDone = 0;
// uint16 _usedScenes = 0;
// int16 _lastPick = -1;
// int16 _initted = 0;
// int16 _sceneCount = 0;
uint16 *_randomSceneList;
uint8 _randomMax = 0;
uint16 _randomMask = 0;
int16 _randomPicked = 0;
uint8 _randomSceneCount = 0;
bool _gunfightInitialized = false;
uint16 _gunfightMask = 0;
int16 _gunfightPicked = 0;
uint8 _gunfightSceneCount = 0;
bool _innocentInitialized = false;
uint16 _innocentMask = 0;
int16 _innocentPicked = 0;
uint8 _innocentSceneCount = 0;
bool _deathInitialized = false;
uint16 _deathMask = 0;
int16 _deathPicked = 0;
uint8 _deathSceneCount = 0;
uint8 _continuesUsed = 0;
bool _wounded = false;
uint16 _mainWounds = 0;
int8 _gunfightCount = 0;
bool _given = false;
uint32 _firstDrawFrame = 0;
uint8 _count = 0;
uint8 _unk_2ADA6 = 0;
// base functions
void newGame();
void doMenu();
void updateCursor();
void updateMouse();
void moveMouse();
void displayLivesLeft(uint8 player);
void displayScores(uint8 player);
void displayShotsLeft(uint8 player);
bool weaponDown();
bool saveState();
bool loadState();
// misc game functions
void setNextScene(uint16 sceneId);
void displayShotFiredImage(Common::Point *point);
void enableVideoFadeIn();
void iconShotgun();
void iconReset();
uint16 beginLevel(uint8 levelNumber);
uint16 pickRandomScene(uint16 *sceneList, uint8 max);
uint16 pickGunfightScene();
uint16 pickInnocentScene();
uint16 pickDeathScene();
uint16 timeForGunfight();
void waitingForShootout(uint32 drawFrame);
void doShotgunSound();
// Script functions: RectHit
void rectShotMenu(Rect *rect);
void rectSave(Rect *rect);
void rectLoad(Rect *rect);
void rectContinue(Rect *rect);
void rectStart(Rect *rect);
void rectTogglePlayers(Rect *rect);
void rectHitIconJug(Rect *rect);
void rectHitIconLantern(Rect *rect);
void rectHitIconSkull(Rect *rect);
void rectHitIconWheel(Rect *rect);
void rectHitSelectHarry(Rect *rect);
void rectHitSelectDan(Rect *rect);
void rectHitSelectLoco(Rect *rect);
void rectHitSelectKid(Rect *rect);
void rectHitKillMan(Rect *rect);
void rectHitGiveShotgun(Rect *rect);
void rectHitKill3(Rect *rect);
void rectHitCheckShotgun(Rect *rect);
void rectHitCheater(Rect *rect);
// Script functions: Scene PreOps
void scenePsoShootout(Scene *scene);
void scenePsoWoundedMain(Scene *scene);
void scenePsoGunfightSetup(Scene *scene);
void scenePsoLoseALife(Scene *scene);
void scenePsoSetupNdRandom1(Scene *scene);
void scenePsoSetCurrentScene(Scene *scene);
// Script functions: Scene InsOps
void sceneIsoShootout(Scene *scene);
void sceneIsoGivemoney(Scene *scene);
// Script functions: Scene NxtScn
void sceneNxtscnLoseALife(Scene *scene);
void sceneNxtscnContinueGame(Scene *scene);
void sceneNxtscnDidNotContinue(Scene *scene);
void sceneNxtscnKillInnocentMan(Scene *scene);
void sceneNxtscnKillInnocentWoman(Scene *scene);
void sceneNxtscnAfterDie(Scene *scene);
void sceneNxtscnGotoLevelSelect(Scene *scene);
void sceneNxtscnContinueRandom(Scene *scene);
void sceneNxtscnInitRandomHarry1(Scene *scene);
void sceneNxtscnInitRandomHarry2(Scene *scene);
void sceneNxtscnInitRandomDan1(Scene *scene);
void sceneNxtscnInitRandomDan2(Scene *scene);
void sceneNxtscnInitRandomLoco1(Scene *scene);
void sceneNxtscnInitRandomLoco2(Scene *scene);
void sceneNxtscnInitRandomKid1(Scene *scene);
void sceneNxtscnInitRandomKid2(Scene *scene);
void sceneNxtscnNextSubLevel(Scene *scene);
void sceneNxtscnGotoBadGuy(Scene *scene);
void sceneNxtscnAutoSelectLevel(Scene *scene);
void sceneNxtscnSelectScenario(Scene *scene);
void sceneNxtscnFinishScenario(Scene *scene);
void sceneNxtscnGameWon(Scene *scene);
void sceneNxtscnKilledMain(Scene *scene);
void sceneNxtscnWoundedMain(Scene *scene);
void sceneNxtscnEndLevel(Scene *scene);
void sceneNxtscnEndGame(Scene *scene);
void sceneNxtscnDoBreakoutMains(Scene *scene);
void sceneNxtscnDiedRefed(Scene *scene);
void sceneNxtscnGiveShotgun(Scene *scene);
void sceneNxtscnCheck2Players(Scene *scene);
// Script functions: Scene WepDwn
void sceneDefaultWepdwn(Scene *scene);
};
class DebuggerBountyHunter : public GUI::Debugger {
public:
DebuggerBountyHunter(GameBountyHunter *game);
bool cmdWarpTo(int argc, const char **argv);
bool cmdDumpLib(int argc, const char **argv);
private:
GameBountyHunter *_game;
};
} // End of namespace Alg
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,279 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ALG_GAME_CRIMEPATROL_H
#define ALG_GAME_CRIMEPATROL_H
#include "common/hashmap.h"
#include "common/rect.h"
#include "gui/debugger.h"
#include "alg/game.h"
#include "alg/scene.h"
namespace Alg {
typedef Common::Functor1Mem<Scene *, void, GameCrimePatrol> CPScriptFunctionScene;
typedef Common::Functor1Mem<Rect *, void, GameCrimePatrol> CPScriptFunctionRect;
typedef Common::HashMap<Common::String, CPScriptFunctionScene *> CPScriptFunctionSceneMap;
typedef Common::HashMap<Common::String, CPScriptFunctionRect *> CPScriptFunctionRectMap;
class GameCrimePatrol : public Game {
enum SceneFuncType {
PREOP = 1,
SHOWMSG = 2,
INSOP = 3,
WEPDWN = 4,
SCNSCR = 5,
NXTFRM = 6,
NXTSCN = 7
};
public:
GameCrimePatrol(AlgEngine *vm, const AlgGameDescription *gd);
~GameCrimePatrol() override;
void init() override;
void debugWarpTo(int val);
private:
Common::Error run() override;
void registerScriptFunctions();
void verifyScriptFunctions();
CPScriptFunctionRect getScriptFunctionRectHit(Common::String name);
CPScriptFunctionScene getScriptFunctionScene(SceneFuncType type, Common::String name);
void callScriptFunctionRectHit(Common::String name, Rect *rect);
void callScriptFunctionScene(SceneFuncType type, Common::String name, Scene *scene);
CPScriptFunctionRectMap _rectHitFuncs;
CPScriptFunctionSceneMap _scenePreOps;
CPScriptFunctionSceneMap _sceneShowMsg;
CPScriptFunctionSceneMap _sceneInsOps;
CPScriptFunctionSceneMap _sceneWepDwn;
CPScriptFunctionSceneMap _sceneScnScr;
CPScriptFunctionSceneMap _sceneNxtFrm;
CPScriptFunctionSceneMap _sceneNxtScn;
// images
Graphics::Surface *_shotIcon;
Graphics::Surface *_emptyIcon;
Graphics::Surface *_liveIcon;
Graphics::Surface *_deadIcon;
Graphics::Surface *_difficultyIcon;
Graphics::Surface *_bulletholeIcon;
// constants
const int16 _scenesLevel0[2] = {0x0191, 0};
const int16 _scenesLevel1[3] = {0x27, 0x01B7, 0};
const int16 _scenesLevel2[4] = {0x33, 0x01C7, 0x01B8, 0};
const int16 _scenesLevel3[3] = {0x48, 0x01C8, 0};
const int16 _scenesLevel4[2] = {0x53, 0};
const int16 _scenesLevel5[2] = {0x60, 0};
const int16 _scenesLevel6[2] = {0x82, 0};
const int16 _scenesLevel7[2] = {0x9B, 0};
const int16 _scenesLevel8[2] = {0xC7, 0};
const int16 _scenesLevel9[2] = {0xB6, 0};
const int16 _scenesLevel10[6] = {0xE0, 0x01BF, 0x01C0, 0x01C1, 0x01C2, 0};
const int16 _scenesLevel11[3] = {0x0136, 0x01C3, 0};
const int16 _scenesLevel12[4] = {0x0119, 0x01C5, 0x0131, 0};
const int16 _scenesLevel13[2] = {0x014C, 0};
const int16 _scenesLevel14[13] = {0x01B1, 0x01B2, 0x01B3, 0x01B4, 0x01B5, 0x01B6, 0};
const int16 _scenesLevel15[5] = {0x3B, 0x3C, 0x3F, 0x41, 0};
const int16 _scenesLevel16[3] = {0x61, 0x65, 0};
const int16 _scenesLevel17[7] = {0x68, 0x6A, 0x6C, 0x6E, 0x70, 0x72, 0};
const int16 _scenesLevel18[8] = {0x83, 0x85, 0x87, 0x8A, 0x8C, 0x8F, 0x90, 0};
const int16 _scenesLevel19[7] = {0x9C, 0x9E, 0xA0, 0xA2, 0xA4, 0xA6, 0};
const int16 _scenesLevel20[5] = {0xC8, 0xCA, 0xCC, 0xCE, 0};
const int16 _scenesLevel21[3] = {0xE8, 0xE9, 0};
const int16 _scenesLevel22[11] = {0xF4, 0xF6, 0xF8, 0xFA, 0xFC, 0xFE, 0x0100, 0x0102, 0x0104, 0x0106, 0};
const int16 _scenesLevel23[3] = {0x010E, 0x0113, 0};
const int16 _scenesLevel24[8] = {0x011D, 0x011F, 0x0121, 0x0123, 0x0125, 0x0127, 0x0129, 0};
const int16 _scenesLevel25[6] = {0x013D, 0x013F, 0x0141, 0x0143, 0x0145, 0};
const int16 _scenesLevel26[10] = {0x0157, 0x0159, 0x015B, 0x015D, 0x015F, 0x0161, 0x0163, 0x0165, 0x0167, 0};
const int16 *_levelScenes[27] = {_scenesLevel0, _scenesLevel1, _scenesLevel2, _scenesLevel3, _scenesLevel4, _scenesLevel5, _scenesLevel6,
_scenesLevel7, _scenesLevel8, _scenesLevel9, _scenesLevel10, _scenesLevel11, _scenesLevel12, _scenesLevel13,
_scenesLevel14, _scenesLevel15, _scenesLevel16, _scenesLevel17, _scenesLevel18, _scenesLevel19, _scenesLevel20,
_scenesLevel21, _scenesLevel22, _scenesLevel23, _scenesLevel24, _scenesLevel25, _scenesLevel26};
const int16 _diedScenesStage0[5] = {0x30, 0x31, 0x47, 0x51, 0};
const int16 _diedScenesStage1[7] = {0x5E, 0x5F, 0x7E, 0x7F, 0x98, 0x99, 0};
const int16 _diedScenesStage2[4] = {0xB2, 0xC5, 0xDB, 0};
const int16 _diedScenesStage3[7] = {0x0115, 0x0116, 0x0135, 0x014A, 0x0175, 0x0190, 0};
const int16 _diedScenesStage4[7] = {0x0115, 0x0116, 0x0135, 0x014A, 0x0175, 0x0190, 0};
const int16 *_diedScenesByStage[5] = {_diedScenesStage0, _diedScenesStage1, _diedScenesStage2, _diedScenesStage3, _diedScenesStage4};
const uint16 _deadScenes[5] = {0x32, 0x80, 0xDC, 0x018D, 0x018D};
const uint16 _stageStartScenes[5] = {0x26, 0x52, 0x9A, 0xDF, 0x014C};
const int16 _practiceTargetLeft[5] = {0xE1, 0x45, 0xA8, 0x73, 0xE1};
const int16 _practiceTargetTop[5] = {0x0A, 0x3E, 0x41, 0x6E, 0x6E};
const int16 _practiceTargetRight[5] = {0x0104, 0x6D, 0xCB, 0x95, 0x0104};
const int16 _practiceTargetBottom[5] = {0x3D, 0x79, 0x7B, 0xA1, 0xA1};
// gamestate
uint16 _gotTo[15] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int8 _stage = 0;
int8 _oldStage = -1;
uint8 _randomSceneCount = 0;
uint8 _randomMax = 0;
uint16 _randomMask = 0;
uint16 _randomPicked = 0;
uint16 _deathMask = 0;
int16 _deathPicked = 0;
uint8 _deathSceneCount = 0;
uint8 _practiceMask = 0;
uint16 _finalStageScene = _stageStartScenes[4];
// base functions
void newGame();
void resetParams();
void doMenu();
void changeDifficulty(uint8 newDifficulty);
void showDifficulty(uint8 newDifficulty, bool updateCursor);
void updateCursor();
void updateMouse();
void moveMouse();
void displayLivesLeft();
void displayScores();
void displayShotsLeft();
bool weaponDown();
bool saveState();
bool loadState();
// misc game functions
void displayShotFiredImage(Common::Point *point);
void enableVideoFadeIn();
uint16 sceneToNumber(Scene *scene);
uint16 pickRandomScene(uint8 index, uint8 max);
uint16 pickDeathScene();
void sceneNxtscnGeneric(uint8 index);
void rectSelectGeneric(uint8 index);
void sceneIsoGotToGeneric(uint8 index, uint16 sceneId);
// Script functions: RectHit
void rectShotMenu(Rect *rect);
void rectSave(Rect *rect);
void rectLoad(Rect *rect);
void rectContinue(Rect *rect);
void rectStart(Rect *rect);
void rectTargetPractice(Rect *rect);
void rectSelectTargetPractice(Rect *rect);
void rectSelectGangFight(Rect *rect);
void rectSelectWarehouse(Rect *rect);
void rectSelectWestcoastSound(Rect *rect);
void rectSelectDrugDeal(Rect *rect);
void rectSelectCarRing(Rect *rect);
void rectSelectBar(Rect *rect);
void rectSelectBank(Rect *rect);
void rectSelectCrackHouse(Rect *rect);
void rectSelectMethLab(Rect *rect);
void rectSelectAirplane(Rect *rect);
void rectSelectNukeTransport(Rect *rect);
void rectSelectAirport(Rect *rect);
void rectKillInnocentMan(Rect *rect);
// Script functions: Scene PreOps
void scenePsoWarehouseGotTo(Scene *scene);
void scenePsoGangFightGotTo(Scene *scene);
void scenePsoWestcoastSoundGotTo(Scene *scene);
void scenePsoDrugDealGotTo(Scene *scene);
void scenePsoCarRingGotTo(Scene *scene);
void scenePsoBankGotTo(Scene *scene);
void scenePsoCrackHouseGotTo(Scene *scene);
void scenePsoMethLabGotTo(Scene *scene);
void scenePsoAirplaneGotTo(Scene *scene);
void scenePsoAirportGotTo(Scene *scene);
void scenePsoNukeTransportGotTo(Scene *scene);
void scenePsoPowerPlantGotTo(Scene *scene);
// Script functions: Scene NxtScn
void sceneNxtscnGameWon(Scene *scene);
void sceneNxtscnLoseALife(Scene *scene);
void sceneNxtscnDidNotContinue(Scene *scene);
void sceneNxtscnKillInnocentMan(Scene *scene);
void sceneNxtscnKillInnocentWoman(Scene *scene);
void sceneNxtscnAfterDie(Scene *scene);
void sceneNxtscnSelectLanguage1(Scene *scene);
void sceneNxtscnSelectLanguage2(Scene *scene);
void sceneNxtscnSelectRookieScenario(Scene *scene);
void sceneNxtscnSelectUndercoverScenario(Scene *scene);
void sceneNxtscnSelectSwatScenario(Scene *scene);
void sceneNxtscnSelectDeltaScenario(Scene *scene);
void sceneNxtscnInitRandomTargetPractice(Scene *scene);
void sceneNxtscnContinueTargetPractice(Scene *scene);
void sceneNxtscnFinishGangFight(Scene *scene);
void sceneNxtscnFinishWestcoastSound(Scene *scene);
void sceneNxtscnFinishWarehouse(Scene *scene);
void sceneNxtscnInitRandomWarehouse(Scene *scene);
void sceneNxtscnContinueWarehouse(Scene *scene);
void sceneNxtscnFinishDrugDeal(Scene *scene);
void sceneNxtscnInitRandomCarRingLeader(Scene *scene);
void sceneNxtscnContinueCarRingLeader1(Scene *scene);
void sceneNxtscnContinueCarRingLeader2(Scene *scene);
void sceneNxtscnInitRandomCarRing(Scene *scene);
void sceneNxtscnContinueCarRing(Scene *scene);
void sceneNxtscnFinishCarRing(Scene *scene);
void sceneNxtscnFinishBar(Scene *scene);
void sceneNxtscnFinishBank(Scene *scene);
void sceneNxtscnFinishCrackHouse(Scene *scene);
void sceneNxtscnFinishMethLab(Scene *scene);
void sceneNxtscnFinishAirplane(Scene *scene);
void sceneNxtscnFinishAirport(Scene *scene);
void sceneNxtscnFinishNukeTransport(Scene *scene);
void sceneNxtscnInitRandomBar(Scene *scene);
void sceneNxtscnContinueBar(Scene *scene);
void sceneNxtscnInitRandomBank(Scene *scene);
void sceneNxtscnContinueBank(Scene *scene);
void sceneNxtscnInitRandomMethLab(Scene *scene);
void sceneNxtscnContinueMethLab(Scene *scene);
void sceneNxtscnPickRandomRapeller(Scene *scene);
void sceneNxtscnInitRandomAirplane(Scene *scene);
void sceneNxtscnContinueAirplane(Scene *scene);
void sceneNxtscnPickRandomAirplaneFront(Scene *scene);
void sceneNxtscnInitRandomAirport(Scene *scene);
void sceneNxtscnContinueAirport(Scene *scene);
void sceneNxtscnInitRandomNukeTransport(Scene *scene);
void sceneNxtscnContinueNukeTransport(Scene *scene);
void sceneNxtscnInitRandomPowerplant(Scene *scene);
void sceneNxtscnContinuePowerplant(Scene *scene);
// Script functions: Scene WepDwn
void sceneDefaultWepdwn(Scene *scene);
void debugDrawPracticeRects();
};
class DebuggerCrimePatrol : public GUI::Debugger {
public:
DebuggerCrimePatrol(GameCrimePatrol *game);
bool cmdWarpTo(int argc, const char **argv);
bool cmdDumpLib(int argc, const char **argv);
private:
GameCrimePatrol *_game;
};
} // End of namespace Alg
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,205 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ALG_GAME_DRUGWARS_H
#define ALG_GAME_DRUGWARS_H
#include "common/hashmap.h"
#include "common/rect.h"
#include "gui/debugger.h"
#include "alg/game.h"
#include "alg/scene.h"
namespace Alg {
typedef Common::Functor1Mem<Scene *, void, GameDrugWars> DWScriptFunctionScene;
typedef Common::Functor1Mem<Rect *, void, GameDrugWars> DWScriptFunctionRect;
typedef Common::HashMap<Common::String, DWScriptFunctionScene *> DWScriptFunctionSceneMap;
typedef Common::HashMap<Common::String, DWScriptFunctionRect *> DWScriptFunctionRectMap;
class GameDrugWars : public Game {
enum SceneFuncType {
PREOP = 1,
SHOWMSG = 2,
INSOP = 3,
WEPDWN = 4,
SCNSCR = 5,
NXTFRM = 6,
NXTSCN = 7
};
public:
GameDrugWars(AlgEngine *vm, const AlgGameDescription *gd);
~GameDrugWars() override;
Common::Error run() override;
void debugWarpTo(int val);
private:
void init() override;
void registerScriptFunctions();
void verifyScriptFunctions();
DWScriptFunctionRect getScriptFunctionRectHit(const Common::String &name);
DWScriptFunctionScene getScriptFunctionScene(SceneFuncType type, const Common::String &name);
void callScriptFunctionRectHit(const Common::String &name, Rect *rect);
void callScriptFunctionScene(SceneFuncType type, const Common::String &name, Scene *scene);
DWScriptFunctionRectMap _rectHitFuncs;
DWScriptFunctionSceneMap _scenePreOps;
DWScriptFunctionSceneMap _sceneShowMsg;
DWScriptFunctionSceneMap _sceneInsOps;
DWScriptFunctionSceneMap _sceneWepDwn;
DWScriptFunctionSceneMap _sceneScnScr;
DWScriptFunctionSceneMap _sceneNxtFrm;
DWScriptFunctionSceneMap _sceneNxtScn;
// images
Graphics::Surface *_shotIcon;
Graphics::Surface *_emptyIcon;
Graphics::Surface *_liveIcon;
Graphics::Surface *_deadIcon;
Graphics::Surface *_difficultyIcon;
Graphics::Surface *_bulletholeIcon;
// constants
const int16 _randomScenes0[7] = {0x29, 0x2B, 0x2D, 0x2F, 0x31, 0x33, 0};
const int16 _randomScenes1[6] = {0x37, 0x39, 0x3B, 0x3D, 0x3F, 0};
const int16 _randomScenes4[8] = {0xA8, 0xAA, 0xAC, 0xAE, 0xB0, 0xB2, 0xB4, 0};
const int16 _randomScenes8[8] = {0xC0, 0xC2, 0xC4, 0xC6, 0xC8, 0xCA, 0xCC, 0};
const int16 _randomScenes9[6] = {0xFE, 0x0100, 0x0102, 0x01A3, 0x0105, 0};
const int16 _randomScenes10[8] = {0x0161, 0x0163, 0x0165, 0x0167, 0x016A, 0x016C, 0x016E, 0};
const int16 _randomScenes11[9] = {0x010B, 0x010D, 0x010F, 0x0111, 0x0113, 0x0115, 0x0117, 0x0119, 0};
const int16 _randomScenes12[10] = {0x014C, 0x014E, 0x0150, 0x0152, 0x0154, 0x0156, 0x0158, 0x015A, 0x015C, 0};
const int16 *_randomScenes[14] = {_randomScenes0, _randomScenes1, nullptr, nullptr, _randomScenes4, nullptr, nullptr, nullptr,
_randomScenes8, _randomScenes9, _randomScenes10, _randomScenes11, _randomScenes12, nullptr};
const uint8 _randomScenesDifficulty[14] = {6, 4, 0, 0, 6, 0, 0, 0, 5, 6, 7, 8, 8, 0};
const uint16 _randomScenesContinue[14] = {0x51, 0x41, 0, 0, 0x01B5, 0, 0, 0, 0xCE, 0x0107, 0x0170, 0x011B, 0x015E, 0};
const int16 _diedScenesStage0[4] = {0x52, 0x53, 0x54, 0};
const int16 _diedScenesStage1[5] = {0x85, 0x86, 0x88, 0x89, 0};
const int16 _diedScenesStage2[3] = {0xEF, 0xF0, 0};
const int16 _diedScenesStage3[3] = {0x0135, 0x0136, 0};
const int16 _diedScenesStage4[3] = {0x0135, 0x0136, 0};
const int16 *_diedScenesByStage[5] = {_diedScenesStage0, _diedScenesStage1, _diedScenesStage2, _diedScenesStage3, _diedScenesStage4};
uint16 _deadScenes[5] = {0x56, 0x8A, 0xF2, 0x0134, 0x0134};
const uint16 _stageStartScenes[5] = {0x51, 0x83, 0xEE, 0x0132, 0x017F};
const uint16 _scenarioStartScenes[14] = {0x27, 0x36, 0x4A, 0x57, 0x9D, 0x8B, 0x74, 0xD8, 0xBF, 0xB8, 0x0160, 0x010A, 0x0137, 0x017F};
// gamestate
uint8 _continues = 0;
uint16 _gotTo[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int8 _gotToIndex = 0;
int8 _stage = 0;
int8 _oldStage = -1;
uint8 _randomSceneCount = 0;
uint8 _randomMax = 0;
uint16 _randomMask = 0;
uint16 _randomPicked = 0;
uint16 _deathMask = 0;
int16 _deathPicked = 0;
uint8 _deathSceneCount = 0;
uint16 _finalStageScene = _stageStartScenes[4];
// base functions
void newGame();
void resetParams();
void doMenu();
void changeDifficulty(uint8 newDifficulty);
void showDifficulty(uint8 newDifficulty, bool updateCursor);
void updateCursor();
void updateMouse();
void moveMouse();
void displayLivesLeft();
void displayScores();
void displayShotsLeft();
bool weaponDown();
bool saveState();
bool loadState();
// misc game functions
void displayShotFiredImage(Common::Point *point);
void enableVideoFadeIn();
uint16 sceneToNumber(Scene *scene);
uint16 pickRandomScene(uint8 index, uint8 max);
uint16 pickDeathScene();
void sceneNxtscnGeneric(uint8 index);
void rectSelectGeneric(uint8 index);
// Script functions: RectHit
void rectShotMenu(Rect *rect);
void rectSave(Rect *rect);
void rectLoad(Rect *rect);
void rectContinue(Rect *rect);
void rectStart(Rect *rect);
void rectSelectTargetPractice(Rect *rect);
void rectSelectBar(Rect *rect);
void rectSelectCarChase(Rect *rect);
void rectSelectDrugHouse(Rect *rect);
void rectSelectOffice(Rect *rect);
void rectSelectCourt(Rect *rect);
void rectSelectBus(Rect *rect);
void rectSelectDocks(Rect *rect);
void rectSelectHouseBoat(Rect *rect);
void rectSelectParty(Rect *rect);
void rectSelectAirport(Rect *rect);
void rectSelectMansion(Rect *rect);
void rectSelectVillage(Rect *rect);
// Script functions: Scene PreOps
void scenePsoGotTo(Scene *scene);
// Script functions: Scene NxtScn
void sceneNxtscnGameWon(Scene *scene);
void sceneNxtscnLoseALife(Scene *scene);
void sceneNxtscnContinueGame(Scene *scene);
void sceneNxtscnDidNotContinue(Scene *scene);
void sceneNxtscnKillInnocentMan(Scene *scene);
void sceneNxtscnKillInnocentWoman(Scene *scene);
void sceneNxtscnAfterDie(Scene *scene);
void sceneNxtscnInitRandom(Scene *scene);
void sceneNxtscnContinueRandom(Scene *scene);
void sceneNxtscnSelectScenario(Scene *scene);
void sceneNxtscnFinishScenario(Scene *scene);
// Script functions: Scene WepDwn
void sceneDefaultWepdwn(Scene *scene);
};
class DebuggerDrugWars : public GUI::Debugger {
public:
DebuggerDrugWars(GameDrugWars *game);
bool cmdWarpTo(int argc, const char **argv);
bool cmdDumpLib(int argc, const char **argv);
private:
GameDrugWars *_game;
};
} // End of namespace Alg
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,285 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ALG_GAME_JOHNNYROCK_H
#define ALG_GAME_JOHNNYROCK_H
#include "common/hashmap.h"
#include "common/rect.h"
#include "gui/debugger.h"
#include "alg/game.h"
#include "alg/scene.h"
namespace Alg {
typedef Common::Functor1Mem<Scene *, void, GameJohnnyRock> JRScriptFunctionScene;
typedef Common::Functor1Mem<Rect *, void, GameJohnnyRock> JRScriptFunctionRect;
typedef Common::Functor1Mem<Common::Point *, void, GameJohnnyRock> JRScriptFunctionPoint;
typedef Common::HashMap<Common::String, JRScriptFunctionScene *> JRScriptFunctionSceneMap;
typedef Common::HashMap<Common::String, JRScriptFunctionRect *> JRScriptFunctionRectMap;
typedef Common::HashMap<Common::String, JRScriptFunctionPoint *> JRScriptFunctionPointMap;
class GameJohnnyRock : public Game {
enum SceneFuncType {
PREOP = 1,
SHOWMSG = 2,
INSOP = 3,
WEPDWN = 4,
SCNSCR = 5,
NXTFRM = 6,
NXTSCN = 7
};
public:
GameJohnnyRock(AlgEngine *vm, const AlgGameDescription *gd);
~GameJohnnyRock() override;
Common::Error run() override;
void debugWarpTo(int val);
private:
void init() override;
void registerScriptFunctions();
void verifyScriptFunctions();
JRScriptFunctionPoint getScriptFunctionZonePtrFb(Common::String name);
JRScriptFunctionRect getScriptFunctionRectHit(Common::String name);
JRScriptFunctionScene getScriptFunctionScene(SceneFuncType type, Common::String name);
void callScriptFunctionZonePtrFb(Common::String name, Common::Point *point);
void callScriptFunctionRectHit(Common::String name, Rect *rect);
void callScriptFunctionScene(SceneFuncType type, Common::String name, Scene *scene);
JRScriptFunctionPointMap _zonePtrFb;
JRScriptFunctionRectMap _rectHitFuncs;
JRScriptFunctionSceneMap _scenePreOps;
JRScriptFunctionSceneMap _sceneShowMsg;
JRScriptFunctionSceneMap _sceneInsOps;
JRScriptFunctionSceneMap _sceneWepDwn;
JRScriptFunctionSceneMap _sceneScnScr;
JRScriptFunctionSceneMap _sceneNxtFrm;
JRScriptFunctionSceneMap _sceneNxtScn;
// images
Common::Array<Graphics::Surface *> *_difficultyIcon;
Graphics::Surface *_levelIcon;
Graphics::Surface *_bulletholeIcon;
// constants
const int16 _randomRooftop[6] = {2, -4, 0x104, 0x1E, 0x100, 0x102};
const int16 _randomTheater[9] = {5, -5, 0x111, 0x1E, 0x107, 0x109, 0x10B, 0x10D, 0x10F};
const int16 _randomAlley[10] = {6, -4, 0, 0x1E, 0x113, 0x115, 0x117, 0x119, 0x11B, 0x11D};
const int16 _randomFuneralMR[10] = {6, -5, 0x12B, 0x1E, 0x11F, 0x121, 0x123, 0x125, 0x127, 0x129};
const int16 _randomBookMR[8] = {4, 5, 0, 0x1E, 0x12E, 0x130, 0x132, 0x134};
const int16 _randomStairway[8] = {4, -3, 0, 0x1E, 0x139, 0x13B, 0x13D, 0x13F};
const int16 _randomHall[8] = {4, -5, 0, 0x1E, 0x141, 0x143, 0x145, 0x146};
const int16 _randomWindows[10] = {6, -3, 0, 0x1E, 0x154, 0x156, 0x158, 0x15A, 0x15C, 0x15E};
const int16 _randomCar[5] = {1, 1, 0, 0, 0x0FE};
const int16 _randomHall1[5] = {1, 1, 0, 0x1E, 0x148};
const int16 _randomElevator[5] = {1, 1, 0, 0, 0x14C};
const int16 _randomBaby[5] = {1, 1, 0, 0, 0x160};
const int16 *_randomPlaces[6] = {_randomWindows, _randomStairway, _randomCar, _randomHall1, _randomElevator, _randomBaby};
const int16 *_randomPlacesMR[8] = {_randomBookMR, _randomFuneralMR, _randomAlley, _randomTheater, _randomHall, _randomWindows, _randomHall1, _randomRooftop};
const int16 _officeTable[5] = {0xA7, 0x9F, 0x9E, 0x0A0, 0x0AD};
const uint16 _diffPos[4][2] = {{0, 0}, {0xCD, 0x35}, {0xD2, 0x53}, {0xD2, 0x6E}};
// gamestate
uint16 _totalDies = 0;
int16 _gameMoney = 0;
int16 _oldGameMoney = 0;
uint16 _ammoAgain = 0;
uint16 _mapTimeout = 0;
uint8 _luckyNumber = 0;
uint8 _thisMap = 0;
uint16 _clues = 0;
uint16 _placeBits = 0;
uint8 _randomCount = 0;
uint16 _doctorBits = 0;
uint16 _undertakerBits = 0;
uint16 _thisClue = 0;
uint8 _gotThisNumber = 0;
uint8 _casino = 0;
uint8 _poolHall = 0;
uint8 _warehouse = 0;
uint8 _garage = 0;
uint8 _office = 0;
uint8 _casinoType = 0;
uint8 _poolHallType = 0;
uint8 _warehouseType = 0;
uint8 _garageType = 0;
uint8 _mansion = 0;
uint8 _inWarehouse = 0;
uint8 _inOffice = 0;
uint16 _gotTo = 0;
uint8 _whoDidIt = 0;
uint8 _hadGoToMansion = 0;
uint16 _officeCount = 0;
uint16 _randomPlaceBits = 0;
uint8 _maxRandomCount = 0;
uint16 _gotoAfterRandom = 0;
uint16 _repeatRandomPlace = 0;
uint16 _maxRepeat = 0;
uint16 _gotThisClue = 0;
uint16 _didContinue = 0;
uint16 _thisGameTime = 0;
uint8 _thisDifficulty = 0;
uint8 _clueTable[4];
uint8 _combinations[4];
uint16 _entranceIndex[20];
const int16 *_randomScenes = nullptr;
uint8 _randomScenesSavestateIndex = 0;
uint16 _randomScenesIndex[10];
Common::String _moneyScene = "";
uint8 _mgunCnt = 0;
uint32 _machGunTimer = 0;
// base functions
bool fired(Common::Point *point);
void newGame();
void resetParams();
void outShots();
void doMenu();
void updateStat();
void displayScore();
void showDifficulty(uint8 newDifficulty, bool updateCursor);
void changeDifficulty(uint8 newDifficulty);
void updateCursor();
void updateMouse();
void moveMouse();
bool weaponDown();
bool saveState();
bool loadState();
void doMoneySound();
// misc game functions
Common::String numToScene(int n);
uint16 sceneToNum(Common::String sceneName);
void defaultBullethole(Common::Point *point);
uint16 pickBits(uint16 *bits, uint8 max);
uint16 pickRandomPlace(uint8 place);
void showCombination();
void shotClue(uint8 clue);
void shotCombination(uint8 combination, bool combinationB);
void shotLuckyNumber(uint8 number);
// Script functions: Zone
void zoneBullethole(Common::Point *point);
// Script functions: RectHit
void rectShotMenu(Rect *rect);
void rectSave(Rect *rect);
void rectLoad(Rect *rect);
void rectContinue(Rect *rect);
void rectStart(Rect *rect);
void rectKillInnocent(Rect *rect);
void rectSelectCasino(Rect *rect);
void rectSelectPoolhall(Rect *rect);
void rectSelectWarehouse(Rect *rect);
void rectSelectGarage(Rect *rect);
void rectSelectMansion(Rect *rect);
void rectSelectAmmo(Rect *rect);
void rectSelectOffice(Rect *rect);
void rectShotManBust(Rect *rect);
void rectShotWomanBust(Rect *rect);
void rectShotBlueVase(Rect *rect);
void rectShotCat(Rect *rect);
void rectShotIndian(Rect *rect);
void rectShotPlate(Rect *rect);
void rectShotBlueDressPic(Rect *rect);
void rectShotModernPic(Rect *rect);
void rectShotMonaLisa(Rect *rect);
void rectShotGWashington(Rect *rect);
void rectShotBoyInRedPic(Rect *rect);
void rectShotCoatOfArms(Rect *rect);
void rectShotCombinationA0(Rect *rect);
void rectShotCombinationA1(Rect *rect);
void rectShotCombinationA2(Rect *rect);
void rectShotCombinationA3(Rect *rect);
void rectShotCombinationA4(Rect *rect);
void rectShotCombinationA5(Rect *rect);
void rectShotCombinationB0(Rect *rect);
void rectShotCombinationB1(Rect *rect);
void rectShotCombinationB2(Rect *rect);
void rectShotCombinationB3(Rect *rect);
void rectShotCombinationB4(Rect *rect);
void rectShotCombinationB5(Rect *rect);
void rectShotLuckyNumber0(Rect *rect);
void rectShotLuckyNumber1(Rect *rect);
void rectShotLuckyNumber2(Rect *rect);
void rectShotLuckyNumber3(Rect *rect);
void rectShotLuckyNumber4(Rect *rect);
void rectShotLuckyNumber5(Rect *rect);
// Script functions: Scene InsOps
void sceneIsoShootpast(Scene *scene);
void sceneIsoShootpastPause(Scene *scene);
void sceneIsoGotoCasino(Scene *scene);
void sceneIsoGotoPoolhall(Scene *scene);
void sceneIsoGotoWarehouse(Scene *scene);
void sceneIsoInWarehouse2(Scene *scene);
void sceneIsoInwarehouse3(Scene *scene);
void sceneIsoGotoGarage(Scene *scene);
void sceneIsoGotoMansion(Scene *scene);
void sceneIsoInMansion1(Scene *scene);
// Script functions: Scene NxtScn
void sceneNxtscnDied(Scene *scene);
void sceneNxtscnBombDead(Scene *scene);
void sceneNxtscnPickUndertaker(Scene *scene);
void sceneNxtscnCallAttract(Scene *scene);
void sceneNxtscnPickLuckyNumber(Scene *scene);
void sceneNxtscnPickMap(Scene *scene);
void sceneNxtscnPickClue(Scene *scene);
void sceneNxtscnMapTimeout(Scene *scene);
void sceneNxtscnEnterCasino(Scene *scene);
void sceneNxtscnCasinoWhat(Scene *scene);
void sceneNxtscnEnterPoolhall(Scene *scene);
void sceneNxtscnPoolhallClue(Scene *scene);
void sceneNxtscnEnterWarehouse(Scene *scene);
void sceneNxtscnWarehouseClue(Scene *scene);
void sceneNxtscnEnterGarage(Scene *scene);
void sceneNxtscnGarageClue(Scene *scene);
void sceneNxtscnEnterMansion(Scene *scene);
void sceneNxtscnGiveClue(Scene *scene);
void sceneNxtscnPickFlowerMan(Scene *scene);
void sceneNxtscnRandomScene(Scene *scene);
void sceneNxtscnEndRandScene(Scene *scene);
void sceneNxtscnKillInnocent(Scene *scene);
// Script functions: Scene WepDwn
void sceneDefaultWepdwn(Scene *scene);
};
class DebuggerJohnnyRock : public GUI::Debugger {
public:
DebuggerJohnnyRock(GameJohnnyRock *game);
bool cmdWarpTo(int argc, const char **argv);
bool cmdDumpLib(int argc, const char **argv);
private:
GameJohnnyRock *_game;
};
} // End of namespace Alg
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,237 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ALG_GAME_MADDOG_H
#define ALG_GAME_MADDOG_H
#include "common/hashmap.h"
#include "common/rect.h"
#include "gui/debugger.h"
#include "alg/game.h"
#include "alg/scene.h"
namespace Alg {
typedef Common::Functor1Mem<Scene *, void, GameMaddog> MDScriptFunctionScene;
typedef Common::Functor1Mem<Rect *, void, GameMaddog> MDScriptFunctionRect;
typedef Common::Functor1Mem<Common::Point *, void, GameMaddog> MDScriptFunctionPoint;
typedef Common::HashMap<Common::String, MDScriptFunctionScene *> MDScriptFunctionSceneMap;
typedef Common::HashMap<Common::String, MDScriptFunctionRect *> MDScriptFunctionRectMap;
typedef Common::HashMap<Common::String, MDScriptFunctionPoint *> MDScriptFunctionPointMap;
class GameMaddog : public Game {
enum SceneFuncType {
PREOP = 1,
SHOWMSG = 2,
INSOP = 3,
WEPDWN = 4,
SCNSCR = 5,
NXTFRM = 6,
NXTSCN = 7
};
public:
GameMaddog(AlgEngine *vm, const AlgGameDescription *gd);
~GameMaddog() override;
Common::Error run() override;
void debugWarpTo(int val);
private:
void init() override;
void registerScriptFunctions();
void verifyScriptFunctions();
MDScriptFunctionPoint getScriptFunctionZonePtrFb(Common::String name);
MDScriptFunctionRect getScriptFunctionRectHit(Common::String name);
MDScriptFunctionScene getScriptFunctionScene(SceneFuncType type, Common::String name);
void callScriptFunctionZonePtrFb(Common::String name, Common::Point *point);
void callScriptFunctionRectHit(Common::String name, Rect *rect);
void callScriptFunctionScene(SceneFuncType type, Common::String name, Scene *scene);
MDScriptFunctionPointMap _zonePtrFb;
MDScriptFunctionRectMap _rectHitFuncs;
MDScriptFunctionSceneMap _scenePreOps;
MDScriptFunctionSceneMap _sceneShowMsg;
MDScriptFunctionSceneMap _sceneInsOps;
MDScriptFunctionSceneMap _sceneWepDwn;
MDScriptFunctionSceneMap _sceneScnScr;
MDScriptFunctionSceneMap _sceneNxtFrm;
MDScriptFunctionSceneMap _sceneNxtScn;
// images
Graphics::Surface *_shotIcon;
Graphics::Surface *_emptyIcon;
Graphics::Surface *_liveIcon;
Graphics::Surface *_deadIcon;
Graphics::Surface *_reloadIcon;
Graphics::Surface *_drawIcon;
Graphics::Surface *_knifeIcon;
Graphics::Surface *_bulletholeIcon;
// constants
const uint16 _fight[3] = {208, 228, 243};
const uint16 _ambush[3] = {192, 193, 192};
const uint16 _hotelScenes[10] = {77, 77, 87, 87, 89, 89, 97, 97, 105, 105};
const uint16 _bottleToss[14] = {171, 171, 174, 174, 175, 175, 178, 178, 179, 179, 182, 182, 183, 183};
const uint16 _diffPos[4][2] = {{0, 0}, {0x4D, 0x43}, {0x4E, 0x66}, {0x4F, 0x80}};
const uint16 _livePos[3][2] = {{0x03, 0x5E}, {0x03, 0x76}, {0x03, 0x8E}};
const uint16 _shotPos[12][2] = {{0x3, 0x5}, {0x0D, 0x5}, {0x17, 0x5}, {0x21, 0x5}, {0x3, 0x21}, {0x0D, 0x21}, {0x17, 0x21}, {0x21, 0x21}, {0x3, 0x3D}, {0x0D, 0x3D}, {0x17, 0x3D}, {0x21, 0x3D}};
// gamestate
uint8 _badMen = 0;
uint8 _badMenBits = 0;
bool _bartenderAlive = false;
uint16 _beenTo = 0;
uint8 _bottles = 0;
uint8 _bottlesMask = 0;
bool _gotClue = false;
uint16 _gotInto = 0;
uint8 _gunTime = 0;
bool _hadSkull = false;
bool _hadLantern = false;
bool _hideOutFront = false;
bool _inShootout = false;
int8 _map0 = 0;
int8 _map1 = 0;
int8 _map2 = 0;
uint8 _mapPos = 0;
uint8 _maxMapPos = 0;
uint8 _peopleKilled = 0;
uint8 _proClue = 0;
uint8 _sheriffCnt = 0; // unused
uint8 _shootOutCnt = 0;
// base functions
void newGame();
void resetParams();
void doMenu();
void updateStat();
void changeDifficulty(uint8 newDifficulty);
void showDifficulty(uint8 newDifficulty, bool updateCursor);
void updateCursor();
void updateMouse();
void moveMouse();
void displayScore();
bool weaponDown();
bool saveState();
bool loadState();
// misc game functions
void defaultBullethole(Common::Point *point);
void die();
uint8 pickRand(uint8 *bits, uint8 max);
uint8 pickBad(uint8 max);
Common::String pickTown();
Common::String pickMap();
Common::String pickSign();
Common::String mapRight();
Common::String mapLeft();
// Script functions: Zone
void zoneBullethole(Common::Point *point);
void zoneSkullhole(Common::Point *point);
// Script functions: RectHit
void rectShotMenu(Rect *rect);
void rectContinue(Rect *rect);
void rectSave(Rect *rect);
void rectLoad(Rect *rect);
void rectStart(Rect *rect);
void rectStartBottles(Rect *rect);
void rectHideFront(Rect *rect);
void rectHideRear(Rect *rect);
void rectMenuSelect(Rect *rect);
void rectSkull(Rect *rect);
void rectKillMan(Rect *rect);
void rectKillWoman(Rect *rect);
void rectProspSign(Rect *rect);
void rectMineSign(Rect *rect);
void rectMineItem1(Rect *rect);
void rectMineItem2(Rect *rect);
void rectMineItem3(Rect *rect);
void rectMineLantern(Rect *rect);
void rectShotHideout(Rect *rect);
void rectShotRight(Rect *rect);
void rectShotLeft(Rect *rect);
// Script functions: Scene PreOps
void scenePsoShootout(Scene *scene);
void scenePsoMDShootout(Scene *scene);
// Script functions: Scene InsOps
void sceneIsoShootPast(Scene *scene);
void sceneIsoShootPastPause(Scene *scene);
void sceneIsoSkipSaloon(Scene *scene);
void sceneIsoSkipSaloon2(Scene *scene);
void sceneIsoCheckSaloon(Scene *scene);
void sceneIsoIntoStable(Scene *scene);
void sceneIsoIntoOffice(Scene *scene);
void sceneIsoIntoBank(Scene *scene);
void sceneIsoCheckBartender(Scene *scene);
void sceneIsoDidHideout(Scene *scene);
void sceneIsoDidSignPost(Scene *scene);
void sceneIsoDoShootout(Scene *scene);
void sceneIsoMDShootout(Scene *scene);
void sceneIsoShotInto116(Scene *scene);
// Script functions: Scene NxtScn
void sceneDefaultNxtscn(Scene *scene);
void sceneNxtscnPickBottle(Scene *scene);
void sceneNxtscnDied(Scene *scene);
void sceneNxtscnAutoSelect(Scene *scene);
void sceneNxtscnFinishSaloon(Scene *scene);
void sceneNxtscnFinishOffice(Scene *scene);
void sceneNxtscnFinishStable(Scene *scene);
void sceneNxtscnFinishBank(Scene *scene);
void sceneNxtscnPicSaloon(Scene *scene);
void sceneNxtscnKillMan(Scene *scene);
void sceneNxtscnKillWoman(Scene *scene);
void sceneNxtscnBank(Scene *scene);
void sceneNxtscnStable(Scene *scene);
void sceneNxtscnSavProsp(Scene *scene);
void sceneNxtscnPickToss(Scene *scene);
void sceneNxtscnHitToss(Scene *scene);
void sceneNxtscnMissToss(Scene *scene);
void sceneNxtscnPickSign(Scene *scene);
void sceneNxtscnBRockMan(Scene *scene);
void sceneNxtscnLRockMan(Scene *scene);
void sceneNxtscnHotelMen(Scene *scene);
// Script functions: Scene WepDwn
void sceneDefaultWepdwn(Scene *scene);
};
class DebuggerMaddog : public GUI::Debugger {
public:
DebuggerMaddog(GameMaddog *game);
bool cmdWarpTo(int argc, const char **argv);
bool cmdDumpLib(int argc, const char **argv);
private:
GameMaddog *_game;
};
} // End of namespace Alg
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,265 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ALG_GAME_MADDOG2_H
#define ALG_GAME_MADDOG2_H
#include "common/hashmap.h"
#include "common/rect.h"
#include "gui/debugger.h"
#include "alg/game.h"
#include "alg/scene.h"
namespace Alg {
typedef Common::Functor1Mem<Scene *, void, GameMaddog2> MD2ScriptFunctionScene;
typedef Common::Functor1Mem<Rect *, void, GameMaddog2> MD2ScriptFunctionRect;
typedef Common::Functor1Mem<Common::Point *, void, GameMaddog2> MD2ScriptFunctionPoint;
typedef Common::HashMap<Common::String, MD2ScriptFunctionScene *> MD2ScriptFunctionSceneMap;
typedef Common::HashMap<Common::String, MD2ScriptFunctionRect *> MD2ScriptFunctionRectMap;
typedef Common::HashMap<Common::String, MD2ScriptFunctionPoint *> MD2ScriptFunctionPointMap;
class GameMaddog2 : public Game {
enum SceneFuncType {
PREOP = 1,
SHOWMSG = 2,
INSOP = 3,
WEPDWN = 4,
SCNSCR = 5,
NXTFRM = 6,
NXTSCN = 7
};
public:
GameMaddog2(AlgEngine *vm, const AlgGameDescription *gd);
~GameMaddog2() override;
Common::Error run() override;
void debugWarpTo(int val);
private:
void init() override;
void registerScriptFunctions();
void verifyScriptFunctions();
MD2ScriptFunctionPoint getScriptFunctionZonePtrFb(Common::String name);
MD2ScriptFunctionRect getScriptFunctionRectHit(Common::String name);
MD2ScriptFunctionScene getScriptFunctionScene(SceneFuncType type, Common::String name);
void callScriptFunctionZonePtrFb(Common::String name, Common::Point *point);
void callScriptFunctionRectHit(Common::String name, Rect *rect);
void callScriptFunctionScene(SceneFuncType type, Common::String name, Scene *scene);
MD2ScriptFunctionPointMap _zonePtrFb;
MD2ScriptFunctionRectMap _rectHitFuncs;
MD2ScriptFunctionSceneMap _scenePreOps;
MD2ScriptFunctionSceneMap _sceneShowMsg;
MD2ScriptFunctionSceneMap _sceneInsOps;
MD2ScriptFunctionSceneMap _sceneWepDwn;
MD2ScriptFunctionSceneMap _sceneScnScr;
MD2ScriptFunctionSceneMap _sceneNxtFrm;
MD2ScriptFunctionSceneMap _sceneNxtScn;
// images
Graphics::Surface *_shotIcon;
Graphics::Surface *_emptyIcon;
Graphics::Surface *_liveIcon;
Graphics::Surface *_deadIcon;
Graphics::Surface *_reloadIcon;
Graphics::Surface *_drawIcon;
Graphics::Surface *_knifeIcon;
Graphics::Surface *_bulletholeIcon;
// constants
const int16 _sbClue[3] = {0x67, 0x68, 0x69};
const int16 _bbClue[3] = {0x47, 0x49, 0x48};
const int16 _tpClue[3] = {0x84, 0x85, 0x86};
const int16 _sbScenes[14] = {0x4A, 0x50, 0xB8, 0x55, 0x57, 0x66, 0xBE, 0x94, 0x87, 0x93, 0xCD, 0x95, 0xE3, -1};
const int16 _bbScenes[14] = {0x33, 0x39, 0xB4, 0x41, 0x43, 0x46, 0xA2, 0x8D, 0x87, 0x8F, 0xCD, 0x8E, 0xE3, -1};
const int16 _tpScenes[14] = {0x6A, 0xC3, 0x76, 0x81, 0xAD, 0x83, 0xDC, 0x92, 0x87, 0x90, 0xCD, 0x91, 0xE3, -1};
const int16 _villageScenes[6] = {0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62};
const int16 _cowboyScenes[7] = {0xCD, 0xCF, 0xD2, 0xD4, 0xD6, 0xD8, 0xDA};
const int16 _farmyardScenes[4] = {0xDC, 0xDE, 0x129, 0xE1};
const int16 _caveScenes[5] = {0xE4, 0xE6, 0xE8, 0xEA, 0xEC};
const int16 _ezShootOuts[5] = {0xAB, 0xBC, 0xC5, 0xC7, 0xCB};
const int16 _shootOuts[6] = {0xAB, 0xBC, 0xC5, 0xC7, 0xC9, 0xCB};
const int16 _ggScenes[3] = {0x87, 0x88, 0x89};
const int16 _dieScenes[6] = {0x96, 0x97, 0x98, 0x9B, 0x9F, 0xA1};
const uint16 _diffPos[3][2] = {{0x0FA, 0x6E}, {0xFA, 0x8E}, {0xFA, 0xAF}};
const uint16 _livePos[3][2] = {{0x81, 0xBE}, {0x70, 0xBE}, {0x5F, 0xBE}};
const uint16 _shotPos[12][2] = {{0x96, 0xBD}, {0x9A, 0xBD}, {0x9E, 0xBD}, {0x0A2, 0xBD}, {0x0A6, 0xBD}, {0x0AA, 0xBD}, {0x0AE, 0xBD}, {0x0B2, 0xBD}, {0x0B6, 0xBD}, {0x0BA, 0xBD}, {0x0BE, 0xBD}, {0x0C2, 0xBD}};
// gamestate
uint16 _dieBits = 0;
uint16 _gotTo = 0;
uint16 _sbGotTo = 0;
uint16 _bbGotTo = 0;
uint16 _tpGotTo = 0;
bool _hadSkull = false;
int16 _thisGuide = 0;
uint16 _doneGuide = 0;
uint16 _shootOutBits = 0;
int16 _lastShootOut = 0;
uint16 _startLives = 3;
bool _wasAShootout = false;
bool _shootoutFromDie = false;
uint16 _whichPadre = 0;
uint16 _whichGatlingGun = 0;
bool _inShootout = false;
uint16 _pickMask = 0;
uint16 _lastPick = 0;
uint16 _placeBits = 0;
uint16 _randomCount = 0;
uint16 _shootOutCnt = 0;
uint16 _totalDies = 0;
// base functions
void newGame();
void resetParams();
void doMenu();
void updateStat();
void changeDifficulty(uint8 newDifficulty);
void showDifficulty(uint8 newDifficulty, bool updateCursor);
void updateCursor();
void updateMouse();
void moveMouse();
void displayScore();
bool weaponDown();
bool saveState();
bool loadState();
// misc game functions
Common::String numToScene(int n);
uint16 sceneToNum(Common::String sceneName);
void defaultBullethole(Common::Point *point);
uint16 die();
uint16 pickBits(uint16 *bits, uint8 max);
uint16 pickShootout();
void nextSB();
void nextBB();
void nextTP();
void ggPickMan();
void genericNext();
void playerWon();
// Script functions: Zone
void zoneBullethole(Common::Point *point);
void zoneSkullhole(Common::Point *point);
// Script functions: RectHit
void rectShotmenu(Rect *rect);
void rectSave(Rect *rect);
void rectLoad(Rect *rect);
void rectContinue(Rect *rect);
void rectStart(Rect *rect);
void rectSkull(Rect *rect);
void rectKillInnocentMan(Rect *rect);
void rectKillInnocentWoman(Rect *rect);
void rectSelectBeaver(Rect *rect);
void rectSelectBonnie(Rect *rect);
void rectSelectProfessor(Rect *rect);
void rectShotAmmo(Rect *rect);
void rectShotGin(Rect *rect);
void rectShotLantern(Rect *rect);
void rectShootSkull(Rect *rect);
// Script functions: Scene PreOps
void scenePsoShootout(Scene *scene);
void scenePsoMDShootout(Scene *scene);
// Script functions: Scene InsOps
void sceneIsoShootpast(Scene *scene);
void sceneIsoShootpastPause(Scene *scene);
void sceneIsoStagecoach(Scene *scene);
void sceneIsoDifferentPadres(Scene *scene);
void sceneIsoDifferentPadresPause(Scene *scene);
void sceneIsoDontPopNext(Scene *scene);
void sceneIsoGetIntoRock(Scene *scene);
void sceneIsoBenAtCave(Scene *scene);
void sceneIsoSkullAtCave(Scene *scene);
void sceneIsoStartOfTrain(Scene *scene);
void sceneIsoMission(Scene *scene);
void sceneIsoMDShootout(Scene *scene);
void sceneIsoStartOfBoardinghouse(Scene *scene);
void sceneIsoDontContinue(Scene *scene);
void sceneIsoDoShootout(Scene *scene);
// Script functions: Scene NxtScn
void sceneDefaultNxtscn(Scene *scene);
void sceneNxtscnDied(Scene *scene);
void sceneNxtscnKillInnocentMan(Scene *scene);
void sceneNxtscnKillInnocentWoman(Scene *scene);
void sceneNxtscnKillGuide(Scene *scene);
void sceneNxtscnShootSkull(Scene *scene);
void sceneNxtscnCallAttract(Scene *scene);
void sceneNxtscnPickUndertaker(Scene *scene);
void sceneNxtscnChoosePadre(Scene *scene);
void sceneNxtscnSelectGuide(Scene *scene);
void sceneNxtscnSaveBonnie(Scene *scene);
void sceneNxtscnFinishBonnie(Scene *scene);
void sceneNxtscnShowGGClue(Scene *scene);
void sceneNxtscnBBAfterClue(Scene *scene);
void sceneNxtscnAsFarSheGoes(Scene *scene);
void sceneNxtscnSaveBeaver(Scene *scene);
void sceneNxtscnFinishBeaver(Scene *scene);
void sceneNxtscnToGatlingGunSBClue(Scene *scene);
void sceneNxtscnToGuideafterClue(Scene *scene);
void sceneNxtscnToGuideCave(Scene *scene);
void sceneNxtscnInitRandomVillage(Scene *scene);
void sceneNxtscnPickVillageScenes(Scene *scene);
void sceneNxtscnSaveProfessor(Scene *scene);
void sceneNxtscnFinishProfessor(Scene *scene);
void sceneNxtscnToGatlingGunTPClue(Scene *scene);
void sceneNxtscnTPAfterClue(Scene *scene);
void sceneNxtscnFinishGatlingGun1(Scene *scene);
void sceneNxtscnFinishGuyAtGG(Scene *scene);
void sceneNxtscnFinishGatlingGun2(Scene *scene);
void sceneNxtscnHowWeDid(Scene *scene);
void sceneNxtscnPlayerWon(Scene *scene);
void sceneNxtscnBackToNextGuide(Scene *scene);
void sceneNxtscnFinishGenericScene(Scene *scene);
void sceneNxtscnInitRandomCowboys(Scene *scene);
void sceneNxtscnToCowboyScenes(Scene *scene);
void sceneNxtscnInitRandomFarmyard(Scene *scene);
void sceneNxtscnToFarmyardScenes(Scene *scene);
void sceneNxtscnInitRandomCave(Scene *scene);
void sceneNxtscnToCaveScenes(Scene *scene);
void sceneNxtscnPickSkullAtCave(Scene *scene);
void sceneNxtscnDrawGun(Scene *scene);
// Script functions: Scene WepDwn
void sceneDefaultWepdwn(Scene *scene);
};
class DebuggerMaddog2 : public GUI::Debugger {
public:
DebuggerMaddog2(GameMaddog2 *game);
bool cmdWarpTo(int argc, const char **argv);
bool cmdDumpLib(int argc, const char **argv);
private:
GameMaddog2 *_game;
};
} // End of namespace Alg
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,268 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ALG_GAME_SPACEPIRATES_H
#define ALG_GAME_SPACEPIRATES_H
#include "common/hashmap.h"
#include "common/rect.h"
#include "gui/debugger.h"
#include "alg/game.h"
#include "alg/scene.h"
namespace Alg {
typedef Common::Functor1Mem<Scene *, void, GameSpacePirates> SPScriptFunctionScene;
typedef Common::Functor1Mem<Rect *, void, GameSpacePirates> SPScriptFunctionRect;
typedef Common::HashMap<Common::String, SPScriptFunctionScene *> SPScriptFunctionSceneMap;
typedef Common::HashMap<Common::String, SPScriptFunctionRect *> SPScriptFunctionRectMap;
class GameSpacePirates : public Game {
enum SceneFuncType {
PREOP = 1,
SHOWMSG = 2,
INSOP = 3,
WEPDWN = 4,
SCNSCR = 5,
NXTFRM = 6,
NXTSCN = 7,
MISSEDRECTS = 8
};
public:
GameSpacePirates(AlgEngine *vm, const AlgGameDescription *gd);
~GameSpacePirates() override;
Common::Error run() override;
void debugWarpTo(int val);
private:
void init() override;
void registerScriptFunctions();
void verifyScriptFunctions();
SPScriptFunctionRect getScriptFunctionRectHit(Common::String name);
SPScriptFunctionScene getScriptFunctionScene(SceneFuncType type, Common::String name);
void callScriptFunctionRectHit(Common::String name, Rect *rect);
void callScriptFunctionScene(SceneFuncType type, Common::String name, Scene *scene);
SPScriptFunctionRectMap _rectHitFuncs;
SPScriptFunctionSceneMap _scenePreOps;
SPScriptFunctionSceneMap _sceneShowMsg;
SPScriptFunctionSceneMap _sceneInsOps;
SPScriptFunctionSceneMap _sceneWepDwn;
SPScriptFunctionSceneMap _sceneScnScr;
SPScriptFunctionSceneMap _sceneNxtFrm;
SPScriptFunctionSceneMap _sceneNxtScn;
SPScriptFunctionSceneMap _sceneMissedRects;
// images
Graphics::Surface *_shotIcon;
Graphics::Surface *_emptyIcon;
Graphics::Surface *_deadIcon;
Graphics::Surface *_liveIcon1;
Graphics::Surface *_liveIcon2;
Graphics::Surface *_liveIcon3;
Graphics::Surface *_difficultyIcon;
Graphics::Surface *_bulletholeIcon;
// constants
// gamestate
bool _gameLoaded = false;
int8 _livesLoaded = 0;
uint16 _shotsLoaded = 0;
int32 _scoreLoaded = 0;
uint8 _difficultyLoaded = 0;
bool _nextSceneFound = false;
bool _playerDied = false;
int16 _randomPicked = -1;
uint32 _lastExtraLifeScore = 0;
uint16 _randomScenesValues[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
uint8 _randomScenesUsed[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
uint8 _maxRandom = 0;
uint8 _randomCount = 0;
uint8 _randomCountAsteroids = 0;
uint8 _randomCountMidship = 0;
uint8 _miscRoomsCount = 0;
uint16 _pickedMiscRooms = 0;
uint16 _gotTo = 0;
int8 _currentWorld = 0;
uint16 _worldGotTo[4] = {0, 0, 0, 0};
bool _worldDone[4] = {false, false, false, false};
bool _selectedAWorld = false;
uint16 _selectedWorldStart = 0;
uint16 _sceneBeforeFlyingSkulls = 0;
uint8 _shotGrinReaperCount = 0;
uint16 _clue = 0;
uint8 _shotColor = 0;
uint8 _shotDirection = 0;
uint8 _crystalsShot = 0;
uint8 _crystalState = 0;
uint16 _pickedStartSplitter = 0;
bool _targetPracticeReset = false;
// base functions
void newGame();
void resetParams();
void doMenu();
void changeDifficulty(uint8 newDifficulty);
void showDifficulty(uint8 newDifficulty, bool updateCursor);
void updateCursor();
void updateMouse();
void moveMouse();
void displayLivesLeft();
void displayScores();
void displayShotsLeft();
bool weaponDown();
bool saveState();
bool loadState();
// misc game functions
void playErrorSound();
void displayShotFiredImage();
void displayShotFiredImage(Common::Point *point);
void displayShotLine(uint16 startX, uint16 startY, uint16 endX, uint16 endY);
void displayMultipleShotLines();
void enableVideoFadeIn();
uint16 sceneToNumber(Scene *scene);
uint16 randomUnusedScene(uint8 max);
uint16 randomNumberInRange(uint16 min, uint16 max);
uint16 pickCrystalScene(uint16 scene1, uint16 scene2, uint16 scene3);
// Script functions: RectHit
void rectShotMenu(Rect *rect);
void rectSave(Rect *rect);
void rectLoad(Rect *rect);
void rectContinue(Rect *rect);
void rectStart(Rect *rect);
void rectEasy(Rect *rect);
void rectAverage(Rect *rect);
void rectHard(Rect *rect);
void rectDefault(Rect *rect);
void rectKillInnocentPerson(Rect *rect);
void rectContinueJunkRings(Rect *rect);
void rectShotGrinReaper(Rect *rect);
void rectShowMadDog(Rect *rect);
void rectPottWorldShowCrystal(Rect *rect);
void rectShotLeft(Rect *rect);
void rectShotRight(Rect *rect);
void rectShotGold(Rect *rect);
void rectShotSilver(Rect *rect);
void rectSelectedDuneWorld(Rect *rect);
void rectSelectedJunkWorld(Rect *rect);
void rectSelectedDragonsTeethWorld(Rect *rect);
void rectSelectedVolcanoWorld(Rect *rect);
void rectShotRedDeathGrip(Rect *rect);
void rectShotBlueDeathGrip(Rect *rect);
void rectShotGreenDeathGrip(Rect *rect);
void rectShotYellow(Rect *rect);
void rectShotBlue(Rect *rect);
void rectShotRedCrystal(Rect *rect);
void rectShotBlueCrystal(Rect *rect);
void rectShotGreenCrystal(Rect *rect);
void rectShotBlackDragon1(Rect *rect);
void rectShotBlackDragon2(Rect *rect);
void rectShotBlackDragon3(Rect *rect);
void rectDoFlyingSkull(Rect *rect);
void rectSkipScene(Rect *rect);
void rectHitPirateShip(Rect *rect);
// Script functions: Scene PreOps
void scenePsoFadeInVideo(Scene *scene);
void scenePsoSetGotTo(Scene *scene);
void scenePsoSetGotToNoFadeIn(Scene *scene);
void scenePsoSetWorldGotTo(Scene *scene);
// Script functions: Scene InsOps
void sceneIsoPickAWorld(Scene *scene);
void sceneIsoSetWorldGotTo(Scene *scene);
// Script functions: Scene NxtScn
void sceneNxtscnGotChewedOut(Scene *scene);
void sceneNxtscnRestartFromLast(Scene *scene);
void sceneNxtscnPlayerDied(Scene *scene);
void sceneNxtscnMiscRooms1(Scene *scene);
void sceneNxtscnPickDungeonClue(Scene *scene);
void sceneNxtscnContinueDungeonClue(Scene *scene);
void sceneNxtscnStartMidshipRandomScene(Scene *scene);
void sceneNxtscnContinueMidshipRandomScene(Scene *scene);
void sceneNxtscnShowDeathGripBeamColor(Scene *scene);
void sceneNxtscnSelectAsteroids(Scene *scene);
void sceneNxtscnAsteroidsDone(Scene *scene);
void sceneNxtscnDoFlyingSkulls(Scene *scene);
void sceneNxtscnDidFlyingSkulls(Scene *scene);
void sceneNxtscnShowWhichStartSplitter(Scene *scene);
void sceneNxtscnGotoSelectedWorld(Scene *scene);
void sceneNxtscnStartVolcanoPopup(Scene *scene);
void sceneNxtscnContinueVolcanoPopup(Scene *scene);
void sceneNxtscnGiveFalinaClue(Scene *scene);
void sceneNxtscnCheckFalinaClues(Scene *scene);
void sceneNxtscnSetupFalinaTargetPractice(Scene *scene);
void sceneNxtscnContinueFalinaTargetPractice(Scene *scene);
void sceneNxtscnStartDunePopup(Scene *scene);
void sceneNxtscnContinueDunePopup(Scene *scene);
void sceneNxtscnPottOrPanShoots(Scene *scene);
void sceneNxtscnSetupPottTargetPractice(Scene *scene);
void sceneNxtscnContinuePottTargetPractice(Scene *scene);
void sceneNxtscnStartDragonsTeethPopup(Scene *scene);
void sceneNxtscnContinueDragonsTeethPopup(Scene *scene);
void sceneNxtscnGrinReaperClue(Scene *scene);
void sceneNxtscnStartGrinReaper(Scene *scene);
void sceneNxtscnContinueGrinReaper(Scene *scene);
void sceneNxtscnGrinTargetPractice(Scene *scene);
void sceneNxtscnContinueGrinTargetPractice(Scene *scene);
void sceneNxtscnStartJunkWorld(Scene *scene);
void sceneNxtscnContinueJunkWorld(Scene *scene);
void sceneNxtscnStartJunkRings(Scene *scene);
void sceneNxtscnShowJunkWorldCrystal(Scene *scene);
void sceneNxtscnStartJunkWorldTargetPractice(Scene *scene);
void sceneNxtscnContinueJunkWorldTargetPractice(Scene *scene);
void sceneNxtscnAreAllWorldsDone(Scene *scene);
void sceneNxtscnStartPracticePirateShip(Scene *scene);
void sceneNxtscnMorePracticePirateShip(Scene *scene);
void sceneNxtscnPlayerWon(Scene *scene);
// Script functions: MissedRect
void sceneMissedRectsDefault(Scene *scene);
void sceneMissedRectsMissedPirateShip(Scene *scene);
// Script functions: Scene WepDwn
void sceneDefaultWepdwn(Scene *scene);
// Script functions: Scene ScnScr
void sceneDefaultScnscr(Scene *scene);
};
class DebuggerSpacePirates : public GUI::Debugger {
public:
DebuggerSpacePirates(GameSpacePirates *game);
bool cmdWarpTo(int argc, const char **argv);
bool cmdDumpLib(int argc, const char **argv);
private:
GameSpacePirates *_game;
};
} // End of namespace Alg
#endif