1 // Keyboard
2 unsigned int keystatus;  		// Estado del teclado
3 
4 // Frames in stage
5 unsigned int stageframe; 		// Guarda las frames en una stage
6 
7 // Speeding thins up
8 unsigned char stageframe2mod;
9 unsigned char stageframe4mod;
10 unsigned char sprite82anim;
11 unsigned char sprite164anim;
12 
13 // Game vars
14 unsigned char basestage;					// Base stage para las 4 primeras fases
15 unsigned char playstage;					// Stage que se esta jugando en playstage
16 unsigned char updateplaystage;				// Si hay que hacer el update de la stage
17 unsigned char stagenum; 					// Numero de fase (del orden de la partida)
18 unsigned char laststagenum;					// Ultima stage, para el continue
19 unsigned char numplayers;					// Numero de players
20 unsigned char exitplaystage;				// Flag para salir de la stage
21 unsigned char gamelevel;					// Dificultad del juego
22 unsigned char gamestock;					// Número de jugadores por defecto
23 unsigned char gamepause;					// Si hay pausa
24 
25 // Player
26 #define DEFAULTPLAYERSPEED 2
27 #define ENEMYSHOOTDENSITY 4
28 
29 unsigned char playerx;				// Posicion X del jugador
30 unsigned char playery;				// Posicion Y del jugador
31 unsigned char playertype;			// Estado del player
32 unsigned char playercounter;		// Contador util para timers
33 unsigned char playershootcounter; 	// Contador para shoots
34 unsigned char playerside;			// Side of player sprite
35 unsigned char playerspeed;			// Player speed
36 unsigned char playershootlevel; 	// Player shoot level
37 unsigned char playershootmax;		// Player shoot max
38 
39 #define PLAYERSHOOT_SIDE_LEFT 0
40 #define PLAYERSHOOT_NORMAL 1
41 #define PLAYERSHOOT_SIDE_RIGHT 3
42 
43 #define PLAYERSHOOTINTERVAL_NORMAL 3
44 #define PLAYERSHOOTINTERVAL_SIDE 6
45 
46 #define MAXPLAYERSHOOTS 3
47 unsigned char numplayershoots;					// Disparos actuales
48 typedef struct playershoot
49 {
50 	unsigned char playershootx;
51 	unsigned char playershooty;
52 	unsigned char playershoottype;
53 	signed char playershootvelx;
54 	unsigned char playershootvely;
55 }playershoot;
56 playershoot playershoots[MAXPLAYERSHOOTS];
57 
58 // Disparos de enemigos
59 #define ENEMYSHOOT_NORMAL 2
60 #define ENEMYSHOOT_LASER 3
61 
62 #define MAXENEMYSHOOTS 10
63 unsigned char shootcount;						// Lleva la cuenta de disparos... sirve para diferenciar entre hard y easy
64 unsigned char numenemyshoots;					// Disparos actuales
65 typedef struct enemyshoot
66 {
67 	unsigned char enemyshootposx;
68 	unsigned char enemyshootposy;
69 	signed char enemyshootvelx;
70 	signed char enemyshootvely;
71 	unsigned char enemyshoottype;
72 }enemyshoot;
73 enemyshoot enemyshoots[MAXENEMYSHOOTS];
74 unsigned char playstageshootspeed;
75 
76 // Explosiones
77 #define MAXEXPLOSIONS 10
78 unsigned char numexplosions;
79 typedef struct explosion
80 {
81 	unsigned char explosionposx;
82 	unsigned char explosionposy;
83 	unsigned char explosionsprite;
84 	unsigned char explosiontype;
85 }explosion;
86 explosion explosions[MAXEXPLOSIONS];
87 
88 #define MAXENEMIES 10
89 unsigned char numenemies;
90 enemy enemies[MAXENEMIES];
91 
92 // The tilemap
93 unsigned char *maplines;				// Lineas de un tilemap
94 unsigned int maplineslength;			// Numero de lineas de un tilemap
95 unsigned char *maptiles;				// Tiles de un tilemap, en lineas
96 unsigned int mappositionx;				// Posicion del map
97 signed int mappositiony;				// Posicion del map
98 signed int oldmappositiony;			// Antigua posicion del map
99 
100 // Bank changer
101 unsigned char lastbank;
102 
103 // Map statics
104 const unsigned int *mapstatics;
105 unsigned int mapstaticscount;
106 unsigned char mapstaticsbank;
107 
108 // Music
109 unsigned char musicbank;
110 
111 // Map
112 unsigned char mapbank;
113 
114 // Playstage
115 unsigned char playstagebank;
116 
117 // Scroller
118 unsigned char numscrolls;
119 signed char scrollactspeedy;
120 signed char scrollactspeedx;
121 unsigned char scrollact;
122 unsigned int scrolltimes;
123 unsigned char disablescroll;
124 
125 typedef struct scroll
126 {
127 	signed int scrolllock;
128 	signed int scrolltimes;
129 	signed int scrolljump;
130 	signed int scrollspeedx;
131 	signed int scrollspeedy;
132 }scroll;
133 
134 scroll *scrolls;
135 
136 
137 // Scripter
138 #define MAXSCRIPTS 4
139 unsigned char numscripts;
140 typedef struct script
141 {
142 	unsigned int scripterpass;
143 	unsigned char *scripterscript;
144 	unsigned char **scripterlabels;
145 	unsigned char scripterframe;
146 	signed char scripterloop;
147 }script;
148 script scripts[MAXSCRIPTS];
149 
150 // Labels
151 #define MAXTIMEREDLABELS 3
152 unsigned char numtimeredlabels;					// Labels actuales
153 
154 typedef struct timeredlabel
155 {
156 unsigned char timeredlabely;	// Posicion Y de una label
157 unsigned char timeredlabelt;	// Tiempo final de una label
158 }timeredlabel;
159 timeredlabel timeredlabels[MAXTIMEREDLABELS];
160 
161 
162 // Usado en intro2 y ending
163 signed int introstageposx;
164 signed int introstagevelx;
165 
166 // Enter jukebox?
167 unsigned char dojukebox;
168 
169 // Spawned explosion
170 unsigned char spawnedexplosionposx;
171 unsigned char spawnedexplosionposy;
172 unsigned char spawnedexplosionwidth;
173 unsigned char spawnedexplosionheight;
174 unsigned char spawnedexplosiontime;
175 
176 // Check if play rays in stage 4
177 unsigned char stage4playrays;
178 
179 // Black magic
180 unsigned char numinterrupts;
181 
182 // Powerup
183 unsigned char powerupx;
184 unsigned char powerupy;
185 unsigned char powerupt;
186 signed char powerupv;
187 unsigned int powerupcounter;
188 
189 // Pause music system
190 char *lastplayedmusic;
191 unsigned char lastplayedmusicbank;
192 unsigned char lastplayedmusiclooped;
193 
194 // Needed in stage 8
195 unsigned char stage8phase;