aboutsummaryrefslogtreecommitdiff
path: root/examples/pac.s
blob: 7c97869b3d6f6cfc8c5b32751f2e49b554d2e4bb (plain)
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
1001
1002
1003
1004
set pc,Start

:speed dat 500

:ticker dat 0
:randish dat 0

:delay
  set a,0
:delayloop
  ifg a,[speed]
  set pc,pop
  add a,1
  set pc,delayloop

:Start
jsr init
:MainLoop
  add [ticker],1
  jsr updatePlayer
  ife [dead],0
  jsr animate
  ife [dead],0
  jsr moveGhosts

  jsr delay
  jsr probeInput
  
  ife [pillsEaten],[pillsInMap]
  jsr completeLevel
set pc,MainLoop

:completeLevel
  set b,0
:completeLevel_Loop
  jsr delay
  add b,1
  ifn b,10
  set pc,completeLevel_Loop
  jsr wipe
  jsr startNewLevel
  set pc,pop
  
:setDeathFrames
  set a,deathFrames
  set [a],sprites
  set [a+1],death1
  set [a+2],death2
  set [a+3],death3
  set [a+4],death4
  set [a+5],death5
  set [a+6],death6
  set [a+7],death7

  set pc,pop

:deathFrames
  dat 0,1,2,3,4,5,6,7

:dead 
  dat 0
:deathAge
  dat 0

:init
  jsr setDeathFrames

  ; copy sprites to vram
  set a,sprites
  set b,0x8600
  set c,304
  jsr copy

  SET [0x9040],1  ; turn graphics mode on
  jsr startNewLevel
  set pc,pop

:animate
   add [currentFrame],1
   ifg [currentFrame],5
   set [currentFrame],0

   set a,[currentFrame]
   set b,[Direction]
   sub b,1
   mul b,6
   add a,b
   set [0x9051],[munchFrames+a]

   ;ifg [fear],0
   ;set pc,fraidyghosts

   ;set [0x9053],0x0368
   ;set [0x9055],0x0370
   ;set [0x9057],0x0378
   ;set [0x9059],0x0380

   set PC,pop
:fraidyghosts
   sub [fear],1
   set a,[blueghost]
   set b,[fear]
   and b,2
   ifg [fear],14  
   set b,0
   ife b,2
   set a,[whiteghost]
   set [0x9053],a
   set [0x9055],a
   set [0x9057],a
   set [0x9059],a
   set PC,pop


:fraidyghost
   sub [i+6],1
   set a,[blueghost]
   set b,[i+6]
   and b,2
   ifg [i+6],14  
   set b,0
   ife b,2
   set a,[whiteghost]
   set b,[i+4]
   set [b+1],a
   ife [i+6],0
   set [b+1],[i+5]
   set PC,pop

:fear
   dat 0;

:currentFrame
  dat 0
:munchFrames
  dat 0x0300, 0x0320, 0x0328, 0x0330, 0x0328, 0x0320
  dat 0x0300, 0x0308, 0x0310, 0x0318, 0x0310, 0x0308
  dat 0x0300, 0x0338, 0x0340, 0x0348, 0x0340, 0x0338
  dat 0x0300, 0x0350, 0x0358, 0x0360, 0x0358, 0x0350

:updatePlayer
  ife [dead],1
  set pc,deathAction 
  add [playerX],[playerDx]
  add [playerY],[playerDy]
  ifb [playerX],0x8000
  add [playerX],81
  ifg [playerX],81
  sub [playerX],81
  
  set x,[playerX]
  set y,[playerY]
  mod x,3
  mod y,3
  bor x,y
  ife x,0
  jsr cellAlignedCheck
  set a,[playerX]
  add a,62
  set b,[playerY];
  add b,62;
  shl a,8
  bor b,a
  set [0x9050],b
  set pc,pop

:deathAction
  add [deathAge],1
  set a,[deathAge]
  sub a,10
  ifn O,0
  set pc,pop

  ;hide ghosts  
  set [0x9052],0
  set [0x9054],0
  set [0x9056],0
  set [0x9058],0

  shr a,1
  ifg a,7 
  set pc, reallyDead
  set [0x9051],0x0300
  set a,[deathFrames+a]
  set b,0x8600
  set c,16
  jsr copy
  set pc,pop

:reallyDead
  set [0x9050],0x0000
  ifg [deathAge], 40
  jsr resetLevel
  set pc,pop

