This repository has been archived by the owner on Feb 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VRCT.asm
2388 lines (2140 loc) · 42.4 KB
/
VRCT.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
;.MODEL SMALL
IMAGESG SEGMENT
AREA DB 0FFFFH DUP(99) ;BMP INTO
IMAGESG ENDS
DATASG SEGMENT
IMG DB "N1.BMP",0 ;PIC0
DB "N2.BMP",0 ;PIC1
DB "N3.BMP",0 ;PIC2
DB "N4.BMP",0 ;PIC3
DB "N5.BMP",0 ;PIC4
DB "N6.BMP",0 ;PIC5
DB "N7.BMP",0 ;PIC6
DB "N8.BMP",0 ;PIC7
DB "N9.BMP",0 ;PIC8
SC_ DB "SC_0.BMP",0 ;PIC0
DB "SC_1.BMP",0 ;PIC1
DB "SC_2.BMP",0 ;PIC2
DB "SC_3.BMP",0 ;PIC3
DB "SC_4.BMP",0 ;PIC4
DB "SC_5.BMP",0 ;PIC5
DB "SC_6.BMP",0 ;PIC6
DB "SC_7.BMP",0 ;PIC7
DB "SC_8.BMP",0 ;PIC8
DB "SC_9.BMP",0 ;PIC9
BSG_N DB "BSG_.BMP",0
END_Z DB "THE_END.BMP",0
TITLE_ DB "voracity.BMP",0
BGNUM_ DB "BGNUM.BMP",0
B_MOVE_ DB "B_MOVE.BMP",0
RIGHT_P DB "SCORE0.BMP",0
B_THZ DB "B_TH_C.BMP",0
B_THZ1 DB "B_TH_C2.BMP",0
B_THZ2 DB "B_TH_C3.BMP",0
B_THZ3 DB "B_TH_C4.BMP",0
B_THY DB "B_TH_E1.BMP",0
B_THX DB "B_TH_E2.BMP",0
B_THXY DB "B_TH_E3.BMP",0
B_THYX DB "B_TH_E4.BMP",0
END_ DB "END_GAME",'$'
USERZ DB "US.BMP",0
GRAD_WN DW ? ; STORE POSITION(IN ARRAY)&& DATA
GRAD_N DW ?
GRAD_EN DW ? ; [WN] [N] [EN]
GRAD_W DW ? ; [W] [E]
GRAD_E DW ? ; [WS] [S] [ES]
GRAD_WS DW ?
GRAD_S DW ?
GRAD_ES DW ?
POS_WN DW ?
POS_N DW ?
POS_EN DW ?
POS_W DW ?
POS_E DW ?
POS_WS DW ?
POS_S DW ?
POS_ES DW ?
X_8_1 DW ?
Y_8_1 DW ?
X_8_2 DW ?
Y_8_2 DW ?
X_8_3 DW ?
Y_8_3 DW ?
X_8_4 DW ?
Y_8_4 DW ?
X_8_5 DW ?
Y_8_5 DW ?
X_8_6 DW ?
Y_8_6 DW ?
X_8_7 DW ?
Y_8_7 DW ?
X_8_8 DW ?
Y_8_8 DW ?
TEMP_END DW ?
FLAG_TABLE DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,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,0,0,0
DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'$'
SCORE_S DW '0','0','0','$'
SHIFT_DIGIT DW ?
POS_NUM_X DW ?
POS_NUM_Y DW ?
DATAZ DB ?
POSZ DW ?
RNUM DW ?
GRAD_ DW ?
TEMP1 DW ?
TEMP2 DW ?
SCORE DW ?
DATASG ENDS
;------------------------------------------------------------------------------------------
CODESG SEGMENT
ASSUME CS:CODESG,DS:DATASG
MAIN PROC
MOV AX,DATASG
MOV DS,AX
MOV AX,0013H
INT 10H
CALL RANDOMZ ; RANDOM TO FLAG TABLE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,B_THZ1
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,24 ;0-25
MOV POS_NUM_Y,0 ;0-40
CALL POS_IMG_DRAW
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,B_THZ
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,0 ;0-25
MOV POS_NUM_Y,0 ;0-40
CALL POS_IMG_DRAW
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,B_THZ2
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,24 ;0-25
MOV POS_NUM_Y,24 ;0-40
CALL POS_IMG_DRAW
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,B_THZ3
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,0 ;0-25
MOV POS_NUM_Y,24 ;0-40
CALL POS_IMG_DRAW
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV CX,19
LOOPROWZ:
MOV DX,26
LOOPCOLZ:
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,BGNUM_
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,CX ;0-25
MOV POS_NUM_Y,DX ;0-40
CALL POS_IMG_DRAW
INC DX
CMP DX,39 ; ( SET COL HERE )
JNE LOOPCOLZ
INC CX
CMP CX,24 ; ( SET ROW HERE )
JNE LOOPROWZ
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV CX,0
LOOPROWX:
MOV DX,1
LOOPCOLX:
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,B_THY
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,CX ;0-25
MOV POS_NUM_Y,DX ;0-40
CALL POS_IMG_DRAW
INC DX
CMP DX,24 ; ( SET COL HERE )
JNE LOOPCOLX
INC CX
CMP CX,1 ; ( SET ROW HERE )
JNE LOOPROWX
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV CX,1
LOOPROWY:
MOV DX,0
LOOPCOLY:
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,B_THX
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,CX ;0-25
MOV POS_NUM_Y,DX ;0-40
CALL POS_IMG_DRAW
INC DX
CMP DX,1 ; ( SET COL HERE )
JNE LOOPCOLY
INC CX
CMP CX,24 ; ( SET ROW HERE )
JNE LOOPROWY
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV CX,24
LOOPROWY1:
MOV DX,1
LOOPCOLY1:
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,B_THXY
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,CX ;0-40
MOV POS_NUM_Y,DX ;0-25
CALL POS_IMG_DRAW
INC DX
CMP DX,24 ; ( SET COL HERE )
JNE LOOPCOLY1
INC CX
CMP CX,25 ; ( SET ROW HERE )
JNE LOOPROWY1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV CX,1
LOOPROWY11:
MOV DX,24
LOOPCOLY11:
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,B_THYX
CALL LOADPALT
LEA SI,AREA
MOV POS_NUM_X,CX ;0-40
MOV POS_NUM_Y,DX ;0-25
CALL POS_IMG_DRAW
INC DX
CMP DX,25 ; ( SET COL HERE )
JNE LOOPCOLY11
INC CX
CMP CX,24 ; ( SET ROW HERE )
JNE LOOPROWY11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,BSG_N
CALL LOADPALT
LEA SI,AREA
CALL DRAW_BIG_IMG_2
; MAIN BOARD
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,TITLE_
CALL LOADPALT
LEA SI,AREA
CALL DRAW_BIG_IMG_4
; MAIN BOARD
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LEA BX,FLAG_TABLE
MOV CX,1
LOOPROW:
MOV DX,1
LOOPCOL:
PUSH CX
PUSH DX
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
;;;;;;;;;;;;;;;;CHOOSE IMAGE :: MATCH TABLE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LEA SI,IMG ; CHAGE IMG HERE
MOV CL,[BX]
SUB CL,30H
INC BX
SUB CH,CH
SUB CX,1 ; SELECT IMG 1-9 FROM DATA IN FLAG_TABLE
SUB AH,AH
MOV AL,7
MUL CL
ADD SI,AX ; ADD 7 FOR NEXT IMG
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CALL LOADPALT
LEA SI,AREA
POP DX
POP CX
MOV POS_NUM_X,CX ;1-23
MOV POS_NUM_Y,DX ;1-23
CALL POS_IMG_DRAW ; ABOUT SI
INC DX
CMP DX,24 ; ( SET COL HERE )
JNE LOOPCOL
INC CX
CMP CX,24 ; ( SET ROW HERE )
JNE LOOPROW
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; // AFTER RUN BOARD
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG ;
MOV AX,DATASG ;
MOV DS,AX ;
;;;;;;;;;;;;;;;;; USER IMG ;;;;;;;;;;;;;;;;;;;;
LEA SI,USERZ
CALL LOADPALT
LEA SI,AREA
CALL RANDOZ
MOV POS_NUM_X,AX ;1-23
CALL RANDOZ
MOV POS_NUM_Y,AX ;1-23
CALL POS_IMG_DRAW ; ABOUT SI
;;;;;;;;;;;;;;STORE USERZ POSITION IN FLAG_TABLE;;;;;;;;;;;;;;;;;;;; =========>>>> STORE IN FLAG_TABLE FORM 0-528
MOV AX,POS_NUM_X ; pass parameter (string data,position)
SUB AH,AH
MOV DL,23
MUL DL ;AX=SOL
SUB AX,23
ADD AX,POS_NUM_Y
SUB AX,1
MOV POSZ,AX ; PASS VALUE POSZ TO STROE 0-575
MOV DL,'#'
MOV DATAZ,DL ; PASS VALUE DATAZ TO STORE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;CALL S2R_
;CALL GET_POS
CALL STORE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;#################################################################################
;;;;;;;;;;;;;;;;;;;;MOUSE;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
MOV AX,0
INT 33H
MOV AX,01H
INT 33H
MOV AX,07H
MOV CX,16
MOV DX,383
INT 33H
MOV AX,08H
MOV CX,8
MOV DX,191
INT 33H
MOV AX,04H
MOV CX,520
MOV DX,100
INT 33H
AG:
MOV AX,01H
INT 33H
MOV AX,03H
INT 33H
SHR DX,3
MOV POS_NUM_X,DX ;1-23 ON BOARD
SHR CX,4
MOV POS_NUM_Y,CX ;1-23 ON BOARD
MOV AH,11H
INT 16H
CMP AH,4FH
JE EE
CMP BX,01H
JE EX
JMP AG
EE:
JMP EXIT
EX:
MOV AX,02H
INT 33H
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV AX,POS_NUM_X ; pass parameter (string data,position)
SUB AH,AH
MOV DL,23
MUL DL ;AX=SOL
SUB AX,23
ADD AX,POS_NUM_Y
SUB AX,1
MOV POSZ,AX ; PASS VALUE POSZ TO STROE 0-575
MOV DX,POS_WN ; TYPE WORD
CMP AX,DX
JE WN
MOV DX,POS_N ; TYPE WORD
CMP AX,DX
JE N
MOV DX,POS_EN ; TYPE WORD
CMP AX,DX
JE EN
MOV DX,POS_W ; TYPE WORD
CMP AX,DX
JE W
MOV DX,POS_E ; TYPE WORD
CMP AX,DX
JE E
MOV DX,POS_WS ; TYPE WORD
CMP AX,DX
JE WS
MOV DX,POS_S ; TYPE WORD
CMP AX,DX
JE S
MOV DX,POS_ES ; TYPE WORD
CMP AX,DX
JE ES_
JMP NEXT_
;NOW HAVE X,Y FOR POST && NUMBER OF STEP(GRAD_XX)
;POS_NUM_Y,CX
;POS_NUM_X,DX
WN:
CALL CHECKMOVE1
CMP BX,1
JNE NEXT_
CALL TRUE_MOVE1
JMP NEXT_
N:
CALL CHECKMOVE2
CMP BX,1
JNE NEXT_
CALL TRUE_MOVE2
JMP NEXT_
EN:
CALL CHECKMOVE3
CMP BX,1
JNE NEXT_
CALL TRUE_MOVE3
JMP NEXT_
W:
CALL CHECKMOVE4
CMP BX,1
JNE NEXT_
CALL TRUE_MOVE4
JMP NEXT_
E:
CALL CHECKMOVE5
CMP BX,1
JNE NEXT_
CALL TRUE_MOVE5
JMP NEXT_
WS:
CALL CHECKMOVE6
CMP BX,1
JNE NEXT_
CALL TRUE_MOVE6
JMP NEXT_
S:
CALL CHECKMOVE7
CMP BX,1
JNE NEXT_
CALL TRUE_MOVE7
JMP NEXT_
ES_:
CALL CHECKMOVE8
CMP BX,1
JNE NEXT_
CALL TRUE_MOVE8
NEXT_:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; END GAME
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CALL CHECK_END
LEA DI,TEMP_END
MOV CX,X_8_1
MOV DX,Y_8_1
MOV POS_NUM_X,CX
MOV POS_NUM_Y,DX
CALL CHECKMOVE1
MOV [DI],BX
MOV CX,X_8_2
MOV DX,Y_8_2
MOV POS_NUM_X,CX
MOV POS_NUM_Y,DX
CALL CHECKMOVE2
ADD [DI],BX
MOV CX,X_8_3
MOV DX,Y_8_3
MOV POS_NUM_X,CX
MOV POS_NUM_Y,DX
CALL CHECKMOVE3
ADD [DI],BX
MOV CX,X_8_4
MOV DX,Y_8_4
MOV POS_NUM_X,CX
MOV POS_NUM_Y,DX
CALL CHECKMOVE4
ADD [DI],BX
MOV CX,X_8_5
MOV DX,Y_8_5
MOV POS_NUM_X,CX
MOV POS_NUM_Y,DX
CALL CHECKMOVE5
ADD [DI],BX
MOV CX,X_8_6
MOV DX,Y_8_6
MOV POS_NUM_X,CX
MOV POS_NUM_Y,DX
CALL CHECKMOVE6
ADD [DI],BX
MOV CX,X_8_7
MOV DX,Y_8_7
MOV POS_NUM_X,CX
MOV POS_NUM_Y,DX
CALL CHECKMOVE7
ADD [DI],BX
MOV CX,X_8_8
MOV DX,Y_8_8
MOV POS_NUM_X,CX
MOV POS_NUM_Y,DX
CALL CHECKMOVE8
ADD [DI],BX
MOV CX,SCORE
LEA DI,SCORE_S
SUB DX,DX
MOV AX,CX
MOV BX,100
DIV BX
ADD AX,30H
MOV [DI],AX
MOV AX,DX
SUB DX,DX
MOV BX,10
DIV BX
ADD AX,30H
MOV [DI+1],AX
ADD DX,30H
MOV [DI+2],DX
PUSH AX
PUSH BX
PUSH DX
PUSH CX
LEA BX,SCORE_S
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
;;;;;;;;;;;;;;;;CHOOSE IMAGE :: MATCH TABLE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LEA SI,SC_ ; CHAGE IMG HERE
MOV CX,[BX+2]
SUB CX,30H ; SELECT IMG 1-9 FROM DATA IN FLAG_TABLE
SUB AH,AH
MOV AL,9
SUB CH,CH
MUL CL
ADD SI,AX ; ADD 7 FOR NEXT IMG
CALL LOADPALT
LEA SI,AREA
MOV DX,64
MOV SHIFT_DIGIT,DX
CALL DRAW_BIG_IMG_ ; ABOUT SI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LEA BX,SCORE_S
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
;;;;;;;;;;;;;;;;CHOOSE IMAGE :: MATCH TABLE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LEA SI,SC_ ; CHAGE IMG HERE
MOV CX,[BX+1]
SUB CX,30H ; SELECT IMG 1-9 FROM DATA IN FLAG_TABLE
SUB AH,AH
MOV AL,9
SUB CH,CH
MUL CL
ADD SI,AX ; ADD 7 FOR NEXT IMG
CALL LOADPALT
LEA SI,AREA
MOV DX,32
MOV SHIFT_DIGIT,DX
CALL DRAW_BIG_IMG_ ; ABOUT SI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LEA BX,SCORE_S
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
;;;;;;;;;;;;;;;;CHOOSE IMAGE :: MATCH TABLE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LEA SI,SC_ ; CHAGE IMG HERE
MOV CX,[BX]
SUB CX,30H ; SELECT IMG 1-9 FROM DATA IN FLAG_TABLE
SUB AH,AH
MOV AL,9
SUB CH,CH
MUL CL
ADD SI,AX ; ADD 7 FOR NEXT IMG
CALL LOADPALT
LEA SI,AREA
MOV DX,0
MOV SHIFT_DIGIT,DX
CALL DRAW_BIG_IMG_ ; ABOUT SI
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA DI,TEMP_END
MOV BX,[DI]
CMP BX,0
JE END_GAME
JMP AG
END_GAME:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASSUME DS:DATASG
MOV AX,DATASG
MOV DS,AX
LEA SI,END_Z
CALL LOADPALT
LEA SI,AREA
CALL DRAW_BIG_IMG_3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV AH,08H
INT 21H
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
EXIT:
MOV AH,4CH
INT 21H
MAIN ENDP
;###############################################################################
;###############################################################################
;###############################################################################
;###############################################################################
;###############################################################################
;###############################################################################
;###############################################################################
;###############################################################################
;###############################################################################
;###############################################################################
;------------------------------------------------------------------------------------------
LOADPALT PROC ; PRE: LEA SI,BMP NAME BEFORE CALL
PUSH AX
PUSH BX
PUSH CX
PUSH DX
;OPEN
MOV DX,SI ; EQUIVALENT LEA DX,IMGNAME
MOV AX,3D00H
INT 21H
MOV BX,AX ;FIX
MOV AX,IMAGESG ;PARAMETER
MOV DS,AX
;SET
MOV AX,3F00H
MOV CX,0FFFFH
LEA DX,AREA ;PARAMETER
INT 21H
MOV AH,3Eh
INT 21h
LEA SI,AREA ;PARAMETER
ADD SI,54
MOV CX,256
MOV DI,SI
LOOPSETZ:
MOV AH,[SI] ;B TO AH
INC SI
MOV AL,[SI] ;G TO AL
INC SI
MOV BL,[SI] ;B TO BL
INC SI
SHR AH,2 ; DIV 4
SHR AL,2
SHR BL,2
MOV [DI],BL ; BACK TO R
INC DI
MOV [DI],AL ; BACK TO G
INC DI
MOV [DI],AH ; BACK TO B
INC DI
INC SI
LOOP LOOPSETZ
MOV AX,IMAGESG ;PARAMETER
MOV ES,AX
MOV AX,1012H
SUB BX,BX
MOV CX,256
MOV DX,54
INT 10H
POP DX
POP CX
POP BX
POP AX
RET
LOADPALT ENDP
;------------------------------------------------------------------------------------------
POS_IMG_DRAW PROC ; PRE: LEA SI,BMP NAME BEFORE CALL
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI ; And here write pixel data to video memory
;;;;;;;;LEA;;;;;SI,AREA;;;;;;
ADD SI,54 ; Jump over Header data 54 byte
ADD SI,4*256 ; 4 byte with 256 color ; We'll find Palatte data, Jump over them ,too.
MOV AX,0A000h
MOV ES,AX
MOV DI,64000
;-----------SET X , Y POSITION------------
SUB AH,AH
MOV AX,8
MOV CX,POS_NUM_Y ; COL N-1 (0-24)
LOOPMULL:
ADD DI,AX ; ADD FOR SHIFT IMG ON HORIZONTAL
LOOP LOOPMULL
SUB AX,AX
MOV AX,8*320
SUB DI,0F000H ; Fix upside-down Image by start DI at last row of pixel
SUB DI,320
MOV CX,POS_NUM_X
LOOPMUL:
ADD DI,AX ; ROW N (0-24)
LOOP LOOPMUL ; DI = 8*320*POS_NUM_X
;----------WRITE EACH IMG-----------------
MOV BX,8 ; Number of row to draw
; Following Loop were Fixed to Correct Upside-down image
A_ONE_IMG:
MOV CX,8 ; Write pixel to screen in full image
ONE_IMG:
MOV AH,DS:[SI]
MOV ES:[DI],AH
INC SI
INC DI
LOOP ONE_IMG
SUB DI,328 ; Rewind back to previous row of pixel
DEC BX
JNZ A_ONE_IMG
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;ASSUME DS:DATASG
;MOV AX,DATASG
;MOV DS,AX
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
POP DI
POP DX
POP CX
POP BX
POP AX
RET
POS_IMG_DRAW ENDP
;----------------------------------------------------------------------------------------------
; DRAW ABOUT INTERFACE SCORE
;----------------------------------------------------------------------------------------------
DRAW_BIG_IMG_ PROC ; PRE: LEA SI,BMP NAME BEFORE CALL
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
;;;;;;;;LEA;;;;;SI,AREA;;;;;;
; And here write pixel data to video memory
ADD SI,54 ; Jump over Header data 54 byte
; We'll find Palatte data, Jump over them ,too.
ADD Si,4*256 ; 4 byte with 256 color
MOV AX,0A000h
MOV ES,AX
MOV Di,64000
SUB DI,2664 ; Fix upside-down Image by start DI at last row of pixel
MOV BX,SHIFT_DIGIT
ADD DI,BX
MOV BX,40 ; Number of row to draw
; Following Loop were Fixed to Correct Upside-down image
newrow:
MOV CX,24 ; Write pixel to screen in full image
loopwrite:
MOV ah,DS:[SI]
MOV ES:[DI],ah
INC SI
INC DI
loop loopwrite
SUB DI,344 ; Rewind back to previous row of pixel
DEC BX
JNZ newrow
POP DI
POP DX
POP CX
POP BX
POP AX
RET
DRAW_BIG_IMG_ ENDP
;---------------------------------------
;----------------------------------------------------------------------------------------------
; DRAW ABOUT INTERFACE SCORE
;----------------------------------------------------------------------------------------------
DRAW_BIG_IMG_2 PROC ; PRE: LEA SI,BMP NAME BEFORE CALL
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
;;;;;;;;LEA;;;;;SI,AREA;;;;;;
; And here write pixel data to video memory
ADD SI,54 ; Jump over Header data 54 byte
; We'll find Palatte data, Jump over them ,too.
ADD Si,4*256 ; 4 byte with 256 color
MOV AX,0A000h
MOV ES,AX
MOV DI,64000
SUB DI,17070 ; Fix upside-down Image by start DI at last row of pixel
MOV BX,35 ; Number of row to draw
; Following Loop were Fixed to Correct Upside-down image
newrow2:
MOV CX,108 ; Write pixel to screen in full image
loopwrite2:
MOV ah,DS:[SI]
MOV ES:[DI],ah
INC SI
INC DI
loop loopwrite2
SUB DI,428 ; Rewind back to previous row of pixel
DEC BX
JNZ newrow2
POP DI
POP DX
POP CX
POP BX
POP AX
RET
DRAW_BIG_IMG_2 ENDP
;---------------------------------------
;----------------------------------------------------------------------------------------------
; DRAW ABOUT INTERFACE SCORE
;----------------------------------------------------------------------------------------------
DRAW_BIG_IMG_3 PROC ; PRE: LEA SI,BMP NAME BEFORE CALL
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
;;;;;;;;LEA;;;;;SI,AREA;;;;;;
; And here write pixel data to video memory
ADD SI,54 ; Jump over Header data 54 byte
; We'll find Palatte data, Jump over them ,too.
ADD Si,4*256 ; 4 byte with 256 color
MOV AX,0A000h
MOV ES,AX
MOV DI,64000
SUB DI,17072 ; Fix upside-down Image by start DI at last row of pixel
MOV BX,50 ; Number of row to draw
; Following Loop were Fixed to Correct Upside-down image
newrow3:
MOV CX,108 ; Write pixel to screen in full image
loopwrite3:
MOV ah,DS:[SI]
MOV ES:[DI],ah
INC SI
INC DI
loop loopwrite3
SUB DI,428 ; Rewind back to previous row of pixel
DEC BX
JNZ newrow3
POP DI
POP DX
POP CX
POP BX
POP AX
RET
DRAW_BIG_IMG_3 ENDP
;---------------------------------------
;----------------------------------------------------------------------------------------------
; DRAW ABOUT INTERFACE SCORE
;----------------------------------------------------------------------------------------------
DRAW_BIG_IMG_4 PROC ; PRE: LEA SI,BMP NAME BEFORE CALL
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
;;;;;;;;LEA;;;;;SI,AREA;;;;;;
; And here write pixel data to video memory
ADD SI,54 ; Jump over Header data 54 byte
; We'll find Palatte data, Jump over them ,too.
ADD Si,4*256 ; 4 byte with 256 color
MOV AX,0A000h
MOV ES,AX
MOV DI,64000
SUB DI,43628 ; Fix upside-down Image by start DI at last row of pixel