forked from historicalsource/smashtv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SYS.BAK
186 lines (153 loc) · 4.78 KB
/
SYS.BAK
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
**************************************************************************
*
* THE Z-UNIT SYSTEM SPECIFIC EQUATES
*
**************************************************************************
;YUNIT EQU 0 ;NOT A YUNIT
YUNIT EQU 1 ;ITS YUNIT TIME...GO FOR IT DUDES!!!!
;DEBUG EQU 1 ;THIS VERSION IS CURRENTLY UNDER CONSTRUCTION
DEBUG EQU 0 ;ADD THIS BEFORE RELEASE!!!!!
*PIXBLT STUFF
PXSIZE .SET 8
SCRN_PTCH .SET 512*PXSIZE
STACK_ST .SET 0FFFC0000H
OFFSETVAL .SET 0
PLANEMSK .SET 0
INI_CTRL .SET 0
*SYSTEM Z MEMORY MAP
SCRATCH .SET 01000000H ;START OF SCRATCH
STCKST .SET 010FFFF0H ;TOP OF STACK
CMOS .SET 01400000H ;START OF CMOS RAM
SCREEN .SET 00H ;START OF SCREEN MEMORY
SCRNE .SET 0200000H ;END OF SCREEN+1
.IF YUNIT
COLRAM .SET 01810000H ;COLOR RAM B0-B4 BLU, B5-B9 GRN, B10-B14 RED
.ELSE
COLRAM .SET 01800000H ;COLOR RAM B0-B4 BLU, B5-B9 GRN, B10-B14 RED
.ENDIF
CYCOLORS .SET COLRAM+3E0H ;COLORS 62 AND 63 (LAST TWO IN PAL!)
ROM .SET 0FFC00000H ;PROGRAM ROM
IROM .SET 02000000H ;IMAGE ROM
CMAPSEL .SET 01A80080H ;COLOR MAP SELECT (0-15)
SWITCH .SET 01C00000H ;I/O WIDGET BOARD
COINS .SET 01C00010H
SOUND .SET 01E00000H ;SOUND I/O (B0-B7 = SOUND#)
; B8 = MUSIC STROBE (0 EN)
; B9 = SOUND STROBE (0 EN)
; B10= RESET (0 EN)
SYSCTRL .SET 01F00000H ;SYSTEM CONTROL LATCH
;BIT 0 - FG SCROLL 0
;BIT 1 - FG SCROLL 1
;BIT 2 - ALWAYS 1
;BIT 3 - ALWAYS 1
;BIT 4 - AUTO-ERASE ENABLE(0)
;BIT 5 - OBJECT PALETTE ENABLE(0)
;BIT 6 - ALWAYS 1
;BIT 7 - ALWAYS 1
;BITS 8 - 15 7 SEG. (DP,G - A)
*SYSTEM STUFF
AUTOERAS .EQU 10H
OBJPALET .EQU 20H
SYSCINIT .EQU 0FFFCH ;INITIAL SYSCTRL VALUE
*SEVEN SEGMENT DISPLAY
SEG70 .EQU 0300H
SEG71 .EQU 9F00H
SEG72 .EQU 2500H
SEG73 .EQU 0D00H
SEG74 .EQU 9900H
SEG75 .EQU 4900H
SEG76 .EQU 4100H
SEG77 .EQU 1F00H
SEG78 .EQU 0100H
SEG79 .EQU 1900H
*DISPLAY INTERRUPT LINE FOR END OF SCORE AREA
SCOREINT .EQU 2+1BH ;END OF SCORE AREA INTERRUPT
ERASEINT .EQU 240+1BH ;SPECIAL INTERRUPT FOR AUTOEOFF
ERASECOL .EQU 03D3DH ;GAME AUTO ERASE COLOR #
ERASELOC .EQU COLRAM+3D0H ;GAME AUTO ERASE COLOR LOCATION
*DMA STUFF
DMAREGS .EQU 01A800A0H ;BOTTOM OF DMA REGISTERS FOR MMTM
DMACTRL .EQU 01A80000H ;DMA CONTROL REGISTER
;BIT 15:
;1=START DMA (WRITE)
;0=STOP DMA (WRITE)
;1=DMA BUSY (READ)
;0=DMA IDLE (READ)
DMAGO .EQU DMACTRL ;FOR SYSCHECK
DMAOFFST .EQU 01A80010H ;DMA OFFSET REGISTER
DMASAGL .EQU 01A80020H ;DMA DATA STARTING ADDRESS LOW 16 BITS
DMASAGH .EQU 01A80030H ;DMA DATA STARTING ADDRESS HIGH 16 BITS
DMAHORIZ .EQU 01A80040H ;DMA DESTINATION, X COORDINATE
DMAVERT .EQU 01A80050H ;DMA DESTINATION, Y COORDINATE
DMAHSIZE .EQU 01A80060H ;DMA DESTINATION, X SIZE
DMAVSIZE .EQU 01A80070H ;DMA DESTINATION, Y SIZE
DMACMAP .EQU 01A80080H ;DMA COLOR MAP SELECT
DMACONST .EQU 01A80090H ;DMA CONSTANT COLOR SUBSTITUTE
SECCHIP .EQU 01C00060H ; LOCATION OF SECURITY CHIP JKM 2/13/90
*BITS FOR THE DMA CONTROL WORD
DMAWZ .SET 1|8000H ;WRITE ZERO DATA
DMAWNZ .SET 2|8000H ;WRITE NON-ZERO DATA
DMACZ .SET 4|8000H ;WRITE CONSTANT ON ZERO DATA
DMACNZ .SET 8|8000H ;WRITE CONSTANT ON NON-ZERO DATA
DMAWAL .SET 3|8000H ;WRITE BOTH ZERO & NON-ZERO DATA
DMACAL .SET 0CH|8000H ;WRITE CONSTANT ON BOTH ZERO & NON-ZERO DATA
ISIZE .EQU 0
ISIZEX .EQU 0
ISIZEY .EQU 10H
IANIOFF .EQU 20H
IANIOFFX .EQU 20H
IANIOFFY .EQU 30H
ISAG .EQU 40H
ICMAP .EQU 60H
ICBOX .EQU 80H
ICBOXSIZ .EQU 90H
ZM .SET 1 ;Z MINUS MULTIPLIER
ZP .SET 010000H ;Z PLUS MULTIPLIER
L .SET 1
W .SET 0
*SOUND PROCESSOR EQUATES
NINT .EQU 0800H ;SOUND NON-INTERRUPTABLE
NINTEQ .EQU 0400H ;SOUND NON-INTERRUPTABLE BY EQUAL PRIORITY
CHANNEL .EQU 0F000H
NOTIME .EQU 04000H
*SOUND CHANNELS
CHANCVSD .EQU 0
CHANDACA .EQU 1
CHANDACB .EQU 2
CHANYAM .EQU 3
WDOGNUM .SET 01A2B3C4DH ;"SYSTEM INITIALIZED" MARKER
*FRANIM FLAG MASKS
SPAWNP EQU 8000H
FLIPBITS EQU 4000H
NEWPALET EQU 2000H
DELTAXZ EQU 1000H
DELTAY EQU 800H
*ANIMATION SCRIPT FLAG BIT POSITIONS
BSPAWNP EQU 15
BFLIPBIT EQU 14
BNEWPAL EQU 13
BDELTAXZ EQU 12
BDELTAY EQU 11
*Palette allocator equates
*Palette allocation ram
*For each color palette ID 32 Bits
*Not used: Palette count 16 bits
*IF PALCNT00H PALETTE IS ALLOCATED, IF PALCNT=0 PALETTE IS FREE
NUMPAL .SET 64 ;# Palettes in pal table
NMFPAL .SET 32 ;# foregnd pals
NMBPAL .SET 32 ;# backgnd pals
*struct PAL
PALID .SET 0 ;UHL 32 BIT PALETTE I.D. (ADDRESS OF ACTUAL PALETTE)
;PALCNT .SET 32 ;UHW 16 BIT COUNT (# OF OBJECTS USING THIS PALETTE)
*endstruct
PALRSIZ .SET 32 ;SIZE OF PALETTE ALLOCATION RAM
*Palette transfer ram
PLDCNT .SET 0 ;COLOR COUNT
PALSRC .SET 010H ;SOURCE ADDRESS OF PALETTE COLOR DATA
PALDEST .SET 030H ;DESTINATION PALETTE|START COLOR
PTRSIZ .SET 040H ;SIZE OF EACH CELL
NUMPTR .SET 64 ;NUMBER OF TRANSFERS ALLOWED
;DISPLAY FLAGS FOR FORE/BACKGROUND OBJECTS
M_SPAWNP EQU 80H ;SPAWN A PROCESS WITH THIS OBJECT IN A8
B_SPAWNP EQU 7