2
* OpenTyrian: A modern cross-platform port of Tyrian
3
* Copyright (C) 2007-2009 The OpenTyrian Development Team
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
#define SAVE_FILES_NUM (11 * 2)
31
/* These are necessary because the size of the structure has changed from the original, but we
32
need to know the original sizes in order to find things in TYRIAN.SAV */
33
#define SAVE_FILES_SIZE 2398
34
#define SIZEOF_SAVEGAMETEMP SAVE_FILES_SIZE + 4 + 100
35
#define SAVE_FILE_SIZE (SIZEOF_SAVEGAMETEMP - 4)
37
/*#define SAVE_FILES_SIZE (2502 - 4)
38
#define SAVE_FILE_SIZE (SAVE_FILES_SIZE)*/
40
typedef SDLKey JE_KeySettingType[8]; /* [1..8] */
41
typedef JE_byte JE_PItemsType[12]; /* [1..12] */
43
typedef JE_byte JE_EditorItemAvailType[100]; /* [1..100] */
52
char levelName[11]; /* string [9]; */ /* SYN: Added one more byte to match lastLevelName below */
53
JE_char name[15]; /* [1..14] */ /* SYN: Added extra byte for null */
55
JE_byte power[2]; /* [1..2] */
57
JE_PItemsType lastItems;
62
JE_boolean gameHasRepeated; /*See if you went from one episode to another*/
63
JE_byte initialDifficulty;
65
/* High Scores - Each episode has both sets of 1&2 player selections - with 3 in each */
66
JE_longint highScore1,
68
char highScoreName[30]; /* string [29] */
69
JE_byte highScoreDiff;
72
typedef JE_SaveFileType JE_SaveFilesType[SAVE_FILES_NUM]; /* [1..savefilesnum] */
73
typedef JE_byte JE_SaveGameTemp[SAVE_FILES_SIZE + 4 + 100]; /* [1..sizeof(savefilestype) + 4 + 100] */
75
extern const JE_byte cryptKey[10];
76
extern const JE_KeySettingType defaultKeySettings;
77
extern const char defaultHighScoreNames[34][23];
78
extern const char defaultTeamNames[22][25];
79
extern const JE_EditorItemAvailType initialItemAvail;
80
extern JE_boolean smoothies[9];
81
extern JE_byte starShowVGASpecialCode;
82
extern JE_word lastCubeMax, cubeMax;
83
extern JE_word cubeList[4];
84
extern JE_boolean gameHasRepeated;
85
extern JE_shortint difficultyLevel, oldDifficultyLevel, initialDifficulty;
86
extern uint power, lastPower, powerAdd;
87
extern JE_byte shieldWait, shieldT;
104
extern JE_byte shotRepeat[11], shotMultiPos[11];
105
extern JE_boolean portConfigChange, portConfigDone;
106
extern char lastLevelName[11], levelName[11];
107
extern JE_byte mainLevel, nextLevel, saveLevel;
108
extern JE_KeySettingType keySettings;
109
extern JE_shortint levelFilter, levelFilterNew, levelBrightness, levelBrightnessChg;
110
extern JE_boolean filtrationAvail, filterActive, filterFade, filterFadeStart;
111
extern JE_boolean gameJustLoaded;
112
extern JE_boolean galagaMode;
113
extern JE_boolean extraGame;
114
extern JE_boolean twoPlayerMode, twoPlayerLinked, onePlayerAction, superTyrian, trentWin;
115
extern JE_byte superArcadeMode;
116
extern JE_byte superArcadePowerUp;
117
extern JE_real linkGunDirec;
118
extern JE_byte inputDevice[2];
119
extern JE_byte secretHint;
120
extern JE_byte background3over;
121
extern JE_byte background2over;
122
extern JE_byte gammaCorrection;
123
extern JE_boolean superPause, explosionTransparent, youAreCheating, displayScore, background2, smoothScroll, wild, superWild, starActive, topEnemyOver, skyEnemyOverAll, background2notTransparent;
124
extern JE_byte versionNum;
125
extern JE_byte fastPlay;
126
extern JE_boolean pentiumMode;
127
extern JE_byte gameSpeed;
128
extern JE_byte processorType;
129
extern JE_SaveFilesType saveFiles;
130
extern JE_SaveGameTemp saveTemp;
131
extern JE_word editorLevel;
133
void JE_initProcessorType( void );
134
void JE_setNewGameSpeed( void );
135
const char *get_user_directory( void );
136
void JE_loadConfiguration( void );
137
void JE_saveConfiguration( void );
139
void JE_saveGame( JE_byte slot, const char *name );
140
void JE_loadGame( JE_byte slot );
142
void JE_encryptSaveTemp( void );
143
void JE_decryptSaveTemp( void );
145
cJSON *load_json( const char *filename );
146
void save_json( cJSON *root, const char *filename );
148
#endif /* CONFIG_H */