-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBANK_GENERIC@1#3.asm
165 lines (106 loc) · 3.98 KB
/
BANK_GENERIC@1#3.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
SLOT 1
NEWBANK GENERIC_BANK_2
;---------------------------------------------------------------------------------------------------
DEF aiWriteStartPieceBlank
SUBROUTINE
REFER AiStateMachine
VEND aiWriteStartPieceBlank
; Flash the piece in-place preparatory to moving it.
; drawDelay = flash speed
; drawCount = # of flashes
lda originX12
sta cursorX12
lda #%100
sta CTRLPF
lda #2
sta COLUP0
lda drawDelay
beq deCount
dec drawDelay
rts
deCount
lda drawCount
beq flashDone
dec drawCount
lda #READY_TO_MOVE_FLASH
sta drawDelay ; "getting ready to move" flash
lda fromX12
sta squareToDraw
jsr CopySinglePiece;@0 ; EOR-draw = flash
rts
flashDone
PHASE AI_MarchToTargetA
rts
;---------------------------------------------------------------------------------------------------
DEF aiDrawPart2
SUBROUTINE
REFER AiStateMachine
VEND aiDrawPart2
jsr CopySinglePiece;@0
DEF aiDrawPart3
SUBROUTINE
dec squareToDraw
lda squareToDraw
cmp #22
bcc .comp
PHASE AI_DrawEntireBoard
rts
.comp
lda #-1
sta toX12 ; becomes startup flash square
lda #36 ; becomes cursor position
sta originX12
PHASE AI_GenerateMoves
rts
;---------------------------------------------------------------------------------------------------
DEF aiMarchB
SUBROUTINE
REFER AiStateMachine
VEND aiMarchB
; Draw the piece in the new square
lda fromX12
sta squareToDraw
jsr CopySinglePiece;@0 ; draw the moving piece into the new square
lda #6 ; snail trail delay
sta drawDelay
PHASE AI_MarchToTargetB
rts
;---------------------------------------------------------------------------------------------------
DEF aiFinalFlash
SUBROUTINE
REFER AiStateMachine
VEND aiFinalFlash
lda drawDelay
beq .deCount
dec drawDelay
rts
.deCount lda drawCount
beq .flashDone2
dec drawCount
lda #10
sta drawDelay ; "getting ready to move" flash
lda fromX12
sta squareToDraw
jsr CopySinglePiece;@0
rts
.flashDone2
lda #100
sta aiFlashDelay
PHASE AI_SpecialMoveFixup
rts
;---------------------------------------------------------------------------------------------------
DEF aiDraw
SUBROUTINE
lda #$C0
sta COLUBK
rts
;---------------------------------------------------------------------------------------------------
DEF aiCheckMate
SUBROUTINE
lda #$44
sta COLUBK
rts
;---------------------------------------------------------------------------------------------------
CHECK_BANK_SIZE "BANK_GENERIC2"
;---------------------------------------------------------------------------------------------------
;EOF