aboutsummaryrefslogtreecommitdiff
path: root/sword1
diff options
context:
space:
mode:
authorJonathan Gray2003-12-17 11:54:48 +0000
committerJonathan Gray2003-12-17 11:54:48 +0000
commit6d1fba28d510526de568fa7354fa6327fd81d74d (patch)
tree39b0f9a471e479f4f201787252f23c05859ce8b2 /sword1
parent9a1bbb361bc62ef95f02317f25e7aa3f1d2da723 (diff)
downloadscummvm-rg350-6d1fba28d510526de568fa7354fa6327fd81d74d.tar.gz
scummvm-rg350-6d1fba28d510526de568fa7354fa6327fd81d74d.tar.bz2
scummvm-rg350-6d1fba28d510526de568fa7354fa6327fd81d74d.zip
initial boot param support, will do the rest of the bootparams next
svn-id: r11712
Diffstat (limited to 'sword1')
-rw-r--r--sword1/logic.h9
-rw-r--r--sword1/sword1.cpp86
-rw-r--r--sword1/sword1.h1
-rw-r--r--sword1/sworddefs.h15
4 files changed, 97 insertions, 14 deletions
diff --git a/sword1/logic.h b/sword1/logic.h
index 3099292684..3237656c72 100644
--- a/sword1/logic.h
+++ b/sword1/logic.h
@@ -52,6 +52,12 @@ public:
void runMouseScript(BsObject *cpt, int32 scriptId);
static uint32 _scriptVars[NUM_SCRIPT_VARS];
+// public for startPositions()
+ int fnAddObject (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
+ int fnEnterSection (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
+ int fnPlaySequence (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
+
+
private:
ObjectMan *_objMan;
ResMan *_resMan;
@@ -101,7 +107,6 @@ private:
int fnSetFadeTargetPalette(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnSetPaletteToFade(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnSetPaletteToCut(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
- int fnPlaySequence (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnIdle (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnPause (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
@@ -154,9 +159,7 @@ private:
int cfnReleaseMenu (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnAddSubject (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
- int fnAddObject (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnRemoveObject (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
- int fnEnterSection (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnLeaveSection (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnChangeFloor (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
int fnWalk (BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp
index 2b95eb9b2d..e6ba961988 100644
--- a/sword1/sword1.cpp
+++ b/sword1/sword1.cpp
@@ -140,20 +140,84 @@ void SwordEngine::initialize(void) {
}
_systemVars.playSpeech = 1;
- //- start.c:
- // todo: move these to somewhere else
+ startPositions(ConfMan.getInt("boot_param"));
+ _mouseState = 0;
+}
+
+void SwordEngine::startPositions(int32 startNumber) {
+ // int32 sect;
+ BsObject *compact;
+
+ SwordLogic::_scriptVars[CHANGE_STANCE] = STAND;
SwordLogic::_scriptVars[GEORGE_CDT_FLAG] = GEO_TLK_TABLE;
- SwordLogic::_scriptVars[CHANGE_X] = 481;
- SwordLogic::_scriptVars[CHANGE_Y] = 413;
- SwordLogic::_scriptVars[CHANGE_DIR] = DOWN;
- SwordLogic::_scriptVars[CHANGE_PLACE] = FLOOR_1;
+
+ //-------------------------------------------------------------------------------------------------------
+ // START 0==intro; 1==without
+
+ if ((startNumber==0)||(startNumber==1))
+ {
+ if (startNumber==0)
+ {
+ // Tdebug("Calling fn check cd");
+ // FN_check_CD(0,0,1,0,0,0,0,0); // request CD for sc1 (which happens to be CD-1)
+ // Tdebug("Calling fn play sequence");
+ _logic->fnPlaySequence(0,0,4,0,0,0,0,0); // intro
+ debug(1, "Setting start number to 1");
+ startNumber=1;
+ }
+
- SwordLogic::_scriptVars[NEW_SCREEN] = 1;
- _objectMan->fetchObject(PLAYER)->o_screen = 1;
- _objectMan->megaEntering(1);
+ SwordLogic::_scriptVars[CHANGE_X] = 481;
+ SwordLogic::_scriptVars[CHANGE_Y] = 413;
+ SwordLogic::_scriptVars[CHANGE_DIR] = DOWN;
+ SwordLogic::_scriptVars[CHANGE_PLACE] = FLOOR_1;
+ }
+ //-------------------------------------------------------------------------------------------------------
+ else if (startNumber==2) // blind_alley
+ {
+ SwordLogic::_scriptVars[CHANGE_X] = 480;
+ SwordLogic::_scriptVars[CHANGE_Y] = 388;
+ SwordLogic::_scriptVars[CHANGE_DIR] = DOWN_LEFT;
+ SwordLogic::_scriptVars[CHANGE_PLACE] = FLOOR_2;
+
+ _logic->fnAddObject(0,0,LIFTING_KEYS,0,0,0,0,0);
+ _logic->fnAddObject(0,0,ROSSO_CARD,0,0,0,0,0);
+
+ SwordLogic::_scriptVars[POCKET_1] = 1;
+ SwordLogic::_scriptVars[POCKET_2] = 1;
+ SwordLogic::_scriptVars[POCKET_3] = 1;
+ SwordLogic::_scriptVars[POCKET_4] = 1;
+ SwordLogic::_scriptVars[POCKET_5] = 1;
+ SwordLogic::_scriptVars[POCKET_6] = 1;
+ SwordLogic::_scriptVars[POCKET_7] = 1;
+ SwordLogic::_scriptVars[POCKET_8] = 1;
+ SwordLogic::_scriptVars[POCKET_9] = 1;
+
+ SwordLogic::_scriptVars[POCKET_10] = 1;
+ SwordLogic::_scriptVars[POCKET_11] = 1;
+ SwordLogic::_scriptVars[POCKET_12] = 1;
+ SwordLogic::_scriptVars[POCKET_13] = 1;
+ SwordLogic::_scriptVars[POCKET_14] = 1;
+ SwordLogic::_scriptVars[POCKET_15] = 1;
+ SwordLogic::_scriptVars[POCKET_16] = 1;
+ SwordLogic::_scriptVars[POCKET_17] = 1;
+ SwordLogic::_scriptVars[POCKET_18] = 1;
+ SwordLogic::_scriptVars[POCKET_19] = 1;
+
+ SwordLogic::_scriptVars[POCKET_20] = 1;
+ SwordLogic::_scriptVars[POCKET_21] = 1;
+ SwordLogic::_scriptVars[POCKET_22] = 1;
+ SwordLogic::_scriptVars[POCKET_23] = 1;
+ SwordLogic::_scriptVars[POCKET_24] = 1;
+ SwordLogic::_scriptVars[POCKET_25] = 1;
+ SwordLogic::_scriptVars[POCKET_26] = 1;
+ SwordLogic::_scriptVars[POCKET_27] = 1;
+ SwordLogic::_scriptVars[POCKET_28] = 1;
+ SwordLogic::_scriptVars[POCKET_29] = 1;
+ }
- SwordLogic::_scriptVars[CHANGE_STANCE] = STAND;
- _mouseState = 0;
+ compact = (BsObject*)_objectMan->fetchObject(PLAYER);
+ _logic->fnEnterSection(compact, PLAYER, startNumber, 0, 0, 0, 0, 0); // (automatically opens the compact resource for that section)
}
void SwordEngine::go(void) {
diff --git a/sword1/sword1.h b/sword1/sword1.h
index 52ba49cc2a..46804a006c 100644
--- a/sword1/sword1.h
+++ b/sword1/sword1.h
@@ -75,6 +75,7 @@ private:
void initialize(void);
void mainLoop(void);
void fnCheckCd(uint32 newScreen);
+ void startPositions(int32 startNumber);
uint16 _mouseX, _mouseY, _mouseState;
diff --git a/sword1/sworddefs.h b/sword1/sworddefs.h
index b57e9fb98c..f59d761753 100644
--- a/sword1/sworddefs.h
+++ b/sword1/sworddefs.h
@@ -132,13 +132,28 @@ enum Language {
#define PLAYER 8388608
#define NICO 8454144
#define GEORGE 8388608
+#define UP 0
+#define UP_RIGHT 1
+#define U_R 1
+#define RIGHT 2
+#define DOWN_RIGHT 3
+#define D_R 3
#define DOWN 4
+#define DOWN_LEFT 5
+#define D_L 5
+#define LEFT 6
+#define UP_LEFT 7
+#define U_L 7
#define FLOOR_1 65536
#define BENOIR 8585216
#define ROSSO 8716288
#define MOUE 9502720
#define ALBERT 9568256
#define DUANE 8781824
+#define FLOOR_2 131072
+#define LIFTING_KEYS 18
+#define ROSSO_CARD 27
+
#define menu_bible 69
#define menu_newspaper 1