:startNewLevel
  set [pillsEaten],0
  jsr resetLevel
  
  set a,map
  set b,mapend
  set c,0x8000
  jsr copyimage
  
  
  set pc,pop
  
:resetLevel
  set [playerX],39
  set [playerY],69
  set [playerDx],0xffff
  set [playerDy],0

  set [Direction],1
  set a,ghost1
  set [a],39
  set [a+1],38
  set [a+2],0
  set [a+3],0xffff
  set [a+6],0
  set [a+7],0

  set a,ghost2
  set [a],36
  set [a+1],42
  set [a+2],1
  set [a+3],0
  set [a+6],0
  set [a+7],0

  set a,ghost3
  set [a],45
  set [a+1],42
  set [a+2],0xffff
  set [a+3],0
  set [a+6],0
  set [a+7],0

  set a,ghost4
  set [a],39
  set [a+1],42
  set [a+2],0
  set [a+3],1
  set [a+6],0
  set [a+7],0
  
  set [dead],0
  set [deathAge],0
  set [fear],0
  set a,sprites
  set b,0x8600
  set c,16
  jsr copy
  set pc,pop


:cellAlignedCheck
  set push,x
  set push,y
  set push,z
  set push,i
  set push,j
  set [previousDirection],[Direction]
  ifn [lastDirectionKey],0
  set [Direction],[lastDirectionKey]
:goInDirection  
  set [playerDx],0
  set [playerDy],0

  ife [Direction],1
  set [playerDx],-1;

  ife [Direction],2
  set [playerDx],1;
  
  ife [Direction],3
  set [playerDy],-1;

  ife [Direction],4
  set [playerDy],1;

  set x,[playerX]
  set y,[playerY]
  div x,3
  div y,3  ; X,y is the cell where we are
  set a,y
  mul a,42
  add a,x
  add a,0x8000 ; a pointing to the current cell
  ife [a],0xa25d
  jsr eatPowerPill
  ife [a],0xa008
  add [pillsEaten],1
  set [a],0  ;eat the pill 
  set i,x
  set j,y
  add i,[playerDx]
  add j,[playerDy]  ; i,J is the cell where we are headed.
  set a,j
  mul a,42
  add a,i
  add a,0x8000 ; a pointing to next cell
  ife [a],0xa25d ; is it a powerpill
  set pc,powerpill
  ife [a],0xa008 ; is it a pill
  set pc,pill
  ife [a],0x0000 ; is it space
  set pc,canmove
  ifn  [Direction],[previousDirection]
  set  pc,cantTurn
  set [playerDx],0
  set [playerDy],0
  set pc,cellAlignCheck_exit
:cantTurn
  set [Direction],[previousDirection]
  set pc,goInDirection
:powerpill

:pill        
  
:canmove
  
:cellAlignCheck_exit
   set j,pop
   set i,pop
   set z,pop
   set y,pop
   set x,pop
   set pc,pop

:eatPowerPill
  add [pillsEaten],1
  set push,a
  set push,i

  set i,ghost1
  jsr flipGhost
  set i,ghost2
  jsr flipGhost
  set i,ghost3
  jsr flipGhost
  set i,ghost4
  jsr flipGhost

  set i,pop
  set a,pop
  set pc,pop

:flipGhost
  set [i+6],[powerPillStrength]
  set a,0
  sub a,[i+2]
  set [i+2],a
  set a,0
  sub a,[i+3]
  set [i+3],a   
   set pc,pop

:powerPillStrength
  dat 128
:playerX
  dat 39
:playerY
  dat 69

:playerDx
  dat 0xffff
:playerDy
  dat 0

:moveGhosts
  set a,ghost1
  jsr moveGhost
  set a,ghost2
  jsr moveGhost
  set a,ghost3
  jsr moveGhost
  set a,ghost4
  jsr moveGhost

  set pc,pop

:moveGhost
;a = ghost pointer
  set push,i
  set i,a
  set a,[i+4]
  ife [i+6],0
  set [a+1],[i+5]
  
  ifn [i+6],0
  jsr fraidyghost
  jsr touchCheck
  set a,[i+6]
  ifb a,1
  set pc,moveGhost_exit

  add [i],[i+2]
  add [i+1],[i+3]
 
  ifb [i],0x8000
  add [i],81
  ifg [i],81
  sub [i],81
 
  set x,[i]
  set y,[i+1]
  mod x,3
  mod y,3
  bor x,y
  ife x,0
  jsr cellAlignedGhostCheck

  set a,[i]
  add a,63
  set b,[i+1]
  add b,63
  shl a,8
  bor b,a
  set a,[i+4]
  set [a],b
