-
Notifications
You must be signed in to change notification settings - Fork 2
/
Macro.inc
65 lines (55 loc) · 1.43 KB
/
Macro.inc
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
LoadImage MACRO name, size, array
LEA DX, name
CALL OpenFile
mov Cx, size * size
LEA DX, array
CALL ReadData
call CloseFile
ENDM LoadImage
DrawP MACRO Dataarray , x, y ; draws 1 chess piece
LEA BX , Dataarray ; BL contains index at the current drawn pixel
MOV ch,x
MOV cl,y
call far ptr DrawPiece
ENDM
ReDrawSq MACRO x, y ; draws 1 chess piece
MOV ch,x
MOV cl,y
call RedrawBoardSq
ENDM
DrawSq MACRO x, y ; draws 1 square of solid color at specified coordinates
; x & y are row and column. not in terms of px
mov bl,x
mov al,y
mov dl, CursorColor;68h;3h
call DrawSquare
ENDM
DrawSq2 MACRO x, y ; draws 1 square of solid color at specified coordinates
; x & y are row and column. not in terms of px
mov bl,x
mov al,y
mov dl, 2Ah ;8Ah
call DrawSquare
ENDM
DeselectPlayer1 MACRO
;===============
;General deselects piece in hx:hy
mov ch, hx
mov cl, hy
call RedrawBoardSq
call RedrawPiece
mov hx,0
mov hy,0
;===============
ENDM
DeselectPlayer2 MACRO params
;===============
;General deselects piece in hx:hy
mov ch, hx2
mov cl, hy2
call RedrawBoardSq
call RedrawPiece
mov hx2,0
mov hy2,0
;===============
ENDM