-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrkfnl.asm
2333 lines (2074 loc) · 64.9 KB
/
brkfnl.asm
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
IDEAL
MODEL small
STACK 100h
DATASEG
;---the arenas--->
arena db 25*20 dup(?) ;the arena itself
arena1_origin db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,46,13,32,40,42,11,44,44,11,42,40,32,13,46,0,0,0
db 0,0,34,46,13,32,40,42,11,44,44,11,42,40,32,13,46,34,0,0
db 0,44,34,46,13,32,40,42,11,44,44,11,42,40,32,13,46,34,44,0
db 0,0,34,46,13,32,40,42,11,44,44,11,42,40,32,13,46,34,0,0
db 0,0,0,46,13,32,40,42,11,44,44,11,42,40,32,13,46,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena2_origin db 44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44
db 44,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,44
db 44,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,44
db 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44
db 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44
db 44,0,42,42,42,42,0,40,40,40,40,40,40,0,42,42,42,42,0,44
db 44,0,42,42,42,42,0,40,32,32,32,32,40,0,42,42,42,42,0,44
db 44,0,42,42,42,42,0,40,32,13,13,32,40,0,42,42,42,42,0,44
db 44,0,42,42,42,42,0,40,32,46,46,32,40,0,42,42,42,42,0,44
db 44,0,42,42,42,42,0,40,32,46,46,32,40,0,42,42,42,42,0,44
db 44,0,42,42,42,42,0,40,32,13,13,32,40,0,42,42,42,42,0,44
db 44,0,0,0,0,0,0,40,32,32,32,32,40,0,0,0,0,0,0,44
db 44,0,0,0,0,0,0,40,40,40,40,40,40,0,0,0,0,0,0,44
db 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44
db 34,34,34,34,0,0,0,0,0,0,0,0,0,0,0,0,34,34,34,34
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena3_origin db 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40
db 40,11,11,11,11,11,11,13,13,13,13,13,13,11,11,11,11,11,11,40
db 40,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,40
db 40,11,0,0,44,44,0,0,0,0,0,0,0,0,44,44,0,0,11,40
db 40,11,0,0,44,44,0,0,0,0,0,0,0,0,44,44,0,0,11,40
db 40,11,0,0,44,44,0,0,0,0,0,0,0,0,44,44,0,0,11,40
db 40,11,0,0,44,44,0,0,0,0,0,0,0,0,44,44,0,0,11,40
db 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40
db 40,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,40
db 40,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,44,0,0,40
db 40,0,0,0,44,0,0,0,0,0,0,0,0,0,0,44,0,0,0,40
db 40,0,0,0,0,44,44,44,44,44,44,44,44,44,44,0,0,0,0,40
db 40,0,0,0,0,0,0,0,0,13,13,0,0,0,0,0,0,0,0,40
db 40,40,40,40,40,40,40,40,40,13,13,40,40,40,40,40,40,40,40,40
db 0,0,0,0,0,0,0,0,0,13,13,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,13,13,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena4_origin db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,0,0
db 0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,40,40,40,40,11,40,40,40,40,0,0,0,0,0,0
db 0,0,0,0,32,32,32,32,32,11,32,32,32,32,32,0,0,0,0,0
db 42,42,42,42,42,42,42,42,42,11,42,42,42,42,42,42,42,42,42,42
db 0,0,0,0,32,32,32,32,32,11,32,32,32,32,32,0,0,0,0,0
db 0,0,0,0,0,40,40,40,40,11,40,40,40,40,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0
db 0,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,0
db 0,0,0,0,0,0,13,13,13,13,13,13,13,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena5_origin db 0,0,0,0,0,0,44,0,0,0,0,44,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,44,0,0,0,0,44,0,0,0,0,0,0,0,0
db 0,0,0,44,44,44,44,44,44,44,44,44,44,44,44,0,0,0,0,0
db 0,0,0,0,0,0,44,42,42,42,42,44,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,44,42,40,40,42,44,0,0,0,0,0,0,0,0
db 0,0,0,44,44,44,44,42,40,40,42,44,44,44,44,0,0,0,0,0
db 0,0,0,0,0,0,44,42,40,40,42,44,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,44,42,40,40,42,44,0,0,0,0,0,0,0,0
db 0,0,0,44,44,44,44,42,42,42,42,44,44,44,44,0,0,0,0,0
db 0,0,0,0,0,0,0,44,44,44,44,44,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,44,0,0,0,44,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,44,0,0,0,44,0,0,0,0,0,0,0,0
db 32,11,32,11,32,11,0,44,0,0,0,44,0,32,11,32,11,32,11,32
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena6_origin db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 46,34,46,34,46,34,46,34,46,34,46,34,46,34,46,34,46,34,46,34
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 11,0,0,0,0,0,0,0,32,32,32,32,0,0,0,0,0,0,0,11
db 11,0,0,0,0,0,0,32,32,11,11,32,32,0,0,0,0,0,0,11
db 11,0,0,0,0,0,32,32,32,11,11,32,32,32,0,0,0,0,0,11
db 11,0,0,0,0,0,32,32,32,11,11,32,32,32,0,0,0,0,0,11
db 11,0,0,0,0,0,0,32,32,11,11,32,32,0,0,0,0,0,0,11
db 11,0,0,0,0,0,0,0,32,32,32,32,0,0,0,0,0,0,0,11
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 46,34,46,34,46,34,46,34,46,34,46,34,46,34,46,34,46,34,46,34
db 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena7_origin db 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 42,42,42,42,40,42,42,42,40,42,42,42,40,42,42,42,40,42,42,42
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 42,42,42,42,40,42,42,42,40,42,42,42,40,42,42,42,40,42,42,42
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 0,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0,40,0,0,0
db 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena8_origin db 46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 44,11,44,11,44,11,44,11,44,11,44,11,44,11,44,11,44,11,44,11
db 11,44,11,44,11,44,11,44,11,44,11,44,11,44,11,44,11,44,11,44
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 32,34,32,34,32,34,32,34,32,34,32,34,32,34,32,34,32,34,32,34
db 34,32,34,32,34,32,34,32,34,32,34,32,34,32,34,32,34,32,34,32
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 13,13,13,13,13,13,0,0,0,0,0,0,0,0,13,13,13,13,13,13
db 13,13,13,13,13,13,0,0,0,0,0,0,0,0,13,13,13,13,13,13
db 13,13,13,13,13,13,0,0,0,0,0,0,0,0,13,13,13,13,13,13
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena9_origin db 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40
db 40,0,0,0,0,0,40,0,0,0,0,0,0,40,0,0,0,0,0,40
db 40,0,0,0,0,0,40,0,0,0,0,0,0,40,0,0,0,0,0,40
db 40,0,44,44,44,44,40,0,0,0,0,0,0,40,44,44,44,44,0,40
db 40,0,46,46,46,46,40,0,0,0,0,0,0,40,46,46,46,46,0,40
db 40,0,34,34,34,34,40,0,0,0,0,0,0,40,34,34,34,34,0,40
db 40,0,48,48,48,48,40,0,0,0,0,0,0,40,48,48,48,48,0,40
db 40,0,32,32,32,32,40,0,0,0,0,0,0,40,32,32,32,32,0,40
db 40,0,42,42,42,42,40,40,40,40,40,40,40,40,42,42,42,42,0,40
db 40,0,11,11,11,11,40,0,0,0,0,0,0,40,11,11,11,11,0,40
db 40,0,13,13,13,13,40,0,0,0,0,0,0,40,13,13,13,13,0,40
db 40,0,0,0,0,0,40,0,0,0,0,0,0,40,0,0,0,0,0,40
db 40,0,0,0,0,0,40,0,0,0,0,0,0,40,0,0,0,0,0,40
db 40,0,0,0,0,0,40,0,0,0,0,0,0,40,0,0,0,0,0,40
db 40,40,40,40,40,0,40,0,0,0,0,0,0,40,0,40,40,40,40,40
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena10_origin db 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
db 40,40,40,40,40,40,40,40,0,0,0,0,40,40,40,40,40,40,40,40
db 42,42,42,42,42,42,42,0,0,0,0,0,0,42,42,42,42,42,42,42
db 11,11,11,11,11,11,0,0,0,0,0,0,0,0,11,11,11,11,11,11
db 46,46,46,46,46,0,0,0,0,0,0,0,0,0,0,46,46,46,46,46
db 13,13,13,13,0,0,0,0,0,0,0,0,0,0,0,0,13,13,13,13
db 40,40,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,40,40
db 34,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,34
db 34,34,34,34,34,34,0,0,0,0,0,0,0,0,34,34,34,34,34,34
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 44,44,44,44,44,44,0,0,0,0,0,0,0,0,44,44,44,44,44,44
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,48,48,48,48,48,48,48,48,48,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena11_origin db 44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44
db 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44
db 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44
db 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44
db 44,0,0,0,0,0,42,11,42,11,42,11,42,11,0,0,0,0,0,44
db 44,0,0,0,0,0,11,42,11,42,11,42,11,42,0,0,0,0,0,44
db 44,0,0,0,0,0,42,11,42,11,42,11,42,11,0,0,0,0,0,44
db 44,0,0,0,0,0,11,42,11,42,11,42,11,42,0,0,0,0,0,44
db 0,0,0,0,0,0,42,11,42,11,42,11,42,11,0,0,0,0,0,0
db 0,0,0,0,0,0,11,42,11,42,11,42,11,42,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 32,32,32,32,32,32,32,32,32,0,0,32,32,32,32,32,32,32,32,32
db 13,13,13,13,13,13,13,13,13,0,0,13,13,13,13,13,13,13,13,13
db 46,46,46,46,46,46,46,46,46,0,0,46,46,46,46,46,46,46,46,46
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena12_origin db 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42
db 42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42
db 42,0,0,48,48,48,48,48,48,48,48,48,48,48,48,48,48,0,0,42
db 42,0,0,34,34,34,34,34,34,34,34,34,34,34,34,34,34,0,0,42
db 42,0,0,46,46,46,0,0,0,0,0,0,0,0,46,46,46,0,0,42
db 42,0,0,13,13,13,0,0,0,0,0,0,0,0,13,13,13,0,0,42
db 42,0,0,32,32,32,0,0,0,0,0,0,0,0,32,32,32,0,0,42
db 42,0,0,40,40,40,0,0,0,0,0,0,0,0,40,40,40,0,0,42
db 42,0,0,11,11,11,0,0,0,0,0,0,0,0,11,11,11,0,0,42
db 42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42
db 42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42
db 42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42
db 42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42
db 42,0,0,0,0,0,46,46,46,46,46,46,46,46,0,0,0,0,0,42
db 42,0,0,0,0,0,46,46,46,46,46,46,46,46,0,0,0,0,0,42
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena13_origin db 0,0,0,0,0,0,42,0,0,0,0,0,0,42,0,0,0,0,0,0
db 0,0,0,0,0,0,42,0,0,0,0,0,0,42,0,0,0,0,0,0
db 0,0,0,0,0,0,42,0,0,0,0,0,0,42,0,0,0,0,0,0
db 0,0,0,0,0,0,42,0,0,0,0,0,0,42,0,0,0,0,0,0
db 0,0,0,44,44,44,44,44,44,44,44,44,44,44,44,44,44,0,0,0
db 0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0
db 0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0
db 0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0
db 0,0,0,11,0,0,40,40,40,40,40,40,40,40,0,0,11,0,0,0
db 0,0,0,11,0,0,40,40,40,40,40,40,40,40,0,0,11,0,0,0
db 0,0,0,11,0,0,40,40,40,40,40,40,40,40,0,0,11,0,0,0
db 0,0,0,11,0,0,40,40,40,40,40,40,40,40,0,0,11,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 32,32,32,32,32,32,0,0,0,0,0,0,0,0,32,32,32,32,32,32
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena14_origin db 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,0,0,0
db 0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0
db 0,0,46,46,46,46,46,0,0,0,0,0,46,46,46,46,46,0,0,0
db 0,0,34,34,34,34,34,0,0,0,0,0,34,34,34,34,34,0,0,0
db 0,0,48,48,48,48,48,0,0,0,0,0,48,48,48,48,48,0,0,0
db 0,0,13,13,13,13,13,0,0,0,0,0,13,13,13,13,13,0,0,0
db 0,0,32,32,32,32,32,0,0,0,0,0,32,32,32,32,32,0,0,0
db 0,0,40,40,40,40,40,0,0,0,0,0,40,40,40,40,40,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,42,42,42,42,42,0,0,0,0,0,42,42,42,42,42,42,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arena15_origin db 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13
db 0,0,0,0,0,0,0,44,0,0,0,0,44,0,0,0,0,0,0,0
db 0,0,11,11,11,0,0,44,0,0,0,0,44,0,0,11,11,11,0,0
db 0,0,42,42,42,0,0,44,0,0,0,0,44,0,0,42,42,42,0,0
db 0,0,11,11,11,0,0,44,0,0,0,0,44,0,0,11,11,11,0,0
db 0,0,42,42,42,0,0,44,0,0,0,0,44,0,0,42,42,42,0,0
db 0,0,11,11,11,0,0,44,0,0,0,0,44,0,0,11,11,11,0,0
db 0,0,42,42,42,0,0,44,0,0,0,0,44,0,0,42,42,42,0,0
db 0,0,11,11,11,0,0,44,0,0,0,0,44,0,0,11,11,11,0,0
db 0,0,42,42,42,0,0,44,0,0,0,0,44,0,0,42,42,42,0,0
db 0,0,11,11,11,0,0,44,0,0,0,0,44,0,0,11,11,11,0,0
db 0,0,42,42,42,0,0,44,0,0,0,0,44,0,0,42,42,42,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,40,40,40,40,40,40,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
;Arena Data:
arena_height equ 25
arena_width equ 20
;---------------->
;---Heart--->
heart db 0,0,4,4,0,0,0,4,4,0,0
db 0,4,4,4,4,0,4,4,4,4,0
db 4,4,4,4,4,4,4,4,4,4,4
db 4,4,4,4,4,4,4,4,4,4,4
db 0,4,4,4,4,4,4,4,4,4,0
db 0,0,4,4,4,4,4,4,4,0,0
db 0,0,0,4,4,4,4,4,0,0,0
db 0,0,0,0,4,4,4,0,0,0,0
db 0,0,0,0,0,4,0,0,0,0,0
heart_width equ 11
heart_height equ 9
;----------->
;---Player Shape--->
player_breakout db 54*7 dup (15)
;------------------>
;---Ball Shape--->
ball_breakout db 0,0,15,15,15,15,0,0
db 0,15,15,15,15,15,15,0
db 15,15,15,15,15,15,15,15
db 15,15,15,15,15,15,15,15
db 15,15,15,15,15,15,15,15
db 15,15,15,15,15,15,15,15
db 0,15,15,15,15,15,15,0
db 0,0,15,15,15,15,0,0
;---------------->
;---Stone data--->
stone_height equ 6
stone_width equ 14
;---------------->
;---ball shape data--->
ball_width_breakout equ 8
ball_height_breakout equ 8
ballX_breakout dw 160
ballY_breakout dw 100
numOfBallMoves_breakout db ?
neededBallMoves_breakout db ?
ballSpeed_breakout db ?
;----------------------->
;---Player shape data--->
player_breakout_height_breakout equ 7
player_breakout_width_breakout equ 54
player_breakoutX_breakout dw ?
player_breakoutY_breakout dw ?
numOfPlayerMoves_breakout db ?
neededPlayerMoves_breakout db ?
level db ?
numOfLives db ?
;----------------------->
;---Keys--->
enter_key equ 28
left_key equ 75
right_key equ 77
left_IsPressed_breakout db ?
right_IsPressed_breakout db ?
;---------->
;---Messages--->
pressToStart db 'press any key to start...$'
livesMsg db 'Lives:$'
levelMsg db 'Level:$'
breakoutMsg db '<-Breakout->$'
;-------------->
CODESEG
;-----Procedure Start------>
; - Parameters: none.
; - Action: moves the arenas to temporary buffer
; that will show on screen. this procedure
; was made to make sure that the user can
; play over and over again all the arenas
proc LoadArena
;---Used Registers--->
push si di es
;-------------------->
cmp [byte ptr level], 1
jne @@levelNot1
;in case levelIs1
mov si, offset arena1_origin
jmp @@skipChecking
@@levelNot1:
cmp [byte ptr level], 2
jne @@levelNot2
;in case levelIs2
mov si, offset arena2_origin
jmp @@skipChecking
@@levelNot2:
cmp [byte ptr level], 3
jne @@levelNot3
;in case levelIs3
mov si, offset arena3_origin
jmp @@skipChecking
@@levelNot3:
cmp [byte ptr level], 4
jne @@levelNot4
;in case levelIs4
mov si, offset arena4_origin
jmp @@skipChecking
@@levelNot4:
cmp [byte ptr level], 5
jne @@levelNot5
;in case levelIs5
mov si, offset arena5_origin
jmp @@skipChecking
@@levelNot5:
cmp [byte ptr level], 6
jne @@levelNot6
;in case levelIs6
mov si, offset arena6_origin
jmp @@skipChecking
@@levelNot6:
cmp [byte ptr level], 7
jne @@levelNot7
;in case levelIs7
mov si, offset arena7_origin
jmp @@skipChecking
@@levelNot7:
cmp [byte ptr level], 8
jne @@levelNot8
;in case levelIs8
mov si, offset arena8_origin
jmp @@skipChecking
@@levelNot8:
cmp [byte ptr level], 9
jne @@levelNot9
;in case levelIs9
mov si, offset arena9_origin
jmp @@skipChecking
@@levelNot9:
cmp [byte ptr level], 10
jne @@levelNot10
;in case levelIs10
mov si, offset arena10_origin
jmp @@skipChecking
@@levelNot10:
cmp [byte ptr level], 11
jne @@levelNot11
;in case levelIs11
mov si, offset arena11_origin
jmp @@skipChecking
@@levelNot11:
cmp [byte ptr level], 12
jne @@levelNot12
;in case levelIs12
mov si, offset arena12_origin
jmp @@skipChecking
@@levelNot12:
cmp [byte ptr level], 13
jne @@levelNot13
;in case levelIs13
mov si, offset arena13_origin
jmp @@skipChecking
@@levelNot13:
cmp [byte ptr level], 14
jne @@levelNot14
;in case levelIs14
mov si, offset arena14_origin
jmp @@skipChecking
@@levelNot14:
cmp [byte ptr level], 15
jne @@levelNot15
;in case levelIs15
mov si, offset arena15_origin
jmp @@skipChecking
@@levelNot15:
@@skipChecking:
;------------------------->
mov di, offset arena ;di holds the Destination Index
push ds
pop es
mov cx, arena_height*arena_width
rep movsb
;---Used Registers--->
pop es di si
;-------------------->
ret
endp LoadArena
;-----End of procedure----->
;-----Procedure Start------>
; - Parameters: none
; - Action: deletes player_breakout's trail
; **must be put AFTER drawing the player_breakout**
proc DeletePlayerTrail_breakout
;---Used Registers--->
push ax bx cx dx
;-------------------->
;--Check If player_breakout goes right-->
cmp [byte ptr right_IsPressed_breakout], 1
jne @@notGoingRight
;In case the player_breakout goes right
mov dx, [player_breakoutY_breakout] ;Y coordinates
mov ah, 0ch ;prints pixel to screen
mov bl, 0 ;0 = wanted page
mov al, 0 ;0 = wanted color in palette = black
mov cx, player_breakout_height_breakout
@@deleteLeftLine:
push cx
mov cx, [player_breakoutX_breakout] ;X coordinates
dec cx
int 10h
inc dx
pop cx
loop @@deleteLeftLine
jmp @@endOfProc
@@notGoingRight:
;------------------------------>
;--Check If player_breakout goes left-->
cmp [byte ptr left_IsPressed_breakout], 1
jne @@notGoingLeft
;In case the player_breakout goes right
mov dx, [player_breakoutY_breakout] ;Y coordinates
mov ah, 0ch ;prints pixel to screen
mov bl, 0 ;0 = wanted page
mov al, 0 ;0 = wanted color in palette = black
mov cx, player_breakout_height_breakout
@@deleteRightLine:
push cx
mov cx, [player_breakoutX_breakout] ;X coordinates
add cx, player_breakout_width_breakout
int 10h
inc dx
pop cx
loop @@deleteRightLine
jmp @@endOfProc
@@notGoingLeft:
;----------------------------->
@@endOfProc:
;---Used Registers--->
pop dx cx bx ax
;-------------------->
ret
endp DeletePlayerTrail_breakout
;-----End of procedure----->
;-----Procedure Start------>
; - Parameters: x,y,color
; - action: prints block
proc PrintBlock
;---Used Registers--->
push ax cx si di es
;------------------->
push bp
mov bp, sp
sub sp, 2
blockColor equ [word ptr bp + 14]
blockY equ [word ptr bp + 16]
blockX equ [word ptr bp + 18]
startPixel equ [word ptr bp - 2]
;-VGA->
push 0A000h
pop es
;----->
;initialize position
shl blockX, 4 ;multiply by 16
shl blockY, 3 ;multiply by 8
;--Print first line-->
mov di, blockX
shl blockY, 6 ;multiply by 64
mov ax, blockY
shl ax, 2 ;multiply by 256
add ax, blockY ;y*64 + y*256 = 320*y
add di, ax ;di holds the exact position
mov startPixel, di
xor al, al ;wanted color - black
mov cx, stone_width + 2 ;+ 2 edges
rep stosb
;-------------------->
mov di, startPixel
add di, stone_width + 2
mov cx, stone_height
@@printingLoop:
push cx ;must save the date for the loop
;---Print First Pixel--->
sub di, stone_width + 2
add di, 320
mov [byte ptr es:di], 0
inc di
;----------------------->
;---Print line from the block--->
mov cx, stone_width
mov ax, blockColor
rep stosb
;------------------------------->
;---Print lase pixel--->
inc di
mov [byte ptr es:di], 0
;---------------------->
pop cx
loop @@printingLoop
;--Print Last line-->
mov cx, stone_width + 2 ;+ 2 edges
xor al, al ;wanted color - black
add di, 320
;------------------->
add sp, 2
pop bp
;---Used Registers--->
pop es di si cx ax
;-------------------->
ret 6
endp PrintBlock
;-----End of procedure----->
;-----Procedure start------>
; - Parameters: offset of arena.
; - action: prints the arena to the screen.
proc PrintArena
;---Used Registers--->
push ax bx cx si
;-------------------->
push bp
mov bp, sp
sub sp, 4
;Temporary variables
xIndex_temp equ [word ptr bp - 2]
yIndex_temp equ [word ptr bp - 4]
mov xIndex_temp, 0 ;uses as an index
mov yIndex_temp, 0 ;uses as an index
mov bx, [bp + 12] ;bx holds the offset of the array
xor si, si
mov cx, arena_height
@@printArenaLoop:
push cx ;must save the data in cx for the loop
mov cx, arena_width
@@innerPrintLoop:
cmp [byte ptr ds:bx + si], 0
je @@skipPrintBlock
push xIndex_temp ;x
push yIndex_temp ;y
mov al, [bx + si]
push ax ;color
call PrintBlock
@@skipPrintBlock:
inc si
inc xIndex_temp
loop @@innerPrintLoop
mov xIndex_temp, 0 ;start from the beginning
inc yIndex_temp ;move to next line
pop cx ;recovers the data in cx for the loop operation
loop @@printArenaLoop
add sp, 4
pop bp
;---Used Registers--->
pop si cx bx ax
;-------------------->
ret 2
endp PrintArena
;-----End of procedure----->
;-----Procedure start------>
; - Parameters: none.
; - Action: checks if the ball should change it's direction
proc ChangeDir
;---Used Registers--->
push ax bx
;-------------------->
;---Check If ball hits Player--->
mov ax, [ballY_breakout]
add ax, ball_height_breakout
cmp ax, [player_breakoutY_breakout]
jne @@notHitsPlayer
mov ax, [player_breakoutX_breakout]
cmp ax, 2
jb @@dontSubFromAx ;because if we sub from ax it will give us a very big unsigned number
sub ax, 2 ;**dangerous**
@@dontSubFromAx:
mov bx,[ballX_breakout]
add bx, ball_width_breakout/2
cmp bx, ax
jb @@notHitsPlayer
add ax, player_breakout_width_breakout + 4 ;**dangerout**
mov bx, [ballX_breakout]
add bx, ball_width_breakout/2
cmp bx, ax
ja @@notHitsPlayer
;In case ball hits player_breakout
mov ax, [ballX_breakout] ;ax holds the X position of the ball comparing to the player_breakout
add ax, ball_width_breakout/2
mov bx, [player_breakoutX_breakout]
sub ax, bx
;makes sure that's the result won't cause errors.
jnc @@notBelow0
mov [byte ptr ballSpeed_breakout], 9
xor dx, dx
jmp @@endOfProc
@@notBelow0:
add ax, 3
mov bl, 6
div bl
;Checks the possible results
cmp al, 1
jnb @@resNot0
mov [byte ptr ballSpeed_breakout], 9
xor dx, dx
jmp @@endOfProc
@@resNot0:
cmp al, 9
jna @@resNotAbv9
mov [byte ptr ballSpeed_breakout], 1
xor dx, dx
jmp @@endOfProc
@@resNotAbv9:
;change the speed according to the position of the ball
mov bl, 10
sub bl, al
mov [ballSpeed_breakout], bl
xor dx, dx
jmp @@endOfProc
@@notHitsPlayer:
;------------------------------->
;---Check If ball is in left edge--->
cmp [ballX_breakout], 0
jne @@notInLeftEdge
cmp [byte ptr ballSpeed_breakout], 6
jb @@notInLeftEdge
;In case the ball is in left edge
cmp [byte ptr ballSpeed_breakout], 9
ja @@speedAbove9_leftEdge
;In case speed is below 9
mov al, 10
sub al, [ballSpeed_breakout]
mov [ballSpeed_breakout], al
mov dl, [ballSpeed_breakout]
xor dh, dh
jmp @@endOfProc
@@speedAbove9_LeftEdge:
;in case speed is above 9
mov al, 28
sub al, [ballSpeed_breakout]
mov [ballSpeed_breakout], al
sub al, 9
mov dl, al
xor dh,dh
jmp @@endOfProc
@@notInLeftEdge:
;----------------------------------->
;---Check If ball is in right edge--->
cmp [word ptr ballX_breakout], 320 - ball_width_breakout
jne @@notInRightEdge
;In case the ball is in right edge
cmp [byte ptr ballSpeed_breakout], 9
ja @@speedAbove9_RightEdge
;In case speed is below 9
mov al, 10
mov dl, [ballSpeed_breakout]
xor dh, dh
sub al, [ballSpeed_breakout]
mov [ballSpeed_breakout], al
jmp @@endOfProc
@@speedAbove9_RightEdge:
;in case speed is above 9
mov al, 28
sub al, [ballSpeed_breakout]
sub [ballSpeed_breakout], 9
mov dl, [ballSpeed_breakout]
xor dh, dh
mov [ballSpeed_breakout], al
jmp @@endOfProc
@@notInRightEdge:
;----------------------------------->
;---Check If ball is in Top edge--->
cmp [word ptr ballY_breakout], 0
jne @@notInTopEdge
;In case the ball is in top edge
add [byte ptr ballSpeed_breakout], 9
xor dx, dx
jmp @@endOfProc
@@notInTopEdge:
;----------------------------------->
@@endOfProc:
;---Used Registers--->
pop bx ax
;-------------------->
ret
endp ChangeDir
;-----End of procedure----->
;-----Procedure start------>
; - Parameters: offset of shape, x coordinates of player_breakout, y coordinates of player_breakout,
; height of shape, width of shape
; - Action: Prints shape
proc PrintShape_breakout
;---Used Registers--->
push ax bx cx dx si di
;-------------------->
push bp
mov bp, sp
shape_width equ [word ptr bp + 16]
shape_height equ [word ptr bp + 18]
shape_y equ [word ptr bp + 20]
shape_x equ [word ptr bp + 22]
shape_offset equ [word ptr bp + 24]
mov ah, 0ch
xor bl, bl
xor di, di
mov dx, shape_y
mov cx, shape_height
@@printShapeLoop_breakout:
push cx
mov cx, shape_width
xor si, si
@@innerPrintingLoop_breakout:
push cx
mov cx, shape_x
add cx, si
mov bx, shape_offset
mov al, [bx + di]
xor bx, bx
int 10h
pop cx
inc di
inc si
loop @@innerPrintingLoop_breakout
pop cx
inc dx
loop @@printShapeLoop_breakout
pop bp
;---Used Registers--->
pop di si dx cx bx ax