:moveGhost_exit
  set i,pop
  set pc,pop

:touchCheck
  set a,[i]
  sub a,[playerX]
  ifn o,0
  jsr nega
  set b,a

  set a,[i+1]
  sub a,[playerY]
  ifn o,0
  jsr nega
  
  add a,b
  ifg a,4
  set pc,touchCheck_exit
  ife [i+6],0
  set pc,die ;no fear -> die
  
  set [i+6],0
  set [i],34
  set [i+1],42
  set [i+2],1
  set [i+3],0  
  set [i+7],10
  set pc,touchCheck_exit   
:die
  set [dead],1  

:touchCheck_exit
  set pc,pop

:nega
  xor a,0xffff
  add a,1
  set pc,pop

:cellAlignedGhostCheck
;i=ghost
  set x,[i]
  set y,[i+1]
  div x,3
  div y,3
  set a,y
  mul a,42
  add a,x
  add a,0x8000 ; a pointing to the current cell
  ifb [randish],1
  jsr ghostTryTurning
  set b,[i+3]
  mul b,42
  add b,[i+2]
  add b,a  ;  b pointed to where ghost is heading
  ife [b],0xb01c ; is it the door
  set pc,ghostCanMove
  ife [b],0xa25d ; is is a powerpill
  set pc,ghostCanMove
  ife [b],0xa008 ; is it a pill
  set pc,ghostCanMove
  ife [b],0x0000 ; is it space  
  set pc,ghostCanMove
  ;way blocked, look for another direction
  add [randish],[ticker]
  set b,[i+2]
  set [i+2],[i+3]
  set [i+3],b

  mul b,42
  add b,[i+2]
  add b,a  ;  b pointed to where ghost is heading
  ife [b],0xa25d ; is is a powerpill
  set pc,ghostCanMove
  ife [b],0xa008 ; is it a pill
  set pc,ghostCanMove
  ife [b],0x0000 ; is it space  
  set pc,ghostCanMove
  set a,0
  sub a,[i+2]
  set [i+2],a
  set a,0
  sub a,[i+3]
  set [i+3],a
:ghostCanMove
  set pc,pop

:thisthat dat 0

:ghostTryTurning
;a = current cell
;i = ghost ptr
  set b,push
  set y,push
  set x,push

  xor [thisthat],1
  set y,[i+2]
  set x,[i+3]
  ifb [thisthat],1
  set pc,ghostTryTurning_checkway 
  set b,0
  sub b,x
  set x,b
  set b,0
  sub b,y
  set y,b
:ghostTryTurning_checkway
  set b,y
  mul b,42
  add b,x
  add b,a
  ife [b],0xb01c
  set pc,ghostTryTurning_success 
  ife [b],0xa25d 
  set pc,ghostTryTurning_success 
  ife [b],0xa008 
  set pc,ghostTryTurning_success 
  ife [b],0x0000
  set pc,ghostTryTurning_success 
  set pc,ghostTryTurning_fail

:ghostTryTurning_success
  set [i+2],x
  set [i+3],y
:ghostTryTurning_fail

  set x,pop
  set y,pop
  set b,pop

  set pc,pop

:ghostdata


:ghost1
  dat 39,38,0x0000,0xffff, 0x9052, 0x0368, 0, 0  ;  x,y,dx,dy, sprite address,spritedata,fear,  respawn counter   = need macro asm real soon
:ghost2 
  dat 36,42,0x0001,0x0000, 0x9054, 0x0370, 0, 0  
:ghost3 
  dat 45,42,0xffff,0x0000, 0x9056, 0x0378, 0, 0  
:ghost4 
  dat 39,42,0x0000,0x0001, 0x9058, 0x0380, 0, 0  

:blueghost
 dat 0x0388
:whiteghost
 dat 0x0390

:probeInput
  set a,0
:probeInput_loop;
  set b,[0x9000+a]
  set [0x9000+a],0
  ifn b,0
  add [randish],[ticker]
  ifg b,4
  set b,0  
  ifn b,0 ; note: catches 1,2,3,4 not 0,1,2,3,4  
  set [lastDirectionKey],b
  add a,1
  ifg a,15 
  set pc,pop
  set pc,probeInput_loop

