forked from historicalsource/smashtv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MINE.ASM
244 lines (229 loc) · 4.25 KB
/
MINE.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
.TITLE "MINE.ASM"
.WIDTH 132
.OPTION B,D,L,T
.MNOLIST
;
; INITIATED: APRIL 13,1989
; MODIFIED: !
; SOFTWARE: MARK TURMELL
;
; COPYRIGHT (C) 1989 WILLIAMS ELECTRONICS GAMES, INC.
;
;
; GET THE SYSTEM STUFF
.INCLUDE "MPROC.EQU" ;MPROC EQUATES
.INCLUDE "DISP.EQU" ;DISPLAY PROC. EQUATES
.include "sys.inc" ;z unit system equates
.include "macros.hdr" ;macros definitions
.INCLUDE "IMGTBL.GLO"
.INCLUDE "ROBO.EQU"
;
;SYMBOLS EXTERNALLY DEFINED
;
.REF BEGINOBJ2,WAVEYX,GAMSTATE,DELPAL,MIN_LIT,WAVE
.REF GET_VALID_XY,GET_WVADDR,FRANIM,RANGRAND
.REF OBJON,OBJOFF,HALT,CIRCUIT,STATUS2,MCON
;
;SYMBOLS DEFINED IN THIS FILE
;
.DEF O_MINE,EXPMINE,O_ITEMS,O_ITEMS2
;
;UNINITIALIZED RAM DEFINITIONS
;
.BSS TMP,8
;
;EQUATES FIRST ORIGINATED IN THIS FILE
;
.TEXT
EXPMINE:
MOVE A10,A8
; MOVI CLSNEUT|TYPNEUT,A0
; MOVE A0,*A8(OID),W
MOVE *A8(OYPOS),A0
ADDI 033H,A0
MOVE A0,*A8(OYPOS)
MOVI 100,A0
MOVE A0,*A8(OZPOS)
MOVI BOOM3,A9
MOVK 1,A1
JSRP FRANIM
MOVE A8,A0
; CALLA DELPAL ;NEEDED? NOT IF IN PLYR PAL!
CALLA DELOBJ
DIE
BOOM3:
.LONG EXPb1
.WORD NEWPALET|4
.LONG BULLET
.LONG EXPb2
.WORD 4
.LONG EXPb3
.WORD 5
.LONG EXPb4
.WORD 5
.LONG EXPb5
.WORD 5
.LONG EXPb6
.WORD 5
.LONG EXPb7
.WORD 6
.LONG EXPb8
.WORD 6
.LONG EXPb9
.WORD 6
.LONG 0
O_ITEMS:
;A2=# OF CASH ITEMS TO CREATE ON SCREEN
CREATE 0,SENDR
CREATE 0,SENDR2
RETS
O_ITEMS2:
;A2=# OF CASH ITEMS TO CREATE ON SCREEN
CREATE 0,SENDR3
CREATE 0,SENDR3
RETS
SENDR2 SLEEP 1
SENDR SLEEP 01B0H+90
SENDR3 MOVI 028H,A9 ;28
MOVI 023H,B0
MOVI 0D8H,B1
CALLA RANGRAND
MOVE A0,A10 ;A10=UPLFT X OF AREA
MOVI 02DH,B0
MOVI 0A4H,B1
CALLA RANGRAND
MOVE A0,A11 ;A11=UPLFT Y OF AREA
OH2 ;CREATE A BUNCH OF THEM
CREATE CSHPID,ANITEM
SLEEP 1
DSJNE A9,OH2
DIE
O_MINE:
;A2=# OF MINES TO CREATE ON SCREEN
CREATE MCYCPID,MIN_LIT
; MOVE @STATUS2,A0
; CMPI 3,A0
; JRZ OH1
; CMPI 7,A2 ;EASIER FOR PLAYER 1
; JRC OH1
; SUBK 3,A2
OH1 PUSH A2 ;CREATE A BUNCH OF THEM
CREATE MNPID,AMINE
PULL A2
DSJNE A2,OH1
RETS
AMINE:
;AMINE IS CALLED AT THE START OF A WAVE TO PLACE X # OF HULKS ON SCREEN
;AT THE BEGINNING OF A WAVE
MOVI MINE,A2
CALLA GET_WVADDR
MOVE *A0(16),A1,W ;DEC WAVE RAM CNT FOR THIS MINE
DEC A1
MOVE A1,*A0(16),W
MOVI MINE,A11
CALLA GET_VALID_XY ;MAKE SURE NEW BUST IS NOT
;OVERLAPPING ANY EXISTING SHAPE
;WHICH IS ALREADY ON SCRN AT START
;A0 & A1 ARE SET UP
;ADD IN OFFSETS FOR THIS PARTICULAR ARENA
MOVE @GAMSTATE,A2
CMPI INAMODE,A2
JREQ DMD
MOVE @WAVEYX,A2,L
;A2=PACKED OFFSETS
MOVX A2,A3
SLL 16,A3
ADD A3,A0 ;ADJUSTED A0 XVAL!
ANDI 0FFFF0000H,A2
ADD A2,A1 ;ADJUSTED A1 YVAL!
DMD CALLR IH1 ;INIT HULK (BEGIN_OBJ)
CALLA BEGINOBJ2
DIE
IH1:
MOVI m1,A2 ;DOES NOT MATTER
MOVE @WAVE,A3
CMPI 4,A3
JRLT IH1A
MOVI M2,A2 ;DOES NOT MATTER
IH1A MOVI 69,A3
MOVI DMAWNZ,A4 ;NON-ZERO VALUE
MOVI CLSNEUT|TYPMINE,A5
CLR A6
CLR A7
RETS
ANITEM:
;AMINE IS CALLED AT THE START OF A WAVE TO PLACE X # OF HULKS ON SCREEN
;AT THE BEGINNING OF A WAVE
MOVI 0,B0
MOVI 04CH,B1
CALLA RANGRAND
ADD A11,A0
MOVE A0,A1
MOVI 0,B0
MOVI 074H,B1
CALLA RANGRAND
ADD A10,A0
SLL 16,A0
SLL 16,A1
;A0=X,A1=Y
;A0 & A1 ARE SET UP
;ADD IN OFFSETS FOR THIS PARTICULAR ARENA
MOVE @GAMSTATE,A2
CMPI INAMODE,A2
JREQ ADMD
MOVE @WAVEYX,A2,L
;A2=PACKED OFFSETS
MOVX A2,A3
SLL 16,A3
ADD A3,A0 ;ADJUSTED A0 XVAL!
ANDI 0FFFF0000H,A2
ADD A2,A1 ;ADJUSTED A1 YVAL!
ADMD CALLR IH2 ;INIT HULK (BEGIN_OBJ)
CALLA BEGINOBJ2
WAIT
MOVI 4*60-30,A0
SUB A9,A0
CALLA PRCSLP
;BLINK
;A8=ICON IMAGE PTR
MOVE @HALT,A0
JRNZ WAIT
MOVK 7,A10
;ABOUT 1 SECOND OF BLINK
BK
MOVE A8,A0
CALLA OBJOFF
SLEEP 5
MOVE A8,A0
CALLA OBJON
SLEEP 5
DSJS A10,BK
SLEEP 30
MOVE A8,A0
CALLA DELOBJ ;ICONS NOW GONE FOREVER!
DIE
IH2:
MOVE @CIRCUIT,A2
CMPI 2,A2
JRNZ IHJ
MOVE @MCON,A4
JRNZ IHJ
MOVK 4,A2
JRUC IHJJ
IHJ
MOVB @TMP,A2
INC A2
MOVB A2,@TMP
ANDI 03H,A2
IHJJ SLL 5,A2
ADDI GTBL,A2
MOVE *A2,A2,L
MOVI 99,A3 ;69
MOVI DMAWNZ,A4 ;NON-ZERO VALUE
MOVI CLSNEUT|TYPICON|SUBCSHI,A5
CLR A6
CLR A7
RETS
GTBL .LONG PRZ1,PRZ2,PRZ3,PRZ1,KEY
.END