-
Notifications
You must be signed in to change notification settings - Fork 2
/
MESSEQU1.ASM
250 lines (227 loc) · 10.1 KB
/
MESSEQU1.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
;************************** THESE EQUATES BELOW ARE GAME SPECIFIC *************
;***********************************BUT ONLY THESE!!!!!************************
;*
;* For SINISTAR 10-20-82
;*
;* Check to see if debugging debug<>0 is rom version
;*
;*TSTORG EQU $E000 ;Your temporary area for the $F000 test rom (4k block)
TSTORG EQU $F000 ;The rom area for the $F000 test rom (4k block)
;*
;*TSBORG EQU $3000 ;Location of the AUDITING and CMOS handling routines,
;* ;(~4K bytes -works with TSTORG block above).
MESS1 EQU $E200 ;Address of Message and character routines.
MESS2 EQU $8EA0 ;Address of Message and character data.
RAMALS EQU $BF01 ;Ram area for all modules -must be sacred (49 BYTES)
;*
;* * * * * * * * * * * END OF CHANGABLE EQUATES * * * * * * * * * * * * * * *
; NLIST
INCLUDE "../SAM/MESSEQU.ASM" ;Character and text equates file
; LIST
;* All equates and labels from this point forth CAN NOT BE CHANGED!!!
LOWRAM EQU $9C00
DMAFIX EQU $0404 ;NON-INVERTED DMA'S 404 INVERTED DMA'S
RAM EQU RAMALS
HSTK EQU $BF00 ;Stack for DCON
CRAM EQU $C000 ;Color ram
WDOG EQU $CBFF ;Where Bowser lives
WDATA EQU $39 ;and to what to feed him
CMOS EQU $CC00 ;Cmos memory
;*NIBPL1 EQU $55 ;H.S.T.D. HIGHLIGHT NIBBLE FOR PLAYER 1
;*NIBPL2 EQU $77 ;H.S.T.D. HIGHLIGHT NIBBLE FOR PLAYER 2
VERTCT EQU $CB00 ;6-bit beam vertical position
RWCNTL EQU $C900 ;(BIT 0: 1-ROM READ; 0-RAM READ)
;* ;(BIT 1: 1-INVERT; 0-NORMAL SCREEN)
;*
;* PIA DEFINITIONS -per SINISTAR
;*
PIA0 EQU $C80C ;A. SIDE OF THE COIN DOOR PIA
;* B0 AUTO UP
;* B1 ADVANCE
;* B2 RCOIN
;* B3 HSRESET
;* B4 LCOIN
;* B5 CCOIN
;* B6 SLAM
;* B7 SOUND HANDSHAKE
;* CA2 LED3
;* CA1 IRQ 240 (16 MS) (LINE 240)
PIA1 EQU $C80E ;B. SIDE OF THE COIN DOOR PIA
;*B0-B5 SOUND
;*B6-B7 LED 0,1
;*CB1 IRQ 4 MS (0,$40,$80,$C0)
;*CB2 LED2
PIA2 EQU $C804 ;A. SIDE OF THE WIDGET
;*B0 PLAYER 1,2 UP-DOWN SWITCH A
;*B1 PLAYER 1,2 UP-DOWN SWITCH B
;*B2 PLAYER 1,2 UP-DOWN SWITCH C
;*B3 PLAYER 1,2 UP-DOWN DIRECTION
;*B4 PLAYER 1,2 LEFT-RIGHT SWITCH A
;*B5 PLAYER 1,2 LEFT-RIGHT SWITCH B
;*B6 PLAYER 1,2 LEFT-RIGHT SWITCH C
;*B7 PLAYER 1,2 LEFT-RIGHT DIRECTION
;*
PIA3 EQU $C806 ;B. SIDE OF THE WIDGET
;*B0 PLAYER 1,2 FIRE
;*B1 PLAYER 1,2 SINI-BOMB
;*
;*B4 1 PLAYER START
;*B5 2 PLAYER START
;*CB2 OUTPUT SWITCH MUX CONTROL 1=PLAYER1,0=PLAYER2
;*
;* 'ENTER' - ENTER CHARACTERS....ALL OFFSETS ARE FROM REG Y.
;* INDEXING OFFSET EQUATES
.NUMLET EQU 0 ;NUMBER OF LETTERS TO GET
.CURLET EQU 1 ;CURRENT LETTER POINTER INTO BUFFER
.STCHR EQU 2 ;THE FIRST CHARACTER OF THE CHARACTER SET
.NDCHR EQU 3 ;THE LAST CHARACTER OF THE CHARACTER SET
.SIDE EQU 4 ;THE CONTROL BYTE FOR THE WIDGET (UP=$3C , CT=$34)
.COLOR EQU 5 ;THE COLOR TO WRITE THE SCREEN ECHO IN
.WAKUP EQU 6 ;THE WAKE UP ADDRESS OF THE SLEEP (BECAUSE OF DUAL USE)
.XSAVE EQU 8 ;THE STARTING POSITION OF THE LINE TO BE INPUTED
.CURPOS EQU 10 ;THE CURRENT CALCULATED CURSOR POSITION
.RETURN EQU 12 ;RETURN ADDRESS
.DEBONC EQU 14 ;THE CURRENT DEBOUNCE TIME ON THE ENTER SWITCH
.CARAC EQU 15 ;THE START OF THE CHARACTER BUFFER
;*
;* CMOS RAM ALLOCATION
;*
PUSHMORG CMOS+$100 ;WRITABLE CMOS
CREDST RMB 2 ;CREDITS BACKUP
SLOT1 RMB 6 ;LEFT COIN TOTAL
RMB 6 ;CENTER COIN TOTAL
RMB 6 ;RIGHT COIN TOTAL
RMB 6 ;TOTAL PAID CREDITS
RMB 6 ;TOTAL REPLAYS
RMB 6 ;FLIGHT TIME IN MINS
RMB 6 ;TOTAL SHIPS PLAYED
ENDBOK RMB 6 ;TOTAL GAMES PLAYED
SCRSIZ EQU 14 ;NUMBER OF NIBBLES IN A SCORE ENTRY
CMSCOR RMB 40*SCRSIZ ;40 BACKED UP SCORES, 39 OF WHICH ARE VISIBLE
TODAYS RMB 6*SCRSIZ ;TODAYS GREATEST
PULLORG TODEND
PUSHMORG CMOS ;ADEQUATE BIRTH CONTROL PROTECTION
REPLAY RMB 2 ;REPLAY LEVEL
REPADD RMB 2 ;REPLAY ADDITIONAL EXTRA SHIP POINT FACTOR
NSHIP RMB 2 ;# OF SHIPS/GAME
GA1 RMB 2 ;GAME DIFFICULTY CONTROL
CONTFI RMB 2 ;CONTINUOUS FIRE
ALHSTD RMB 2 ;ALLOW HIGH SCORES
COINSL RMB 2 ;FOR COINAGE SELECT MODE
SLOT1M RMB 2 ;LEFT COIN MULT
SLOT2M RMB 2 ;CENTER COIN MULT
SLOT3M RMB 2 ;RIGHT COIN MULT
CUNITC RMB 2 ;COIN UNITS PER CREDIT
CUNITB RMB 2 ;COIN UNITS FOR BONUS
MINUNT RMB 2 ;MINIMUM REQD
SPECFN RMB 2 ;RESTORE FACTORY SETTINGS
RMB 2 ;CLEAR AUDIT TOTALS
RMB 2 ;INITIALIZE HIGH SCORE TABLE
RMB 2 ;INTIATE AUTO CYCLE
RMB 2 ;ENTER ATTRACT MODE MESSAGE
ENDADJ EQU *
OPL1 RMB 2
OPL2 RMB 2
ADJSUM RMB 2
OMESUM RMB 2
PULLORG
;* RAM NECESSARY FOR ALL PACKAGE ROUTINES
PUSHMORG RAMALS
ASAVE RMB 1 ;A SAVE LOCATION
XSAVE RMB 2 ;(2 BYTES) TO SAVE X (DURING ROUTINE EXECUTION)
FONT RMB 2 ;(2 BYTES) TO SAVE THE SELECTED FONT TABLE 3X5 OR 5X7
XTEMP RMB 2
FDTEST RMB 1
INDIAG RMB 1 ;NON ZERO INDICATES IN DIAGNOSTICS
FSEED RMB 1 ;-------|
FHSEED RMB 1 ;-------|-- RAM FOR RANDOM NUMBER GENERATOR
FLSEED RMB 1 ;-------|
BCDR RMB 3 ;BCD DIVIDES REMAINDER (BCDN FOLLOWS)
BCDN RMB 3 ;BCD DIVIDES NUMERATOR
;* ;BCD DIVIDES RESULT
BCDD RMB 3 ;BCD DIVIDES DENOMINATOR
BCDCNT RMB 1 ;BCD DIVIDES NUMBER OF DIGITS LEFT
BCDTMP RMB 3 ;BCD DIVIDES TEMPORARY AREA FOR SUBTRACTION
COLR RMB 1 ;COLOR STORE AREA FOR OUTCMOS
;* COIN SWITCH CREDIT RAM
CREDIT RMB 1 ;CURRENT NUMBER OF CREDITS TO AWARD
CUNITS RMB 1 ;CURRENT NUMBER OF CREDIT UNITS
BUNITS RMB 1 ;CURRENT NUMBER OF BONUS UNITS
FLAG RMB 1 ;FLAG FOR ERASING TEXT (NON-ZERO IS TO ERASE)
;* RAM USED IN SWITCH TEST AND REUSED IN THE TESTS MULTIPLE TIMES
;* THIS IS DISPENSIBABLE BECAUSE IT IS USED ONLY WHEN SELF TEST
;* AND BY THAT TIME YOUR SYSTEM HAS RELAESED TOTAL CONTROL
;* SUCH THAT IF YOU DID USE IT, IT WON'T MATTER ANYMORE
SW0ST RMB 1
SW0SCN RMB 1
SW2ST RMB 1
SW2SCN RMB 1
SW3ST RMB 1
SW3SCN RMB 1
SW2STI RMB 1
SW2SCI RMB 1
SW3STI RMB 1
SW3SCI RMB 1
PULLORG
;* VECTOR EQUATES INTO THE DIFFERENT PARTS
PUSHMORG TSTORG ;THE $F000 BLOCK
POWRUP RMB 3 ;POWER UP TESTING (ROM AND RAM)
ADVANC RMB 3 ;ENTRY POINT FOR WHEN THE ADVANCE SWITCH IS PRESSED
;* ;WHEN YOU JUMP HERE YOU HAVE RELEASED TOTAL CONTROL
;* ;AND ON COMPLETION YOUR SYSTEM WILL BE RESTARTED
;* MY INTERNAL VECTORS
AUTOCY RMB 3 ;AUTO CYCLE TESTING (ROM, RAM, AND COLOR RAM)
NAPV RMB 3 ;NAP TIMER (~16ms) A. CONTAINS THE NAP TIME
RANDV RMB 3 ;DEFENDER STYLE RANDOM NUMBER GENERATOR (CAN BE USED)
PULLORG
;* PUSHORG TSBORG THE AUDITING AND CMOS BLOCK
;*
;* MOST OF THESE ARE INTERNAL VECTORS
;*
;*CKCMSV RMB 3 ;THE POWER UP TESTING OF CMOS CHECKSUMS
;*OPTSTV RMB 3 ;CHECK THE OPERATOR MESSAGE
;*CMSMOV RMB 3 ;CMOS MOVE ROUTINE
;*ADVSCV RMB 3 ;OTHER HALF OF ADJUSTMENTS
;*CKHSV RMB 3 ;CHECK HIGH SCORES (POWER UP)
;*RSHSV RMB 3 ;RESET HIGH SCORES
;*CHKHSV RMB 3 ;CHECK HIGH SCORES AFTER FAC SET RESTORE
;*RESHSB RMB 3 ;HIGH SCORE RESET BUTTON
;*AUDIT RMB 3 ;ADD THE VALUE IN B TO THE AUDIT COUNTER IN A
;*AUDIT1 RMB 3 ;INCREMENT THE AUDIT COUNTER IN B BY 1
;*SCCLR RMB 3 ;DMA SCREEN CLEAR
;*RCMSA RMB 3 ;READ CMOS INTO A
;*RCMSB RMB 3 ;READ COMS INTO B
;*RCMSD RMB 3 ;READ CMOS INTO D
;*WCMSA RMB 3 ;WRITE TO CMOS FROM A
;*WCMSB RMB 3 ;WRITE TO CMOS FROM B
;*WCMSD RMB 3 ;WRITE TO CMOS FROM D
;*HIGH RMB 3 ;HIGH SCORE OUTPUT PAGE ROUTINE
;*ACREDV RMB 3 ;ADD A CREDIT TO THE CURRENT NUMBER OF CREDITS
;*COINLV RMB 3 ;LEFT COIN SWITCH
;*COINCV RMB 3 ;CENTER COIN SWITCH
;*COINRV RMB 3 ;RIGHT COIN SWITCH
;*DIVABV RMB 3 ;DIVIDE A BY B
;*BCDHX RMB 3 ;CONVERT BCD TO HEX
;*HXBCD RMB 3 ;CONVERT HEX TO BCD
;*ENTRY RMB 3 ;GENERAL CHARACTER ENTERING ROUTINE
;*OPWRT RMB 3 ;OPERATOR MESSAGE OUTPUT ROUTINE
;*GAMEND RMB 3 ;GAME OVER H.S.T.D. CHECK AND ENTER ROUTINE
;*VAPIA2 RMB 3 ;READ PIA2 INTO REG.A (CONVERT TO LEFT-RIGHT, UP-DOWN)
;* PULLORG
;* MESSAGE CALL VECTORS
PUSHMORG MESS1 ;MESSAGE OUTPUT ROUTINES AND CHARACTER TABLES
OUTCHR RMB 3 ;5X7 CHARACTER OUTPUT ROUTINE
OUTP68 RMB 0 ;6X8 PHRASE OUTPUT ROUTINE FOR SINISTAR
OUTPHR RMB 3 ;5X7 PHRASE OUTPUT ROUTINE (NOT REALLY)
OUTBCD RMB 3 ;5X7 BCD OUTPUT ROUTINE
OUTC35 RMB 3 ;3X5 CHARACTER OUTPUT ROUTINE
OUTP35 RMB 3 ;3X5 PHRASE OUTPUT ROUTINE
OUTB35 RMB 3 ;3X5 BCD OUTPUT ROUTINE
TEXT68 RMB 3 ;5X7 TEXT OUTPUT ROUTINE
TEXT35 RMB 3 ;3X5 TEXT OUTPUT ROUTINE
FONT5 RMB 2 ;THE ADDRESS OF THE 5X7 FONT TABLE (ie LDX FONT57)
ETEXT RMB 3 ;5X7 TEXT ERASE ROUTINE
ETEXT35 RMB 3 ;3X5 TEXT ERASE ROUTINE
FONT3 RMB 2 ;THE ADDRESS OF THE 3X5 FONT TABLE (ie LDX FONT35)
EXPFONT RMB 3 ;FONT EXPANDER ROUTINE
PULLORG