/[projet1]/users/chema/TINE/data.s
Defence Force logotype

Contents of /users/chema/TINE/data.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 266 - (show annotations)
Mon Feb 8 22:12:53 2010 UTC (9 years, 8 months ago) by Chema
File size: 8323 byte(s)
many small changes and bug huntings. Newest line routine, removed clearing the laser vertices from the main loop...
1
2 #include "oobj3d/obj3d.h"
3 #include "tine.h"
4 #include "ships.h"
5
6
7 ; Player workspace (for saving)
8
9 ;unsigned char name[32]="Jameson"; /* Commander's name */
10 ;unsigned int shipshold[lasttrade+1]; /* Contents of cargo bay */
11 ;unsigned char currentplanet; /* Current planet */
12 ;unsigned char galaxynum=1; /* Galaxy number (1-8) */
13 ;unsigned char cash[4]={0xd0,0x07,0,0}; /* four bytes for cash */
14 ;unsigned char fuel=70; /* Amount of fuel, can this be a byte? */
15 ;unsigned char fluct; /* price fluctuation */
16 ;unsigned int holdspace=20; /* Current space used? */
17 ;unsigned char legal_status=50; /* Current legal status 0=Clean, <50=Offender, >50=Fugitive */
18 ;unsigned int score=60000; /* Score. Can this be just two bytes? */
19 ;unsigned char mission=0; /* Current mission */
20 ;unsigned int equip=0xfff; /* Equipment flags */
21
22
23 ; Default commander's data
24 _default_commander
25 .asc "Jameson" ; Commander's name
26 .byt 00
27 .dsb 3
28 .dsb 17 ; Contents of cargo bay
29 .byt 7 ; Current planet
30 .byt 1 ; Galaxy number (1-8)
31 .byt $e8,$03 ; Four bytes for cash (100.0)
32 .byt $00,$00
33 .byt 70 ; Amount of fuel
34 .byt 0 ; Price fluctuation
35 .byt 20 ; Current space left in cargo bay
36 .byt 00 ; Legal status 0=Clean, <50=Offender, >50=Fugitive
37 .byt 00 ; Score, remainder
38 .word 00000 ; Current score
39 .byt 0 ; Current mission
40 .word $0001 ; Equipment flags
41 .byt SHIP_COBRA3 ; Current player's ship
42 .byt 3 ; Number of missiles
43
44 ; Stats for player's ship. Initially the basic for the ship, but may vary with equipment
45 .byt 0
46 .byt 0
47 .byt 0
48 .byt 0
49 _default_commander_end
50
51
52 ; Other player variables
53 _front_shield .byt 22
54 _rear_shield .byt 22
55 _missile_armed .byt 0
56 _ptla .byt 0
57 _ptsh .byt 0
58
59 ;Is ECM active?
60 _ecm_counter .byt 0
61
62 ;typedef struct
63 ;{ char a,b,c,d;
64 ;} fastseedtype; /* four byte random number used for planet description */
65
66 ;typedef struct
67 ;{ int w0;
68 ; int w1;
69 ; int w2;
70 ;} seedtype; /* six byte random number used as seed for planets */
71
72 ;typedef struct
73 ;{
74 ; unsigned char x;
75 ; unsigned char y; /* One byte unsigned */
76 ; unsigned char economy; /* These two are actually only 0-7 */
77 ; unsigned char govtype;
78 ; unsigned char techlev; /* 0-16 i think */
79 ; unsigned char population; /* One byte */
80 ; unsigned int productivity; /* Two byte */
81 ; unsigned int radius; /* Two byte (not used by game at all) */
82 ; fastseedtype goatsoupseed;
83 ; char name[12];
84 ;} plansys ;
85
86
87 ; plansys cpl_system, hyp_system
88 _cpl_system .dsb 26
89 _hyp_system .dsb 26
90
91
92 ;unsigned char quantities[lasttrade+1];
93 ;unsigned int prices[lasttrade+1];
94
95 _prices .dsb 34
96 _quantities .dsb 17
97
98
99 _dest_num .byt 7 ; So we start at LAVE
100 _dest_dist .word 0 ; Distance to target planet
101 _current_screen .byt 0
102 _docked .byt 255
103 _planet_dist .byt 255
104
105
106 ; Variables to mantain for each space object
107
108 _rotx .dsb MAXSHIPS
109 _roty .dsb MAXSHIPS
110 _rotz .dsb MAXSHIPS
111 _accel .dsb MAXSHIPS
112 _speed .dsb MAXSHIPS
113 _target .dsb MAXSHIPS
114 _flags .dsb MAXSHIPS
115 _ttl .dsb MAXSHIPS
116 _energy .dsb MAXSHIPS
117 _missiles .dsb MAXSHIPS
118 _ai_state .dsb MAXSHIPS
119 _vertexXLO .dsb MAXSHIPS
120 _vertexXHI .dsb MAXSHIPS
121 _vertexYLO .dsb MAXSHIPS
122 _vertexYHI .dsb MAXSHIPS
123
124
125 ; Some more variables
126
127 fixed_objects .byt 00
128 thargoid_counter .byt 00
129 police_counter .byt 00
130 asteroid_counter .byt 00
131 worm_counter .byt 00
132 missile_counter .byt 00
133
134 police_ids .dsb MAXCOPS
135
136 ; Digrams
137
138 _pairs0 .asc "ABOUSEITILETSTONLONUTHNO"
139 _pairs .asc "..LEXEGEZACEBISO"
140 .asc "USESARMAINDIREA."
141 .asc "ERATENBERALAVETI"
142 .asc "EDORQUANTEISRION"
143
144
145 ; Goat soup dictionary
146
147 ; Call entry string
148 gs_init_str
149 .byt $0f
150 .asc " is "
151 .byt $17
152 .asc "."
153 .byt 0
154
155
156 ian_str
157 .asc "ian"
158 .byt 0
159
160
161 gs_jump_lo .byt <gs_planet_name,<gs_planet_nameian,<gs_random_name
162 gs_jump_hi .byt >gs_planet_name,>gs_planet_nameian,>gs_random_name
163
164
165 #define USEPAGE4
166 #ifdef USEPAGE4
167 .bss
168 *=$400
169 #endif
170
171
172 __commander_data_start
173 _name .asc "Jameson" ; Commander's name (10 chars plus ending 0)
174 .byt 00
175 .dsb 3
176 _shipshold .dsb 17 ; Contents of cargo bay
177 _currentplanet .byt 7 ; Current planet
178 _galaxynum .byt 1 ; Galaxy number (1-8)
179 _cash .byt $e8,$03 ; Four bytes for cash
180 .byt $10,$00
181 _fuel .byt 70 ; Amount of fuel
182 _fluct .byt 0 ; Price fluctuation
183 _holdspace .byt 20 ; Current space left in cargo bay
184 _legal_status .byt 00 ; Legal status 0=Clean, <50=Offender, >50=Fugitive
185 _score_rem .byt 00 ; Score, remainder
186 _score .word 0000 ; Current score
187 _mission .byt 0 ; Current mission
188 _equip .word $0001 ; Equipment flags
189 _ship_type .byt SHIP_COBRA3 ; Current player's ship
190 _missiles_left .byt 3 ; Number of missiles
191
192 ; Stats for player's ship. Initially the basic for the ship, but may vary with equipment
193 _p_maxspeed .byt 0
194 _p_maxenergy .byt 0
195 _p_maxmissiles .byt 0
196 _p_laserdamage .byt 0
197 __commander_data_end
198
199
200 ; From galaxy.s
201
202 ; Some vars for loops, etc...
203 count2 .byt 0 ; used in genmarket & displaymarket
204 num .byt 0 ; used in infoplanet
205 index .byt 00 ; These two usedin gs_randomname
206 lowcase .byt 00
207
208 ; For plotting charts
209
210 scroll .byt 0 ; Are we scrolling?
211
212 names .dsb 24
213 col .byt 00
214 row .byt 00
215 plotX .byt 00
216 plotY .byt 00
217
218
219 ; Buffer for strings, so they can be centered or justified. Main use is goatsup texts.
220 ; The speccy version has room for 4 lines of 30 character (120 in total), AND
221 ; performs justification of texts (which adds more spaces). I guess that is
222 ; a good limit for the buffer. As we print 38 characters per line we'd need 152
223 ; bytes, but I guess 120 should be enough.
224 ; Also used for inflight messages.
225
226 str_buffer .dsb 120
227
228
229 ; For naming planets
230 ; Uses a temporal seed
231 temp_seed .dsb 6
232 ; Use temporal buffer for name
233 temp_name .dsb 9
234
235
236 ; For market
237 ; Current selection
238 _cur_sel .byt $ff
239
240 ; These are filled when accessing the equip list screen
241
242 equip_items .byt 0 ; Number of possible items (for selection)
243 equip_flags .word 00 ; Flags with 1's when an item is available
244
245
246 ;From tinefuncs.s
247 ;; Some Global Variables
248 ;; that can be used from C
249
250 ;; General coordinate variables
251 _VX .byt 0
252 _VY .byt 0
253 _VZ .byt 0
254
255 ;; A vector definition Should be contiguous!
256 _VectX .byt 0,0
257 _VectY .byt 0,0
258 _VectZ .byt 0,0
259
260 ;; Position of a ship Should be contiguous!
261 _PosX .byt 0,0
262 _PosY .byt 0,0
263 _PosZ .byt 0,0
264
265
266 ; From tactics.s
267 ; fly_to_ship
268 A1 .word 0
269 oX .word 0
270 oY .word 0
271 oZ .word 0
272
273 ; AIMain
274 AIShipID .byt 00 ; Current ship's ID
275 AIShipType .byt 00 ; Current ship's type
276 AITarget .byt 00 ; Current ship's target
277 AIIsAngry .byt 00 ; Angry status (with target)
278
279 #ifdef USEPAGE4
280 .text
281 #endif
282
283 ;From radar.s
284 ; To store objects for plotting the radar
285 radar_savX .dsb MAX_RADAR_POINTS*2
286 radar_savY .dsb MAX_RADAR_POINTS*2
287
288 ; From tactics.s
289
290 ;; Some variables to decouple firing and drawing the lasers
291 _numlasers .byt 00
292 _laser_source .dsb 4
293 _laser_target .dsb 4
294
295
296 ; For displaying the market
297 mkstrslo
298 .byt <(str_mktunit)
299 .byt <(str_mktquant)
300 .byt <(str_mktin)
301 .byt <(str_mktlist)
302 .byt <(str_mktunit)
303 .byt <(str_mktprice)
304 .byt <(str_mktsale)
305 .byt <(str_mktcargo)
306 mkstrshi
307 .byt >(str_mktunit)
308 .byt >(str_mktquant)
309 .byt >(str_mktin)
310 .byt >(str_mktlist)
311 .byt >(str_mktunit)
312 .byt >(str_mktprice)
313 .byt >(str_mktsale)
314 .byt >(str_mktcargo)
315
316 positionsX
317 .byt 20*6, 26*6, 35*6, 2*6, 14*6, 20*6, 26*6, 35*6
318
319
320 #echo Commander's data:
321 #print (__commander_data_end - __commander_data_start)
322
323
324
325
326
327
328

  ViewVC Help
Powered by ViewVC 1.1.26