-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTR9SaveGame.cpp
More file actions
9877 lines (8908 loc) · 308 KB
/
TR9SaveGame.cpp
File metadata and controls
9877 lines (8908 loc) · 308 KB
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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "stdafx.h"
#include "TR9SaveGame.h"
#include "TRXGlobal.h"
#include "TRXTools.h"
#include "TR_Areas.h"
#include "TRXCHEATWIN.h"
extern CTRXCHEATWINApp theApp;
//
/////////////////////////////////////////////////////////////////////////////
// Indicator Table
// The Table use only the first two words (3 bytes)
// But anyway the position is checked too
/////////////////////////////////////////////////////////////////////////////
TRR_BYTES_INDICATORS IndicatorsTRRTableBytes [ MAX_INDICATORS ] =
{
{ FALSE, 0x02, 0x00, 0x02, 0, "Standing", }, // Normally 0x0002 0x0002 0xnnnn 0x0067
{ FALSE, 0x03, 0x00, 0x03, 1, "Sliding forward", },
{ FALSE, 0x0D, 0x00, 0x0D, 1, "Underwater", },
{ FALSE, 0x0D, 0x00, 0x12, 1, "Underwater", },
{ FALSE, 0x12, 0x00, 0x12, 1, "Other", },
{ FALSE, 0x13, 0x00, 0x13, 1, "Climbing", },
{ FALSE, 0x17, 0x00, 0x02, 1, "Rolling", },
{ FALSE, 0x18, 0x00, 0x18, 1, "Sliding", },
{ FALSE, 0x20, 0x00, 0x20, 1, "Sliding backward", },
{ FALSE, 0x21, 0x00, 0x21, 1, "On water", },
{ FALSE, 0x41, 0x00, 0x02, 1, "Walking in water", },
{ FALSE, 0x41, 0x00, 0x41, 1, "Walking in water", },
{ FALSE, 0x47, 0x00, 0x47, 1, "Duck", },
{ FALSE, 0x57, 0x00, 0x57, 1, "Climbing", },
{ FALSE, 0x5b, 0x00, 0x5b, 1, "Climbing", },
{ TRUE, 0xff, 0xff, 0xff, 0, "End", },
};
int IndicatorsTRRTableBytesCount = sizeof(IndicatorsTRRTableBytes)/sizeof(TRR_BYTES_INDICATORS);
//
// Normally we could use a table like follows
TRR_WORDS_INDICATORS IndicatorsTRRTableWords [ MAX_INDICATORS ] =
{
{ FALSE, 0x0002, 0x0002, 0x0000, 0x0067, FALSE, 0, "Standing" },
{ FALSE, 0x0008, 0x0008, 0x0000, 0x0112, FALSE, 1, "Quad Bike" },
{ FALSE, 0x000d, 0x000d, 0x0000, 0x006c, FALSE, 1, "Swimming" },
{ FALSE, 0x0012, 0x0012, 0x0000, 0x0057, FALSE, 1, "Indicator 2" },
{ FALSE, 0x0021, 0x0021, 0x0000, 0x006E, TRUE, 1, "Swimming" }, // Use W3
{ FALSE, 0x0018, 0x0018, 0x0000, 0x0046, TRUE, 1, "Sliding" }, // Use W3
{ FALSE, 0x000d, 0x0012, 0x0000, 0x006c, TRUE, 1, "Underwater" }, // Use W3
{ FALSE, 0x0002, 0x0002, 0x0047, 0x00bd, TRUE, 1, "Standing" }, // Use W3
{ FALSE, 0x000f, 0x000f, 0x0000, 0x0173, TRUE, 2, "Quad Bike" }, // Use W3
{ FALSE, 0x0001, 0x0001, 0x0000, 0x0163, TRUE, 2, "Quad Bike" }, // Use W3
{ FALSE, 0x0001, 0x0002, 0x0000, 0x000a, FALSE, 2, "Indicator 10" },
{ FALSE, 0x0001, 0x0002, 0x0000, 0x0008, FALSE, 2, "Indicator 11" },
{ FALSE, 0x0002, 0x0002, 0x0000, 0x000B, TRUE, 9, "Standing" }, // Use W3
{ TRUE, 0xffff, 0xffff, 0xffff, 0xffff, TRUE, 0, "End" }, // End
};
int IndicatorsTRRTableWordsCount = sizeof(IndicatorsTRRTableWords)/sizeof(TRR_WORDS_INDICATORS);
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
static const char *TR1LevelNames [] =
{
"Caves",
"City of Vilcabamba",
"The Lost Valley", // Shotgun
"Tomb of Qualopec",
"St. Francis' Folly", // Magnum
"Colosseum",
"Palace Midas",
"Cistern",
"Tomb of Tihocan",
"City of Khamoon",
"Obelisk of Khamoon",
"Sanctuary of the Scion", // Uzis
"Natla's Mines",
"Atlantis",
"The Great Pyramid", // End if TR1
"Return to Egypt", // Start of TUB
"Temple of the Cat", // All Guns
"Atlantean Stronghold",
"The Hive",
"20: ",
"21: ",
"22: ",
"23: ",
"24: ",
"25: ",
"26: ",
"27: ",
"28: ",
"29: ",
"30: ",
"31: ",
"32: ",
};
static BYTE TR1Secrets [] =
{
3, 3, 5, 3, 4,
3, 3, 3, 2, 3,
3, 1, 3, 3, 3,
3, 4, 2, 1, // Unfinished Business
};
static BYTE TR1Pickup [] =
{
7, 13, 16, 8, 19, 14, 23, 28, 26, 24, 38, 29, 30, 50, 31,
53, 63, 63, 60
};
static BYTE TR1Kills [] =
{
14, 29, 13, 8, 23, 27, 43, 34, 17, 14, 16, 15, 3, 32, 6,
41, 43, 31, 41
};
//
static WORD TR1_Secrets_Offsets[] =
{
0, 1, 2, 3, 4,
5, 6, 7, 8, 9,
10, 11, 12, 13, 14,
15, 16, 17, 18,
};
static TR_START_CONDITIONS TR1_Start_LikePlus [] =
{
// PIS MAG UZI RIO HAR ROC GRE M16
{ true, true, true, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
// SMA LAR FLA HEA AIR
0, 0, 2, 1000, 1800 },
};
static TR_START_CONDITIONS TR1_Start_LikeGame [] =
{
// PIS MAG UZI RIO HAR ROC GRE M16
{ true, false, false, false, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
// SMA LAR FLA HEA AIR
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false, // Lost Valley
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, false, false, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, false, false, true, false, false, false, false, // St. Francis' Folly
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, false, false, false, false, // Sanctuary of the Scion
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, false, false, false, false, // The Great Pyramid
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, false, false, false, false,
50, 100, 6*10, 0, 0, 0, 0,
0, 0, 2, 1000, 1800 },
};
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
static const char *TR2LevelNames [] =
{
"Great Wall", // Grenade
"Venice", // Magnum
"Bartoli's Hideout", // Uzi
"Opera House",
"Offshore Rig", // Shotgun Harpoon
"Diving Area", // M16
"40 Fathoms",
"Wreck of the Maria Doria",
"Living Quarters",
"The Deck",
"Tibetan Foothills",
"Barkhang Monastery",
"Catacombs of the Talion",
"Ice Palace",
"Temple of Xian",
"Floating Islands",
"The Dragon's Lair",
"Home Sweet Home",
"The Cold War", // Harpoon M16 Magnum Uzi
"Fool's Gold", // Grenade
"Furnace of the Gods",
"Kingdom",
"Nightmare in Vegas",
"24: ",
"25: ",
"26: ",
"27: ",
"28: ",
"29: ",
"30: ",
"31: ",
"32: ",
};
static BYTE TR2Secrets [] =
{
3,
3, 3, 3,
3, 3, 3,
3, 3, 3,
3, 3, 3, 3,
3, 3, 0,
0,
3, 3, 3, 3, 3,
};
//
static BYTE TR2Pickup [] =
{
14,
30, 28, 37,
31, 39, 14,
41, 16, 35,
31, 49, 39, 33,
40, 39, 24,
45,
71, 69, 64, 52, 75,
};
static BYTE TR2Kills [] =
{
23,
24, 37, 46,
20, 34, 16,
35, 21, 30,
33, 30, 33, 22,
37, 26, 11,
16,
44, 62, 41, 29, 23,
};
static BYTE TR2Crystals [] =
{
0
};
//
static WORD TR2_Secrets_Offsets[] =
{
// China
0,
// Venice
7, 8, 9, //
// Offshore
10, 11, 12,
// Sunken Ship
13, 14, 15,
// Tibet
1, 2, 3, 4,
// China & Dragon Lair
5, 6,
// Tje Dragon Lair
21,
// Manor
23,
//
16, 17, 18, 19, 20 // Offset in TR2G override TR2
};
static TR_START_CONDITIONS TR2_Start_LikePlus [] =
{
// PIS MAG UZI RIO HAR ROC GRE M16
{ true, true, true, true, true, false, true, true,
80, 160, 4*6, 3, 0, 4, 80,
// SMA LAR FLA HEA AIR
0, 0, 2, 1000, 1800 },
};
static TR_START_CONDITIONS TR2_Start_LikeGame [] =
{
// PIS MAG UZI RIO HAR ROC GRE M16
{ true, false, false, false, false, false, false, false, // 0
80, 160, 4*6, 3, 0, 4, 80,
// SMA LAR FLA HEA AIR
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, true, false, // 1 Venice
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, false, false, false, false, true, false, // 2 Bartoldi
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, false, false, false, true, false, // 3 Opera
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, false, false, false, true, false, // 4 Offshore Rig
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, false, // 5 Diving Area
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 6
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 7
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 8
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 9
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 10
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 11
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 12
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 13
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 14
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 15
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, false, true, true, // 16
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ false, false, false, false, false, false, false, false, // 17 Home
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false, // Cold War
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, true, true, false, false, // Fool's Gold
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, true, true, false, false, // Furnace of the Gods
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ true, true, false, true, true, true, true, false, // Kingdom
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
{ false, false, false, false, false, false, false, false, // Vegas
80, 160, 4*6, 3, 0, 4, 80,
0, 0, 2, 1000, 1800 },
};
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
static const char *TR3LevelNames [] =
{
// India
"Jungle", // Shotgun
"Temple Ruins",
"The River Ganges",
"Caves of Kaliya", // Grenade
//
// South Pacific
"Coastal Village", // Harpoon
"Crash Site", // M16
"Madubu Gorge", // Rocket
"Temple of Puna", // Magnum
// London
"Thames Wharf",
"Aldwych", // Uzi M16 Rocket
"Lud's Gate", // Rocket Harpoon
"City",
// Nevada
"Nevada Desert", // Nevada
"High Security Compound", // Magnum Grenade
"Area 51", // M16 Grenade
// Antartica
"Antarctica", // Uzi
"RX-Tech Mines",
"Lost City of Tinnos", // Rocket
"Meteorite Cavern",
//
"London - All Hallows", // Uzi
//
"Highland Fling",
"Willard's Lair",
"Shakespeare Cliff",
"Sleeping with the Fishes",
"It's a Madhouse!",
"Reunion",
"27: ",
"28: ",
"29: ",
"30: ",
"31: ",
"32: ",
};
static TR_START_CONDITIONS TR3_Start_LikePlus [] =
{
// PIS MAG UZI RIO HAR ROC GRE M16
{ true, true, true, true, true, true, true, true,
10, 40, 6*2, 3, 1, 2, 60,
// SMA LAR FLA HEA AIR
0, 0, 2, 1000, 1800 },
};
static TR_START_CONDITIONS TR3_Start_LikeGame [] =
{
// PIS MAG UZI RIO HAR ROC GRE M16
{ true, false, false, false, false, false, false, false, // India
10, 40, 6*2, 3, 1, 2, 60,
// SMA LAR FLA HEA AIR
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, true, false, // Pacific
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, true, false, true, false,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, true, false, true, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, true, true, true, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false, // London
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, true, false, false, true, false, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, true, false, true, true, false, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false, // Nevada
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ false, false, false, false, false, false, false, false,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, true, false, false, false, false, true, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, true, false, false, false, false, true, true, // Antartica
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, true, true, false, false, false, true, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, true, true, false, false, false, true, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, true, true, false, false, true, true, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, true, true, false, false, true, true, true, // All Hallows
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, false, false, false, false, false, false, // Highland
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, true, true, true, false, false, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, true, true, true, false, false, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, false, true, true, true, true, false, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, true, true, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
{ true, true, true, true, true, true, true, true,
10, 40, 6*2, 3, 1, 2, 60,
0, 0, 2, 1000, 1800 },
};
static BYTE TR3Secrets [] =
{
// India
6, 4, 5, 0,
// Pacific
4, 3, 3, 1,
// London
5, 5, 6, 1,
// Nevada
3, 2, 3,
// Antartic
3, 3, 3, 0,
// All Hallows
0,
// Last Artefact
3, 3, 3, 3, 3, 0, // Gold
};
//
//
static BYTE TR3Pickup [] =
{
33, 43, 32, 10,
29, 26, 12, 11,
32, 50, 59, 7,
28, 34, 36,
34, 26, 33, 7,
15,
47, 41, 39, 57, 49, 32,
};
static BYTE TR3Kills [] =
{
19, 30, 37, 15,
26, 56, 16, 9,
26, 29, 20, 0,
29, 16, 40,
30, 24, 90, 7,
2,
24, 21, 30, 15, 22, 11,
};
static BYTE TR3Crystals [] =
{
6, 8, 7, 2, 5, 4, 8, 2, 8, 9, 11, 0, 3, 3, 4, 4, 5, 5, 0,
0, 0, 0, 0, 0, 0,
};
//
static WORD TR3_Secrets_Offsets[] =
{
0x00, // 0xe28e4 - 0xe28e4, // Jungle 0xe28e4
0x01, // 0xe28e5 - 0xe28e4, // Ruins 0xe28e5
0x02, // 0xe28e6 - 0xe28e4, // Gange 0xe2866
0x03, // 0xe28e7 - 0xe28e4, // Cave 0xe2867
0x04, // 0xe28e8 - 0xe28e4, // Costal 0xe28e8
0x05, // 0xe28e9 - 0xe28e4, // Crash 0xe28e9
0x06, // 0xe28ea - 0xe28e4, // Madubu 0xe28ea
0x07, // 0xe28eb - 0xe28e4, // Puna 0xe28eb
// Some Space Here between 0x08 and 0x6f (0x67 places)
//
0x72, // 0xe2956 - 0xe28e4, // Thames 0xe2956
0x73, // 0xe2957 - 0xe28e4, // Aldwytch 0xe2957
0x74, // 0xe2958 - 0xe28e4, // Lud 0xe2958
0x75, // 0xe2959 - 0xe28e4, // City 0xe2959
0x6f, // 0xe2953 - 0xe28e4, // Nevada 0xe2953
0x70, // 0xe2954 - 0xe28e4, // Compound 0xe2954
0x71, // 0xe2955 - 0xe28e4, // Area51 0xe2955
0x76, // 0xe295a - 0xe28e4, // Antartic 0xe295a
0x77, // 0xe295b - 0xe28e4, // Rx Tech 0xe295b
0x78, // 0xe295c - 0xe28e4, // Lost City 0xe295c
0x79, // 0xe295d - 0xe28e4, // Meteore 0xe295d
0x7a, // 0xe295e - 0xe28e4, // All Hallows
0x7b, // 0xe295f - 0xe28e4, // Highland
0x7c, // 0xe2960 - 0xe28e4, // Willard
0x7d, // 0xe2961 - 0xe28e4, // Shakespeare
0x7e, // 0xe2962 - 0xe28e4, // Madhouse
0x7f, // 0xe2963 - 0xe28e4, // Sleeping
0x80, // 0xe2964 - 0xe28e4, // Reunion
};
// Add 0x300 and add Start of Block
// Health Will Be 10 bytes after
TR_HEALTH_RANGE TR1_HEALTH_RANGES[32] =
{
{ 0x825, 0 }, // Caves
{ 0x181D, 0 }, // City of Vilacamba
{ 0x82D, 0 }, // Lost Valley
{ 0xC41, 0 }, // Tomb of Qualopec
{ 0x1A39, 0 }, // St. Francis' Folly
{ 0xF4F, 0 }, // Colosseum
{ 0x82F, 0 }, // Palace Midas
{ 0x197B, 0 }, // The Cistern
{ 0xA29, 0 }, // Tomb of Tihocan
{ 0x827, 0 }, // City of Khamoon
{ 0xA8F, 0 }, // Obelisk of Khamoon
{ 0x114F, 0 }, // Sanctuary of the Scion
{ 0x12D3, 0 }, // Natla's Mines
{ 0xD0F, 0 }, // Atlantis
{ 0x10FD, 0 }, // The Great Pyramid
{ 0x8F3, 0 }, // Return to Egypt
{ 0xE1D, 0 }, // Temple of the Cat
{ 0xE35, 0 }, // Atlantean Stronghold
{ 0x10DF, 0 }, // The Hive
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
// Add 0x300 and add Start of Block
TR_HEALTH_RANGE TR2_HEALTH_RANGES[32] =
{
{ 0xB64, 0xB7C, }, // The Great Wall
{ 0x7FA, 0x7FA, }, // Venice
{ 0x1734, 0x1758, }, // Bartoli's Hideout
{ 0x1E20, 0x1E38, }, // Opera House
{ 0xAC4, 0xADC, }, // Offshore Rig
{ 0x12DE, 0x131A, }, // Diving Area
{ 0x7FC, 0x7FC, }, // 40 Fathoms
{ 0x238E, 0x23EE, }, // Wreck of the Maria Doria
{ 0x90A, 0x90A, }, // Living Quarters
{ 0xBAC, 0xBF4, }, // The Deck
{ 0x12E4, 0x1314, }, // Tibetan Foothills
{ 0x2522, 0x2552+0x90, }, // Barkhang Monastery
{ 0x7F8, 0x7F8, }, // Catacombs of the Talion
{ 0xE2A, 0xE4E, }, // Ice Palace
{ 0x2A7A, 0x2A9E+0x28, }, // Temple of Xian
{ 0x9CC, 0x9D8, }, // Floating Islands
{ 0xF78, 0xF90, }, // The Dragon's Lair
{ 0xE86, 0xF2E, }, // Home Sweet Home
{ 0x1626, 0x163E, }, // The Cold War
{ 0x1D80, 0x1D80+0x20, }, // Fool's Gold
{ 0x1FD4, 0x1FE0+0x60, }, // Furnace of the Gods
{ 0x91A, 0x91A+0x20, }, // Kingdom
{ 0xDDA, 0xDF2, }, // Nightmare in Vegas
//
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
// Add 0x300 and add Start of Block
TR_HEALTH_RANGE TR3_HEALTH_RANGES [32] =
{
{ 0xB26, 0xB26, }, // Jungle
{ 0xDCC, 0xE00, }, // Temple Ruins
{ 0xAFC, 0xAFC, }, // The River Ganges
{ 0x1038, 0x118A, }, // Caves of Kaliya
{ 0xCB8, 0xCB8 }, // Coastal Village
{ 0x2046, 0x2046 }, // Crash Site
{ 0x1250, 0x126A }, // Madubu Gorge
{ 0xAD2, 0xAD2 }, // Temple of Puna
{ 0x10AA, 0x10AA }, // Thames Wharf
{ 0x2C9A, 0x2D02 }, // Aldwych
{ 0xFF0, 0x100A+0x50 }, // Lud's Gate
{ 0xBB2, 0xBB2 }, // City
{ 0xAF8, 0xAF8 }, // Nevada Desert
{ 0xB4C, 0xB66 }, // High Security Compound
{ 0x11E4, 0x1218 }, // Area 51
{ 0xB12, 0xB12 }, // Antarctica
{ 0xFB0, 0xFB0+0x20 }, // RX-Tech Mines
{ 0xB7C, 0xB7C }, // Lost City of Tinnos
{ 0xAD0, 0xAD0 }, // Meteorite Cavern
{ 0x1076, 0x10AA }, // All Hallows
{ 0x1BF4, 0x1C0E+0x20 }, // Highland Fling
{ 0x15EE, 0x15EE }, // Willard's Lair
{ 0x1338, 0x1352 }, // Shakespeare Cliff
{ 0xB5A, 0xB5A+0x10 }, // Sleeping with the Fishes
{ 0x1084, 0x1084 }, // It's a Madhouse!
{ 0x1810, 0x1844 }, // Reunion
//
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
static const char *TR4LevelNames [] =
{
"Angkor Wat", // 01 Index 0
"Race for the Iris", // 02
"Tomb of Seth", // 03
"Burial Chambers", // 04
"Valley of the Kings", // 05
"KV5", // 06
"Temple of Karnak", // 07
"Great Hypostyle Hall", // 08
"Sacred Lake", // 09
"Nothing ???", // 10 Index 9
"Tomb of Semerkhet", // 11 Index 10
"Guardian of Semerkhet", // 12
"Desert Railroad", // 13
"Alexandria", // 14
"Coastal Ruins", // 15
"Pharos, Temple of Isis", // 16
"Cleopatra's Palaces", // 17
"Catacombs", // 18
"Temple of Poseidon", // 19
"The Lost Library", // 20
"Hall of Demetrius", // 21 Index 20
"City of the Dead", // 22
"Trenches", // 23
"Chambers of Tulun", // 24
"Street Bazaar", // 25
"Citadel Gate", // 26
"Citadel", // 27
"Sphinx Complex", // 28
"Nothing ???", // 29 Index 28
"Underneath the Sphinx", // 30
"Menkaure's Pyramid", // 31 Index 30
"Inside Menkaure's Pyramid", // 32
"The Mastabas", // 33
"The Great Pyramid", // 34
"Khufu's Queen's Pyramids", // 35
"Inside the Great Pyramid", // 36
"Temple of Horus", // 37
"Temple of Horus", // 38 Index 37
"Office", // 39 Index 38
"Times Exclusive", // 40 Index 39
};
static const char *TR5LevelNames [] =
{
"Streets of Rome", // 01
"Trajan's markets", // 02
"The Colosseum", // 03
"The Base", // 04
"The Submarine", // 05
"Deepsea Dive", // 06
"Sinking Submarine", // 07
"Gallows Tree", // 08
"Labyrinth", // 09
"Old Mill", // 10
"The 13th Floor", // 11
"Escape with the Iris", // 12
"Security Breach", // 13
"Red Alert!", // 14
};
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
char *CTR9SaveGame::m_TR1_Start [ NB_TR1_BLOCKS ] = { NULL };
char *CTR9SaveGame::m_TR2_Start [ NB_TR2_BLOCKS ] = { NULL };
char *CTR9SaveGame::m_TR3_Start [ NB_TR3_BLOCKS ] = { NULL };
char *CTR9SaveGame::m_TR1_Blocks [ NB_TR1_BLOCKS ] [ NB_OF_SLOTS ] = { NULL };
char *CTR9SaveGame::m_TR2_Blocks [ NB_TR2_BLOCKS ] [ NB_OF_SLOTS ] = { NULL };
char *CTR9SaveGame::m_TR3_Blocks [ NB_TR3_BLOCKS ] [ NB_OF_SLOTS ] = { NULL };
GUN_TR1 *CTR9SaveGame::m_TR1_Guns [ NB_TR1_BLOCKS ] [ NB_OF_SLOTS ] = { NULL };
GUN_TR2 *CTR9SaveGame::m_TR2_Guns [ NB_TR2_BLOCKS ] [ NB_OF_SLOTS ] = { NULL };
GUN_TR3 *CTR9SaveGame::m_TR3_Guns [ NB_TR3_BLOCKS ] [ NB_OF_SLOTS ] = { NULL };
char *CTR9SaveGame::m_pBuffer = NULL;
char *CTR9SaveGame::m_pBufferBackup = NULL;
int CTR9SaveGame::m_iSaveLength = 0;
//
BOOL TraceMode = FALSE;
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
CTR9SaveGame *CTR9SaveGame::m_pInstance = NULL;
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNAMIC(CTR9SaveGame, CObject)
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
CTR9SaveGame::CTR9SaveGame(void)
{
Init(true);
}
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
CTR9SaveGame *CTR9SaveGame::GetInstance(BOOL bCreate)
{
if ( bCreate && m_pInstance == NULL )
{
m_pInstance = new CTR9SaveGame();
}
return m_pInstance;
}
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
CTR9SaveGame *CTR9SaveGame::I(BOOL bCreate)
{
return GetInstance(bCreate);
}
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
BOOL CTR9SaveGame::IsBufferModified()
{
if ( m_pInstance != NULL )
{
return m_pInstance->BufferModified();
}
return FALSE;
}
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
BOOL CTR9SaveGame::WriteFile(const char *oFilename)
{
if ( m_pInstance != NULL )
{
return m_pInstance->writeFile(oFilename);
}
return FALSE;
}
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
void CTR9SaveGame::Discard()
{
if ( m_pInstance != NULL )
{
m_pInstance->discard();
}
}
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
void CTR9SaveGame::Init(bool bFromContructor)
{
m_hFile = NULL;
ZeroMemory ( m_szFilename, sizeof(m_szFilename) );
ZeroMemory ( m_szIndicatorLabel, sizeof(m_szIndicatorLabel) );
//
for ( int b = 0; b < NB_TR1_BLOCKS; b++ )
{
m_TR1_Start [ b ] = NULL;
m_TR2_Start [ b ] = NULL;
m_TR3_Start [ b ] = NULL;
for ( int l = 0; l < NB_OF_SLOTS; l++ )
{
m_TR1_Blocks [ b ] [ l ] = NULL;
m_TR2_Blocks [ b ] [ l ] = NULL;
m_TR3_Blocks [ b ] [ l ] = NULL;
m_TR1_Guns [ b ] [ l ] = NULL;
m_TR2_Guns [ b ] [ l ] = NULL;
m_TR3_Guns [ b ] [ l ] = NULL;
}
}
//
m_iSaveLength = 0;
if ( bFromContructor || m_pBuffer == NULL )
{
m_pBuffer = new char [ LEN_BUFFER ];
}
ZeroMemory ( m_pBuffer, LEN_BUFFER );
if ( bFromContructor || m_pBufferBackup == NULL )
{
m_pBufferBackup = new char [ LEN_BUFFER ];
}
ZeroMemory ( m_pBufferBackup, LEN_BUFFER );
}
//
/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////
CTR9SaveGame::~CTR9SaveGame(void)
{
m_pInstance = NULL;
if ( m_pBuffer != NULL )
{
delete m_pBuffer;
m_pBuffer = NULL;
}
if ( m_pBufferBackup != NULL )
{
delete m_pBufferBackup;
m_pBufferBackup = NULL;
}
}
//
/////////////////////////////////////////////////////////////////////////////