Jo Engine  2024.04.28
Jo Sega Saturn Engine
sega_saturn.h
Go to the documentation of this file.
1 /*
2 ** Jo Sega Saturn Engine
3 ** Copyright (c) 2012-2024, Johannes Fetz (johannesfetz@gmail.com)
4 ** All rights reserved.
5 **
6 ** Redistribution and use in source and binary forms, with or without
7 ** modification, are permitted provided that the following conditions are met:
8 ** * Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** * Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** * Neither the name of the Johannes Fetz nor the
14 ** names of its contributors may be used to endorse or promote products
15 ** derived from this software without specific prior written permission.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 ** DISCLAIMED. IN NO EVENT SHALL Johannes Fetz BE LIABLE FOR ANY
21 ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
35 #ifndef __JO_SEGA_SATURN_H__
36 # define __JO_SEGA_SATURN_H__
37 
38 /*
39 
40 -------------------------------------------------|-----------------------------|------------------------------
41 | Function | Normal Scroll Screen | Rotation Scroll Screen |
42 | |-----------------------------|-----------------------------|------------------------------
43 | | NBG0 | NBG1 | NBG2 | NBG3 | RBG0 | RBG1 |
44 -------------------------------------------------|-----------------------------|------------------------------
45 | Character Colour | 16 colours | 16 colours | 16 colours | 16 colours | 16 colours | 16 colours |
46 | Count | 256 " " | 256 " " | 256 " " | 256 " " | 256 " " | 256 " " |
47 | | 2048 " " | 2048 " " | | | 2048 " " | 2048 " " |
48 | | 32768 " " | 32768 " " | | | 32768 " " | 32768 " " |
49 | | 16770000 " " | | | | 16770000 " " | 16770000 " " |
50 -------------------------------------------------|-----------------------------|------------------------------
51 | Character Size | 1x1 Cells , 2x2 Cells |
52 -------------------------------------------------|-----------------------------|------------------------------
53 | Pattern Name | 1 word , 2 words |
54 | Data Size | |
55 -------------------------------------------------|-----------------------------|------------------------------
56 | Plane Size | 1 H x 1 V 1 Pages ; 2 H x 1 V 1 Pages ; 2 H x 2 V Pages (I don't understand ... ) |
57 -------------------------------------------------|-----------------------------|------------------------------
58 | Plane Count | 4 | 16 |
59 -------------------------------------------------|-----------------------------|------------------------------
60 | Bitmap Possible | Yes | No | Yes | No |
61 -------------------------------------------------|-----------------------------|------------------------------
62 | Bitmap Size | 512 x 256 | N/A | 512x256 | N/A |
63 | | 512 x 512 | | 512x512 | |
64 | | 1024 x 256 | | | |
65 | | 1024 x 512 | | | |
66 -------------------------------------------------|-----------------------------|------------------------------
67 | Scale | 0.25 x - 256 x | None | Any ? |
68 -------------------------------------------------|-----------------------------|------------------------------
69 | Rotation | No | Yes |
70 -------------------------------------------------|-----------------------------|-----------------------------|
71 | Linescroll | Yes | No |
72 -------------------------------------------------|-----------------------------|------------------------------
73 | Column Scroll | Yes | No |
74 -------------------------------------------------|-----------------------------|------------------------------
75 | Mosaic | Yes | Horizontal Only |
76 -------------------------------------------------|-----------------------------|------------------------------
77 */
78 
79 /*
80 ██╗ ██╗██████╗ ██████╗ ██╗
81 ██║ ██║██╔══██╗██╔══██╗███║
82 ██║ ██║██║ ██║██████╔╝╚██║
83 ╚██╗ ██╔╝██║ ██║██╔═══╝ ██║
84  ╚████╔╝ ██████╔╝██║ ██║
85  ╚═══╝ ╚═════╝ ╚═╝ ╚═╝
86 
87 */
88 
90 # define JO_VDP1_VRAM (0x25C00000)
91 
92 # define JO_VDP1_FB (0x25C80000)
93 
94 # define JO_VDP1_REG (0x25D00000)
95 
96 # define JO_VDP1_LAST_REG (0x25D00016)
97 
99 # define JO_VDP1_TVMR (*(volatile unsigned short *)0x25D00000) // 0x0
100 
101 # define JO_VDP1_FBCR (*(volatile unsigned short *)0x25D00002) // 0x0
102 
103 # define JO_VDP1_PTMR (*(volatile unsigned short *)0x25D00004) // 0x2
104 
105 # define JO_VDP1_EWDR (*(volatile unsigned short *)0x25D00006) // 0x0
106 
107 # define JO_VDP1_EWLR (*(volatile unsigned short *)0x25D00008) // 0x0
108 
109 # define JO_VDP1_EWRR (*(volatile unsigned short *)0x25D0000A) // 0x58FF
110 
111 # define JO_VDP1_ENDR (*(volatile unsigned short *)0x25D0000C) // 0x0
112 
113 # define JO_VDP1_EDSR (*(volatile unsigned short *)0x25D00010) // 0x3
114 
115 # define JO_VDP1_LOPR (*(volatile unsigned short *)0x25D00012) // N/A
116 
117 # define JO_VDP1_COPR (*(volatile unsigned short *)0x25D00014) // N/A
118 
119 # define JO_VDP1_MODR (*(volatile unsigned short *)0x25D00016) // 0x1100
120 
121 # define JO_VDP1_USER_AREA_SIZE (0x71D38)
122 
123 # define JO_VDP1_USER_AREA_END_ADDR (0x25C7FEF8)
124 
125 # define JO_VDP1_TEXTURE_DEF_BASE_ADDRESS (0x10000)
126 
127 /*
128 ██╗ ██╗██████╗ ██████╗ ██████╗
129 ██║ ██║██╔══██╗██╔══██╗╚════██╗
130 ██║ ██║██║ ██║██████╔╝ █████╔╝
131 ╚██╗ ██╔╝██║ ██║██╔═══╝ ██╔═══╝
132  ╚████╔╝ ██████╔╝██║ ███████╗
133  ╚═══╝ ╚═════╝ ╚═╝ ╚══════╝
134 
135 */
137 # define JO_VDP2_REG (0x25F80000)
138 
139 # define JO_VDP2_LAST_REG (0x25F8011E)
140 
141 # define JO_VDP2_VRAM (0x25E00000)
142 
143 # define JO_VDP2_VRAM_A0 (JO_VDP2_VRAM)
144 
145 # define JO_VDP2_VRAM_A1 (0x25E20000)
146 
147 # define JO_VDP2_VRAM_B0 (0x25E40000)
148 
149 # define JO_VDP2_VRAM_B1 (0x25E60000)
150 
151 # define JO_VDP2_CRAM (0x25F00000)
152 
153 # define JO_VDP2_BANK_SIZE (0x20000)
154 
155 # define JO_VDP2_NBG0_CEL_ADR (VDP2_VRAM_A1)
156 # define JO_VDP2_NBG0_MAP_ADR (VDP2_VRAM_B1)
157 # define JO_VDP2_NBG1_CEL_ADR (VDP2_VRAM_A0)
158 # define JO_VDP2_NBG1_MAP_ADR (VDP2_VRAM_B0)
159 
160 
161 /* 180002 - r/w - EXTEN - External Signal Enable Register
162  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
163  | -- | -- | -- | -- | -- | -- | EXLTEN | EXSYEN |
164  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
165  | -- | -- | -- | -- | -- | -- | DASEL | EXBGEN |
166  \----------|----------|----------|----------|----------|----------|----------|---------*/
167 # define JO_VDP2_TVMD (*(volatile unsigned short *)0x25F80000) // 0x8110 0x8120
168 # define JO_VDP2_EXTEN (*(volatile unsigned short *)0x25F80002) // 0x0
169 # define JO_VDP2_TVSTAT (*(volatile unsigned short *)0x25F80004) // N/A
170 
171 /* 180006 - r/w - VRSIZE - VRAM Size
172  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
173  | VRAMSZ | -- | -- | -- | -- | -- | -- | -- |
174  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
175  | -- | -- | -- | -- | VER3 | VER2 | VER1 | VER0 |
176  \----------|----------|----------|----------|----------|----------|----------|---------*/
177 # define JO_VDP2_VRSIZE (*(volatile unsigned short *)0x25F80006) // 0x0
178 
179 /* 180008 - r/o - HCNT - H-Counter
180  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
181  | -- | -- | -- | -- | -- | -- | HCT9 | HCT8 |
182  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
183  | HCT7 | HCT6 | HCT5 | HCT4 | HCT3 | HCT2 | HCT1 | HCT0 |
184  \----------|----------|----------|----------|----------|----------|----------|---------*/
185 # define JO_VDP2_HCNT (*(volatile unsigned short *)0x25F80008) // 0x275 0x26B
186 
187 /* 18000A - r/o - VCNT - V-Counter
188  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
189  | -- | -- | -- | -- | -- | -- | VCT9 | VCT8 |
190  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
191  | VCT7 | VCT6 | VCT5 | VCT4 | VCT3 | VCT2 | VCT1 | VCT0 |
192  \----------|----------|----------|----------|----------|----------|----------|---------*/
193 # define JO_VDP2_VCNT (*(volatile unsigned short *)0x25F8000A) // 0x36
194 
195 /* 18000E - r/w - RAMCTL - RAM Control
196  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
197  | CRKTE | -- | CRMD1 | CRMD0 | -- | -- | VRBMD | VRAMD |
198  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
199  | RDBSB11 | RDBSB10 | RDBSB01 | RDBSB00 | RDBSA11 | RDBSA10 | RDBSA01 | RDBSA00 |
200  \----------|----------|----------|----------|----------|----------|----------|---------*/
201 # define JO_VDP2_RAMCTL (*(volatile unsigned short *)0x25F8000E) // 0x1327
202 
203 # define JO_VDP2_CYCA0L (*(volatile unsigned short *)0x25F80010) // 0x5555
204 # define JO_VDP2_CYCA0U (*(volatile unsigned short *)0x25F80012) // 0xFEEE
205 # define JO_VDP2_CYCA1L (*(volatile unsigned short *)0x25F80014) // 0x5555
206 # define JO_VDP2_CYCA1U (*(volatile unsigned short *)0x25F80016) // 0xFEEE
207 # define JO_VDP2_CYCB0L (*(volatile unsigned short *)0x25F80018) // 0xFFFF
208 # define JO_VDP2_CYCB0U (*(volatile unsigned short *)0x25F8001A) // 0xEEEE
209 # define JO_VDP2_CYCB1L (*(volatile unsigned short *)0x25F8001C) // 0x44F
210 # define JO_VDP2_CYCB1U (*(volatile unsigned short *)0x25F8001E) // 0xEEEE
211 
212 /* 180020 - r/w - BGON - SCREEN DISPLAY ENABLE
213 
214  this register allows each tilemap to be enabled or disabled and also which layers are solid
215 
216  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
217  | -- | -- | -- | R0TPON | N3TPON | N2TPON | N1TPON | N0TPON |
218  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
219  | -- | -- | R1ON | R0ON | N3ON | N2ON | N1ON | N0ON |
220  \----------|----------|----------|----------|----------|----------|----------|---------*/
221 # define JO_VDP2_BGON (*(volatile unsigned short *)0x25F80020) // 0x3
222 
223 /*
224 180022 - MZCTL - Mosaic Control
225 bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
226  | -- | -- | -- | -- | -- | -- | -- | -- |
227  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
228  | -- | -- | -- | -- | -- | -- | -- | -- |
229  \----------|----------|----------|----------|----------|----------|----------|---------*/
230 # define JO_VDP2_MZCTL (*(volatile unsigned short *)0x25F80022) // 0x0
231 # define JO_VDP2_SFSEL (*(volatile unsigned short *)0x25F80024) // 0x0
232 # define JO_VDP2_SFCODE (*(volatile unsigned short *)0x25F80026) // 0x0
233 # define JO_VDP2_CHCTLA (*(volatile unsigned short *)0x25F80028) // 0x3210
234 # define JO_VDP2_CHCTLB (*(volatile unsigned short *)0x25F8002A) // 0x1000
235 /*
236 18002C - BMPNA - Bitmap Palette Number (NBG0, NBG1)
237  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
238  | -- | -- | -- | -- | -- | -- | -- | -- |
239  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
240  | -- | -- | -- | -- | -- | -- | -- | -- |
241  \----------|----------|----------|----------|----------|----------|----------|---------*/
242 # define JO_VDP2_BMPNA (*(volatile unsigned short *)0x25F8002C) // 0x0
243 
244 /* 18002E - Bitmap Palette Number (RBG0)
245  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
246  | -- | -- | -- | -- | -- | -- | -- | -- |
247  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
248  | -- | -- | -- | -- | -- | -- | -- | -- |
249  \----------|----------|----------|----------|----------|----------|----------|---------*/
250 # define JO_VDP2_BMPNB (*(volatile unsigned short *)0x25F8002E) // 0x0
251 
252 /* 180030 - PNCN0 - Pattern Name Control (NBG0)
253  bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\
254  | N0PNB | N0CNSM | -- | -- | -- | -- | N0SPR | N0SCC |
255  |----07----|----06----|----05----|----04----|----03----|----02----|----01----|----00----|
256  | N0SPLT6 | N0SPLT5 | N0SPLT4 | N0SPCN4 | N0SPCN3 | N0SPCN2 | N0SPCN1 | N0SPCN0 |
257  \----------|----------|----------|----------|----------|----------|----------|---------*/
258 # define JO_VDP2_PNCN0 (*(volatile unsigned short *)0x25F80030) // 0x800C
259 # define JO_VDP2_PNCN1 (*(volatile unsigned short *)0x25F80032) // 0xC00E
260 # define JO_VDP2_PNCN2 (*(volatile unsigned short *)0x25F80034) // 0xC000
261 # define JO_VDP2_PNCN3 (*(volatile unsigned short *)0x25F80036) // 0xC000
262 # define JO_VDP2_PNCR (*(volatile unsigned short *)0x25F80038) // 0xC000
263 # define JO_VDP2_PLSZ (*(volatile unsigned short *)0x25F8003A) // 0x0
264 # define JO_VDP2_MPOFN (*(volatile unsigned short *)0x25F8003C) // 0x0
265 # define JO_VDP2_MPOFR (*(volatile unsigned short *)0x25F8003E) // 0x0
266 
267 # define JO_VDP2_MPABN0 (*(volatile unsigned short *)0x25F80040) // 0x3B3B
268 # define JO_VDP2_MPCDN0 (*(volatile unsigned short *)0x25F80042) // 0x3B3B
269 # define JO_VDP2_MPABN1 (*(volatile unsigned short *)0x25F80044) // 0x3939
270 # define JO_VDP2_MPCDN1 (*(volatile unsigned short *)0x25F80046) // 0x3939
271 # define JO_VDP2_MPABN2 (*(volatile unsigned short *)0x25F80048) // 0x0
272 # define JO_VDP2_MPCDN2 (*(volatile unsigned short *)0x25F8004A) // 0x0
273 # define JO_VDP2_MPABN3 (*(volatile unsigned short *)0x25F8004C) // 0x0
274 # define JO_VDP2_MPCDN3 (*(volatile unsigned short *)0x25F8004E) // 0x0
275 
276 # define JO_VDP2_MPABRA (*(volatile unsigned short *)0x25F80050) // 0x2020
277 # define JO_VDP2_MPCDRA (*(volatile unsigned short *)0x25F80052) // 0x2020
278 # define JO_VDP2_MPEFRA (*(volatile unsigned short *)0x25F80054) // 0x2020
279 # define JO_VDP2_MPGHRA (*(volatile unsigned short *)0x25F80056) // 0x2020
280 # define JO_VDP2_MPIJRA (*(volatile unsigned short *)0x25F80058) // 0x2020
281 # define JO_VDP2_MPKLRA (*(volatile unsigned short *)0x25F8005A) // 0x2020
282 # define JO_VDP2_MPMNRA (*(volatile unsigned short *)0x25F8005C) // 0x2020
283 # define JO_VDP2_MPOPRA (*(volatile unsigned short *)0x25F8005E) // 0x2020
284 
285 # define JO_VDP2_MPABRB (*(volatile unsigned short *)0x25F80060) // 0x2828
286 # define JO_VDP2_MPCDRB (*(volatile unsigned short *)0x25F80062) // 0x2828
287 # define JO_VDP2_MPEFRB (*(volatile unsigned short *)0x25F80064) // 0x2828
288 # define JO_VDP2_MPGHRB (*(volatile unsigned short *)0x25F80066) // 0x2838
289 # define JO_VDP2_MPIJRB (*(volatile unsigned short *)0x25F80068) // 0x2828
290 # define JO_VDP2_MPKLRB (*(volatile unsigned short *)0x25F8006A) // 0x2828
291 # define JO_VDP2_MPMNRB (*(volatile unsigned short *)0x25F8006C) // 0x2828
292 # define JO_VDP2_MPOPRB (*(volatile unsigned short *)0x25F8006E) // 0x2828
293 
294 # define JO_VDP2_SCXIN0 (*(volatile unsigned short *)0x25F80070) // 0x0
295 # define JO_VDP2_SCXDN0 (*(volatile unsigned short *)0x25F80072) // 0x0
296 # define JO_VDP2_SCYIN0 (*(volatile unsigned short *)0x25F80074) // 0x0
297 # define JO_VDP2_SCYDN0 (*(volatile unsigned short *)0x25F80076) // 0x0
298 # define JO_VDP2_ZMXIN0 (*(volatile unsigned short *)0x25F80078) // 0x1
299 # define JO_VDP2_ZMXDN0 (*(volatile unsigned short *)0x25F8007A) // 0x0
300 # define JO_VDP2_ZMYIN0 (*(volatile unsigned short *)0x25F8007C) // 0x1
301 # define JO_VDP2_ZMYDN0 (*(volatile unsigned short *)0x25F8007E) // 0x0
302 
303 # define JO_VDP2_SCXIN1 (*(volatile unsigned short *)0x25F80080) // 0x0
304 # define JO_VDP2_SCXDN1 (*(volatile unsigned short *)0x25F80082) // 0x0
305 # define JO_VDP2_SCYIN1 (*(volatile unsigned short *)0x25F80084) // 0x0
306 # define JO_VDP2_SCYDN1 (*(volatile unsigned short *)0x25F80086) // 0x0
307 # define JO_VDP2_ZMXIN1 (*(volatile unsigned short *)0x25F80088) // 0x1
308 # define JO_VDP2_ZMXDN1 (*(volatile unsigned short *)0x25F8008A) // 0x0
309 # define JO_VDP2_ZMYIN1 (*(volatile unsigned short *)0x25F8008C) // 0x1
310 # define JO_VDP2_ZMYDN1 (*(volatile unsigned short *)0x25F8008E) // 0x0
311 
312 # define JO_VDP2_SCXN2 (*(volatile unsigned short *)0x25F80090) // 0x0
313 # define JO_VDP2_SCYN2 (*(volatile unsigned short *)0x25F80092) // 0x0
314 # define JO_VDP2_SCXN3 (*(volatile unsigned short *)0x25F80094) // 0x0
315 # define JO_VDP2_SCYN3 (*(volatile unsigned short *)0x25F80096) // 0x0
316 # define JO_VDP2_ZMCTL (*(volatile unsigned short *)0x25F80098) // 0x0
317 # define JO_VDP2_SCRCTL (*(volatile unsigned short *)0x25F8009A) // 0x0
318 # define JO_VDP2_VCSTAU (*(volatile unsigned short *)0x25F8009C) // 0x0
319 # define JO_VDP2_VCSTAL (*(volatile unsigned short *)0x25F8009E) // 0x0
320 
321 # define JO_VDP2_LSTA0U (*(volatile unsigned short *)0x25F800A0) // 0x0
322 # define JO_VDP2_LSTA0L (*(volatile unsigned short *)0x25F800A2) // 0x0
323 # define JO_VDP2_LSTA1U (*(volatile unsigned short *)0x25F800A4) // 0x0
324 # define JO_VDP2_LSTA1L (*(volatile unsigned short *)0x25F800A6) // 0x0
325 # define JO_VDP2_LCTAU (*(volatile unsigned short *)0x25F800A8) // 0x0
326 # define JO_VDP2_LCTAL (*(volatile unsigned short *)0x25F800AA) // 0x0
327 # define JO_VDP2_BKTAU (*(volatile unsigned short *)0x25F800AC) // 0x12F1
328 # define JO_VDP2_BKTAL (*(volatile unsigned short *)0x25F800AE) // 0xFFFF
329 
330 # define JO_VDP2_RPMD (*(volatile unsigned short *)0x25F800B0) // 0x0
331 # define JO_VDP2_RPRCTL (*(volatile unsigned short *)0x25F800B2) // 0x0
332 # define JO_VDP2_KTCTL (*(volatile unsigned short *)0x25F800B4) // 0x0
333 # define JO_VDP2_KTAOF (*(volatile unsigned short *)0x25F800B6) // 0x0
334 # define JO_VDP2_OVPNRA (*(volatile unsigned short *)0x25F800B8) // 0x0
335 # define JO_VDP2_OVPNRB (*(volatile unsigned short *)0x25F800BA) // 0x0
336 # define JO_VDP2_RPTAU (*(volatile unsigned short *)0x25F800BC) // 0x1
337 # define JO_VDP2_RPTAL (*(volatile unsigned short *)0x25F800BE) // 0xFF80
338 
339 # define JO_VDP2_WPSX0 (*(volatile unsigned short *)0x25F800C0) // 0x0
340 # define JO_VDP2_WPSY0 (*(volatile unsigned short *)0x25F800C2) // 0x0
341 # define JO_VDP2_WPEX0 (*(volatile unsigned short *)0x25F800C4) // 0x27E SCRW-1
342 # define JO_VDP2_WPEY0 (*(volatile unsigned short *)0x25F800C6) // 0x1BE SCRH-1
343 # define JO_VDP2_WPSX1 (*(volatile unsigned short *)0x25F800C8) // 0x0
344 # define JO_VDP2_WPSY1 (*(volatile unsigned short *)0x25F800CA) // 0x0
345 # define JO_VDP2_WPEX1 (*(volatile unsigned short *)0x25F800CC) // 0x27E SCRW-1
346 # define JO_VDP2_WPEY1 (*(volatile unsigned short *)0x25F800CE) // 0x1BE SCRH-1
347 
348 # define JO_VDP2_WCTLA (*(volatile unsigned short *)0x25F800D0) // 0x0
349 # define JO_VDP2_WCTLB (*(volatile unsigned short *)0x25F800D2) // 0x0
350 # define JO_VDP2_WCTLC (*(volatile unsigned short *)0x25F800D4) // 0x0
351 # define JO_VDP2_WCTLD (*(volatile unsigned short *)0x25F800D6) // 0x0
352 # define JO_VDP2_LWTA0U (*(volatile unsigned short *)0x25F800D8) // 0x0
353 # define JO_VDP2_LWTA0L (*(volatile unsigned short *)0x25F800DA) // 0x0
354 # define JO_VDP2_LWTA1U (*(volatile unsigned short *)0x25F800DC) // 0x0
355 # define JO_VDP2_LWTA1L (*(volatile unsigned short *)0x25F800DE) // 0x0
356 
357 # define JO_VDP2_SPCTL (*(volatile unsigned short *)0x25F800E0) // 0x23
358 # define JO_VDP2_SDCTL (*(volatile unsigned short *)0x25F800E2) // 0x0
359 # define JO_VDP2_CRAOFA (*(volatile unsigned short *)0x25F800E4) // 0x0
360 # define JO_VDP2_CRAOFB (*(volatile unsigned short *)0x25F800E6) // 0x0
361 # define JO_VDP2_LNCLEN (*(volatile unsigned short *)0x25F800E8) // 0x0
362 # define JO_VDP2_SFPRMD (*(volatile unsigned short *)0x25F800EA) // 0x0
363 # define JO_VDP2_CCCTL (*(volatile unsigned short *)0x25F800EC) // 0x0
364 # define JO_VDP2_SFCCMD (*(volatile unsigned short *)0x25F800EE) // 0x0
365 
366 # define JO_VDP2_PRISA (*(volatile unsigned short *)0x25F800F0) // 0x506
367 # define JO_VDP2_PRISB (*(volatile unsigned short *)0x25F800F2) // 0x505
368 # define JO_VDP2_PRISC (*(volatile unsigned short *)0x25F800F4) // 0x505
369 # define JO_VDP2_PRISD (*(volatile unsigned short *)0x25F800F6) // 0x505
370 # define JO_VDP2_PRINA (*(volatile unsigned short *)0x25F800F8) // 0x607
371 # define JO_VDP2_PRINB (*(volatile unsigned short *)0x25F800FA) // 0x102
372 # define JO_VDP2_PRIR (*(volatile unsigned short *)0x25F800FC) // 0x4
373 # define JO_VDP2_RESERVE (*(volatile unsigned short *)0x25F800FE) // 0x0
374 
375 # define JO_VDP2_CCRSA (*(volatile unsigned short *)0x25F80100) // 0x0
376 # define JO_VDP2_CCRSB (*(volatile unsigned short *)0x25F80102) // 0x0
377 # define JO_VDP2_CCRSC (*(volatile unsigned short *)0x25F80104) // 0x0
378 # define JO_VDP2_CCRSD (*(volatile unsigned short *)0x25F80106) // 0x0
379 # define JO_VDP2_CCRNA (*(volatile unsigned short *)0x25F80108) // 0x0
380 # define JO_VDP2_CCRNB (*(volatile unsigned short *)0x25F8010A) // 0x0
381 # define JO_VDP2_CCRR (*(volatile unsigned short *)0x25F8010C) // 0x0
382 # define JO_VDP2_CCRLB (*(volatile unsigned short *)0x25F8010E) // 0x0
383 
384 # define JO_VDP2_CLOFEN (*(volatile unsigned short *)0x25F80110) // 0x0
385 # define JO_VDP2_CLOFSL (*(volatile unsigned short *)0x25F80112) // 0x0
386 # define JO_VDP2_COAR (*(volatile unsigned short *)0x25F80114) // 0x0
387 # define JO_VDP2_COAG (*(volatile unsigned short *)0x25F80116) // 0x0
388 # define JO_VDP2_COAB (*(volatile unsigned short *)0x25F80118) // 0x0
389 # define JO_VDP2_COBR (*(volatile unsigned short *)0x25F8011A) // 0x0
390 # define JO_VDP2_COBG (*(volatile unsigned short *)0x25F8011C) // 0x0
391 # define JO_VDP2_COBB (*(volatile unsigned short *)0x25F8011E) // 0x0
392 
393 /*
394 ██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ █████╗ ███╗ ███╗
395 ██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝ ██╔══██╗██╔══██╗████╗ ████║
396 ██║ █╗ ██║██║ ██║██████╔╝█████╔╝ ██████╔╝███████║██╔████╔██║
397 ██║███╗██║██║ ██║██╔══██╗██╔═██╗ ██╔══██╗██╔══██║██║╚██╔╝██║
398 ╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗ ██║ ██║██║ ██║██║ ╚═╝ ██║
399  ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ (SGL)
400 
401 */
402 
404 # define JO_WORK_RAM_BOOT_ROM (0x06000000)
405 
406 # define JO_WORK_RAM_SLAVE_CPU_STACK_AREA (0x06000800)
407 
408 # define JO_WORK_RAM_MASTER_CPU_DEFAULT_STACK (0x06001000)
409 
410 # define JO_WORK_RAM_UNKNOWN_USAGE (0x06002000)
411 
412 # define JO_WORK_RAM_USER_PROGRAM_AND_DATA (0x06004000)
413 
414 # define JO_WORK_RAM_SORT_LIST (0x060C0000)
415 
416 # define JO_WORK_RAM_USER_PROGRAM_AND_DATA_END (JO_WORK_RAM_SORT_LIST)
417 
418 # define JO_WORK_RAM_DMA_TRANSFERT_LIST (0x060C549C)
419 
420 # define JO_WORK_RAM_WINDOW_0_ZBUFFER (0x060C558C)
421 
422 # define JO_WORK_RAM_WINDOW_1_ZBUFFER (0x060C578C)
423 
424 # define JO_WORK_RAM_POLYGON_SORT_ZBUFFER (0x060C598C)
425 
426 # define JO_WORK_RAM_SPRITE_BUFFER_1 (0x060C5D8C)
427 
428 # define JO_WORK_RAM_SPRITE_BUFFER_2 (0x060D5B60)
429 
430 # define JO_WORK_RAM_POLYGON_VERTEX_CALC_BUFFER (0x060E5934)
431 
432 # define JO_WORK_RAM_LIGHT_COLORS_BUFFER (0x060EF574)
433 
434 # define JO_WORK_RAM_COMMAND_BUFFER (0x060EF994)
435 
436 # define JO_WORK_RAM_STACK_AREA (0x06FDA94)
437 
438 # define JO_WORK_RAM_SYSTEM_WORK (0x06FFC00)
439 # define JO_WORK_RAM_SYSTEM_WORK_SIZE (0x400)
440 
441 /*
442 ██╗ ██╗███████╗██╗ ██████╗ ███████╗██████╗ ███████╗
443 ██║ ██║██╔════╝██║ ██╔══██╗██╔════╝██╔══██╗██╔════╝
444 ███████║█████╗ ██║ ██████╔╝█████╗ ██████╔╝███████╗
445 ██╔══██║██╔══╝ ██║ ██╔═══╝ ██╔══╝ ██╔══██╗╚════██║
446 ██║ ██║███████╗███████╗██║ ███████╗██║ ██║███████║
447 ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝
448 
449 */
450 
454 # define JO_IS_PTR_INSIDE_USER_RAM_AREA(PTR) (((unsigned int)(PTR)) >= JO_WORK_RAM_USER_PROGRAM_AND_DATA && \
455  ((unsigned int)(PTR)) < JO_WORK_RAM_USER_PROGRAM_AND_DATA_END)
456 
460 # define JO_IS_ARRAY_INSIDE_USER_RAM_AREA(ARRAY) (JO_IS_PTR_INSIDE_USER_RAM_AREA((unsigned char *)ARRAY) && \
461  JO_IS_PTR_INSIDE_USER_RAM_AREA(((unsigned char *)ARRAY) + sizeof(ARRAY)))
462 
463 #endif /* !__JO_SEGA_SATURN_H__ */
464 
465 /*
466 ** END OF FILE
467 */