-
Notifications
You must be signed in to change notification settings - Fork 10
/
TheGreatEscape.ctl
13706 lines (13705 loc) · 630 KB
/
TheGreatEscape.ctl
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
> $4000 @start
> $4000 @writer=:TheGreatEscape.TheGreatEscapeAsmWriter
> $4000 @set-line-width=240
> $4000 @set-warnings=1
> $4000 @replace=/#FACT(?![A-Z])/#LINK:Facts
> $4000 ;
> $4000 ; SkoolKit disassembly of The Great Escape by Denton Designs.
> $4000 ; https://github.com/dpt/The-Great-Escape
> $4000 ;
> $4000 ; Copyright 1986 Ocean Software Ltd. (The Great Escape)
> $4000 ; Copyright 2012-2024 David Thomas <[email protected]> (this disassembly)
> $4000 ;
> $4000 @ofix+begin
> $4000 ; This disassembly contains ofix changes (operand fixes):
> $4000 ;
> $4000 @ofix+end
> $4000 @bfix+begin
> $4000 ; This disassembly contains bfix changes (bug fixes):
> $4000 ; * Fix the $A2C6 incorrect iteration count resulting in a ROM write to $1A42.
> $4000 ; * Makes unconditional a needless conditional return at $7CAF.
> $4000 ; * Corrects the exterior_mask_data iteration count in render_mask_buffer/$B935.
> $4000 ;
> $4000 @bfix+end
> $4000 @rfix+begin
> $4000 ; This disassembly contains rfix changes (code movement):
> $4000 ; * Removes the redundant self-modifying code at $6B19.
> $4000 ; * Removes a redundant jump at $7AFB.
> $4000 ; * Removes a redundant jump at $A0B8.
> $4000 ; * Inserts the missing RET at the end of render_mask_buffer/$B916.
> $4000 ; * $CCED potential bug fix for is_item_discoverable.
> $4000 ;
> $4000 @rfix+end
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; THE DISASSEMBLY
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; * This is a disassembly of the game when it has been loaded and relocated,
> $4000 ; but not yet invoked: every byte is in its pristine state.
> $4000 ;
> $4000 ; * Any terminology used herein such as 'super tiles' or 'vischars' is my own
> $4000 ; and has been invented for the purposes of the disassembly. I have seen none
> $4000 ; of the original source, nor know anything of how it was built.
> $4000 ;
> $4000 ; When I contacted the designer and author, John Heap, he informed me that
> $4000 ; the original source is probably now lost forever. :-(
> $4000 ;
> $4000 ; * The md5sum of the original tape image this disassembly was taken from is
> $4000 ; a6e5d50ab065accb017ecc957a954b53 and was sourced from
> $4000 ; http://www.worldofspectrum.org/pub/sinclair/games/g/GreatEscapeThe.tzx.zip
> $4000 ; but you may see slight differences towards the end of the file if you
> $4000 ; attempt to recreate the disassembly yourself.
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; ASSEMBLY PATTERNS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; Here are a selection of Z80 assembly language patterns which occur throughout
> $4000 ; the code.
> $4000 ;
> $4000 ; Multiply A by 2^N:
> $4000 ; ADD A,A ; A += A (repeated N times)
> $4000 ; Note that this disposes of the topmost bit of A. Some routines discard flag
> $4000 ; bits this way.
> $4000 ;
> $4000 ; Increment HL by an 8-bit delta:
> $4000 ; A = L
> $4000 ; A += delta
> $4000 ; L = A
> $4000 ; JR NC,skip
> $4000 ; H++
> $4000 ; skip:
> $4000 ; Q: Does this only work for HL?
> $4000 ;
> $4000 ; if-else:
> $4000 ; CP <value>
> $4000 ; JR <cond>,elsepart;
> $4000 ; <ifwork>
> $4000 ; JR endifpart;
> $4000 ; elsepart: <elsework>
> $4000 ; endifpart:
> $4000 ;
> $4000 ; Jump if less than or equal:
> $4000 ; CP $0F
> $4000 ; JP Z,$C8F1
> $4000 ; JP C,$C8F1
> $4000 ;
> $4000 ; Transfer between awkward registers:
> $4000 ; PUSH reg
> $4000 ; POP anotherreg
> $4000 ;
> $4000 ; Increment (HL) by -1 or +1:
> $4000 ; BIT 7,A
> $4000 ; JR Z,inc
> $4000 ; DEC (HL)
> $4000 ; DEC (HL)
> $4000 ; inc: INC (HL)
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; COMMENTARY TERMS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; "CHECK". This indicates something that is still to be proven or verified.
> $4000 ;
> $4000 ; "Exit via". This indicates that, instead of a RET, the instruction will jump
> $4000 ; into another routine which itself will perform the RET.
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; ZX SPECTRUM BASIC DEFINITIONS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; These are here for information only and are not used by any of the assembly
> $4000 ; directives.
> $4000 ;
> $4000 ; attribute_BLUE_OVER_BLACK = 1,
> $4000 ; attribute_RED_OVER_BLACK = 2,
> $4000 ; attribute_PURPLE_OVER_BLACK = 3,
> $4000 ; attribute_GREEN_OVER_BLACK = 4,
> $4000 ; attribute_CYAN_OVER_BLACK = 5,
> $4000 ; attribute_YELLOW_OVER_BLACK = 6,
> $4000 ; attribute_WHITE_OVER_BLACK = 7,
> $4000 ; attribute_BRIGHT_BLUE_OVER_BLACK = 65,
> $4000 ; attribute_BRIGHT_RED_OVER_BLACK = 66,
> $4000 ; attribute_BRIGHT_PURPLE_OVER_BLACK = 67,
> $4000 ; attribute_BRIGHT_GREEN_OVER_BLACK = 68,
> $4000 ; attribute_BRIGHT_CYAN_OVER_BLACK = 69,
> $4000 ; attribute_BRIGHT_YELLOW_OVER_BLACK = 70,
> $4000 ; attribute_BRIGHT_WHITE_OVER_BLACK = 71,
> $4000 ;
> $4000 ; port_KEYBOARD_SHIFTZXCV = $FEFE,
> $4000 ; port_KEYBOARD_ASDFG = $FDFE,
> $4000 ; port_KEYBOARD_QWERT = $FBFE,
> $4000 ; port_KEYBOARD_12345 = $F7FE,
> $4000 ; port_KEYBOARD_09876 = $EFFE,
> $4000 ; port_KEYBOARD_POIUY = $DFFE,
> $4000 ; port_KEYBOARD_ENTERLKJH = $BFFE,
> $4000 ; port_KEYBOARD_SPACESYMSHFTMNB = $7FFE,
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; CONSTANTS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; These are here for information only and are not used by any of the assembly
> $4000 ; directives.
> $4000 ;
> $4000 ; character_0_COMMANDANT = 0,
> $4000 ; character_1_GUARD_1 = 1,
> $4000 ; character_2_GUARD_2 = 2,
> $4000 ; character_3_GUARD_3 = 3,
> $4000 ; character_4_GUARD_4 = 4,
> $4000 ; character_5_GUARD_5 = 5,
> $4000 ; character_6_GUARD_6 = 6,
> $4000 ; character_7_GUARD_7 = 7,
> $4000 ; character_8_GUARD_8 = 8,
> $4000 ; character_9_GUARD_9 = 9,
> $4000 ; character_10_GUARD_10 = 10,
> $4000 ; character_11_GUARD_11 = 11,
> $4000 ; character_12_GUARD_12 = 12,
> $4000 ; character_13_GUARD_13 = 13,
> $4000 ; character_14_GUARD_14 = 14,
> $4000 ; character_15_GUARD_15 = 15,
> $4000 ; character_16_GUARD_DOG_1 = 16,
> $4000 ; character_17_GUARD_DOG_2 = 17,
> $4000 ; character_18_GUARD_DOG_3 = 18,
> $4000 ; character_19_GUARD_DOG_4 = 19,
> $4000 ; character_20_PRISONER_1 = 20,
> $4000 ; character_21_PRISONER_2 = 21,
> $4000 ; character_22_PRISONER_3 = 22,
> $4000 ; character_23_PRISONER_4 = 23,
> $4000 ; character_24_PRISONER_5 = 24,
> $4000 ; character_25_PRISONER_6 = 25,
> $4000 ; character_26_STOVE_1 = 26, ; movable item
> $4000 ; character_27_STOVE_2 = 27, ; movable item
> $4000 ; character_28_CRATE = 28, ; movable item
> $4000 ; character_NONE = 255,
> $4000 ;
> $4000 ; room_0_OUTDOORS = 0,
> $4000 ; room_1_HUT1RIGHT = 1,
> $4000 ; room_2_HUT2LEFT = 2,
> $4000 ; room_3_HUT2RIGHT = 3,
> $4000 ; room_4_HUT3LEFT = 4,
> $4000 ; room_5_HUT3RIGHT = 5,
> $4000 ; room_6 = 6, ; unused room index
> $4000 ; room_7_CORRIDOR = 7,
> $4000 ; room_8_CORRIDOR = 8,
> $4000 ; room_9_CRATE = 9,
> $4000 ; room_10_LOCKPICK = 10,
> $4000 ; room_11_PAPERS = 11,
> $4000 ; room_12_CORRIDOR = 12,
> $4000 ; room_13_CORRIDOR = 13,
> $4000 ; room_14_TORCH = 14,
> $4000 ; room_15_UNIFORM = 15,
> $4000 ; room_16_CORRIDOR = 16,
> $4000 ; room_17_CORRIDOR = 17,
> $4000 ; room_18_RADIO = 18,
> $4000 ; room_19_FOOD = 19,
> $4000 ; room_20_REDCROSS = 20,
> $4000 ; room_21_CORRIDOR = 21,
> $4000 ; room_22_REDKEY = 22,
> $4000 ; room_23_MESS_HALL = 23,
> $4000 ; room_24_SOLITARY = 24,
> $4000 ; room_25_MESS_HALL = 25,
> $4000 ; room_26 = 26, ; unused room index
> $4000 ; room_27 = 27, ; unused room index
> $4000 ; room_28_HUT1LEFT = 28,
> $4000 ; room_29_SECOND_TUNNEL_START = 29, ; first of the tunnel rooms
> $4000 ; room_30 = 30,
> $4000 ; room_31 = 31,
> $4000 ; room_32 = 32,
> $4000 ; room_33 = 33,
> $4000 ; room_34 = 34,
> $4000 ; room_35 = 35,
> $4000 ; room_36 = 36,
> $4000 ; room_37 = 37,
> $4000 ; room_38 = 38,
> $4000 ; room_39 = 39,
> $4000 ; room_40 = 40,
> $4000 ; room_41 = 41,
> $4000 ; room_42 = 42,
> $4000 ; room_43 = 43,
> $4000 ; room_44 = 44,
> $4000 ; room_45 = 45,
> $4000 ; room_46 = 46,
> $4000 ; room_47 = 47,
> $4000 ; room_48 = 48,
> $4000 ; room_49 = 49,
> $4000 ; room_50_BLOCKED_TUNNEL = 50,
> $4000 ; room_51 = 51,
> $4000 ; room_52 = 52,
> $4000 ; room_NONE = 255,
> $4000 ;
> $4000 ; item_WIRESNIPS = 0,
> $4000 ; item_SHOVEL = 1,
> $4000 ; item_LOCKPICK = 2,
> $4000 ; item_PAPERS = 3,
> $4000 ; item_TORCH = 4,
> $4000 ; item_BRIBE = 5,
> $4000 ; item_UNIFORM = 6,
> $4000 ; item_FOOD = 7,
> $4000 ; item_POISON = 8,
> $4000 ; item_RED_KEY = 9,
> $4000 ; item_YELLOW_KEY = 10,
> $4000 ; item_GREEN_KEY = 11,
> $4000 ; item_RED_CROSS_PARCEL = 12,
> $4000 ; item_RADIO = 13,
> $4000 ; item_PURSE = 14,
> $4000 ; item_COMPASS = 15,
> $4000 ; item__LIMIT = 16,
> $4000 ; item_NONE = 255,
> $4000 ;
> $4000 ; zoombox_tile_TL = 0, ; top left
> $4000 ; zoombox_tile_HZ = 1, ; horizontal
> $4000 ; zoombox_tile_TR = 2, ; top right
> $4000 ; zoombox_tile_VT = 3, ; vertical
> $4000 ; zoombox_tile_BR = 4, ; bottom right
> $4000 ; zoombox_tile_BL = 5, ; bottom left
> $4000 ;
> $4000 ; message_MISSED_ROLL_CALL = 0,
> $4000 ; message_TIME_TO_WAKE_UP = 1,
> $4000 ; message_BREAKFAST_TIME = 2,
> $4000 ; message_EXERCISE_TIME = 3,
> $4000 ; message_TIME_FOR_BED = 4,
> $4000 ; message_THE_DOOR_IS_LOCKED = 5,
> $4000 ; message_IT_IS_OPEN = 6,
> $4000 ; message_INCORRECT_KEY = 7,
> $4000 ; message_ROLL_CALL = 8,
> $4000 ; message_RED_CROSS_PARCEL = 9,
> $4000 ; message_PICKING_THE_LOCK = 10,
> $4000 ; message_CUTTING_THE_WIRE = 11,
> $4000 ; message_YOU_OPEN_THE_BOX = 12,
> $4000 ; message_YOU_ARE_IN_SOLITARY = 13,
> $4000 ; message_WAIT_FOR_RELEASE = 14,
> $4000 ; message_MORALE_IS_ZERO = 15,
> $4000 ; message_ITEM_DISCOVERED = 16,
> $4000 ; message_HE_TAKES_THE_BRIBE = 17,
> $4000 ; message_AND_ACTS_AS_DECOY = 18,
> $4000 ; message_ANOTHER_DAY_DAWNS = 19,
> $4000 ; message_QUEUE_END = 255,
> $4000 ;
> $4000 ; interiorobject_STRAIGHT_TUNNEL_SW_NE = 0,
> $4000 ; interiorobject_SMALL_TUNNEL_ENTRANCE = 1,
> $4000 ; interiorobject_ROOM_OUTLINE_22x12_A = 2,
> $4000 ; interiorobject_STRAIGHT_TUNNEL_NW_SE = 3,
> $4000 ; interiorobject_TUNNEL_T_JOIN_NW_SE = 4,
> $4000 ; interiorobject_PRISONER_SAT_MID_TABLE = 5,
> $4000 ; interiorobject_TUNNEL_T_JOIN_SW_NE = 6,
> $4000 ; interiorobject_TUNNEL_CORNER_SW_SE = 7,
> $4000 ; interiorobject_WIDE_WINDOW_FACING_SE = 8,
> $4000 ; interiorobject_EMPTY_BED_FACING_SE = 9,
> $4000 ; interiorobject_SHORT_WARDROBE_FACING_SW = 10,
> $4000 ; interiorobject_CHEST_OF_DRAWERS_FACING_SW = 11,
> $4000 ; interiorobject_TUNNEL_CORNER_NW_NE = 12,
> $4000 ; interiorobject_EMPTY_BENCH = 13,
> $4000 ; interiorobject_TUNNEL_CORNER_NE_SE = 14,
> $4000 ; interiorobject_DOOR_FRAME_SE = 15,
> $4000 ; interiorobject_DOOR_FRAME_SW = 16,
> $4000 ; interiorobject_TUNNEL_CORNER_NW_SW = 17,
> $4000 ; interiorobject_TUNNEL_ENTRANCE = 18,
> $4000 ; interiorobject_PRISONER_SAT_END_TABLE = 19,
> $4000 ; interiorobject_COLLAPSED_TUNNEL_SW_NE = 20,
> $4000 ; interiorobject_UNUSED_21 = 21, ; unused by game, draws as interiorobject_ROOM_OUTLINE_22x12_A
> $4000 ; interiorobject_CHAIR_FACING_SE = 22,
> $4000 ; interiorobject_OCCUPIED_BED = 23,
> $4000 ; interiorobject_ORNATE_WARDROBE_FACING_SW = 24,
> $4000 ; interiorobject_CHAIR_FACING_SW = 25,
> $4000 ; interiorobject_CUPBOARD_FACING_SE = 26,
> $4000 ; interiorobject_ROOM_OUTLINE_18x10_A = 27,
> $4000 ; interiorobject_UNUSED_28 = 28, ; unused by game, draws as interiorobject_TABLE
> $4000 ; interiorobject_TABLE = 29,
> $4000 ; interiorobject_STOVE_PIPE = 30,
> $4000 ; interiorobject_PAPERS_ON_FLOOR = 31,
> $4000 ; interiorobject_TALL_WARDROBE_FACING_SW = 32,
> $4000 ; interiorobject_SMALL_SHELF_FACING_SE = 33,
> $4000 ; interiorobject_SMALL_CRATE = 34,
> $4000 ; interiorobject_SMALL_WINDOW_WITH_BARS_FACING_SE = 35
> $4000 ; interiorobject_TINY_DOOR_FRAME_NE = 36, ; tunnel entrance
> $4000 ; interiorobject_NOTICEBOARD_FACING_SE = 37,
> $4000 ; interiorobject_DOOR_FRAME_NW = 38,
> $4000 ; interiorobject_UNUSED_39 = 39, ; unused by game, draws as interiorobject_END_DOOR_FRAME_NW_SE
> $4000 ; interiorobject_DOOR_FRAME_NE = 40,
> $4000 ; interiorobject_ROOM_OUTLINE_15x8 = 41,
> $4000 ; interiorobject_CUPBOARD_FACING_SW = 42,
> $4000 ; interiorobject_MESS_BENCH = 43,
> $4000 ; interiorobject_MESS_TABLE = 44,
> $4000 ; interiorobject_MESS_BENCH_SHORT = 45,
> $4000 ; interiorobject_ROOM_OUTLINE_18x10_B = 46,
> $4000 ; interiorobject_ROOM_OUTLINE_22x12_B = 47,
> $4000 ; interiorobject_TINY_TABLE = 48,
> $4000 ; interiorobject_TINY_DRAWERS_FACING_SE = 49,
> $4000 ; interiorobject_TALL_DRAWERS_FACING_SW = 50,
> $4000 ; interiorobject_DESK_FACING_SW = 51,
> $4000 ; interiorobject_SINK_FACING_SE = 52,
> $4000 ; interiorobject_KEY_RACK_FACING_SE = 53,
> $4000 ; interiorobject__LIMIT = 54
> $4000 ;
> $4000 ; interiorobjecttile_MAX = 194, ; number of tiles at $9768 interior_tiles
> $4000 ; interiorobjecttile_ESCAPE = 255, ; escape character
> $4000 ;
> $4000 ; sound_CHARACTER_ENTERS_1 = $2030,
> $4000 ; sound_CHARACTER_ENTERS_2 = $2040,
> $4000 ; sound_BELL_RINGER = $2530,
> $4000 ; sound_PICK_UP_ITEM = $3030,
> $4000 ; sound_DROP_ITEM = $3040,
> $4000 ;
> $4000 ; morale_MIN = 0,
> $4000 ; morale_MAX = 112,
> $4000 ;
> $4000 ; direction_TOP_LEFT = 0
> $4000 ; direction_TOP_RIGHT = 1,
> $4000 ; direction_BOTTOM_RIGHT = 2,
> $4000 ; direction_BOTTOM_LEFT = 3,
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; FLAGS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; These are here for information only and are not used by any of the
> $4000 ; directives.
> $4000 ;
> $4000 ; INPUT
> $4000 ; -----
> $4000 ;
> $4000 ; input_NONE = 0,
> $4000 ; input_UP = 1,
> $4000 ; input_DOWN = 2,
> $4000 ; input_LEFT = 3,
> $4000 ; input_RIGHT = 6,
> $4000 ; input_FIRE = 9,
> $4000 ; input_UP_FIRE = input_UP + input_FIRE,
> $4000 ; input_DOWN_FIRE = input_DOWN + input_FIRE,
> $4000 ; input_LEFT_FIRE = input_LEFT + input_FIRE,
> $4000 ; input_RIGHT_FIRE = input_RIGHT + input_FIRE,
> $4000 ;
> $4000 ; VISCHAR
> $4000 ; -------
> $4000 ;
> $4000 ; vischar byte 0 'character' ::
> $4000 ;
> $4000 ; Character index mask. This is used in a couple of places but it's not
> $4000 ; consistently applied. I've not spotted anything else sharing the this field.
> $4000 ; vischar_CHARACTER_MASK = $1F,
> $4000 ;
> $4000 ; vischar byte 1 'flags' ::
> $4000 ;
> $4000 ; Indicates that this vischar is unused.
> $4000 ; vischar_FLAGS_EMPTY_SLOT = $FF,
> $4000 ;
> $4000 ; Bits 0..5 form a mask to isolate all of the modes.
> $4000 ; Note: $0F would be sufficient.
> $4000 ; vischar_FLAGS_MASK = $3F,
> $4000 ;
> $4000 ; The bottom nibble of flags contains either two flags for the hero, or a
> $4000 ; pursuit mode field for NPCs.
> $4000 ;
> $4000 ; Bit 0 is set when the hero is picking a lock. (Hero only)
> $4000 ; vischar_FLAGS_PICKING_LOCK = 1,
> $4000 ;
> $4000 ; Bit 1 is set when the hero is cutting wire. (Hero only)
> $4000 ; vischar_FLAGS_CUTTING_WIRE = 2,
> $4000 ;
> $4000 ; Bits 0..3 are a mask to isolate the pursuit mode.
> $4000 ; vischar_FLAGS_PURSUIT_MASK = $0F,
> $4000 ;
> $4000 ; Pursuit mode == 1 when a friendly character was nearby when a bribe was used
> $4000 ; or when a hostile is pursuing with intent to capture. (NPC only) Set in
> $4000 ; #R$CCAB.
> $4000 ; vischar_PURSUIT_PURSUE = 1,
> $4000 ;
> $4000 ; Pursuit mode == 2 when a hostile sees a player-controlled hero, or the flag
> $4000 ; is red. It causes hostiles to follow the hero and get in his way but not
> $4000 ; arrest him. (NPC only)
> $4000 ; Set in #R$CC37.
> $4000 ; vischar_PURSUIT_HASSLE = 2,
> $4000 ;
> $4000 ; Pursuit mode == 3 when food is in the vicinity of a dog. (Guard dog NPC only)
> $4000 ; vischar_PURSUIT_DOG_FOOD = 3,
> $4000 ;
> $4000 ; Pursuit mode == 4 when a hostile was nearby when a bribe was accepted. It
> $4000 ; causes the hostile to target the character who accepted the bribe. (Hostile
> $4000 ; NPC only)
> $4000 ; vischar_PURSUIT_SAW_BRIBE = 4,
> $4000 ;
> $4000 ; Bits 4 and 5 are unused.
> $4000 ;
> $4000 ; Bit 6 is set when the next target is a door.
> $4000 ; vischar_FLAGS_TARGET_IS_DOOR = 1 << 6,
> $4000 ;
> $4000 ; Bit 7 is set in #R$B5CE to stop #R$AFDF running for this vischar.
> $4000 ; vischar_FLAGS_NO_COLLIDE = 1 << 7,
> $4000 ;
> $4000 ; vischar byte 7 'counter_and_flags' ::
> $4000 ;
> $4000 ; Bits 0..3 form a mask to isolate the character behaviour delay field.
> $4000 ; #R$C918 counts this field down to zero at which point it performs character
> $4000 ; behaviours. In the game this is only ever set to five.
> $4000 ; vischar_BYTE7_COUNTER_MASK = $F0,
> $4000 ;
> $4000 ; Bit 4 is unused.
> $4000 ;
> $4000 ; Bit 5 is set when #$CA49 should run in preference to #R$CA11.
> $4000 ; vischar_BYTE7_Y_DOMINANT = 1 << 5,
> $4000 ;
> $4000 ; Bit 6 is set when map movement should be inhibited. (Hero only)
> $4000 ; Set in #R$AF8F.
> $4000 ; vischar_BYTE7_DONT_MOVE_MAP = 1 << 6,
> $4000 ;
> $4000 ; Bit 7 is set when #R$AF8F is entered, implying that vischar.mi etc. are
> $4000 ; setup.
> $4000 ; vischar_DRAWABLE = 1 << 7,
> $4000 ;
> $4000 ; vischar byte $C 'animindex' ::
> $4000 ;
> $4000 ; Bit 7 is set to play the animation in reverse.
> $4000 ; vischar_ANIMINDEX_BIT7 = 1 << 7,
> $4000 ;
> $4000 ; vischar byte $E 'direction' ::
> $4000 ;
> $4000 ; Bits 0..1 form a mask to isolate the direction field.
> $4000 ; vischar_DIRECTION_MASK = $03,
> $4000 ;
> $4000 ; Bit 2 is set when crawling.
> $4000 ; vischar_DIRECTION_CRAWL = 1 << 2,
> $4000 ;
> $4000 ; ITEMSTRUCT
> $4000 ; ----------
> $4000 ;
> $4000 ; itemstruct byte 0 'item_and_flags' ::
> $4000 ;
> $4000 ; Bits 0..3 form a mask to isolate the item field.
> $4000 ; itemstruct_ITEM_MASK = $0F,
> $4000 ;
> $4000 ; Bit 4 is an unknown purpose flag used in a mask by #R$7B36, but never set.
> $4000 ; It's possibly evidence of a larger itemstruct_ITEM_MASK.
> $4000 ;
> $4000 ; Bit 5 is set on item_FOOD when it is poisoned. This only affects the amount
> $4000 ; of time a guard dog is stalled for. The dog will eat the food and "die"
> $4000 ; (halt) either way.
> $4000 ; itemstruct_ITEM_FLAG_POISONED = 1 << 5,
> $4000 ;
> $4000 ; Bit 6 is unused.
> $4000 ;
> $4000 ; Bit 7 is set when the item is picked up for the first time (for scoring).
> $4000 ; itemstruct_ITEM_FLAG_HELD = 1 << 7,
> $4000 ;
> $4000 ; itemstruct byte 1 'room_and_flags' ::
> $4000 ;
> $4000 ; Bits 0..5 form a mask to isolate the room field.
> $4000 ; itemstruct_ROOM_MASK = $3F,
> $4000 ;
> $4000 ; Indicates that the item is nowhere. This is (item_NONE &
> $4000 ; itemstruct_ROOM_MASK).
> $4000 ; itemstruct_ROOM_NONE = $3F,
> $4000 ;
> $4000 ; Bit 6 is set when the item is nearby.
> $4000 ; Cleared by #R$DB9E and #R$B89C.
> $4000 ; itemstruct_ROOM_FLAG_NEARBY_6 = 1 << 6,
> $4000 ;
> $4000 ; Bit 7 is set when the item is nearby.
> $4000 ; Cleared by #R$DB9E. Enables #R$7C82 for the item. #R$C918 uses it on
> $4000 ; item_FOOD to trigger guard dog behaviour.
> $4000 ; itemstruct_ROOM_FLAG_NEARBY_7 = 1 << 7,
> $4000 ;
> $4000 ; OTHERS
> $4000 ; ------
> $4000 ;
> $4000 ; route_REVERSED = 1 << 7, ; set if the route is to be followed in reverse order
> $4000 ;
> $4000 ; door_REVERSE = 1 << 7, ; used to reverse door transitions
> $4000 ; door_LOCKED = 1 << 7, ; used to lock doors in locked_doors[]
> $4000 ; door_NONE = $FF
> $4000 ;
> $4000 ; characterstruct_FLAG_ON_SCREEN = 1 << 6, ; this disables the character
> $4000 ; characterstruct_CHARACTER_MASK = $1F,
> $4000 ; characterstruct_BYTE5_MASK = $7F,
> $4000 ; characterstruct_BYTE6_MASK_LO = $07,
> $4000 ;
> $4000 ; door_FLAGS_MASK_DIRECTION = $03, ; up/down or direction field?
> $4000 ;
> $4000 ; searchlight_STATE_CAUGHT = $1F,
> $4000 ; searchlight_STATE_SEARCHING = $FF, ; hunting for hero
> $4000 ;
> $4000 ; bell_RING_PERPETUAL = $00,
> $4000 ; bell_RING_40_TIMES = $28,
> $4000 ; bell_STOP = $FF,
> $4000 ;
> $4000 ; escapeitem_COMPASS = 1,
> $4000 ; escapeitem_PAPERS = 2,
> $4000 ; escapeitem_PURSE = 4,
> $4000 ; escapeitem_UNIFORM = 8,
> $4000 ;
> $4000 ; statictiles_COUNT_MASK = $7F,
> $4000 ; statictiles_VERTICAL = 1 << 7, ; otherwise horizontal
> $4000 ;
> $4000 ; map_MAIN_GATE_X = $696D, ; coords: $69..$6D
> $4000 ; map_MAIN_GATE_Y = $494B,
> $4000 ; map_ROLL_CALL_X = $727C,
> $4000 ; map_ROLL_CALL_Y = $6A72,
> $4000 ;
> $4000 ; inputdevice_KEYBOARD = 0,
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; COMMON TYPES
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; 'bounds_t' is a bounding box:
> $4000 ; +---------------------------------+
> $4000 ; | Type | Bytes | Name | Meaning |
> $4000 ; |---------------------------------|
> $4000 ; | Byte | 1 | x0 | Minimum x |
> $4000 ; | Byte | 1 | x1 | Maximum x |
> $4000 ; | Byte | 1 | y0 | Minimum y |
> $4000 ; | Byte | 1 | y1 | Maximum y |
> $4000 ; +---------------------------------+
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; ROOMS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; Key
> $4000 ;
> $4000 ; '' => door (up/down)
> $4000 ; = => door (left/right)
> $4000 ; in => entrance
> $4000 ; [] => exit
> $4000 ; ~ => void / ground
> $4000 ;
> $4000 ; Map of rooms' indices
> $4000 ;
> $4000 ; +--------+--------+----+----+----+
> $4000 ; | 25 = 23 = 19 = 18 = 12 |
> $4000 ; +--------+-+-''-+-+----+ +-''-+
> $4000 ; | 24 = 22 = 21 | | 20 + + 17 |
> $4000 ; +----+----+-''-+ +-''-+----+-''-+
> $4000 ; = 15 | 7 |
> $4000 ; +----+------+ +-''-+-''-+
> $4000 ; = 28 = 1 | | 14 = 16 |
> $4000 ; +----+--''--+ +----+-''-+
> $4000 ; = 13 |
> $4000 ; +----+------+ +-''-+
> $4000 ; = 2 = 3 | | 11 |
> $4000 ; +----+--''--+ | |
> $4000 ; +----+----+
> $4000 ; +----+------+ | 10 | 9 |
> $4000 ; = 4 = 5 | | | |
> $4000 ; +----+--''--+ +-''-+-''-+
> $4000 ; = 8 |
> $4000 ; +----+----+
> $4000 ;
> $4000 ; Map of tunnels' indices 1
> $4000 ;
> $4000 ; ~~~~~~~~~~~~~~~~~~~~+---------+----+
> $4000 ; ~~~~~~~~~~~~~~~~~~~~| 49 = 50 |
> $4000 ; ~~~~~~~~~~~~~~~~~~~~+-''-+----+-''-+
> $4000 ; ~~~~~~~~~~~~~~~~~~~~| 48 |~~~~| 47 |
> $4000 ; ~~~~~~~~~~~~~~~~~~~~+-[]-+~~~~| |
> $4000 ; +------+-------+----+----+----+ |
> $4000 ; | 45 = 41 = 40 | 46 = |
> $4000 ; +-''-+-+--+-''-+------''-+-''-+----+
> $4000 ; | 44 = 43 = 42 |~~~~| 38 = 39 |~~~~~
> $4000 ; +----+----+----+~~~~+-''-+----+~~~~~
> $4000 ; ~~~~~~~~~~~~~~~~~~~~| 37 |~~~~~~~~~~
> $4000 ; ~~~~~~~~~~~~~~~~~~~~+-in-+~~~~~~~~~~
> $4000 ;
> $4000 ; Map of tunnels' indices 2
> $4000 ;
> $4000 ; +----------+--------+--------+
> $4000 ; | 36 = 30 = 52 |
> $4000 ; +-''-+-----+--''----+---+-''-+
> $4000 ; | 35 |~~~~~~| 31 |~~~~~~| 51 |
> $4000 ; | +------+-''-+~~~~~~| |
> $4000 ; | = 33 = 32 |~~~~~~| |
> $4000 ; | +------+----+~~~~~~| |
> $4000 ; | |~~~~~~~~~~~~~+----+ |
> $4000 ; +-''-+~~~~~~~~~~~~in 29 = |
> $4000 ; | 34 |~~~~~~~~~~~~~+----+----+
> $4000 ; +-[]-+~~~~~~~~~~~~~~~~~~~~~~~~
> $4000 ;
> $4000 ; I'm fairly sure that the visual of the above layout is actually topologically
> $4000 ; impossible. e.g. if you take screenshots of every room and attempt to combine
> $4000 ; them in an image editor it won't join up.
> $4000 ;
> $4000 ; Unused room indices: 6, 26, 27
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; GAME STATE
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; There are eight visible character (vischar) structures living at $8000
> $4000 ; onwards. The game therefore supports up to eight characters on-screen at
> $4000 ; once. The stove and crate items count as characters too.
> $4000 ;
> $4000 ; These structures occupy the same addresses as some of the static tiles. This
> $4000 ; is fine as the static tiles are never referenced once they're plotted to the
> $4000 ; screen at startup.
> $4000 ;
> $4000 ; The structures are 32 bytes long. Each structure is laid out as follows:
> $4000 ;
> $4000 ; +-------------+-------+-------------------+-------------------------------------------------------------------------------+
> $4000 ; | Type | Bytes | Name | Meaning |
> $4000 ; +-------------+-------+-------------------+-------------------------------------------------------------------------------+
> $4000 ; | Character | 1 | character | Character index, or $FF if none |
> $4000 ; | Byte | 1 | flags | Flags |
> $4000 ; | Route | 2 | route | Route |
> $4000 ; | TinyPos | 3 | target | Target position |
> $4000 ; | Byte | 1 | counter_and_flags | Top nibble = flags, bottom nibble = counter used by character_behaviour only |
> $4000 ; | Pointer | 2 | animbase | Pointer to animation base (never changes) |
> $4000 ; | Pointer | 2 | anim | Pointer to value in animations |
> $4000 ; | Byte | 1 | animindex | Bit 7 is up/down flag, other bits are an animation counter |
> $4000 ; | Byte | 1 | input | Input .. previous direction? |
> $4000 ; | Byte | 1 | direction | Direction and walk/crawl flag |
> $4000 ; | MovableItem | 9 | mi | Movable item structure (pos (where we are), current sprite, sprite index) |
> $4000 ; | BigXY | 4 | iso_pos | Screen x, y coord |
> $4000 ; | Room | 1 | room | Current room index |
> $4000 ; | Byte | 1 | unused | - |
> $4000 ; | Byte | 1 | width_bytes | Copy of sprite width in bytes + 1 |
> $4000 ; | Byte | 1 | height | Copy of sprite height in rows |
> $4000 ; +-------------+-------+-------------------+-------------------------------------------------------------------------------+
> $4000 ;
> $4000 ; The first entry in the array is the hero.
> $4000 ;
> $4000 ; Further notes:
> $4000 ;
> $4000 ; b $8001 flags: bit 6 gets toggled in set_hero_route / bit 0: picking lock / bit 1: cutting wire ($FF when reset)
> $4000 ; w $8002 route (set in set_hero_route, process_player_input)
> $4000 ; b*3 $8004 (<- process_player_input) a coordinate? (i see it getting scaled in #R$CA11)
> $4000 ; b $8007 bits 5/6/7: flags (suspect bit 4 is a flag too) ($00 when reset)
> $4000 ; w $8008 (read by animate)
> $4000 ; w $800A (read/written by animate)
> $4000 ; b $800C (read/written by animate)
> $4000 ; b $800D tunnel related (<- process_player_input, cutting_wire, process_player_input) assigned from cutting_wire_new_inputs table. causes movement when set. but not when in solitary.
> $4000 ; $81 -> move toward top left,
> $4000 ; $82 -> move toward bottom right,
> $4000 ; $83 -> move toward bottom left,
> $4000 ; $84 -> TL (again)
> $4000 ; $85 ->
> $4000 ; b $800E tunnel related, direction (bottom 2 bits index cutting_wire_new_inputs) bit 2 is walk/crawl flag
> $4000 ; set to - $00 -> character faces top left
> $4000 ; $01 -> character faces top right
> $4000 ; $02 -> character faces bottom right
> $4000 ; $03 -> character faces bottom left
> $4000 ; $04 -> character faces top left (crawling)
> $4000 ; $05 -> character faces top right (crawling)
> $4000 ; $06 -> character faces bottom right (crawling)
> $4000 ; $07 -> character faces bottom left (crawling)
> $4000 ; w $800F position on X axis (along the line of - bottom right to top left of screen) (set by process_player_input)
> $4000 ; w $8011 position on Y axis (along the line of - bottom left to top right of screen) (set by process_player_input) i think this might be relative to the current size of the map. each step seems to be two pixels.
> $4000 ; w $8013 character's height // set to 24 in process_player_input, cutting_wire, set to 12 in action_wiresnips, reset in calc_vischar_iso_pos_from_vischar, read by animate ($B68C) (via IY), get_next_drawable ($B8DE), setup_vischar_plotting ($E433), in_permitted_area ($9F4F) written by touch ($AFD5) often written as a byte, but suspect it's a word-sized value
> $4000 ; w $8015 pointer to current character sprite set (gets pointed to the 'tl_4' sprite)
> $4000 ; b $8017 touch sets this to touch_stashed_A
> $4000 ; w $8018 points to something (gets $06C8 subtracted from it) (<- in_permitted_area)
> $4000 ; w $801A points to something (gets $0448 subtracted from it) (<- in_permitted_area)
> $4000 ; b $801C room index: cleared to zero by action_papers, set to room_24_SOLITARY by solitary, copied to room_index by transition
> $4000 ;
> $4000 ; Other things:
> $4000 ;
> $4000 ; b $8100 mask buffer ($A0 bytes - 4 * 8 * 5)
> $4000 ; w $81A0 mask buffer pointer
> $4000 ; w $81A2 screen buffer pointer
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; ROUTES
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; Each vischar has a "route" structure that guides its pathfinding. The route
> $4000 ; is composed of an index and a step (the first and second bytes respectively).
> $4000 ; The index selects a route from the table at #R$7738. The step is the index
> $4000 ; into that route. If the top bit of the route index is set then the route is
> $4000 ; followed in reverse order.
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; HUTS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; Hut 1 is the hut at the 'top' of the map.
> $4000 ; Hut 2 is the middle hut.
> $4000 ; Hut 3 is the bottom hut.
> $4000 ;
> $4000 ; These identifiers for the huts are my own convention - as with all things in
> $4000 ; this disassembly it was determined from scratch.
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; HUT INTERIORS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; Hut 1 is composed of room 28 on the left and room 1 on the right.
> $4000 ; Hut 2 is composed of room 2 on the left and room 3 on the right.
> $4000 ; Hut 3 is composed of room 4 on the left and room 5 on the right.
> $4000 ;
> $4000 ;
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ; SLEEPING CHARACTERS
> $4000 ; //////////////////////////////////////////////////////////////////////////////
> $4000 ;
> $4000 ; Three of the four beds in hut 1 are occupied by sleeping figures who -
> $4000 ; creepily - never rise from their slumber. Perhaps more concurrent prisoner
> $4000 ; characters were originally planned - there's capacity in the room layout for
> $4000 ; eleven - but machine limits prevented more than six being used.
> $4000 ;
> $4000 ; In hut 2, our hero sleeps in the left hand room and three active characters
> $4000 ; (20..22) slumber in the right hand room.
> $4000 ;
> $4000 ; Hut 3 has no character sleeping in its left hand room and three active
> $4000 ; characters (23..25) sleep in the right hand room.
> $4000 ;
> $4000 ; |-- Left room --|----------------- Right room -----------------|
> $4000 ; |---------------|-- Left bed --|-- Middle bed -|-- Right bed --|
> $4000 ; Hut 1 | Always asleep | Always empty | Always asleep | Always asleep |
> $4000 ; Hut 2 | Hero | 22 | 21 | 20 |
> $4000 ; Hut 3 | Always empty | 25 | 24 | 23 |
> $4000 ;
> $4000 @org=$4000
;
b $4000 Loading screen
D $4000 #UDGTABLE { #SCR(loading) | This is the loading screen. } TABLE#
@ $4000 label=screen
B $4000,6144,32 Pixel data.
B $5800,768,32 Attribute data.
;
b $5B00 Super tiles
D $5B00 These are the 32x32 pixel "super tiles" that the game's exterior map (defined by #R$BCEE) is built of. Each super tile holds a 4x4 array of tile indices. #R$BCAA is used to turn the super tile index into a tileset pointer (pointing within #R$8590). The tileset pointer in combination with the tile indices in the super tile can then be used to fetch the tile data.
@ $5B00 label=super_tiles
B $5B00,16,4 super_tile $00 #HTML[#CALL:supertile($5B00, 0)]
B $5B10,16,4 super_tile $01 #HTML[#CALL:supertile($5B10, 0)]
B $5B20,16,4 super_tile $02 #HTML[#CALL:supertile($5B20, 0)]
B $5B30,16,4 super_tile $03 #HTML[#CALL:supertile($5B30, 0)]
B $5B40,16,4 super_tile $04 #HTML[#CALL:supertile($5B40, 0)]
B $5B50,16,4 super_tile $05 #HTML[#CALL:supertile($5B50, 0)]
B $5B60,16,4 super_tile $06 #HTML[#CALL:supertile($5B60, 0)]
B $5B70,16,4 super_tile $07 #HTML[#CALL:supertile($5B70, 0)]
B $5B80,16,4 super_tile $08 #HTML[#CALL:supertile($5B80, 0)]
B $5B90,16,4 super_tile $09 #HTML[#CALL:supertile($5B90, 0)]
B $5BA0,16,4 super_tile $0A #HTML[#CALL:supertile($5BA0, 0)]
B $5BB0,16,4 super_tile $0B #HTML[#CALL:supertile($5BB0, 0)]
B $5BC0,16,4 super_tile $0C #HTML[#CALL:supertile($5BC0, 0)]
B $5BD0,16,4 super_tile $0D #HTML[#CALL:supertile($5BD0, 0)]
B $5BE0,16,4 super_tile $0E #HTML[#CALL:supertile($5BE0, 0)]
B $5BF0,16,4 super_tile $0F #HTML[#CALL:supertile($5BF0, 0)]
B $5C00,16,4 super_tile $10 #HTML[#CALL:supertile($5C00, 0)]
B $5C10,16,4 super_tile $11 #HTML[#CALL:supertile($5C10, 0)]
B $5C20,16,4 super_tile $12 #HTML[#CALL:supertile($5C20, 0)]
B $5C30,16,4 super_tile $13 #HTML[#CALL:supertile($5C30, 0)]
B $5C40,16,4 super_tile $14 #HTML[#CALL:supertile($5C40, 0)]
B $5C50,16,4 super_tile $15 #HTML[#CALL:supertile($5C50, 0)]
B $5C60,16,4 super_tile $16 #HTML[#CALL:supertile($5C60, 0)]
B $5C70,16,4 super_tile $17 #HTML[#CALL:supertile($5C70, 0)]
B $5C80,16,4 super_tile $18 #HTML[#CALL:supertile($5C80, 0)]
B $5C90,16,4 super_tile $19 #HTML[#CALL:supertile($5C90, 0)]
B $5CA0,16,4 super_tile $1A #HTML[#CALL:supertile($5CA0, 0)]
B $5CB0,16,4 super_tile $1B #HTML[#CALL:supertile($5CB0, 0)]
B $5CC0,16,4 super_tile $1C #HTML[#CALL:supertile($5CC0, 0)]
B $5CD0,16,4 super_tile $1D #HTML[#CALL:supertile($5CD0, 0)]
B $5CE0,16,4 super_tile $1E #HTML[#CALL:supertile($5CE0, 0)]
B $5CF0,16,4 super_tile $1F #HTML[#CALL:supertile($5CF0, 0)]
B $5D00,16,4 super_tile $20 #HTML[#CALL:supertile($5D00, 0)]
B $5D10,16,4 super_tile $21 #HTML[#CALL:supertile($5D10, 0)]
B $5D20,16,4 super_tile $22 #HTML[#CALL:supertile($5D20, 0)]
B $5D30,16,4 super_tile $23 #HTML[#CALL:supertile($5D30, 0)]
B $5D40,16,4 super_tile $24 #HTML[#CALL:supertile($5D40, 0)]
B $5D50,16,4 super_tile $25 #HTML[#CALL:supertile($5D50, 0)]
B $5D60,16,4 super_tile $26 #HTML[#CALL:supertile($5D60, 0)]
B $5D70,16,4 super_tile $27 #HTML[#CALL:supertile($5D70, 0)]
B $5D80,16,4 super_tile $28 #HTML[#CALL:supertile($5D80, 0)]
B $5D90,16,4 super_tile $29 #HTML[#CALL:supertile($5D90, 0)]
B $5DA0,16,4 super_tile $2A #HTML[#CALL:supertile($5DA0, 0)]
B $5DB0,16,4 super_tile $2B #HTML[#CALL:supertile($5DB0, 0)]
B $5DC0,16,4 super_tile $2C #HTML[#CALL:supertile($5DC0, 0)]
B $5DD0,16,4 super_tile $2D #HTML[#CALL:supertile($5DD0, 0)]
B $5DE0,16,4 super_tile $2E #HTML[#CALL:supertile($5DE0, 0)]
B $5DF0,16,4 super_tile $2F #HTML[#CALL:supertile($5DF0, 0)]
B $5E00,16,4 super_tile $30 #HTML[#CALL:supertile($5E00, 0)]
B $5E10,16,4 super_tile $31 #HTML[#CALL:supertile($5E10, 0)]
B $5E20,16,4 super_tile $32 #HTML[#CALL:supertile($5E20, 0)]
B $5E30,16,4 super_tile $33 #HTML[#CALL:supertile($5E30, 0)]
B $5E40,16,4 super_tile $34 #HTML[#CALL:supertile($5E40, 0)]
B $5E50,16,4 super_tile $35 #HTML[#CALL:supertile($5E50, 0)]
B $5E60,16,4 super_tile $36 #HTML[#CALL:supertile($5E60, 0)]
B $5E70,16,4 super_tile $37 #HTML[#CALL:supertile($5E70, 0)]
B $5E80,16,4 super_tile $38 #HTML[#CALL:supertile($5E80, 0)]
B $5E90,16,4 super_tile $39 #HTML[#CALL:supertile($5E90, 0)]
B $5EA0,16,4 super_tile $3A #HTML[#CALL:supertile($5EA0, 0)]
B $5EB0,16,4 super_tile $3B #HTML[#CALL:supertile($5EB0, 0)]
B $5EC0,16,4 super_tile $3C #HTML[#CALL:supertile($5EC0, 0)]
B $5ED0,16,4 super_tile $3D #HTML[#CALL:supertile($5ED0, 0)]
B $5EE0,16,4 super_tile $3E #HTML[#CALL:supertile($5EE0, 0)]
B $5EF0,16,4 super_tile $3F #HTML[#CALL:supertile($5EF0, 0)]
B $5F00,16,4 super_tile $40 #HTML[#CALL:supertile($5F00, 0)]
B $5F10,16,4 super_tile $41 #HTML[#CALL:supertile($5F10, 0)]
B $5F20,16,4 super_tile $42 #HTML[#CALL:supertile($5F20, 0)]
B $5F30,16,4 super_tile $43 #HTML[#CALL:supertile($5F30, 0)]
B $5F40,16,4 super_tile $44 #HTML[#CALL:supertile($5F40, 0)]
B $5F50,16,4 super_tile $45 #HTML[#CALL:supertile($5F50, 0)]
B $5F60,16,4 super_tile $46 #HTML[#CALL:supertile($5F60, 0)]
B $5F70,16,4 super_tile $47 #HTML[#CALL:supertile($5F70, 0)]
B $5F80,16,4 super_tile $48 #HTML[#CALL:supertile($5F80, 0)]
B $5F90,16,4 super_tile $49 #HTML[#CALL:supertile($5F90, 0)]
B $5FA0,16,4 super_tile $4A #HTML[#CALL:supertile($5FA0, 0)]
B $5FB0,16,4 super_tile $4B #HTML[#CALL:supertile($5FB0, 0)]
B $5FC0,16,4 super_tile $4C #HTML[#CALL:supertile($5FC0, 0)]
B $5FD0,16,4 super_tile $4D #HTML[#CALL:supertile($5FD0, 0)]
B $5FE0,16,4 super_tile $4E #HTML[#CALL:supertile($5FE0, 0)]
B $5FF0,16,4 super_tile $4F #HTML[#CALL:supertile($5FF0, 0)] [unused by map]
B $6000,16,4 super_tile $50 #HTML[#CALL:supertile($6000, 0)]
B $6010,16,4 super_tile $51 #HTML[#CALL:supertile($6010, 0)]
B $6020,16,4 super_tile $52 #HTML[#CALL:supertile($6020, 0)]
B $6030,16,4 super_tile $53 #HTML[#CALL:supertile($6030, 0)]
B $6040,16,4 super_tile $54 #HTML[#CALL:supertile($6040, 0)]
B $6050,16,4 super_tile $55 #HTML[#CALL:supertile($6050, 0)]
B $6060,16,4 super_tile $56 #HTML[#CALL:supertile($6060, 0)]
B $6070,16,4 super_tile $57 #HTML[#CALL:supertile($6070, 0)]
B $6080,16,4 super_tile $58 #HTML[#CALL:supertile($6080, 0)]
B $6090,16,4 super_tile $59 #HTML[#CALL:supertile($6090, 0)]
B $60A0,16,4 super_tile $5A #HTML[#CALL:supertile($60A0, 0)]
B $60B0,16,4 super_tile $5B #HTML[#CALL:supertile($60B0, 0)]
B $60C0,16,4 super_tile $5C #HTML[#CALL:supertile($60C0, 0)]
B $60D0,16,4 super_tile $5D #HTML[#CALL:supertile($60D0, 0)]
B $60E0,16,4 super_tile $5E #HTML[#CALL:supertile($60E0, 0)]
B $60F0,16,4 super_tile $5F #HTML[#CALL:supertile($60F0, 0)]
B $6100,16,4 super_tile $60 #HTML[#CALL:supertile($6100, 0)]
B $6110,16,4 super_tile $61 #HTML[#CALL:supertile($6110, 0)]
B $6120,16,4 super_tile $62 #HTML[#CALL:supertile($6120, 0)]
B $6130,16,4 super_tile $63 #HTML[#CALL:supertile($6130, 0)]
B $6140,16,4 super_tile $64 #HTML[#CALL:supertile($6140, 0)]
B $6150,16,4 super_tile $65 #HTML[#CALL:supertile($6150, 0)]
B $6160,16,4 super_tile $66 #HTML[#CALL:supertile($6160, 0)]
B $6170,16,4 super_tile $67 #HTML[#CALL:supertile($6170, 0)]
B $6180,16,4 super_tile $68 #HTML[#CALL:supertile($6180, 0)]
B $6190,16,4 super_tile $69 #HTML[#CALL:supertile($6190, 0)]
B $61A0,16,4 super_tile $6A #HTML[#CALL:supertile($61A0, 0)]
B $61B0,16,4 super_tile $6B #HTML[#CALL:supertile($61B0, 0)]
B $61C0,16,4 super_tile $6C #HTML[#CALL:supertile($61C0, 0)]
B $61D0,16,4 super_tile $6D #HTML[#CALL:supertile($61D0, 0)]
B $61E0,16,4 super_tile $6E #HTML[#CALL:supertile($61E0, 0)]
B $61F0,16,4 super_tile $6F #HTML[#CALL:supertile($61F0, 0)]
B $6200,16,4 super_tile $70 #HTML[#CALL:supertile($6200, 0)]
B $6210,16,4 super_tile $71 #HTML[#CALL:supertile($6210, 0)]
B $6220,16,4 super_tile $72 #HTML[#CALL:supertile($6220, 0)]
B $6230,16,4 super_tile $73 #HTML[#CALL:supertile($6230, 0)]
B $6240,16,4 super_tile $74 #HTML[#CALL:supertile($6240, 0)]
B $6250,16,4 super_tile $75 #HTML[#CALL:supertile($6250, 0)]
B $6260,16,4 super_tile $76 #HTML[#CALL:supertile($6260, 0)]
B $6270,16,4 super_tile $77 #HTML[#CALL:supertile($6270, 0)]
B $6280,16,4 super_tile $78 #HTML[#CALL:supertile($6280, 0)]
B $6290,16,4 super_tile $79 #HTML[#CALL:supertile($6290, 0)]
B $62A0,16,4 super_tile $7A #HTML[#CALL:supertile($62A0, 0)]
B $62B0,16,4 super_tile $7B #HTML[#CALL:supertile($62B0, 0)]
B $62C0,16,4 super_tile $7C #HTML[#CALL:supertile($62C0, 0)]
B $62D0,16,4 super_tile $7D #HTML[#CALL:supertile($62D0, 0)]
B $62E0,16,4 super_tile $7E #HTML[#CALL:supertile($62E0, 0)]
B $62F0,16,4 super_tile $7F #HTML[#CALL:supertile($62F0, 0)]
B $6300,16,4 super_tile $80 #HTML[#CALL:supertile($6300, 0)]
B $6310,16,4 super_tile $81 #HTML[#CALL:supertile($6310, 0)]
B $6320,16,4 super_tile $82 #HTML[#CALL:supertile($6320, 0)]
B $6330,16,4 super_tile $83 #HTML[#CALL:supertile($6330, 0)]
B $6340,16,4 super_tile $84 #HTML[#CALL:supertile($6340, 0)]
B $6350,16,4 super_tile $85 #HTML[#CALL:supertile($6350, 0)]
B $6360,16,4 super_tile $86 #HTML[#CALL:supertile($6360, 0)]
B $6370,16,4 super_tile $87 #HTML[#CALL:supertile($6370, 0)]
B $6380,16,4 super_tile $88 #HTML[#CALL:supertile($6380, 0)]
B $6390,16,4 super_tile $89 #HTML[#CALL:supertile($6390, 0)]
B $63A0,16,4 super_tile $8A #HTML[#CALL:supertile($63A0, 0)]
B $63B0,16,4 super_tile $8B #HTML[#CALL:supertile($63B0, 0)]
B $63C0,16,4 super_tile $8C #HTML[#CALL:supertile($63C0, 0)]
B $63D0,16,4 super_tile $8D #HTML[#CALL:supertile($63D0, 0)]
B $63E0,16,4 super_tile $8E #HTML[#CALL:supertile($63E0, 0)]
B $63F0,16,4 super_tile $8F #HTML[#CALL:supertile($63F0, 0)]
B $6400,16,4 super_tile $90 #HTML[#CALL:supertile($6400, 0)]
B $6410,16,4 super_tile $91 #HTML[#CALL:supertile($6410, 0)]
B $6420,16,4 super_tile $92 #HTML[#CALL:supertile($6420, 0)]
B $6430,16,4 super_tile $93 #HTML[#CALL:supertile($6430, 0)]
B $6440,16,4 super_tile $94 #HTML[#CALL:supertile($6440, 0)]
B $6450,16,4 super_tile $95 #HTML[#CALL:supertile($6450, 0)]
B $6460,16,4 super_tile $96 #HTML[#CALL:supertile($6460, 0)]
B $6470,16,4 super_tile $97 #HTML[#CALL:supertile($6470, 0)]
B $6480,16,4 super_tile $98 #HTML[#CALL:supertile($6480, 0)]
B $6490,16,4 super_tile $99 #HTML[#CALL:supertile($6490, 0)]
B $64A0,16,4 super_tile $9A #HTML[#CALL:supertile($64A0, 0)] [unused by map]
B $64B0,16,4 super_tile $9B #HTML[#CALL:supertile($64B0, 0)]
B $64C0,16,4 super_tile $9C #HTML[#CALL:supertile($64C0, 0)]
B $64D0,16,4 super_tile $9D #HTML[#CALL:supertile($64D0, 0)]
B $64E0,16,4 super_tile $9E #HTML[#CALL:supertile($64E0, 0)]
B $64F0,16,4 super_tile $9F #HTML[#CALL:supertile($64F0, 0)]
B $6500,16,4 super_tile $A0 #HTML[#CALL:supertile($6500, 0)]
B $6510,16,4 super_tile $A1 #HTML[#CALL:supertile($6510, 0)]
B $6520,16,4 super_tile $A2 #HTML[#CALL:supertile($6520, 0)]
B $6530,16,4 super_tile $A3 #HTML[#CALL:supertile($6530, 0)]
B $6540,16,4 super_tile $A4 #HTML[#CALL:supertile($6540, 0)]
B $6550,16,4 super_tile $A5 #HTML[#CALL:supertile($6550, 0)]
B $6560,16,4 super_tile $A6 #HTML[#CALL:supertile($6560, 0)]
B $6570,16,4 super_tile $A7 #HTML[#CALL:supertile($6570, 0)]
B $6580,16,4 super_tile $A8 #HTML[#CALL:supertile($6580, 0)]
B $6590,16,4 super_tile $A9 #HTML[#CALL:supertile($6590, 0)]
B $65A0,16,4 super_tile $AA #HTML[#CALL:supertile($65A0, 0)]
B $65B0,16,4 super_tile $AB #HTML[#CALL:supertile($65B0, 0)]
B $65C0,16,4 super_tile $AC #HTML[#CALL:supertile($65C0, 0)]
B $65D0,16,4 super_tile $AD #HTML[#CALL:supertile($65D0, 0)]
B $65E0,16,4 super_tile $AE #HTML[#CALL:supertile($65E0, 0)]
B $65F0,16,4 super_tile $AF #HTML[#CALL:supertile($65F0, 0)]
B $6600,16,4 super_tile $B0 #HTML[#CALL:supertile($6600, 0)]
B $6610,16,4 super_tile $B1 #HTML[#CALL:supertile($6610, 0)]
B $6620,16,4 super_tile $B2 #HTML[#CALL:supertile($6620, 0)]
B $6630,16,4 super_tile $B3 #HTML[#CALL:supertile($6630, 0)]
B $6640,16,4 super_tile $B4 #HTML[#CALL:supertile($6640, 0)]
B $6650,16,4 super_tile $B5 #HTML[#CALL:supertile($6650, 0)]
B $6660,16,4 super_tile $B6 #HTML[#CALL:supertile($6660, 0)]
B $6670,16,4 super_tile $B7 #HTML[#CALL:supertile($6670, 0)]
B $6680,16,4 super_tile $B8 #HTML[#CALL:supertile($6680, 0)]
B $6690,16,4 super_tile $B9 #HTML[#CALL:supertile($6690, 0)]
B $66A0,16,4 super_tile $BA #HTML[#CALL:supertile($66A0, 0)]
B $66B0,16,4 super_tile $BB #HTML[#CALL:supertile($66B0, 0)]
B $66C0,16,4 super_tile $BC #HTML[#CALL:supertile($66C0, 0)]
B $66D0,16,4 super_tile $BD #HTML[#CALL:supertile($66D0, 0)]
B $66E0,16,4 super_tile $BE #HTML[#CALL:supertile($66E0, 0)]
B $66F0,16,4 super_tile $BF #HTML[#CALL:supertile($66F0, 0)]
B $6700,16,4 super_tile $C0 #HTML[#CALL:supertile($6700, 0)]
B $6710,16,4 super_tile $C1 #HTML[#CALL:supertile($6710, 0)]
B $6720,16,4 super_tile $C2 #HTML[#CALL:supertile($6720, 0)]
B $6730,16,4 super_tile $C3 #HTML[#CALL:supertile($6730, 0)]
B $6740,16,4 super_tile $C4 #HTML[#CALL:supertile($6740, 0)]
B $6750,16,4 super_tile $C5 #HTML[#CALL:supertile($6750, 0)]
B $6760,16,4 super_tile $C6 #HTML[#CALL:supertile($6760, 0)]
B $6770,16,4 super_tile $C7 #HTML[#CALL:supertile($6770, 0)]
B $6780,16,4 super_tile $C8 #HTML[#CALL:supertile($6780, 0)]
B $6790,16,4 super_tile $C9 #HTML[#CALL:supertile($6790, 0)]
B $67A0,16,4 super_tile $CA #HTML[#CALL:supertile($67A0, 0)]
B $67B0,16,4 super_tile $CB #HTML[#CALL:supertile($67B0, 0)]
B $67C0,16,4 super_tile $CC #HTML[#CALL:supertile($67C0, 0)]
B $67D0,16,4 super_tile $CD #HTML[#CALL:supertile($67D0, 0)]
B $67E0,16,4 super_tile $CE #HTML[#CALL:supertile($67E0, 0)]
B $67F0,16,4 super_tile $CF #HTML[#CALL:supertile($67F0, 0)]
B $6800,16,4 super_tile $D0 #HTML[#CALL:supertile($6800, 0)]
B $6810,16,4 super_tile $D1 #HTML[#CALL:supertile($6810, 0)]
B $6820,16,4 super_tile $D2 #HTML[#CALL:supertile($6820, 0)]
B $6830,16,4 super_tile $D3 #HTML[#CALL:supertile($6830, 0)]
B $6840,16,4 super_tile $D4 #HTML[#CALL:supertile($6840, 0)]
B $6850,16,4 super_tile $D5 #HTML[#CALL:supertile($6850, 0)]
B $6860,16,4 super_tile $D6 #HTML[#CALL:supertile($6860, 0)]
B $6870,16,4 super_tile $D7 #HTML[#CALL:supertile($6870, 0)]
B $6880,16,4 super_tile $D8 #HTML[#CALL:supertile($6880, 0)]
B $6890,16,4 super_tile $D9 #HTML[#CALL:supertile($6890, 0)]
;
g $68A0 Room index
D $68A0 This holds the index of the room that the hero is presently in, or 0 when he's outside.
D $68A0 The possible room numbers are as follows:
D $68A0 #TABLE(default) { =h Room | =h Description | =h Movable Object | =h Items } { 0 | Outdoors / exterior / main map | - | Green key } { 1 | Lowest hut, right hand side | - | Poison } { 2 | Middle hut, left hand side (Hero's start room) | - | Stove } { 3 | Middle hut, right hand side | - | - } { 4 | Highest hut, left hand side | - | - } { 5 | Highest hut, right hand side | - | - } { 6 | (unused index) | - | - } { 7 | Corridor | - | - } { 8 | Corridor | - | - } { 9 | "Crate" | Crate | Shovel } { 10 | "Lockpick" | - | Lockpick } { 11 | Commandant's office | - | Papers } { 12 | Corridor | - | - } { 13 | Corridor | - | - } { 14 | Guard’s quarters 1 | - | Torch } { 15 | Guard’s quarters 2 | - | Uniform, Yellow key } { 16 | Corridor | - | - } { 17 | Corridor | - | - } { 18 | “Radio” | - | Radio } { 19 | “Food” | - | Food } { 20 | "Red Cross parcel" | - | From parcel: Purse, Wire snips, Bribe, Compass } { 21 | Corridor | - | - } { 22 | Corridor to solitary | - | Red key } { 23 | Mess hall, right room | - | - } { 24 | Solitary confinement | - | - } { 25 | Mess hall, left room | - | - } { 26 | (unused index) | - | - } { 27 | (unused index) | - | - } { 28 | Lowest hut, left hand side | Stove | - } { 29 | Tunnel 2, start of | - | - } { 30 | Tunnel 2 | - | - } { 31 | Tunnel 2 | - | - } { 32 | Tunnel 2 | - | - } { 33 | Tunnel 2 | - | - } { 34 | Tunnel 2, end of | - | - } { 35 | Tunnel 2 | - | - } { 36 | Tunnel 2 | - | - } { 37 | Tunnel 1, start of | - | - } { 38 | Tunnel 1 | - | - } { 39 | Tunnel 1 | - | - } { 40 | Tunnel 1 | - | - } { 41 | Tunnel 1 | - | - } { 42 | Tunnel 1 | - | - } { 43 | Tunnel 1 | - | - } { 44 | Tunnel 1 | - | - } { 45 | Tunnel 1 | - | - } { 46 | Tunnel 1 | - | - } { 47 | Tunnel 1 | - | - } { 48 | Tunnel 1, end of | - | - } { 49 | Tunnel 1 | - | - } { 50 | Tunnel 1 (initially blocked) | - | - } { 51 | Tunnel 2 | - | - } { 52 | Tunnel 2 | - | - } TABLE#
@ $68A0 label=room_index
B $68A0,1,1
;
g $68A1 Current door
D $68A1 This is the current door id. Bit 7 is the door_REVERSE flag.
D $68A1 Used by the routines at #R$B1D4, #R$B1F5, #R$B32D and #R$CB98.