-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMISC.SRC
1475 lines (1343 loc) · 30.1 KB
/
MISC.SRC
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
;
;Affect object health
;IN:A=signed amount to affect by, X=ob index
;
harmp ldx #pi ;enter here to harm plr
harm tay
beq !c ;exit if nothing to do
cpx #pi ;harming plr?
clc
bne !d
adc obhel+pi ;yes
bcs !a
lda #$00 ;dead
!a sta obhel+pi
ldx #$07 ;figure out msg
cmp #$ac ;172..255
bcs !b
inx
cmp #$57 ;87..171
bcs !b
inx
cmp #$01 ;1..85
bcs !b
lda deathseq ;dead, specific death seq?
bpl !a0
lda rn ;no, pick one randomly
and #$03
adc #d_twinkle
!a0 jsr killplr
lda #%01100000 ;set plr to no explode,no damage
sta obchr+pi ;in case any storms continuing
ldx #$0a
!b cpx helmsg ;only send it once
beq !c
stx helmsg
jmp miscmsg
!c rts
!d adc obhel,x ;handle other obs
bcc killob ;not dead
sta obhel,x
lda obchr,x ;ob attacking plr?
and #%00001100
cmp #%00001100
beq !e
lda obchr,x ;no, set to permanent attack
ora #%00001100
sta obchr,x
lda #$02
jmp set4oi
!e rts
;
;Call to kill object (NOT plr)
;IN :X=ob ind
;
killob txa ;set ob event flag to dead,not searched
pha
jsr get4oi
and #$03
ora #$04
jsr set4
pla
tax
lda obchr,x ;set interaction ctrl to always 'no one there'
and #%01000011 ;set bullet control to physical
ora #%00100000 ;no explode, no damage
sta obchr,x
lda #$02 ;set obmod to 'just been killed'
sta obmod,x
lda obafr1,x ;set alt blank frm for 'flashing'
eor #$ff
sta obven,x
lda #$3c ;set 'flash' timer
sta obadel,x
lda #$00
koa sta obhel,x ;set health=0
rts
;
;Check if need to convert ob to chest after death
;OUT:N=0=convert, chest no. in OBCHEST
;
chkchest ldy #numch ;chk if ob must convert to a chest
!a lda curlev
cmp chlev,y
bne !b
lda obeno,x
cmp chevn,y
beq !c
!b dey
bpl !a
!c tya ;if chest found
bmi !d
adc #choff1-1 ;convert to dead ob triggered chest
!d sta obchest,x
rts
chlev hex 20 ;ob>chest level
chevn hex 15 ;ob>chest event no.
numch equ *-chevn-1
;
;Kill player
;IN :A=death type
;USES:A,X
;
killplr bit deathtyp ;already dying?
bpl !a
sta deathtyp ;no, set death type
ldx #%00111000 ;disable joypad buttons but allow movement
stx ctrl
ldx #$00
stx obhel+pi ;zero health
stx obmaflg+pi ;normal speed+weight
ldx plrflg ;was plr in air?
beq !b
jmp setfall ;yes, make him fall
!a rts
!b
;
;Change plr from normal mode to dying mode
;
setdeath lda #%11111000 ;stop all movement
sta ctrl
ldx deathtyp ;get death type as index
lda dfrs,x ;set anim index
sta obaind+pi
lda #$00 ;init anim timing
sta obadel+pi
txa ;set death mode
clc
adc #m_drown
sta obmod+pi
lda #$1a ;set death tune len
sta deathtime
mus 4 ;set death tune
ret02 rts
dfrs db pstand+4-fb00,pstand+4-fb00
db pde0-fb00,pde1-fb00,pde2-fb00,pde3-fb00,pde4-fb00
db pde0-fb00,pde0-fb00
;
;Add health points to plr health
;IN:A=amount of extra health
;
heal clc
adc obhel+pi
bcc !a ;limit to 255
lda #$ff
!a sta obhel+pi
rts
;
;Set plr standing mode
;OUT:A=00,C=1,Z=1
;USES:A, T0
;
setstnd lda obstat+pi
setstnda and #$03 ;enter here to set facing in A
sta t0
cmp #$01
bne !a
ora #$10 ;x-flip if facing right
!a sta obstat+pi
lda t0
asl a
beq !b ;handle l/r
sbc #$02-1 ;C=0
clc
!b adc #pstand-fb00
sta obaind+pi
lda #m_stand ;** A=$01 - set standing mode
sta obmod+pi
lsr a
sta obadel+pi
sta plrxvel
rts ;& exit
;
;Set plr back on ground after fly/fall/jump
;
unfly sfx 22
lda deathtyp
bmi !a
ora #$c0
sta deathtyp
!a lda forfloor ;force plr onto floor
ldx curlev ;handle forest
cpx #$40
beq !b
lda obyl+pi
clc
adc plryvel
sec
sbc #$04
and #$f8
clc
adc #$04
!b sta obyl+pi
ldx #$01
stx serflg ;stop instant search
stx yvel0 ;normal speed y scrolling
dex
stx plrflg ;flag no flying/jumping/falling
stx plrxvel ;no x/y-movement
stx plryvel
lda obstat+pi ;facing l/r?
and #$13
bit msk0+1
bne setstnd
sta obstat+pi
lda lr ;yes, going straight into walking mode?
beq setstnd
lda #m_walk ;yes, set walking mode
sta obmod+pi
lda #pwalk-fb00 ;set frame to start at
sta obaind+pi
stx obafr1+pi ;set frm
stx obadel+pi ;no delay
rts
;
;Set falling mode
;
setfall lda #m_fall ;already falling?
cmp obmod+pi
beq !a
sta obmod+pi ;no, set it
lda #$01
sta cnt ;init fall table del
sta ind ;init fall table index
bit plrflg
sta plrflg ;1=falling
bvs !a ;no sfx if fall after jump
sfx 05,jmp
!a rts
;
;Set turning mode
;IN :A=new dir
;USES:A, Y, T0
;
setturn and #$03 ;set anim index for ob turning seq
asl a
asl a
sta t0
lda obstat+pi
and #$03
ora t0
tay
lda turnind,y
sta obaind+pi
lda #$05 ;set anim speed
sta obaorg+pi
lda #m_turn ;** A=$02 - set turning mode
sta obmod+pi
lda #$00 ;set no anim del so frame will change instantly
sta obadel+pi
sta plrxvel
rts
;Indexes to turning seqs
turnind db 0,ptrl-fb00,ptul-fb00,ptdl-fb00
db ptlr-fb00,0,ptur-fb00,ptdr-fb00
db ptlu-fb00,ptru-fb00,0,ptdu-fb00
db ptld-fb00,ptrd-fb00,ptud-fb00,0
;
;Set new ob mode / anim index
;IN:A=anim index, X=ob index, Y=mode
;
modenexts lda obaind,x ;enter here to use same anim index
modenext ldy obmod,x ;set ob mode + 1
iny
modey sta obaind,x ;set anim index
modeyy tya ;set ob mode
sta obmod,x
lda #$00 ;set no anim del so frame will change instantly
sta obadel,x
rts
;
;Forest height handling
;IN :PLXVEL=amount to move plr by
;OUT:A=new forest floor y-pos, X=new plrxchr (both non-updated)
; :C=1=no floor-y change, C=0=floor-y changed
;
forlr ldx #$00 ;move plr left/right
lda plrxvel
clc
adc #$08
bpl !a
dex
!a clc
adc obxl+pi
tay
txa
adc obxh+pi
sta t1
tya ;get new x-chr pos
lsr t1
ror a
lsr t1
ror a
lsr t1
ror a
cmp plrxchr ;changed?
bne !b
tax ;no, exit with same values
lda forfloor
rts
!b sta t0 ;yes, get bit index
and #$03
tay
lda t0 ;get byte index
lsr t1
ror a
lsr t1
ror a
tax
bit plrxvel
bpl !c
iny ;forward a vector if moving left
cpy #$04
bne !c
ldy #$00
inx
!c lda forground,x ;extract bits
dey
bmi !1
!0 lsr a
lsr a
dey
bpl !0
!1 and #$03
tax
lda plrxvel
asl a
lda hdtab,x ;get height diff : 0=flat, 1=up, 2=down
bcc !d
eor #$ff ;negate offset if needed
!d adc forfloor ;updated floor y-pos
ldx t0 ;updated plr x-chr pos
clc
rts
FORGROUND HEX 008004804A0180AA5405000050555555 ;packed 2-bit HDTAB indexes
HEX 85040686090680AA0AA8AA0200000000
HEX 00000000000000000000000000000000
HEX 00005555555548000080AAAAAAAA8104
HEX 80840000000010800480044800555555
HEX 554880A9AAAAAA820100000000000000
HEX 06484880040048004800800480545555
HEX 5585048084198084AA2AA85400000000
HEX 80AA2A48000648000080010018505505
HEX 00800100000000000000000000000000
hdtab db 0,-2,2 ;height difference table
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;Perform plr character detection to l/r or u/d of plr
;IN :A=L/R/U/D signed pixel offset
;OUT :T0..T5=translated chrs
;USES :A, X, Y, T0..TD
;
chrdetlr ldx #$01
stx td ;move r
dex ;set x+offset,y
tay
bpl !a
dex ;set x-offset,y
!a clc
adc obxl+pi
sta t6
txa
adc obxh+pi
sta t7
lda obyl+pi ;adjust y
sec
sbc #$0c
sta t8
lda obyh+pi
sbc #$00
sta t9
ldx #$06
bcs cuda
chrdetud sty tc ;set no. of chrs to chk
ldx #$00 ;set x,y+offset
stx td ;move d
tay
bpl !a
dex ;set x,y-offset
!a clc
adc obyl+pi
sta t8
txa
adc obyh+pi
sta t9
lda obxl+pi ;adjust x
sec
sbc #$04
sta t6
lda obxh+pi
sbc #$00
sta t7
ldx #$02
cuda stx tc ;set no. of chrs to check
;
;Get row/column of chr types from map
;IN :T6/T7=x-pos, T8/T9=y-pos, TC=no. of chrs, TD=right/down flag
;OUT :T0..T0+(TC)-1=chr types, A=last chr checked
;USES:A, X, Y, T0..T0+(TC)-1,T6..TD
;
chkchr lda #$07 ;bank in map & blocks
sta bnksel
sta $8000
lda mapbnk70
sta $8001
lda t6 ;calc landx & blokx
lsr t7
ror a
lsr t7
ror a
lsr t7
ror a
lsr t7
ror a
sta t6
lda #$00
rol a
sta ta
lda t8 ;calc landy & bloky
lsr t9
ror a
lsr t9
ror a
lsr t9
ror a
lsr t9
ror a
sta t8
lda #$00
rol a
asl a
sta tb
ldy t8 ;calc landy * xsize + landx + bmbase
lda xsize
jsr mul8
clc
adc bmbase
tax
tya
ldy xsize+1
beq !a
adc t8
!a adc bmbase+1
tay
txa
adc xorg
tax
tya
adc xorg+1
tay
txa
adc t6
sta t6
tya
adc t7
sta t7
ldx #$00
!b ldy #$00 ;set blok adr
lda (t6),y
tay
and #%11111100
adc blbase ;C=0
sta t8
tya
and #%00000011
adc blbase+1
sta t9
!c lda ta ;get chr
ora tb
tay
lda (t8),y
lsr a ;unpack chr type from table nybbles
tay
lda (cdtab),y
bcs !d
lsr a
lsr a
lsr a
lsr a
!d and #$0f
cmp #c_cwall ;special castle chr?
bne !e
lda #c_air ;yes, convert it to air/land
bit cdflag ;depending on level
bpl !e
rol a ;land
!e sta t0,x
inx
dec tc
beq !g
ldy td
bne !f
lda ta
eor #$01
sta ta
bne !c
clc
inc t6
bne !b
inc t7
bcc !b
!f lda tb
eor #$02
sta tb
bne !c
clc
lda t6
adc xsize
sta t6
lda t7
adc xsize+1
sta t7
bcc !b
!g ldy #$07 ;restore bank & exit
sty bnksel
sty $8000
ldy r7
sty $8001
rts
;
;Return chr type of 1 character FAST
;IN :T0/T1=x-pos, T2/T3=y-pos
;OUT :A=type (if A=00, Z=1)
;USES:A, X, Y, T4..T7
;
chkonechr clc ;set y-pos
lda t2
adc #$08
sta t6
lda t3
adc #$00
lsr a ;calc landy & bloky
ror t6
lsr a
ror t6
lsr a
ror t6
lsr a
ror t6
rol a ;A=00
sta t7
lda t0 ;set x-pos
sta t4
lda t1
lsr a ;calc landx & blokx
ror t4
lsr a
ror t4
lsr a
ror t4
lsr a
ror t4
sta t5
rol t7
ldy t6 ;calc landy * xsize + landx + bmbase
lda xsize
jsr mul8
clc
adc bmbase
tax
tya
ldy xsize+1
beq !a
adc t6
!a adc bmbase+1
tay
txa
adc xorg
tax
tya
adc xorg+1
tay
txa
adc t4
sta t4
tya
adc t5
sta t5
ldx #$07 ;bank in map & blocks
stx bnksel
stx $8000
lda mapbnk70
sta $8001
ldy #$00 ;set blok adr
lda (t4),y
tay
and #%11111100
adc blbase ;C=0
sta t4
tya
and #%00000011
adc blbase+1
sta t5
ldy t7
lda (t4),y
lsr a
tay
lda (cdtab),y
stx bnksel ;restore bank
stx $8000
ldx r7
stx $8001
bcs !c ;unpack chr type from table nybbles
lsr a
lsr a
lsr a
lsr a
cmp #c_cwall ;special castle chr?
bne !b
lda #c_air ;yes, convert it to air/land
bit cdflag ;depending on level
bpl !b
rol a ;land
!b tax
rts
!c and #$0f
cmp #c_cwall ;special castle chr?
bne !d
lda #c_air ;yes, convert it to air/land
bit cdflag ;depending on level
bpl !d
rol a ;land
!d tax
rts
;
;Health text
;
hetxt dc "DIRE" ;0-31
dc "BAD" ;32-63
dc "POOR" ;64-95
dc "AVERAGE" ;96-127
dc "FAIR" ;128-159
dc "GOOD" ;160-191
dc "VERY GOOD" ;192-223
dc "EXCELLENT" ;224-255
;
;Rating text
;
ratxt dc "NOVICE" ;0-99
dc "APPRENTICE" ;100-299
dc "TALENTED" ;300-599
dc "ADEPT" ;600-999
dc "DEXTROUS" ;1000-1499
dc "COMPETENT" ;1500-2099
dc "PROFICIENT" ;2100-2799
dc "SKILLED" ;2800-3599
dc "EXPERT" ;3600-4499
dc "MASTER" ;4500-5499
dc "LEGEND" ;5500-65535
;
;Level text
;
letxt dc "TOWN" ;1.?
dc "WILDERNESS" ;2.?
dc "LAKE" ;3.?
dc "FOREST" ;4.?
dc "CAVERNS" ;5.?
dc "DUNGEON" ;6.?
dc "CASTLE" ;7.?
dc "TOWER" ;8.?
dc "TOWER TOP" ;9.?
db "COMPLETED",ex+$80 ;---
;
;Inventory object descriptions
;39=ptr,3a=tankard,3b=hands,3c=lips,3d=ear,3e=exit,3f=blank
;
obtxt dc "WATER FLASK" ;00
dc "CRUST OF BREAD"
dc "CHICKEN"
dc "HAM"
dc "VEGETABLES"
dc "POUCH OF COINS"
dc "FIRE BRAND"
dc "STAFF OF MALICE"
dc "STAFF OF KNELL" ;08
dc "STAFF OF MAYHEM"
dc "STAFF OF BLAYZE"
dc "STAFF OF POWER"
dc "RING OF HALE"
dc "RING OF ANA"
dc "RING OF VEN"
dc "AMULET OF SHEELD"
dc "AMULET OF MOR" ;10
dc "ULTIMATE POTION"
dc "KEY"
dc "HOLY WATER"
dc "MAGIC CHARM"
dc "VIAL OF EARTH"
dc "VIAL OF AIR"
dc "VIAL OF FIRE"
dc "VIAL OF WATER" ;18
dc "DRAGON EGG"
db "SUN",hyp,"GLASSE","S"+$80
db "WALKING",hyp,"STIC","K"+$80
dc "LETTER"
dc "RUNE STONE"
db hyp,hyp," QUIT GAME ",hyp,hyp+$80
db "SCROLL ",col+$80
db "POTION ",col+$80 ;20
dc " " ;21 blank
;
;Spell descriptions
;
sptxt dc "RAZOR" ;00 destructive physical
dc "AXOR"
dc "BOULDER"
dc "SCARY"
dc "VEN"
dc "FIREBALL"
dc "LIGHTNING"
dc "RAZORSTORM"
dc "KISS MY AXE" ;08
dc "FIRESTORM"
dc "FIRE FOUNTAIN"
dc "DEATH RING"
dc "DISPELL" ;destructive etherial
dc "EXORCISE"
dc "REPELLENT"
dc "PSYCHIC"
dc "HELP" ;10 constructive
dc "PHYS SHIELD"
dc "VEN SHIELD"
dc "FIRE SHIELD"
dc "POWER SHIELD"
dc "HEAL"
dc "ANTI VEN"
dc "FLY"
dc "JUMP" ;18
dc "FLEET FOOT"
dc "SLOWMO"
dc " UNUSED"
dc "FEATHERLITE"
dc "IRON BOOTS"
dc "REVEAL"
dc " UNUSED"
dc "WAKEY WAKEY" ;20
dc "TRANSLATE"
dc "LIGHT"
dc "TWIN"
dc " UNUSED"
dc "MUZAK" ;special
db "WHO",app,"S WHO",qu+$80
dc "NINTENDO"
dc " "
db "UNKNOWN",fs,fs,fs+$80
;
;Potion descriptions
;
potxt dc "MANA" ;00
dc "HEAL"
dc "ANTI VEN"
dc "RESURRECT"
;
;Packed spell rune nybbles
;
spells hex 06efb0 ;00
hex 068db0
hex 0689a0
hex 06cdf0
hex 06af00
hex 06d8e0
hex 06d9e0
hex 06efbc
hex 068c00 ;08
hex 06ef8c
hex 06ef98
hex 06bde0
hex 05fc80
hex 05ec00
hex 05caf0
hex 058db0
hex 07bd00 ;10
hex 07afe0
hex 04bfe0
hex 048fe0
hex 079fe0
hex 079000
hex 04afc0
hex 07aced
hex 04bf00 ;18
hex 048dfc
hex 078dec
hex 04cea0
hex 04d9b0
hex 04d9a0
hex 07c000
hex 07abed
hex 04eda0 ;20
hex 07eba0
hex 07f000
hex 048eb0
hex 07c800
hex 04dca8
hex 05a9bc
hex 04b89d
hex 100000 ;28 empty (tiles = 10,10,10,10,10,10)
hex 110000 ;29 unknown... (tiles = 11,11,11,11,11,11)
;
;Object/potion/scroll costs
;
obcostl dl 5,0,0,0,0,20,25,30
dl 35,0,0,40,45,50,55,60
dl 65,70,75,80,85,90,95,99
dl 100,105,110,115,120,125,130,135
dl 140,150,155,160,165,170,175,180
dl 180,185,190,195,200,205,210,215
dl 220,225,230,235,240,245,250,255
dl 260,265,270,275,280,285,290,295
dl 300,305,310,315,320,325,330,335
dl 340,345,350,355
obcosth dh 5,0,0,0,0,20,25,30
dh 35,0,0,40,45,50,55,60
dh 65,70,75,80,85,90,95,99
dh 100,105,110,115,120,125,130,135
dh 140,150,155,160,165,170,175,180
dh 180,185,190,195,200,205,210,215
dh 220,225,230,235,240,245,250,255
dh 260,265,270,275,280,285,290,295
dh 300,305,310,315,320,325,330,335
dh 340,345,350,355
;
;Main game phase jump vectors
;
gvl dl g00,g01,g02,g03,g04,g05,g06 ;main
dl g07 ;shops etc.
dl g08 ;inv
dl g09 ;spell
dl g0a ;map
gvh dh g00,g01,g02,g03,g04,g05,g06
dh g07
dh g08
dh g09
dh g0a
;
;Bin>dec conversion table
;
dlo dl 1,10,100,1000,10000
dhi dh 1,10,100,1000,10000
;
;Spr index table : TAB[I]=I*4
;
mul4
hex 0004080C1014181C2024282C3034383C4044484C5054585C6064686C7074787C
hex 8084888C9094989CA0A4A8ACB0B4B8BCC0C4C8CCD0D4D8DCE0E4E8ECF0F4F8FC
;
;2's complement addition table
;
tab0 db -1,0,0
;
;Scn row addresses
;
scnl HEX 0020406080A0C0E00020406080A0C0E00020406080A0C0E00020406080A0
scnh HEX 000000000000000001010101010101010202020202020202030303030303
;
;Atr row addresses
;
atrl hex c0 c8 d0 d8 e0 e8 f0 f8
;
;Base of plr-position triggered event flags for each level
;
ptbas
db pi10
db pi20,pi21
db pi30
db pi40,pi41,pi42,pi43
db pi50,pi51,pi52,pi53,pi54,pi55,pi56
db pi60,pi61,pi62,pi63,pi64,pi65,pi66,pi67,pi68,pi69
db pi70,pi71,pi72,pi73,pi74,pi75,pi76
db pi80,pi81,pi82,pi83,pi84,pi85,pi86
db pi90
db pia0,pia1,pia2,pia3,pia4,pia5,pia6,pia7,pia8,pia9,piaa,piab,piac,piad,piae
gameind equ *-ptbas ;indexes >= are non main-game
;
;Base of scn-position triggered event flags for each level
;
stbas
db si10
db si20,si21
db si30
db si40,si41,si42,si43
db si50,si51,si52,si53,si54,si55,si56
db si60,si61,si62,si63,si64,si65,si66,si67,si68,si69
db si70,si71,si72,si73,si74,si75,si76
db si80,si81,si82,si83,si84,si85,si86
db si90
db sia0,sia1,sia2,sia3,sia4,sia5,sia6,sia7,sia8,sia9,siaa,siab,siac,siad,siae
db sib0
;
;Tune no. for each level (bit-7=1=no tune)
;
tune
hex 0b
hex 03 ff
hex 00
hex 09 0e 0d 05
hex 01 01 01 0d 0d 05 0e
hex 0a 0d 05 0d 05 0d 0d 05 05 0e
hex 01 01 01 0e 01 01 01
hex 01 05 05 0e 05 05 10
hex 07
hex 0c 0c 0c 0c 0c 0c 0c 0c 0c 0c 0c 0c 0c 0c 0c
;
;X/Y object trigger coords
;Entry #0 is always the 8-bit plr Y/X start coord for H/V levels
;
obxyst
hex a0 a0 a0 a0 ;1.0
hex a0 a0 a0 a0 ;2.0
hex 80 80 80 80 ;2.1 ;V
hex 90 50 64 84 ;3.0
hex 98 64 54 9a ;4.0
hex a0 a0 a0 a0 ;4.1
hex a0 a0 a0 a0 ;4.2
hex 90 90 90 90 ;4.3
hex 70 70 70 70 ;5.0
hex 40 da 80 68 ;5.1 ;V
hex 90 48 58 70 ;5.2
hex a0 a0 a0 a0 ;5.3
hex a0 a0 a0 a0 ;5.4