:lastDirectionKey
  dat 0
:previousDirection
  dat 1
:Direction
  dat 1

:EndLoop

:WriteCharAt ; X, Y, Z, C, B
  SET PUSH, A
  SET PUSH, B
  SET PUSH, C
  SET A, Y
  SHL A, 5
  ADD A, X
  SHL C, 4
  BOR B, C
  SHL B, 8
  BOR B, Z
  SET [0x8000+A], B
  SET C, POP
  SET B, POP
  SET A, POP
  SET PC, POP

:scroll
    set b, 0x0
    set a,0x81e0
    :scroll_loop
        set [0x8000+b], [0x8020+b]
        set [0x8001+b], [0x8021+b]
        set [0x8002+b], [0x8022+b]
        set [0x8003+b], [0x8023+b]
        set [0x8003+b], [0x8023+b]
        set [0x8004+b], [0x8024+b]
        set [0x8005+b], [0x8025+b]
        set [0x8006+b], [0x8026+b]
        set [0x8007+b], [0x8027+b]
        add b, 8
        ifg b, 0x01df
            set pc, scroll_clear_ll
        set pc, scroll_loop

        :scroll_clear_ll

        set [a], 0
        add a, 1
        ifg a, 0x81ff
            set pc, scroll_end
        set pc, scroll_clear_ll

    :scroll_end
        set [0x1335], 0x81e0
        set pc, pop   

:fillpattern
       set a,0
       set b,0
:oloop
       set c,0
:lineloop
       set z,a
       shl z,8
       bor z,0x55
       set y,a
       shl y,8
       and y,0x0f00
       bor y,a
       shl y,4
       and y,0xff00
       bor y,0x55
       set [0x8000+b],z
       set [0x802b+b],z
       set [0x8001+b],y
       set [0x802a+b],y
       add a,1
       add b,2
       add c,1
       ifg c,15
       set pc,lineout
       set pc,lineloop
:lineout
       ifg a,255
       set pc,fillout
       add b,52
       set pc,oloop
:fillout
       set pc, pop

:wipe
  set z,0;
:wipeLoop
  jsr scroll_g
  ADD Z, 1
  IFN Z,42
  SET PC, wipeLoop
  SET PC,POP

:scroll_g
    set b, 0x0
    set a,0x8516
    :scroll_g_loop
        set [0x8000+b], [0x802a+b]
        set [0x8001+b], [0x802b+b]
        set [0x8002+b], [0x802c+b]
        set [0x8003+b], [0x802d+b]
        set [0x8004+b], [0x802e+b]
        set [0x8005+b], [0x802f+b]
        set [0x8006+b], [0x8030+b]
        set [0x8007+b], [0x8031+b]
        add b, 8
        ifg b, 0x0515
            set pc, scroll_g_clear_ll
        set pc, scroll_g_loop

        :scroll_g_clear_ll

        set [a], 0
        add a, 1
        ifg a, 0x8540
            set pc, scroll_g_end
        set pc, scroll_g_clear_ll

    :scroll_g_end
        set [0x1335], 0x81e0
        set pc, pop   
  
:copyimage
        set c,0x8000
    :copyimage_loop
        set [c],[a]
        add a,1
        add c,1
        ifg a,b
        set pc, copyimage_end
        set pc, copyimage_loop
    :copyimage_end
        set pc, pop

:copy
     ; a = source
     ; b = dest
     ; c = length
     add c,a
:copy_loop
     set [b],[a]
     add a,1
     add b,1
     ifg c,a
     set pc,copy_loop
     set pc,pop

:pillsEaten
  dat 0
:pillsInMap 
  dat 244
