My Project
Loading...
Searching...
No Matches
config.h
1/*
2 * OpenTyrian: A modern cross-platform port of Tyrian
3 * Copyright (C) 2007-2009 The OpenTyrian Development Team
4 *
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.
9 *
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.
14 *
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.
18 */
19#ifndef CONFIG_H
20#define CONFIG_H
21
22#include "opentyr.h"
23#include "config_file.h"
24
25#include "SDL.h"
26
27#include <stdio.h>
28
29#define SAVE_FILES_NUM (11 * 2)
30
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)
36
37/*#define SAVE_FILES_SIZE (2502 - 4)
38#define SAVE_FILE_SIZE (SAVE_FILES_SIZE)*/
39
40enum
41{
42 DIFFICULTY_WIMP = 0,
43 DIFFICULTY_EASY,
44 DIFFICULTY_NORMAL,
45 DIFFICULTY_HARD,
46 DIFFICULTY_IMPOSSIBLE,
47 DIFFICULTY_INSANITY,
48 DIFFICULTY_SUICIDE,
49 DIFFICULTY_MANIACAL,
50 DIFFICULTY_ZINGLON, // aka Lord of the Game
51 DIFFICULTY_NORTANEOUS,
52 DIFFICULTY_10,
53};
54
55// NOTE: Do not reorder. This ordering corresponds to the keyboard
56// configuration menu and to the bits stored in demo files.
57enum
58{
59 KEY_SETTING_UP,
60 KEY_SETTING_DOWN,
61 KEY_SETTING_LEFT,
62 KEY_SETTING_RIGHT,
63 KEY_SETTING_FIRE,
64 KEY_SETTING_CHANGE_FIRE,
65 KEY_SETTING_LEFT_SIDEKICK,
66 KEY_SETTING_RIGHT_SIDEKICK,
67};
68
69typedef JE_byte DosKeySettings[8]; // fka KeySettingType
70
71typedef SDL_Scancode KeySettings[8];
72
73typedef JE_byte MouseSettings[3];
74
75typedef JE_byte JE_PItemsType[12]; /* [1..12] */
76
77typedef JE_byte JE_EditorItemAvailType[100]; /* [1..100] */
78
79typedef struct
80{
81 JE_word encode;
82 JE_word level;
83 JE_PItemsType items;
84 JE_longint score;
85 JE_longint score2;
86 char levelName[11]; /* string [9]; */ /* SYN: Added one more byte to match lastLevelName below */
87 JE_char name[15]; /* [1..14] */ /* SYN: Added extra byte for null */
88 JE_byte cubes;
89 JE_byte power[2]; /* [1..2] */
90 JE_byte episode;
91 JE_PItemsType lastItems;
92 JE_byte difficulty;
93 JE_byte secretHint;
94 JE_byte input1;
95 JE_byte input2;
96 JE_boolean gameHasRepeated; /*See if you went from one episode to another*/
97 JE_byte initialDifficulty;
98
99 /* High Scores - Each episode has both sets of 1&2 player selections - with 3 in each */
100 JE_longint highScore1;
101 JE_longint highScore2; // unused
102 char highScoreName[30]; /* string [29] */
103 JE_byte highScoreDiff;
105
106typedef JE_SaveFileType JE_SaveFilesType[SAVE_FILES_NUM]; /* [1..savefilesnum] */
107typedef JE_byte JE_SaveGameTemp[SAVE_FILES_SIZE + 4 + 100]; /* [1..sizeof(savefilestype) + 4 + 100] */
108
109typedef struct
110{
111 // Tyrian 2000 uses a different high scores struct and appends it to TYRIAN.SAV
112 JE_longint score;
113 char playerName[30];
114 JE_byte difficulty;
116
117// First 10 are timed battle, next 10 are episodes
118extern T2KHighScoreType t2kHighScores[20][3];
119
120extern const JE_byte cryptKey[10];
121extern const DosKeySettings defaultDosKeySettings; // fka defaultKeySettings
122extern const KeySettings defaultKeySettings;
123extern const MouseSettings defaultMouseSettings;
124extern char defaultHighScoreNames[39][23];
125extern char defaultTeamNames[10][25];
126extern const JE_EditorItemAvailType initialItemAvail;
127extern JE_boolean smoothies[9];
128extern JE_byte starShowVGASpecialCode;
129extern JE_word lastCubeMax, cubeMax;
130extern JE_word cubeList[4];
131extern JE_boolean gameHasRepeated;
132extern JE_shortint difficultyLevel, oldDifficultyLevel, initialDifficulty;
133extern JE_byte timeBattleSelection;
134extern uint power, lastPower, powerAdd;
135extern JE_byte shieldWait, shieldT;
136
137enum
138{
139 SHOT_FRONT,
140 SHOT_REAR,
141 SHOT_LEFT_SIDEKICK,
142 SHOT_RIGHT_SIDEKICK,
143 SHOT_MISC,
144 SHOT_P2_CHARGE,
145 SHOT_P1_SUPERBOMB,
146 SHOT_P2_SUPERBOMB,
147 SHOT_SPECIAL,
148 SHOT_NORTSPARKS,
149 SHOT_SPECIAL2
150};
151
152extern JE_byte shotRepeat[11], shotMultiPos[11];
153extern JE_boolean portConfigChange, portConfigDone;
154extern char lastLevelName[11], levelName[11];
155extern JE_byte mainLevel, nextLevel, saveLevel;
156extern DosKeySettings dosKeySettings; // fka keySettings
157extern KeySettings keySettings;
158extern MouseSettings mouseSettings;
159extern JE_shortint levelFilter, levelFilterNew, levelBrightness, levelBrightnessChg;
160extern JE_boolean filtrationAvail, filterActive, filterFade, filterFadeStart;
161extern JE_boolean gameJustLoaded;
162extern JE_boolean galagaMode;
163extern JE_boolean extraGame;
164extern JE_boolean twoPlayerMode, twoPlayerLinked, onePlayerAction, timedBattleMode, superTyrian, trentWin;
165extern JE_byte superArcadeMode;
166extern JE_byte superArcadePowerUp;
167extern JE_real linkGunDirec;
168extern JE_byte inputDevice[2];
169extern JE_byte secretHint;
170extern JE_byte background3over;
171extern JE_byte background2over;
172extern JE_byte gammaCorrection;
173extern JE_boolean superPause, explosionTransparent, youAreCheating, displayScore, background2, smoothScroll, wild, superWild, starActive, topEnemyOver, skyEnemyOverAll, background2notTransparent;
174extern JE_byte versionNum;
175extern JE_byte fastPlay;
176extern JE_boolean pentiumMode;
177extern JE_byte gameSpeed;
178extern JE_byte processorType;
179extern JE_SaveFilesType saveFiles;
180extern JE_SaveGameTemp saveTemp;
181extern JE_word editorLevel;
182
183extern Config opentyrian_config;
184
185void JE_initProcessorType(void);
186void JE_setNewGameSpeed(void);
187const char *get_user_directory(void);
188void JE_loadConfiguration(void);
189void JE_saveConfiguration(void);
190
191void JE_saveGame(JE_byte slot, const char *name);
192void JE_loadGame(JE_byte slot);
193
194void JE_encryptSaveTemp(void);
195void JE_decryptSaveTemp(void);
196
197#endif /* CONFIG_H */
A configuration consisting of sections.
Definition config_file.h:182
Definition config.h:80
Definition config.h:110