-
Notifications
You must be signed in to change notification settings - Fork 3
/
Track.cpp
2725 lines (2420 loc) · 74.2 KB
/
Track.cpp
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
/**************************************************************************
Track.cpp - Functions for manipulating track
24/04/1998 - all Track data from Amiga StuntCarRacer is now made 2
(PC_FACTOR) times bigger for use by PC StuntCarRacer
**************************************************************************/
/* ============= */
/* Include files */
/* ============= */
#include "dxstdafx.h"
#include "Track.h"
#include "StuntCarRacer.h"
#include "3D Engine.h"
/* ===== */
/* Debug */
/* ===== */
#if defined(DEBUG) || defined(_DEBUG)
extern FILE *out;
extern long VALUE1, VALUE2;
#endif
/* ========= */
/* Constants */
/* ========= */
#define DISTANT_OBJECT_BOUNDARY (0x18000000)
#define SCR_BASE_COLOUR 26
/* =========== */
/* Global data */
/* =========== */
extern GameModeType GameMode;
extern long bTrackDrawMode;
unsigned char sections_car_can_be_put_on[] =
{
0x00,0x80,0x20,0xc0,0x00,0x73,0x80,0xc0,0xa9,0x59,0x00,0x02,0xa9,0x5e,0x85,0x4b
// These 16 bytes are flags for each of the near sections. The actual values used are as follows :-
//
// 0x00,0x80,0x00,0xc0,0x00,0x00,0x80,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
//
// If bit 7 is set then the car cannot be lowered onto this section.
};
/* =========== */
/* Static data */
/* =========== */
//
//road.section.x.z.positions
//
static char Piece_X_Z_Position[MAX_PIECES_PER_TRACK];/* Little Ramp data, from before it was loaded =
{
(char)0xcf,(char)0xbf,(char)0xaf,(char)0x9f,(char)0x8f,(char)0x7f,(char)0x6f,(char)0x5f,
(char)0x4f,(char)0x3f,(char)0x2f,(char)0x1f,(char)0x0e,(char)0x0d,(char)0x0c,(char)0x0b,
(char)0x0a,(char)0x09,(char)0x08,(char)0x07,(char)0x06,(char)0x05,(char)0x04,(char)0x03,
(char)0x02,(char)0x01,(char)0x10,(char)0x20,(char)0x31,(char)0x42,(char)0x53,(char)0x64,
(char)0x75,(char)0x86,(char)0x97,(char)0xa8,(char)0xb9,(char)0xca,(char)0xdb,(char)0xec,
(char)0xfd,(char)0xfe,(char)0xef,(char)0xdf
};
*/
//
//road.section.angle.and.piece
//
//* Top two bits are the rough angle for the piece (0, 90, 180 or 270 degrees).
//*
//* Bit 4 indicates that piece is rotated through a further 180 degrees.
//*
//* Bottom nibble is the near section piece to use.
//
static char Piece_Angle_And_Template[MAX_PIECES_PER_TRACK];/* Little Ramp data, from before it was loaded =
{
(char)0xa0,(char)0xa0,(char)0xa0,(char)0xa0,(char)0xa0,(char)0xa0,(char)0xa0,(char)0xa0,
(char)0xa0,(char)0xa0,(char)0x80,(char)0x86,(char)0x57,(char)0xc0,(char)0xe0,(char)0xe0,
(char)0xe0,(char)0xe0,(char)0xe0,(char)0xe0,(char)0xe0,(char)0xe0,(char)0xe0,(char)0xe0,
(char)0xc0,(char)0xc6,(char)0xb7,(char)0x01,(char)0x94,(char)0x2a,(char)0x2a,(char)0x2a,
(char)0x2a,(char)0x2a,(char)0x2a,(char)0x2a,(char)0x2a,(char)0x2a,(char)0x2a,(char)0x04,
(char)0xd3,(char)0x66,(char)0x17,(char)0x80
};
*/
//
//left.y.coordinate.IDs
//
//* Bit 7 indicates that the y coords for that section are stored as words
//* e.g. for steeper sections on the roller coaster or the high jump
//
static char Left_Y_Coordinate_ID[MAX_PIECES_PER_TRACK];/* Little Ramp data, from before it was loaded =
{
(char)0x6a,(char)0x6b,(char)0x24,(char)0x50,(char)0x50,(char)0x25,(char)0x00,(char)0x00,
(char)0x19,(char)0x63,(char)0x04,(char)0x65,(char)0x68,(char)0x64,(char)0x69,(char)0x17,
(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,
(char)0x03,(char)0x16,(char)0x00,(char)0x19,(char)0x04,(char)0x00,(char)0x00,(char)0x00,
(char)0x28,(char)0x29,(char)0x00,(char)0x2a,(char)0x2b,(char)0x00,(char)0x00,(char)0x09,
(char)0x16,(char)0x00,(char)0x1b,(char)0x04
};
*/
//
//right.y.coordinate.IDs
//
//* Bit 7 goes to other.road.line.colour
//
static char Right_Y_Coordinate_ID[MAX_PIECES_PER_TRACK];/* Little Ramp data, from before it was loaded =
{
(char)0x6a,(char)0x6b,(char)0x24,(char)0x50,(char)0x50,(char)0x25,(char)0x00,(char)0x00,
(char)0x19,(char)0x63,(char)0x64,(char)0x66,(char)0xe7,(char)0x04,(char)0x69,(char)0x17,
(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,
(char)0x04,(char)0x17,(char)0x80,(char)0x18,(char)0x03,(char)0x80,(char)0x00,(char)0x80,
(char)0x28,(char)0xa9,(char)0x00,(char)0xaa,(char)0x2b,(char)0x80,(char)0x00,(char)0x8a,
(char)0x17,(char)0x00,(char)0x9a,(char)0x03
};
*/
//
//overall.left.y.shifts
//
//* A value for each road section, used to shift all the left side y
//* co-ordinates up by the same amount.
//
static short Left_Overall_Y_Shift[MAX_PIECES_PER_TRACK];/* Little Ramp data, from before it was loaded =
{
(short)0x0280,(short)0x0280,(short)0x0780,(short)0x0a60,
(short)0x1260,(short)0x1a60,(short)0x1d40,(short)0x1d40,
(short)0x1ce0,(short)0x1920,(short)0x17a0,(short)0x1380,
(short)0x0ea0,(short)0x0660,(short)0x0560,(short)0x0500,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0500,(short)0x0700,(short)0x0760,(short)0x0700,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0700,(short)0x0760,(short)0x0700,(short)0x0500
};
*/
//
//overall.right.y.shifts
//
//* Same as above, but for the right side y co-ordinates.
//
static short Right_Overall_Y_Shift[MAX_PIECES_PER_TRACK];/* Little Ramp data, from before it was loaded =
{
(short)0x0280,(short)0x0280,(short)0x0780,(short)0x0a60,
(short)0x1260,(short)0x1a60,(short)0x1d40,(short)0x1d40,
(short)0x1ce0,(short)0x1920,(short)0x1160,(short)0x0ec0,
(short)0x0aa0,(short)0x08a0,(short)0x0560,(short)0x0500,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0300,(short)0x02a0,(short)0x02a0,(short)0x02a0,
(short)0x0300,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0500,
(short)0x0500,(short)0x0500,(short)0x0500,(short)0x0300,
(short)0x02a0,(short)0x02a0,(short)0x02a0,(short)0x0300
};
*/
//
//******** Start of y co-ordinates for near sections ********
//
// B means co-ords are stored as bytes, W means words.
//
static unsigned char B1037[] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
static unsigned char B1051[] =
{
0x00,0x60,0x61,0x03,0x44,
0x26,0x28,0x2a,0x2c
};
static unsigned char W1060[] =
{
0x00,0x00,0x02,0x00,0x04,0x00,
0x06,0x00,0x08,0x00,0x0a,0x00,
0x0c,0x00,0x0e,0x00,0x10,0x00
};
static unsigned char B1078[] =
{
0x00,0x20,0x40,0x60,0x01,0x21,0x41,
0x61,0x02,0x02,0x02,0x02,0x02,0x02
};
static unsigned char B1092[] =
{
0x02,0x61,0x41,0x21,0x01,0x60,0x40,
0x20,0x00,0x00,0x00,0x00,0x00,0x00
};
static unsigned char B1106[] =
{
0x00,0x60,0x21,0x51,0x02,
0x22,0x42,0x62,0x03,0x13
};
static unsigned char B1116[] =
{
0x00,0x20,0x40,0x70,0x21,
0x41,0x61,0x02,0x22,0x32
};
static unsigned char B1126[] =
{
0x00,0x02,0x04,0x06,0xe7,
0x29,0xca,0x4b,0x2c
};
static unsigned char B1135[] =
{
0x46,0x96,0x55,0x85,0x24,
0x33,0xb2,0x21,0x00
};
static unsigned char B1144[] =
{
0x00,0x00,0x00,0x00,0x00,0x10,0x20,
0x40,0x60,0x01,0x21,0x41,0x61,0x02
};
static unsigned char B1158[] =
{
0x02,0x02,0x02,0x02,0x02,0x71,0x61,
0x41,0x21,0x01,0x60,0x40,0x20,0x00
};
static unsigned char B1172[] =
{
0x00,0x10,0x10,0x10,0x10,
0x10,0x10,0x90,0x80
};
static unsigned char B1181[] =
{
0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0x90
};
static unsigned char B1190[] =
{
0x00,0x01,0x02,0x03,0x04,0x05,
0x06,0x07,0x08,0x09,0x0a,0x0b
};
static unsigned char W1202[] =
{
0x1b,0x80,0x1c,0x80,0x1d,0x80,
0x1e,0x80,0x1f,0x80,0x20,0x80,
0xa1,0x80,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00
};
static unsigned char B1226[] =
{
0x4e,0x1d,0xdb,0x0a,0xa8,
0x36,0x34,0x22,0x00
};
static unsigned char W1235[] =
{
0x00,0x00,0x9b,0x20,0x19,0xe0,
0x18,0xa0,0x17,0x60,0x16,0x20,
0x14,0xe0,0x13,0xa0,0x12,0x60,
0x11,0x20,0x0f,0xe0,0x0e,0xa0
};
static unsigned char B1259[] =
{
0x48,0x27,0x26,0x35,0x44,0x63,
0x13,0x42,0x71,0x21,0x50,0x00
};
static unsigned char B1271[] =
{
0x13,0x03,0x62,0x42,0x22,
0x02,0x51,0x21,0xe0,0x80
};
static unsigned char B1281[] =
{
0x05,0x05,0x85,0x00,0x00,
0x85,0x05,0x05,0x05
};
static unsigned char B1290[] =
{
0x32,0x22,0x02,0x61,0x41,
0x21,0x70,0x40,0xa0,0x80
};
static unsigned char B1300[] =
{
0x00,0x40,0x01,0x41,0x02,
0x42,0x03,0x33,0x63
};
static unsigned char B1309[] =
{
0x00,0x20,0x30,0x30,0x30,
0x30,0x30,0x30,0x30,0x30
};
static unsigned char B1319[] =
{
0x30,0x10,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00
};
static unsigned char B1329[] =
{
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x90,0xb0
};
static unsigned char B1338[] =
{
0x30,0x30,0x30,0x30,0x30,
0x30,0x30,0xa0,0x80
};
static unsigned char B1347[] =
{
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x90,0xb0
};
static unsigned char B1357[] =
{
0x30,0x30,0x30,0x30,0x30,
0x30,0x30,0x30,0xa0,0x80
};
static unsigned char B1367[] =
{
0x00,0x21,0x42,0x53,0xe4,
0x65,0xe6,0x57,0x48
};
static unsigned char B1376[] =
{
0x00,0x60,0x41,0x92,0x62,
0xa3,0x63,0x14,0x44
};
static unsigned char B1385[] =
{
0x00,0x20,0x40,0xd0,0x60,
0x60,0xd0,0x40,0x20
};
static unsigned char B1394[] =
{
0x04,0x63,0xb3,0x03,0x42,
0x82,0x31,0x60,0x00
};
static unsigned char B1403[] =
{
0xa6,0x80,0x00,0x00,0x00,
0x00,0x00,0x80,0x35
};
static unsigned char B1412[] =
{
0x47,0x87,0x46,0x75,0x25,0x44,
0x63,0x03,0x22,0x41,0x60,0x00
};
static unsigned char B1424[] =
{
0x08,0x27,0x36,0xc5,0x44,
0x43,0x32,0x21,0x00
};
static unsigned char B1433[] =
{
0x50,0x50,0x50,0x50,0xc0,
0x30,0x20,0x10,0x00
};
static unsigned char B1442[] =
{
0x00,0x00,0x10,0x30,0x60,
0x11,0x51,0x22,0x72
};
static unsigned char B1451[] =
{
0x00,0x60,0x41,0xa2,0xd2,0x62,
0xf2,0x72,0x72,0x72,0x72,0x72
};
static unsigned char B1463[] =
{
0x22,0xb2,0x32,0xa2,0x12,
0xf1,0x31,0x60,0x00
};
static unsigned char B1472[] =
{
0x0a,0x68,0x47,0x26,0x05,
0x63,0x42,0x21,0x00
};
static unsigned char B1481[] =
{
0x00,0x10,0x30,0x60,0x21,0x71,
0x42,0x13,0x63,0x34,0x05,0x55
};
static unsigned char B1493[] =
{
0x55,0x26,0x76,0x47,0x18,0x68,
0x39,0x8a,0x00,0x00,0x00,0x00
};
static unsigned char B1505[] =
{
0x00,0xc7,0x76,0x26,0x55,0x05,
0x34,0x63,0x13,0x42,0x71,0x21
};
static unsigned char B1517[] =
{
0x21,0x60,0x30,0x10,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00
};
static unsigned char B1529[] =
{
0x8a,0x80,0x00,0x00,0x00,
0x00,0x00,0x80,0x4c
};
static unsigned char B1538[] =
{
0x00,0x41,0x03,0x44,0x06,
0x47,0x09,0x4a,0x0c
};
static unsigned char B1547[] =
{
0x70,0x50,0x30,0x10,0x00,
0x10,0x30,0x50,0x70
};
static unsigned char B1556[] =
{
0xaa,0x80,0x00,0x00,0x00,
0x00,0x00,0x80,0x2a
};
static unsigned char B1565[] =
{
0x59,0x49,0x39,0xa9,0x63,
0x63,0x63,0x63,0x47
};
static unsigned char B1574[] =
{
0x00,0x00,0x00,0x10,0x30,0x50,
0x01,0x31,0x71,0x42,0x23,0x14
};
static unsigned char B1586[] =
{
0x62,0x62,0x62,0xd2,0x42,0xa2,
0x02,0x61,0xb1,0x01,0x40,0x00
};
static unsigned char B1598[] =
{
0x00,0x40,0x01,0x41,0x02,0x42,0x03,
0x43,0x04,0x64,0x45,0x26,0x07,0x67
};
static unsigned char B1612[] =
{
0x00,0x10,0x20,0x30,0x40,
0x40,0x40,0x40,0x40,0x40
};
static unsigned char B1622[] =
{
0x00,0x00,0x00,0x00,0x00,
0x10,0x30,0x60,0x21
};
static unsigned char B1631[] =
{
0x8d,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};
static unsigned char W1640[] =
{
0x00,0x00,0x00,0x00,0x80,0x00,
0x9c,0x80,0x1c,0x80,0x9c,0x80,
0x80,0x00,0x00,0x00,0x00,0x00
};
static unsigned char B1658[] =
{
0x00,0x00,0x10,0x20,0x40,
0x60,0x01,0x31,0x71
};
static unsigned char B1667[] =
{
0x00,0x10,0x30,0x70,0x31,
0x71,0xb2,0x52,0x62
};
static unsigned char B1676[] =
{
0x00,0x00,0x00,0x10,0x30,
0x60,0x21,0x02,0x03
};
static unsigned char B1685[] =
{
0x00,0x10,0x30,0x60,0x21,
0x71,0x62,0x53,0x44
};
static unsigned char B1694[] =
{
0x00,0x70,0x61,0x52,0x43,
0x34,0x25,0x16,0x07
};
static unsigned char B1703[] =
{
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0x2e
};
static unsigned char B1712[] =
{
0x00,0x01,0xf1,0x52,0xa3,
0x63,0x94,0x34,0x54
};
static unsigned char B1721[] =
{
0x00,0x30,0xd0,0x70,0x11,
0xa1,0x31,0x41,0x41,0x41
};
static unsigned char B1731[] =
{
0x40,0x10,0x00,0x00,0x00,
0x10,0x40,0x11,0x61
};
static unsigned char B1740[] =
{
0x40,0x40,0x40,0x40,0x40,
0x40,0x30,0x20,0x10,0x00
};
static unsigned char W1750[] =
{
0x9a,0xc0,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0x00,0x0c,0x80
};
static unsigned char B1768[] =
{
0x24,0x03,0x02,0x21,0x60,
0x30,0x10,0x00,0x00
};
static unsigned char B1777[] =
{
0x47,0x46,0x65,0x25,0x05,
0x05,0x15,0x35,0x75
};
static unsigned char B1786[] =
{
0x80,0xe6,0x16,0x45,0x74,
0x24,0x53,0x23,0x13
};
static unsigned char B1795[] =
{
0x46,0x25,0x14,0x13,0x22,
0x41,0x70,0x30,0x00
};
static unsigned char B1804[] =
{
0x00,0x01,0x12,0x33,0x54,
0x75,0x17,0x38,0x59,0x7a
};
static unsigned char B1814[] =
{
0x02,0x71,0xd1,0x21,0x60,
0x30,0x10,0x00,0x00
};
static unsigned char B1823[] =
{
0x00,0x00,0x10,0x30,0x60,
0x21,0xd1,0x71,0x02
};
static unsigned char B1832[] =
{
0x00,0x40,0x81,0x31,0xd1,
0x61,0xf1,0x71,0x71
};
static unsigned char B1841[] =
{
0x22,0x61,0x21,0x60,0x30,
0x10,0x00,0x00,0x00
};
static unsigned char B1850[] =
{
0x00,0x60,0x41,0x22,0x03,0x63,
0x44,0x25,0x06,0x66,0x47,0x28
};
static unsigned char B1862[] =
{
0x00,0x00,0x10,0x30,0x60,
0x21,0x71,0x52,0x43
};
static unsigned char B1871[] =
{
0x24,0x45,0xe6,0x80,0x21,
0x42,0x63,0x05,0x26
};
static unsigned char W1880[] =
{
0x28,0x60,0x27,0xc0,0x27,0x40,
0x26,0xe0,0x26,0xa0,0x26,0x80,
0x26,0x80,0x26,0xa0,0x26,0xe0,
0x27,0x20,0xa7,0x60,0x00,0x00
};
static unsigned char B1904[] =
{
0x00,0x01,0x02,0x03,0x04,0x05,0x06,
0x07,0x08,0x68,0x49,0x2a,0x0b,0x6b
};
static unsigned char B1918[] =
{
0x00,0x70,0x51,0x32,0x13,
0x73,0x54,0x35,0x06
};
static unsigned char B1927[] =
{
0x00,0x50,0x31,0x12,0x72,
0x53,0x34,0x15,0x06
};
static unsigned char B1936[] =
{
0x00,0x60,0x41,0x22,0x03,0x73,0x64,
0x65,0x66,0x67,0x68,0x69,0x6a,0x6b
};
static unsigned char B1950[] =
{
0x00,0x60,0x41,0x22,0x03,0x53,0x24,
0x64,0x25,0x65,0x26,0x66,0x27,0x67
};
static unsigned char B1964[] =
{
0x00,0x81,0x61,0xa2,0x42,
0x52,0x52,0x52,0x52
};
static unsigned char B1973[] =
{
0x00,0x41,0x72,0x14,0x35,
0x56,0x77,0x19,0x3a,0x5b
};
static unsigned char B1983[] =
{
0x00,0x21,0x42,0x63,0x05,
0x26,0x47,0x68,0x1a,0x5b
};
static unsigned char B1993[] =
{
0x64,0x14,0x43,0x72,0x22,0x51,
0x01,0x40,0x20,0x10,0x00,0x00
};
static unsigned char B2005[] =
{
0x05,0x05,0x05,0x15,0x25,
0x45,0xe5,0x00,0x00
};
static unsigned char B2014[] =
{
0x22,0x12,0xf1,0x51,0x31,
0x11,0x60,0x30,0x00
};
static unsigned char B2023[] =
{
0x00,0x50,0x31,0x22,0x23,
0x34,0x55,0x76,0x18
};
static unsigned char B2032[] =
{
0x00,0x21,0x42,0x63,0x05,
0x26,0x47,0x68,0x79,0x7a
};
static unsigned char B2042[] =
{
0x52,0x71,0x21,0x60,0x30,
0x10,0x00,0x00,0x00
};
// 20/08/1998 - following four arrays form the animating section of the DrawBridge
// The original Amiga StuntCarRacer data for these (large spikes) has been changed to a
// set of data from the MoveDrawBridge function (height of 15), to prevent some of
// the road surfaces being made black when this is not required.
static unsigned char W2051[] =
{
0x00,0x00,0x02,0x60,0x04,0xc0,
0x07,0x20,0x09,0x80,0x0b,0xe0,
0x0e,0x40,0x10,0xa0,0x13,0x00
};
static unsigned char W2069[] =
{
0x13,0x00,0x15,0x60,0x17,0xc0,
0x1a,0x20,0x1c,0x80,0x1e,0xe0,
0x21,0x40,0x23,0xa0,0x00,0x00
};
static unsigned char W2087[] =
{
0x00,0x00,0x23,0xa0,0x21,0x40,
0x1e,0xe0,0x1c,0x80,0x1a,0x20,
0x17,0xc0,0x15,0x60,0x13,0x00
};
static unsigned char W2105[] =
{
0x13,0x00,0x10,0xa0,0x0e,0x40,
0x0b,0xe0,0x09,0x80,0x07,0x20,
0x04,0xc0,0x02,0x60,0x00,0x00
};
static unsigned char B2123[] =
{
0x63,0x43,0xa3,0xf2,0x42,
0x02,0x41,0x01,0x40
};
static unsigned char B2132[] =
{
0x28,0x47,0x66,0x06,0x25,0x44,
0x63,0x03,0x22,0x41,0x60,0x00
};
static unsigned char B2144[] =
{
0x14,0x73,0x43,0x03,0x42,
0x02,0x41,0x01,0x40,0x00
};
static unsigned char B2154[] =
{
0x74,0x14,0x43,0x03,0x42,
0x02,0x41,0x01,0x40,0x00
};
static unsigned char B2164[] =
{
0x14,0x53,0x13,0x52,0x12,
0x51,0x11,0x50,0xa0,0x80
};
static unsigned char B2174[] =
{
0x74,0x34,0x73,0x33,0x72,
0x32,0x71,0x31,0xe0,0x80
};
static unsigned char B2184[] =
{
0x23,0x62,0x22,0x61,0x21,
0x70,0x40,0x20,0x00
};
static unsigned char B2193[] =
{
0x42,0x42,0x52,0x72,0x13,
0x43,0xf3,0x80,0x00
};
static unsigned char B2202[] =
{
0x00,0x00,0x00,0x80,0x85,
0x05,0x05,0x05,0x05
};
static unsigned char B2211[] =
{
0x0c,0x59,0x47,0x55,0x04,
0x52,0x41,0x50,0x00
};
static unsigned char B2220[] =
{
0x00,0x10,0x30,0x50,0xe0,
0x50,0x30,0x10,0x00
};
static unsigned char B2229[] =
{
0x00,0x00,0x00,0x00,0x80,
0x00,0x00,0x00,0x00
};
static unsigned char B2238[] =
{
0x04,0x04,0x04,0x04,0x04,0x04,
0x73,0xe3,0x33,0x52,0x41,0x00
};
static unsigned char B2250[] =
{
0x44,0x04,0x43,0x03,0x42,
0x02,0x41,0x01,0x40,0x00
};
static unsigned char B2260[] =
{
0x41,0x41,0x41,0x41,0x41,0x41,
0x31,0xa1,0x01,0xe0,0x30,0x00
};
static unsigned char W2272[] =
{
0x18,0xc0,0x16,0x80,0x14,0x40,
0x12,0x00,0x0f,0xc0,0x0d,0x80,
0x0b,0x40,0x09,0x00,0x06,0xc0,
0x04,0x80,0x02,0x40,0x00,0x00
};
static unsigned char B2296[] =
{
0x7e,0x4c,0x1a,0x08,0x16,0x44,
0x13,0x02,0x11,0x40,0x10,0x00
};
static unsigned char B2308[] =
{
0x60,0x30,0x10,0x00,0x00,
0x10,0x30,0x60,0x21
};
static unsigned char W2317[] =
{
0x13,0x00,0x10,0xa0,0x0e,0x40,
0x0b,0xe0,0x09,0x80,0x07,0x20,
0x04,0xc0,0x02,0x60,0x00,0x00
};
static unsigned char B2335[] =
{
0x00,0xe8,0x18,0x47,0x76,
0x26,0x55,0x05,0x34
};
static unsigned char B2344[] =
{
0x00,0x00,0x00,0x10,0x30,
0x60,0x21,0x71,0x42
};
static unsigned char B2353[] =
{
0x00,0x21,0x42,0x63,0x05,
0x26,0x47,0x68,0x0a
};
static unsigned char B2362[] =
{
0x00,0x60,0x31,0x71,0x32,
0x72,0x33,0x73,0x34,0x74
};
static unsigned char B2372[] =
{
0x00,0x20,0x50,0x11,0x51,
0x12,0x52,0x13,0x53,0x14
};
static unsigned char B2382[] =
{
0x00,0x40,0x01,0x41,0x02,
0x42,0x03,0x43,0x94,0xf4
};
static unsigned char B2392[] =
{
0x00,0x40,0x01,0x41,0x02,
0x42,0x03,0x43,0xf3,0x94
};
#define NUM_AMIGA_PIECE_Y 128
#define MAX_Y_COORDS_PER_PIECE (MAX_SEGMENTS_PER_PIECE + 1)
//
// y.coordinate.offsets
//
static struct AMIGA_PIECE_Y
{
unsigned char *amigaY;
long words; /* TRUE/FALSE - indicating whether or not co-ords are word sized */
long size;
} Amiga_Piece_Y[NUM_AMIGA_PIECE_Y] =
{
{B1037,FALSE,sizeof(B1037)},
{B1051,FALSE,sizeof(B1051)},
{W1060,TRUE,sizeof(W1060)},
{B1078,FALSE,sizeof(B1078)},
{B1092,FALSE,sizeof(B1092)},
{B1106,FALSE,sizeof(B1106)},
{B1116,FALSE,sizeof(B1116)},
{B1126,FALSE,sizeof(B1126)},
{B1135,FALSE,sizeof(B1135)},
{B1144,FALSE,sizeof(B1144)},
{B1158,FALSE,sizeof(B1158)},
{B1172,FALSE,sizeof(B1172)},
{B1181,FALSE,sizeof(B1181)},
{B1190,FALSE,sizeof(B1190)},
{W1202,TRUE,sizeof(W1202)},
{B1226,FALSE,sizeof(B1226)},
{W1235,TRUE,sizeof(W1235)},
{B1259,FALSE,sizeof(B1259)},
{B1271,FALSE,sizeof(B1271)},
{B1281,FALSE,sizeof(B1281)},
{B1290,FALSE,sizeof(B1290)},
{B1300,FALSE,sizeof(B1300)},
{B1309,FALSE,sizeof(B1309)},
{B1319,FALSE,sizeof(B1319)},
{B1329,FALSE,sizeof(B1329)},
{B1338,FALSE,sizeof(B1338)},
{B1347,FALSE,sizeof(B1347)},
{B1357,FALSE,sizeof(B1357)},
{B1367,FALSE,sizeof(B1367)},
{B1376,FALSE,sizeof(B1376)},
{B1385,FALSE,sizeof(B1385)},
{B1394,FALSE,sizeof(B1394)},
{B1403,FALSE,sizeof(B1403)},
{B1412,FALSE,sizeof(B1412)},
{B1424,FALSE,sizeof(B1424)},
{B1433,FALSE,sizeof(B1433)},
{B1442,FALSE,sizeof(B1442)},
{B1451,FALSE,sizeof(B1451)},
{B1463,FALSE,sizeof(B1463)},
{B1472,FALSE,sizeof(B1472)},
{B1481,FALSE,sizeof(B1481)},
{B1493,FALSE,sizeof(B1493)},
{B1505,FALSE,sizeof(B1505)},
{B1517,FALSE,sizeof(B1517)},
{B1529,FALSE,sizeof(B1529)},
{B1538,FALSE,sizeof(B1538)},
{B1547,FALSE,sizeof(B1547)},
{B1556,FALSE,sizeof(B1556)},
{B1565,FALSE,sizeof(B1565)},
{B1574,FALSE,sizeof(B1574)},
{B1586,FALSE,sizeof(B1586)},
{B1598,FALSE,sizeof(B1598)},
{B1612,FALSE,sizeof(B1612)},
{B1622,FALSE,sizeof(B1622)},
{B1631,FALSE,sizeof(B1631)},
{W1640,TRUE,sizeof(W1640)},
{B1658,FALSE,sizeof(B1658)},
{B1667,FALSE,sizeof(B1667)},
{B1676,FALSE,sizeof(B1676)},
{B1685,FALSE,sizeof(B1685)},
{B1694,FALSE,sizeof(B1694)},
{B1703,FALSE,sizeof(B1703)},
{B1712,FALSE,sizeof(B1712)},
{B1721,FALSE,sizeof(B1721)},
{B1731,FALSE,sizeof(B1731)},
{B1740,FALSE,sizeof(B1740)},
{W1750,TRUE,sizeof(W1750)},
{B1768,FALSE,sizeof(B1768)},
{B1777,FALSE,sizeof(B1777)},
{B1786,FALSE,sizeof(B1786)},
{B1795,FALSE,sizeof(B1795)},
{B1804,FALSE,sizeof(B1804)},
{B1814,FALSE,sizeof(B1814)},
{B1823,FALSE,sizeof(B1823)},
{B1832,FALSE,sizeof(B1832)},
{B1841,FALSE,sizeof(B1841)},
{B1850,FALSE,sizeof(B1850)},
{B1862,FALSE,sizeof(B1862)},
{B1871,FALSE,sizeof(B1871)},
{W1880,TRUE,sizeof(W1880)},
{B1904,FALSE,sizeof(B1904)},
{NULL,FALSE,0},
{B1918,FALSE,sizeof(B1918)},
{B1927,FALSE,sizeof(B1927)},
{B1936,FALSE,sizeof(B1936)},
{B1950,FALSE,sizeof(B1950)},
{B1964,FALSE,sizeof(B1964)},
{B1973,FALSE,sizeof(B1973)},
{B1983,FALSE,sizeof(B1983)},
{B1993,FALSE,sizeof(B1993)},
{B2005,FALSE,sizeof(B2005)},
{B2014,FALSE,sizeof(B2014)},
{B2023,FALSE,sizeof(B2023)},
{B2032,FALSE,sizeof(B2032)},
{B2042,FALSE,sizeof(B2042)},
{W2051,TRUE,sizeof(W2051)},
{W2069,TRUE,sizeof(W2069)},
{W2087,TRUE,sizeof(W2087)},
{W2105,TRUE,sizeof(W2105)},
{B2123,FALSE,sizeof(B2123)},
{B2132,FALSE,sizeof(B2132)},
{B2144,FALSE,sizeof(B2144)},
{B2154,FALSE,sizeof(B2154)},
{B2164,FALSE,sizeof(B2164)},
{B2174,FALSE,sizeof(B2174)},
{B2184,FALSE,sizeof(B2184)},
{B2193,FALSE,sizeof(B2193)},
{B2202,FALSE,sizeof(B2202)},
{B2211,FALSE,sizeof(B2211)},
{B2220,FALSE,sizeof(B2220)},
{B2229,FALSE,sizeof(B2229)},
{B2238,FALSE,sizeof(B2238)},
{B2250,FALSE,sizeof(B2250)},
{B2260,FALSE,sizeof(B2260)},
{W2272,TRUE,sizeof(W2272)},
{B2296,FALSE,sizeof(B2296)},
{B2308,FALSE,sizeof(B2308)},
{W2317,TRUE,sizeof(W2317)},
{B2335,FALSE,sizeof(B2335)},
{B2344,FALSE,sizeof(B2344)},
{NULL,FALSE,0},
{NULL,FALSE,0},
{B2353,FALSE,sizeof(B2353)},
{NULL,FALSE,0},
{B2362,FALSE,sizeof(B2362)},
{B2372,FALSE,sizeof(B2372)},
{B2382,FALSE,sizeof(B2382)},
{B2392,FALSE,sizeof(B2392)}
};
//
// straight 8
//
//O336 dc.b 4 offset for number.of.coords
// dc.b 0 near.section.byte1
// dc.b $40,$03
// dc.b 9*2 number.of.coords
// dc.b 0 gives curve.to.left
// dc.b WIDTH.REDUCTION road.width.reduction
// dc.b 128 road.length.reduction
// dc.b $80,$01
// dc.b $20 section.steering.amount
//
static unsigned char Amiga_Piece0_XZ[9*8] =
{
0x40,0x03,0x00,0x00,0xc0,0x04,0x00,0x00,
0x40,0x03,0x00,0x01,0xc0,0x04,0x00,0x01,
0x40,0x03,0x00,0x02,0xc0,0x04,0x00,0x02,
0x40,0x03,0x00,0x03,0xc0,0x04,0x00,0x03,
0x40,0x03,0x00,0x04,0xc0,0x04,0x00,0x04,
0x40,0x03,0x00,0x05,0xc0,0x04,0x00,0x05,
0x40,0x03,0x00,0x06,0xc0,0x04,0x00,0x06,
0x40,0x03,0x00,0x07,0xc0,0x04,0x00,0x07,
0x40,0x03,0x00,0x08,0xc0,0x04,0x00,0x08
};
//
// curve right 8
//
//O419 dc.b 12
// dc.b $80
// dc.b $a8,$0d,$00,$00,$00,$ff,$80,$68,$0a,$87
// dc.b 9*2
// dc.b 0
// dc.b WIDTH.REDUCTION
// dc.b 135
// dc.b $80,$01
// dc.b $3e
//
static unsigned char Amiga_Piece1_XZ[9*8] =
{
0x40,0x03,0x00,0x00,0xc0,0x04,0x00,0x00,
0x4c,0x03,0x05,0x01,0xca,0x04,0xdf,0x00,
0x73,0x03,0x07,0x02,0xeb,0x04,0xbc,0x01,
0xb2,0x03,0x05,0x03,0x22,0x05,0x95,0x02,