-
Notifications
You must be signed in to change notification settings - Fork 163
/
game-info-h.gc
458 lines (425 loc) · 12.2 KB
/
game-info-h.gc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
;;-*-Lisp-*-
(in-package goal)
;; name: game-info-h.gc
;; name in dgo: game-info-h
;; dgos: GAME
;; +++game-vehicles
(defenum game-vehicles
:type uint64
:bitfield #t
(v-turtle 0)
(v-snake 1)
(v-scorpion 2)
(v-toad 3)
(v-fox 4)
(v-rhino 5)
(v-mirage 6)
(vehicle-x-ride 7)
)
;; ---game-vehicles
;; +++game-items
(defenum game-items
:type uint64
:bitfield #t
(amulet0 0)
(amulet1 1)
(amulet2 2)
(pass-wascity 3)
(seal-of-mar 4)
(pass-factory 5)
(artifact-holocube 6)
(artifact-quantum-reflector 7)
(artifact-prism 8)
(artifact-beam-generator 9)
(artifact-time-map 10)
(light-eco-crystal0 11)
(light-eco-crystal1 12)
(light-eco-crystal2 13)
(light-eco-crystal3 14)
(dark-eco-crystal0 15)
(dark-eco-crystal1 16)
(dark-eco-crystal2 17)
(dark-eco-crystal3 18)
(item19 19)
(item20 20)
(item21 21)
(item22 22)
(item23 23)
(item24 24)
(item25 25)
(item26 26)
(item27 27)
(item28 28)
(item29 29)
(item30 30)
(item31 31)
)
;; ---game-items
;; +++pickup-type
(defenum pickup-type
:type int32
(none 0)
(eco-yellow 1)
(eco-red 2)
(eco-blue 3)
(eco-dark 4)
(eco-green 5)
(eco-pill-green 6)
(eco-pill-dark 7)
(eco-pill-light 8)
(eco-pill-random 9)
(money 10)
(fuel-cell 11)
(buzzer 12)
(darkjak 13)
(lightjak 14)
(ammo-yellow 15)
(ammo-red 16)
(ammo-blue 17)
(ammo-dark 18)
(shield 19)
(health 20)
(trick-point 21)
(trick-judge 22)
(gem 23)
(skill 24)
(karma 25)
(gun-red-1 26)
(gun-red-2 27)
(gun-red-3 28)
(gun-yellow-1 29)
(gun-yellow-2 30)
(gun-yellow-3 31)
(gun-blue-1 32)
(gun-blue-2 33)
(gun-blue-3 34)
(gun-dark-1 35)
(gun-dark-2 36)
(gun-dark-3 37)
(board 38)
(pass-red 39)
(pass-green 40)
(pass-yellow 41)
(pass-blue 42)
(ammo-random 43)
(health-max 44)
(light-eco-crystal 45)
(dark-eco-crystal 46)
(pass-slumb-genb 47)
(ammo-light-random 48)
(ammo-dark-light-random 49)
(light-random 50)
)
;; ---pickup-type
;; +++highscore-flags
(defenum highscore-flags
:bitfield #t
:type uint8
(time)
)
;; ---highscore-flags
;; +++continue-flags
;; TODO copied from jak 2
(defenum continue-flags
:type uint32
:bitfield #t
;(continue-flag-0 0)
(scene-wait 1)
(change-continue 2)
(no-auto 3)
(no-blackout 4)
(game-start 5)
(demo-end 6)
(warp-gate 7)
(demo 8)
(intro 9)
(hero-mode 10)
(demo-movie 11)
(title 12)
(title-movie 13)
(continue-flag-14 14)
(continue-flag-15 15)
(continue-flag-16 16)
(test 17)
(record-path 18)
(pilot 19)
(pilot-dax 20)
(record-sig 21)
(indax 22)
)
;; ---continue-flags
(declare-type game-info basic)
(define-extern *game-info* game-info)
(declare-type entity-perm-array inline-array-class)
;; DECOMP BEGINS
(local-vars (gp-0 game-info))
(deftype game-bank (basic)
((life-max-default float)
(life-start-default float)
(life-single-inc float)
(money-task-inc float)
(money-oracle-inc float)
)
)
(define *GAME-bank* (new 'static 'game-bank
:life-max-default 99.0
:life-start-default 5.0
:life-single-inc 1.0
:money-task-inc 90.0
:money-oracle-inc 120.0
)
)
(deftype actor-id (uint32)
()
)
(deftype highscore-info (structure)
((flags highscore-flags)
(award-scores float 3)
(bronze-score float :overlay-at (-> award-scores 0))
(silver-score float :overlay-at (-> award-scores 1))
(gold-score float :overlay-at (-> award-scores 2))
)
(:methods
(get-rank (_type_ float) int)
)
)
(deftype level-buffer-state (structure)
((name symbol)
(display? symbol)
(force-vis? symbol)
(force-inside? symbol)
)
:pack-me
)
(deftype level-buffer-state-small (structure)
((name basic)
(display? symbol)
)
)
(deftype load-state (basic)
((want level-buffer-state 10 :inline)
(want-exp level-buffer-state 10 :inline)
(target level-buffer-state 10 :inline)
(want-sound sound-bank-state 3 :inline)
(want-exp-sound sound-bank-state 6 :inline)
(target-sound sound-bank-state 6 :inline)
(vis-nick symbol)
(command-list pair)
(object-name string 256)
(object-status basic 256)
(update-callback basic)
)
(:methods
(new (symbol type) _type_)
(load-state-method-9 () none)
(load-state-method-10 () none)
(load-state-method-11 () none)
(want-sound-banks (_type_ (pointer symbol)) none)
(load-state-method-13 () none)
(load-state-method-14 () none)
(load-state-method-15 () none)
(load-state-method-16 () none)
(load-state-method-17 () none)
(load-state-method-18 () none)
(load-state-method-19 () none)
(load-state-method-20 () none)
(load-state-method-21 () none)
)
)
;; WARN: Return type mismatch none vs load-state.
(defmethod new load-state ((allocation symbol) (type-to-make type))
(let ((a0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> a0-1 update-callback) #f)
(the-as load-state ((method-of-object a0-1 load-state-method-9)))
)
)
(deftype continue-point (basic)
((name string)
(level symbol)
(flags continue-flags)
(trans vector :inline)
(camera-trans vector :inline)
(quat vector4h :inline)
(camera-rot vector3s 3 :inline)
(on-goto pair :offset 76)
(vis-nick symbol :offset 80)
(vehicle-type uint8 :offset 84)
(want-count int8 :offset 85)
(want level-buffer-state-small :offset 88)
(want-sound symbol 3 :offset 92)
)
(:methods
(continue-point-method-9 () none)
(continue-point-method-10 () none)
(continue-point-method-11 () none)
)
)
(deftype game-info (basic)
((mode symbol)
(save-name string)
(life float)
(life-max float)
(money float)
(money-total float)
(money-per-level uint8 32)
(deaths-per-level uint8 32)
(buzzer-total float)
(fuel float)
(gem float)
(gem-total float)
(skill float)
(skill-total float)
(skill-high-watermark float)
(light-crystal float)
(dark-crystal float)
(karma float)
(eco-pill-dark float)
(eco-pill-dark-total float)
(eco-pill-light float)
(eco-pill-light-total float)
(features game-feature)
(debug-features game-feature)
(old-features game-feature)
(items game-items)
(debug-items game-items)
(old-items game-items)
(secrets game-secrets)
(purchase-secrets game-secrets)
(gun-type pickup-type)
(gun-ammo float 4)
(shield float)
(vehicles game-vehicles)
(debug-vehicles game-vehicles)
(old-vehicles game-vehicles)
(score float)
(score-owner handle)
(timer time-frame)
(timer-owner handle)
(timer-flash symbol)
(counter float)
(counter-flash basic)
(health-bar float)
(health-bar-owner uint64)
(enemies-killed float)
(civilians-killed float)
(marauders-killed float)
(shots-fired float 4)
(shots-hit float 4)
(crates-opened float)
(health-collected float)
(board-time uint64)
(attack-id uint32)
(perm-list entity-perm-array)
(task-perm-list entity-perm-array)
(current-continue continue-point)
(last-continue continue-point)
(task-node-commands pair :offset 416)
(task-node-exclusive pair)
(task-counter uint32)
(unknown-arr4 (array uint16))
(level-opened uint8 32)
(total-deaths int32)
(continue-deaths int32)
(task-deaths int32)
(total-trys int32)
(game-start-time uint64)
(continue-time uint64)
(death-time uint64)
(hit-time uint64)
(task-pickup-time uint64)
(unknown-arr0 (array uint64))
(unknown-arr1 (array uint64))
(unknown-arr2 (array uint64))
(death-pos vector-array)
(stop-watch-start time-frame)
(stop-watch-stop time-frame)
(blackout-time time-frame)
(letterbox-time time-frame)
(hint-play-time time-frame)
(display-text-time time-frame)
(display-text-handle handle)
(death-movie-tick int32)
(want-auto-save symbol)
(auto-save-proc handle)
(auto-save-status mc-status-code)
(auto-save-card int32)
(auto-save-which int32)
(auto-save-count int32)
(pov-camera-handle handle)
(other-camera-handle handle)
(controller handle 2)
(race-timer time-frame)
(race-current-lap-count int32)
(race-total-lap-count int32)
(race-position int32)
(race-number-turbos int32)
(bot-health float 3)
(demo-state uint32)
(wanted-flash symbol)
(distance float)
(kiosk-timeout time-frame)
(pause-start-time time-frame)
(game-score (array float))
(goal float)
(miss float)
(miss-max float)
(unknown-arr3 (array uint64))
(live-eco-pill-count int32)
(live-gem-count int32)
(air-supply float)
(homing-beacon int32)
(dark-eco-pickup int32)
(green-eco-pickup int32)
(health-bar-vehicle float)
(dust-storm handle)
(flut-count int32)
(death-resetter resetter-spec :inline)
(current-vehicle uint8)
(vehicle-turbo-ready float)
(percent-complete float)
)
(:methods
(game-info-method-9 () none)
(game-info-method-10 () none)
(game-info-method-11 () none)
(game-info-method-12 () none)
(game-info-method-13 () none)
(game-info-method-14 () none)
(game-info-method-15 () none)
(game-info-method-16 () none)
(game-info-method-17 () none)
(game-info-method-18 () none)
(game-info-method-19 () none)
(game-info-method-20 () none)
(game-info-method-21 () none)
(game-info-method-22 () none)
(game-info-method-23 () none)
(game-info-method-24 () none)
(game-info-method-25 () none)
(get-next-attack-id! (_type_) uint)
(game-info-method-27 () none)
(game-info-method-28 () none)
(game-info-method-29 () none)
(game-info-method-30 () none)
(game-info-method-31 () none)
(game-info-method-32 () none)
(game-info-method-33 () none)
(game-info-method-34 () none)
)
)
(defmethod get-next-attack-id! ((this game-info))
(let ((v0-0 (+ (-> this attack-id) 1)))
(set! (-> this attack-id) v0-0)
v0-0
)
)
(set! gp-0 (when (or (not *game-info*) (zero? *game-info*))
(set! gp-0 (new 'static 'game-info :mode 'debug :current-continue #f :last-continue #f))
(set! (-> gp-0 unknown-arr0) (new 'global 'boxed-array uint64 138))
(set! (-> gp-0 unknown-arr3) (new 'global 'boxed-array uint64 138))
(set! (-> gp-0 unknown-arr1) (new 'global 'boxed-array uint64 32))
(set! (-> gp-0 unknown-arr2) (new 'global 'boxed-array uint64 32))
(set! *game-info* gp-0)
gp-0
)
)