forked from aliaagheisX/Cheeese
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.asm
More file actions
2701 lines (2338 loc) · 104 KB
/
game.asm
File metadata and controls
2701 lines (2338 loc) · 104 KB
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
;Author: Aliaa Gheis
;DATE:
;This Progam
;======================
;======================
; 0 1 2 3 4 5 6 7 rows
; 0 0 1 2 3 4 5 6 7
; 1 8 ............................ 15
; 2 16 ...............................
; 3 24 ..................................
; 4 32 ..................................
; 5 40 ..................................
; 6 48 ..................................
; 7 56.............................. 63
;==================================================
;TODO
;- don't draw another player move => miss things up
;- exit for both on click f4
PUBLIC StartGame
PUBLIC boardWidth, imageWidth, color, board, Bpawn, validateMoves, highlightPeiceMvs
PUBLIC playerCells, playerCols, playerRows, PlayerPos, highlightColor, PlayerSelectedCell,PlayerSelectedRow, PlayerSelectedPos
EXTRN DrawBoard:FAR
EXTRN DrawSquareBord:FAR
EXTRN DrawSquareBordSm:FAR
EXTRN MvePlayerFromGraphics:FAR
EXTRN DrawHighlightedMvs:FAR
EXTRN ClrHighlightedMvs:FAR
EXTRN MvePieceToGraphics:FAR
EXTRN MvePieceFromGraphics:FAR
EXTRN DrawPlayers:FAR
EXTRN killedPeicePos:WORD
EXTRN PlayerGameNumber:WORD
EXTRN killedPeiceRow:BYTE
EXTRN killedPeiceCol:BYTE
EXTRN playerWinGame:BYTE
EXTRN player1:BYTE
EXTRN player2:BYTE
.286
.MODEL HUGE
.STACK 256
.DATA
activePage equ 3
;======= chat
ValueForchat DB '$$'
msg1 DB 'Me: $'
msg2 DB 'You: $'
keypressed db ?
c1 DW 0
c2 DW 0400h
startCol db 23
rowSize db 40
stausLineRow equ 7 ;endRow-2 =>
;line sepreate status from chat
ChatLineRow equ 3 ;line seperate two chats
;(end-start)/2
;start = 0
PlayerSentMessState equ 64
;==== chat
;_______sending&recieving__________;
from_against_player db '$'
to_against_player db '$'
;__________Peices________;
color db 31, 9
highlightColor equ 72
highlightPeiceMvs db ?, 64, 80
boardWidth equ 23
imageWidth equ 23
; ____ game time _____ ;
GameMin equ 3
GameSec equ 0
StartMin db ?
StartSec db ?
; ____ game peice ____ ;
emptyCell equ 0
pawn equ 1
rook equ 2
knight equ 3
bishop equ 4
queen equ 5
king equ 6
; ____ peice color ____ ;
black equ 8
white equ 0
; ____ peice mask ____ ;
peice equ 7
;____ players _____;
playerNum1 equ 1
playerNum2 equ 2
PlayerClkF4 equ 128
playerMoveToChoosePeice equ 0
playerMoveToChooseAction equ 1
PlayerLose equ 2
PlayerWin equ 3
PlayerEndedGame equ 4
isGameEnded db 0 ;1 => game ended & 2 game ended by player
isKingCheck db ?, 0, 0
playersState db ?, playerMoveToChoosePeice, playerMoveToChoosePeice
playerCells db ?, 0, 56
playerRows db ?, 0, 7
playerCols db ?, 0, 0
PlayerPos dw ?, 0, 51520
kingsCells db ?, 4, 60
kingsRows db ?, 0, 7
kingsCols db ?, 4, 4
PlayerSelectedCell db ?, ?, ?
PlayerSelectedRow db ?, ?, ?
PlayerSelectedPos dw ?, ?, ?
lstValidDirection dw 8 dup(?);
validateMoves db 64 dup(0)
validateMovesTemp db 64 dup(0)
; ____ board ____ ;
board db rook+black, knight+black, bishop+black, queen+black, king+black, bishop+black, knight+black, rook+black
db 8 dup(pawn+black)
db 4 dup(8 dup(emptyCell))
db 8 dup(pawn)
db rook, knight, bishop, queen, king, bishop, knight, rook
peiceTimer dw 64 dup(0)
TmDiff equ 3
; _____Important Position ______;
checkmes db "be carefull there is a check$"
Clearcheckmes db ' $'
player1WinMess db " Win!!", 1h, '$'
player2WinMess db " Loss!! $"
prntExitMess db "click f4 to exit the game $"
timerArray dw 33 dup(0);[row,[4]col[4]] than have still time
;to print
headTimeArray db 0
tailTimeArray db 0
VALUE DB '$$'
Bpawn DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 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 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Brook DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 4, 16, 16, 16, 16, 4, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Wrook DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 4, 16, 16, 16, 16, 4, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 15, 15, 16, 16, 15, 15, 15, 16, 16, 16, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Bknight DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 4, 4, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 4, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Wknight DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 4, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 15, 15, 15, 15, 15, 15, 15, 16, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 16, 16, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 15, 15, 15, 15, 15, 15, 16, 16, 16, 15, 15, 15, 15, 15, 15, 16, 4, 4, 4, 4
DB 4, 16, 16, 16, 15, 15, 15, 15, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4
DB 4, 16, 16, 15, 15, 15, 15, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16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4, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 15, 15, 15, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Wbishop DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 15, 15, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 16, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 16, 16, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Bqueen DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 4, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4
DB 16, 16, 16, 16, 16, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4
DB 16, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 16, 4, 4
DB 16, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 4, 16, 16, 16, 4, 4, 4
DB 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 15, 15, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 15, 15, 15, 15, 16, 16, 16, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Wqueen DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 16, 16, 4, 4, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 16, 16, 4, 4, 4
DB 16, 16, 16, 16, 16, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4
DB 16, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 16, 4, 4
DB 16, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 4, 16, 16, 16, 16, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 16, 15, 16, 16, 15, 16, 16, 15, 15, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 15, 16, 16, 15, 16, 16, 15, 15, 16, 15, 15, 16, 15, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 15, 16, 16, 15, 16, 16, 16, 16, 16, 15, 16, 16, 15, 16, 16, 4, 4, 4, 4
DB 4, 4, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 15, 15, 15, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Bking DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 16, 16, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 16, 4, 4, 4, 4
DB 4, 16, 15, 15, 16, 16, 16, 15, 15, 16, 16, 16, 15, 15, 16, 16, 16, 16, 15, 16, 4, 4, 4
DB 4, 16, 15, 16, 16, 16, 16, 16, 16, 15, 16, 15, 16, 16, 16, 16, 16, 16, 15, 16, 4, 4, 4
DB 4, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 16, 16, 16, 16, 16, 15, 16, 4, 4, 4
DB 4, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15, 16, 4, 4, 4
DB 4, 4, 16, 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 4, 4, 4
DB 4, 4, 16, 16, 15, 15, 15, 15, 15, 16, 16, 16, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 15, 15, 16, 16, 16, 16, 16, 16, 15, 15, 16, 16, 4, 4, 4, 4,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15, 16, 16, 16, 15, 15, 16, 16, 16, 15, 15, 16, 16, 16, 4, 4, 4
DB 4, 16, 16, 15, 15, 15, 15, 15, 16, 16, 15, 15, 16, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4
DB 4, 16, 16, 15, 15, 15, 15, 15, 15, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 4, 4, 4
DB 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 15, 15, 15, 15, 15, 15, 15, 15, 16, 4, 4, 4
DB 4, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 15, 15, 15, 15, 15, 15, 15, 16, 16, 4, 4, 4
DB 4, 4, 16, 16, 15, 15, 15, 15, 15, 15, 16, 15, 15, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4
DB 4, 4, 4, 16, 16, 16, 16, 16, 16, 15, 15, 15, 16, 16, 16, 15, 16, 16, 16, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 15, 15, 16, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 15, 15, 16, 16, 16, 16, 16, 15, 15, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 16, 16, 16, 16, 16, 15, 15, 15, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
DB 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
.code
port_initializatiion PROC FAR
pusha
mov dx,3fbh ; Line Control Register
mov al,10000000b ;Set Divisor Latch Access Bit
out dx,al
mov dx,3f8h
mov al,0ch
out dx,al
mov dx,3f9h
mov al,00h
out dx,al
mov dx,3fbh
mov al,00011011b
out dx,al
popa
ret
port_initializatiion EndP
SEND PROC
pusha
mov dx , 3FDH
AG: in al, dx ;Read Line Status
AND al , 00100000b
JZ AG
mov dx , 3F8H ; Transmit data register
mov al,VALUE
out dx , al
popa
RET
SEND ENDP
EndGameState PROC FAR
;========= inialize board =========;
mov cx, 64 ;clear board
mov si, 0
mov di, 0
inializeBoard: mov board[si], 0
mov peiceTimer[di], 0;dw
mov validateMoves[si], 0
inc si
add di, 2
loop inializeBoard
mov board[0], black+rook
mov board[1], black+knight
mov board[2], black+bishop
mov board[3], queen+black
mov board[4], king+black
mov board[5], bishop+black
mov board[6], knight+black
mov board[7], rook+black
mov board[8], black+pawn
mov board[9], black+pawn
mov board[10], black+pawn
mov board[11], black+pawn
mov board[12], black+pawn
mov board[13], black+pawn
mov board[14], black+pawn
mov board[15], black+pawn
mov board[48], pawn
mov board[49], pawn
mov board[50], pawn
mov board[51], pawn
mov board[52], pawn
mov board[53], pawn
mov board[54], pawn
mov board[55], pawn
;
mov board[56], rook
mov board[57], knight
mov board[58], bishop
mov board[59], queen
mov board[60], king
mov board[61], bishop
mov board[62], knight
mov board[63], rook
;============= in
mov isGameEnded, 0
mov playersState[1], playerMoveToChoosePeice
mov playersState[2], playerMoveToChoosePeice
mov playerCells[1], 0
mov playerCells[2], 56
mov playerRows[1], 0
mov playerRows[2], 7
mov playerCols[1], 0
mov playerCols[2], 0
mov PlayerPos[2], 0
mov PlayerPos[4], 51520
;======= king and check
mov isKingCheck[1], 0
mov isKingCheck[2], 0
mov kingsCells[1], 4
mov kingsCells[2], 60
mov kingsRows[1], 0
mov kingsRows[2], 7
mov kingsCols[1], 4
mov kingsCols[2], 4
;========================================
mov killedPeicePos, 20664
mov killedPeiceRow, 0
mov killedPeiceCol, 0
RET
EndGameState ENDP
RowColToCell PROC FAR ;al = row cl = col =>> si = CellNumber
push ax
push bx
mov bl,8
mul bl ; al = al*8
add al, cl ; al = al*8 + col
sub ah, ah
mov si, ax
pop bx
pop ax
RET
RowColToCell ENDP
RowColToStartPos PROC FAR
;al =row cl=col =>di=StartPos
push ax
push bx
push cx
push dx
mov ah,0
mov di,ax
mov al,boardWidth ;al = width|hight
mul cl ;al = width*col
mov bx,ax ;bx = width*col
mov dx,0
mov ax,320*boardWidth ;ax=320*hight
mul di ;ax=320*hight*row
mov di,ax ;di=320*row*hight
add di,bx ;di=320*row*hight+width*col
pop dx
pop cx
pop bx
pop ax
RET
RowColToStartPos ENDP
;________ __________ ___________;
;________ __________ ___________;
;________ validators ___________;
;________ __________ ___________;
;________ __________ ___________;
GetPlayerColorV2 Proc FAR; si = player ; cl=piece ;ch =output
push si
;for empty cell
cmp cl,emptyCell
je result
; if si =1 => 8 || si = 2 =>0
and si ,1
shl si, 3
and cl ,black
mov ch,0
;compare if the color is the same
cmp cx,si
jne result
mov cx, 0
pop si
RET
result: pop si
mov cx,si
ret
GetPlayerColorV2 Endp
;** si = peice
GetPlayerColor Proc far ; si = player ; cl =color
push si
shr si,3;si = color
and si,1;si = color => make sure
mov ch,0
mov cx,si;cx => 0 => white || 1 =>
pop si
ret
GetPlayerColor Endp
ispeice Proc FAR; si = palyer ; dl = 1 if piece and 0 if not piece
push si
and si ,peice
shl si,5
jnz PeiceExist
mov dl,0
jmp Ex
PeiceExist:
mov dl,1
Ex:
pop si
ret
ispeice Endp
; === helpers
ValidatePawn PROC FAR ;al = row cl = col si = player di = cell
pusha
mov bh, 0
mov dx, si
mov ah, 0
mov al, playerCells[si]
mov di, ax
;===== for valid players ====;
cmp si, 1 ;chk if player black
jne PaP2
PaP1: cmp playerRows[si], 7
je EXITPP1
PwnMv1: ;down one if
mov al, board[di+8]
cmp al, emptyCell
jne PwnMv3 ;skip down twice if not valid
mov validateMoves[di+8], dl
PwnMv2: ;down twice if
cmp playerRows[si], 1 ;down twice in first move
jne PwnMv3
mov al, board[di+16]
cmp al, emptyCell
jne PwnMv3
mov validateMoves[di+16], dl
PwnMv3: ;right down
cmp PlayerCols[si], 7
je PwnMv4
mov al, board[di+9]
cmp al, emptyCell
je PwnMv4
shr al, 3 ;get color bit
cmp al, 0 ;check if white
jne PwnMv4
mov validateMoves[di+9], dl
mov lstValidDirection[0], di ;for check
add lstValidDirection[0], 9
PwnMv4: ;right down
cmp PlayerCols[si], 0
mov al, board[di+7]
cmp al, emptyCell
je EXITPP1
shr al, 3 ;get color bit
cmp al, 0 ;check if white
jne EXITPP1
mov validateMoves[di+7], dl
mov lstValidDirection[2], di ;for check
add lstValidDirection[2], 7
EXITPP1:
POPA
RET
PaP2: cmp playerRows[si], 0
je EXITPP2
PwnMv12: ;up one if
mov al, board[di-8]
cmp al, emptyCell
jne PwnMv32
mov validateMoves[di-8], dl
PwnMv22:;up twice if
cmp playerRows[si], 6 ;up twice in first move
jne PwnMv32
mov al, board[di-16]
cmp al, emptyCell
jne PwnMv32
mov validateMoves[di-16], dl
PwnMv32: ;down -> left
cmp PlayerCols[si], 0
je PwnMv42
mov al, board[di-9]
cmp al, emptyCell
je PwnMv42
shr al, 3 ;get color bit
cmp al, 1 ;check if white
jne PwnMv42
mov validateMoves[di-9], dl
mov lstValidDirection[0], di ;for check
sub lstValidDirection[0], 9
PwnMv42: ;right down
cmp PlayerCols[si], 7
mov al, board[di-7]
cmp al, emptyCell
je EXITPP2
shr al, 3 ;get color bit
cmp al, 1 ;check if white
jne EXITPP2
mov validateMoves[di-7], dl
mov lstValidDirection[2], di ;for check
sub lstValidDirection[2], 7
EXITPP2:
popa
RET
ValidatePawn ENDP
ValidateRook Proc ;al = row cl = col si = player di = cell
pusha
mov ax, 0
mov al, playerCells[si]
mov di, ax
mov al, playerRows[si]
mov cl, playerCols[si]
push cx
push si
mov cl,board[di]
mov ch,0
mov si,cx
Call GetPlayerColor ; bx=color of the player to get its validation pos
mov bx,cx
pop si
pop cx
push ax
mov ax,si
mov ch,al
pop ax
pusha
verticalDown:
cmp al,7
jz VP
inc al
add di,8
mov dl,board[di]
mov dh,0
mov si ,dx
Call ispeice ;dl=1 if peice and dl =0 if not peice
cmp dl,0
jz Helight
push cx
Call GetPlayerColor ; cx=color of the player in this cell
cmp cx,bx
jz NH
pop cx
jmp Helight
NH:
pop cx
jmp NotHelight
Helight:
mov validateMoves[di],ch
mov lstValidDirection[0], di ;for check
NotHelight:
cmp dl,1
jnz verticalDown
VP:
popa
pusha
verticalUP:
cmp al,0
jz HR
dec al
sub di,8
mov dl,board[di]
mov dh,0
mov si ,dx
Call ispeice ;dl=1 if peice and dl =0 if not peice
cmp dl,0
jz Helight1
push cx
Call GetPlayerColor ; cx=color of the player in this cell
cmp cx,bx
jz NH1
pop cx
jmp Helight1
NH1:
pop cx
jmp NotHelight1
Helight1:
mov validateMoves[di],ch
mov lstValidDirection[2], di ;for check
NotHelight1:
cmp dl,1
jnz verticalUP
HR:
popa
pusha
HorizontalRight:
cmp cl,7
jz HL
inc cl
add di,1
mov dl,board[di]
mov dh,0
mov si,dx
Call ispeice ;dl=1 if peice and dl =0 if not peice
cmp dl,0
jz Helight2
push cx
Call GetPlayerColor ; cx=color of the player in this cell
cmp cx,bx
jz NH2
pop cx
jmp Helight2
NH2:
pop cx
jmp NotHelight2
Helight2:
mov validateMoves[di],ch
mov lstValidDirection[4], di ;for check
;========for check
NotHelight2:
cmp dl,1
jnz HorizontalRight
HL:
popa
pusha
HorizontalLeft:
cmp cl,0
jz EndValidate
dec cl
sub di,1
mov dl,board[di]
mov dh,0
mov si ,dx
Call ispeice ;dl=1 if peice and dl =0 if not peice
cmp dl,0
jz Helight3
push cx
Call GetPlayerColor ; cx=color of the player in this cell
cmp cx,bx
jz NH3
pop cx
jmp Helight3
NH3:
pop cx
jmp NotHelight3
Helight3:
mov validateMoves[di],ch
mov lstValidDirection[6], di ;for check
NotHelight3:
cmp dl,1
jnz HorizontalLeft
EndValidate:
popa
popa
RET
ValidateRook ENDP
;========================= chat
;========================= chat
;========================= chat
;_____game chat__________;
InializeChar PROC
;__________ inialize cursor ________;
mov ah, 0 ;me:cursor => row
mov al, startCol ;me:cursor => col
mov c1, ax
mov ah, ChatLineRow ;you:cursor => row
inc ah ;ender the line sep bet chat
mov al, startCol ;you:cursor => col
mov c2, ax
;__________ print me ________;
mov dx, c1 ;set cursor
mov bh, 0
mov ah, 02
int 10h
lea dx, player1 ;print ME:
mov ah, 9
int 21h
;___________________print YOU_______________________;
mov dx, c2 ;set cursor
mov bh, 0 ;page
mov ah, 02 ;interrupt
int 10h
lea dx, player2 ;print YOU:
mov ah, 9
int 21h
;_____________________update cursors_____________________;
mov al, startCol
add al, 3 ;just maragin
mov ah, 1
mov c1, ax ;update cursos to nxt line
mov ah, ChatLineRow
add ah, 2
mov c2, ax ;update cursos to nxt line
;_____________ draw line seperate between chats___________________;
mov dh, ChatLineRow
mov dl, startCol ;lineCol
mov bh, 0 ;set cusor to line row
mov ah, 02
int 10h
mov al, '_' ;charcter
mov bl, 03h ;color
mov bh, 0 ;page
mov ch, 0
mov cl, rowSize ;count
sub cl, startCol
mov ah, 09 ;repeat count
int 10h
;_____________ draw line___________________;
mov dh, stausLineRow
mov dl, startCol ;lineCol
mov bh, 0 ;set cusor to line row