:map
dat 0x08ff, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8002, 0x08ff, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0x8005, 0x801c, 0x801c, 0x8011, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8049, 0x8049, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8005, 0x801c, 0x801c, 0x8011, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa25d, 0x8049, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x8049, 0xa25d, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0x8044, 0x801c, 0x801c, 0x8050, 0xa008, 0x8044, 0x801c, 0x801c, 0x801c, 0x8050, 0xa008, 0x8044, 0x8050, 0xa008, 0x8044, 0x801c, 0x801c, 0x801c, 0x8050, 0xa008, 0x8044, 0x801c, 0x801c, 0x8050, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0x8005, 0x801c, 0x801c, 0x8011, 0xa008, 0x8005, 0x8011, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8005, 0x8011, 0xa008, 0x8005, 0x801c, 0x801c, 0x8011, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0x8044, 0x801c, 0x801c, 0x8050, 0xa008, 0x8049, 0x8049, 0xa008, 0x8044, 0x801c, 0x801c, 0x8002, 0x08ff, 0x801c, 0x801c, 0x8050, 0xa008, 0x8049, 0x8049, 0xa008, 0x8044, 0x801c, 0x801c, 0x8050, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8020, 0x801c, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8049, 0x8020, 0x801c, 0x801c, 0x8011, 0x0000, 0x8049, 0x8049, 0x0000, 0x8005, 0x801c, 0x801c, 0x8080, 0x8049, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x801c, 0x8080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x08ff, 0x801c, 0x801c, 0x8050, 0x0000, 0x8044, 0x8050, 0x0000, 0x8044, 0x801c, 0x801c, 0x8002, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x8049, 0x0000, 0x8005, 0x801c, 0x801c, 0xb01c, 0xb01c, 0x801c, 0x801c, 0x8011, 0x0000, 0x8049, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x800c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8050, 0xa008, 0x8044, 0x8050, 0x0000, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0x0000, 0x8044, 0x8050, 0xa008, 0x8044, 0x801c, 0x801c, 0x801c, 0x801c, 0x8018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa008, 0x0000, 0x0000, 0x0000, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0x0000, 0x0000, 0x0000, 0xa008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x800c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8005, 0x8011, 0x0000, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0x0000, 0x8005, 0x8011, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x801c, 0x8018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x8049, 0x0000, 0x8044, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8050, 0x0000, 0x8049, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8049, 0xa008, 0x8049, 0x8049, 0x0000, 0x8005, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8011, 0x0000, 0x8049, 0x8049, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x08ff, 0x801c, 0x801c, 0x801c, 0x801c, 0x8050, 0xa008, 0x8044, 0x8050, 0x0000, 0x8044, 0x801c, 0x801c, 0x8002, 0x08ff, 0x801c, 0x801c, 0x8050, 0x0000, 0x8044, 0x8050, 0xa008, 0x8044, 0x801c, 0x801c, 0x801c, 0x801c, 0x8003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0x8005, 0x801c, 0x801c, 0x8011, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8049, 0x8049, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8005, 0x801c, 0x801c, 0x8011, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0x8044, 0x801c, 0x8002, 0x8049, 0xa008, 0x8044, 0x801c, 0x801c, 0x801c, 0x8050, 0xa008, 0x8044, 0x8050, 0xa008, 0x8044, 0x801c, 0x801c, 0x801c, 0x8050, 0xa008, 0x8049, 0x08ff, 0x801c, 0x8050, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa25d, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x0000, 0x0000, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa25d, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8020, 0x801c, 0x8011, 0xa008, 0x8049, 0x8049, 0xa008, 0x8005, 0x8011, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8005, 0x8011, 0xa008, 0x8049, 0x8049, 0xa008, 0x8005, 0x801c, 0x8080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x08ff, 0x801c, 0x8050, 0xa008, 0x8044, 0x8050, 0xa008, 0x8049, 0x8049, 0xa008, 0x8044, 0x801c, 0x801c, 0x8002, 0x08ff, 0x801c, 0x801c, 0x8050, 0xa008, 0x8049, 0x8049, 0xa008, 0x8044, 0x8050, 0xa008, 0x8044, 0x801c, 0x8002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0x8005, 0x801c, 0x801c, 0x801c, 0x801c, 0x8080, 0x8020, 0x801c, 0x801c, 0x8011, 0xa008, 0x8049, 0x8049, 0xa008, 0x8005, 0x801c, 0x801c, 0x8080, 0x8020, 0x801c, 0x801c, 0x801c, 0x801c, 0x8011, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0x8044, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8050, 0xa008, 0x8044, 0x8050, 0xa008, 0x8044, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8050, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8049, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0xa008, 0x8049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x8020, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x801c, 0x8080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
dat 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
:mapend


:death0
:sprites
dat 0x0000, 0x0000
dat 0x00ee, 0xe000
dat 0x0eee, 0xee00
dat 0x0eee, 0xee00
dat 0x0eee, 0xee00
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0000, 0x0000
dat 0x00ee, 0xe000
dat 0x0eee, 0xee00
dat 0x0ee7, 0x0000
dat 0x0eee, 0xee00
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0000, 0x0000
dat 0x00ee, 0xe000
dat 0x0eee, 0x7200
dat 0x0ee0, 0x0000
dat 0x0eee, 0x7200
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0000, 0x0000
dat 0x00ee, 0x7000
dat 0x0eee, 0x0000
dat 0x0ee0, 0x0000
dat 0x0eee, 0x0000
dat 0x00ee, 0x7000
dat 0x0000, 0x0000
dat 0x0000, 0x0000


;left 1-3
dat 0x0000, 0x0000
dat 0x00ee, 0xe000
dat 0x0eee, 0xee00
dat 0x0007, 0xee00
dat 0x0eee, 0xee00
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0000, 0x0000
dat 0x00ee, 0xe000
dat 0x027e, 0xee00
dat 0x0000, 0xee00
dat 0x027e, 0xee00
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0000, 0x0000
dat 0x007e, 0xe000
dat 0x000e, 0xee00
dat 0x0000, 0xee00
dat 0x000e, 0xee00
dat 0x007e, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

;up 1-3
:death1
dat 0x0000, 0x0000
dat 0x00e0, 0xe000
dat 0x0ee0, 0xee00
dat 0x0ee7, 0xee00
dat 0x0eee, 0xee00
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

:death2
dat 0x0000, 0x0000
dat 0x0020, 0x2000
dat 0x0e70, 0x7e00
dat 0x0ee0, 0xee00
dat 0x0eee, 0xee00
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

:death3
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0700, 0x0700
dat 0x0ee0, 0xee00
dat 0x0eee, 0xee00
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

;down 1-3
dat 0x0000, 0x0000
dat 0x00ee, 0xe000
dat 0x0eee, 0xee00
dat 0x0ee7, 0xee00
dat 0x0ee0, 0xee00
dat 0x00e0, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0000, 0x0000
dat 0x00ee, 0xe000
dat 0x0eee, 0xee00
dat 0x0ee0, 0xee00
dat 0x0e70, 0x7e00
dat 0x0020, 0x2000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0000, 0x0000
dat 0x00ee, 0xe000
dat 0x0eee, 0xee00
dat 0x0ee0, 0xee00
dat 0x0700, 0x0700
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0555, 0x5000
dat 0x5f5f, 0x5500
dat 0x5f5f, 0x5500
dat 0x5555, 0x5500
dat 0x5050, 0x5000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0ddd, 0xd000
dat 0xdfdf, 0xdd00
dat 0xdfdf, 0xdd00
dat 0xdddd, 0xdd00
dat 0xd0d0, 0xd000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0aaa, 0xa000
dat 0xafaf, 0xaa00
dat 0xafaf, 0xaa00
dat 0xaaaa, 0xaa00
dat 0xa0a0, 0xa000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0bbb, 0xb000
dat 0xbfbf, 0xbb00
dat 0xbfbf, 0xbb00
dat 0xbbbb, 0xbb00
dat 0xb0b0, 0xb000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0444, 0x4000
dat 0x4f4f, 0x4400
dat 0x4f4f, 0x4400
dat 0x4444, 0x4400
dat 0x4040, 0x4000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

dat 0x0fff, 0xf000
dat 0xf4f4, 0xff00
dat 0xf4f4, 0xff00
dat 0xffff, 0xff00
dat 0xf0f0, 0xf000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000


:death4
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0707, 0x7700
dat 0x0eee, 0xee00
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

:death5
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x0000, 0x0000
dat 0x027e, 0x7200
dat 0x00ee, 0xe000
dat 0x0000, 0x0000
dat 0x0000, 0x0000

:death6
dat 0x000E, 0x0000
dat 0x0E0E, 0x0E00
dat 0x00E0, 0xE000
dat 0xEE00, 0x0EE0
dat 0x00E0, 0xE000
dat 0x0E0E, 0x0E00
dat 0x000E, 0x0000
dat 0x0000, 0x0000

:death7
dat 0xE00E, 0x00E0
dat 0x0E00, 0x0E00
dat 0x0000, 0x0000
dat 0xE000, 0x00E0
dat 0x0000, 0x0000
dat 0x0E00, 0x0E00
dat 0xE00E, 0x00E0
dat 0x0000, 0x0000

:spritesend