-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgfxdefs
479 lines (398 loc) · 9.63 KB
/
gfxdefs
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
profile
{
id nec_pcengine_sprites
desc NEC PC Engine / TurboGrafx-16 (sprites)
chrdef chr_nec_pcengine_sprites
paldef pal_16bit_16color
coldef col_nec_pcengine
}
profile
{
id nec_pcengine_tiles
desc NEC PC Engine / TurboGrafx-16 (tiles)
chrdef chr_nec_pcengine_tiles
paldef pal_16bit_16color
coldef col_nec_pcengine
}
profile
{
id snk_neogeocd
desc SNK NeoGeo CD
chrdef chr_snk_neogeocd
paldef pal_16bit_16color
coldef col_snk_neogeo
}
profile
{
id snk_neogeo
desc SNK NeoGeo
chrdef chr_snk_neogeo
paldef pal_16bit_16color
coldef col_snk_neogeo
}
profile
{
id capcom_cps
desc Capcom CPS / CPS 2
chrdef chr_capcom_cps
paldef pal_16bit_16color
coldef col_capcom_cps
}
profile
{
id sega_ms
desc Sega Master System
chrdef chr_8x8_4bpp_planar
paldef pal_sega_ms
coldef col_bgr_222_packed
}
profile
{
id sega_gg
desc Sega Game Gear
chrdef chr_8x8_4bpp_planar
paldef pal_16bit_16color
coldef col_bgr_444_packed
}
profile
{
id nintendo_sfc
desc Nintendo Super Famicom
chrdef chr_nintendo_sfc
paldef pal_16bit_16color
coldef col_bgr_555_packed
}
profile
{
id nintendo_vb
desc Nintendo Virtual Boy
chrdef chr_nintendo_vb
paldef pal_nintendo_vb
coldef col_nintendo_vb
}
profile
{
id nintendo_fc
desc Nintendo Famicom
chrdef chr_nintendo_fc
paldef pal_nintendo_fc
coldef col_nintendo_fc
}
profile
{
id nintendo_gb
desc Nintendo Game Boy
chrdef chr_8x8_2bpp_planar
paldef pal_nintendo_gb
coldef col_nintendo_gb
}
profile
{
id nintendo_gb_pocket
desc Nintendo Game Boy Pocket
chrdef chr_8x8_2bpp_planar
paldef pal_nintendo_gb
coldef col_nintendo_gb_pocket
}
profile
{
id sega_md
desc Sega Mega Drive
chrdef chr_8x8_4bpp_packed_lsb
paldef pal_16bit_16color
coldef col_sega_md
}
#################################
##
## P A L D E F S
##
#################################
paldef
{
id pal_sega_ms
desc Sega Master System
# 32 colors per palette, 1 byte per color
# 2 subpalettes, 16 colors each
entry_datasize 8
length 16
}
paldef
{
id pal_nintendo_vb
desc Nintendo Virtual Boy
# 2 bits per color, 3 colors per palette
# palette data is 1 byte; lowest two bits ignored as padding
# 8 palettes total
entry_datasize 2
length 4
# We manually specify the palette data size here since
# VB palettes are actually word length, with the upper
# byte ignored
datasize 16
}
paldef
{
id pal_nintendo_fc
desc Nintendo Famicom
# 32 colors, each color is 1 byte; 8 palettes, 4 colors each
# (color 0 is always transparent)
entry_datasize 8
length 4
}
paldef
{
id pal_nintendo_gb
desc Nintendo Game Boy
# 2 bits per color, 4 colors, packed (1 byte per palette)
# 3 palettes (3 bytes, stored at 0xFF47 in memory)
entry_datasize 2
length 4
}
#################################
##
## C H R D E F S
##
#################################
chrdef
{
id chr_nec_pcengine_tiles
desc NEC PC Engine / TurgoGrafx-16 (tiles)
# 8x8 4bpp Planar
# 2 byte interleaved
width 8
height 8
bpp 4
plane_offsets 0, 8, 128, 136
pixel_offsets 0, 1, 2, 3, 4, 5, 6, 7
row_offsets 0, 16, 32, 48, 64, 80, 96, 112
}
chrdef
{
id chr_nec_pcengine_sprites
desc NEC PC Engine / TurgoGrafx-16 (sprites)
# 16x16 4bpp Planar
width 16
height 16
bpp 4
plane_offsets 0, 256, 512, 768
pixel_offsets 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
row_offsets 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240
}
chrdef
{
id chr_snk_neogeocd
desc SNK NeoGeo CD
# 16x16 4bpp Planar
# basically the same as normal NeoGeo but the 8x8
# "subtiles" are ordered differently
# https://wiki.neogeodev.org/index.php?title=Sprite_graphics_format
width 16
height 16
bpp 4
plane_offsets 8, 0, 24, 16
pixel_offsets 519, 518, 517, 516, 515, 514, 513, 512, 7, 6, 5, 4, 3, 2, 1, 0
row_offsets 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480
}
chrdef
{
id chr_snk_neogeo
desc SNK NeoGeo
# 16x16 4bpp Planar
# desc that your tile data (C ROMs) will need to be
# interleaved (odd|even|odd|even..., at 2 bytes each) into one file first.
# see this page: https://wiki.neogeodev.org/index.php?title=Sprite_graphics_format
width 16
height 16
bpp 4
plane_offsets 0, 8, 16, 24
pixel_offsets 519, 518, 517, 516, 515, 514, 513, 512, 7, 6, 5, 4, 3, 2, 1, 0
row_offsets 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480
}
chrdef
{
id chr_capcom_cps
desc Capcom CPS 1/2
# 16x16 4bpp Planar
width 16
height 16
bpp 4
#plane_offsets 24, 16, 8, 0
plane_offsets 0, 8, 16, 24
pixel_offsets 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39
row_offsets 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960
}
chrdef
{
id chr_nintendo_sfc
desc Nintendo Super Famicom, NEC PC Engine
# 8x8 4bpp planar
width 8
height 8
bpp 4
plane_offsets 0, 8, 128, 136
pixel_offsets 0, 1, 2, 3, 4, 5, 6, 7
row_offsets 0, 16, 32, 48, 64, 80, 96, 112
}
chrdef
{
id chr_nintendo_vb
desc Nintendo Virtual Boy
# 8x8 2bpp Packed
width 8
height 8
bpp 2
plane_offsets 0, 1
pixel_offsets 6, 4, 2, 0, 14, 12, 10, 8
row_offsets 0, 16, 32, 48, 64, 80, 96, 112
}
chrdef
{
id chr_nintendo_fc
desc Nintendo Famicom
# 8x8 2bpp planar
width 8
height 8
bpp 2
plane_offsets 0, 64
pixel_offsets 0, 1, 2, 3, 4, 5, 6, 7
row_offsets 0, 8, 16, 24, 32, 40, 48, 56
}
chrdef
{
id chr_capcom_cps
desc Capcom CPS / CPS 2
# 16x16 4bpp Planar
width 16
height 16
bpp 4
#plane_offsets 24, 16, 8, 0
plane_offsets 0, 8, 16, 24
pixel_offsets 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39
row_offsets 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960
}
#################################
##
## C O L D E F S
##
#################################
rgbcoldef
{
# 15| |0
# xxxxxxxG GGRRRBBB
# (little endian)
id col_nec_pcengine
desc NEC PC Engine / TurgoGrafx-16
bitdepth 3
layout 3, 3, 6, 3, 0, 3
big_endian 0
}
rgbcoldef
{
id col_snk_neogeo
desc SNK NeoGeo
# 15 | | |0
# DDR0G0B0R4R3R2R1 G4G3G2G1B4B3B2B1
# D = "dark bit", acts as shared LSB for all color components
bitdepth 6
layout 15, 1, 15, 1, 15, 1
layout 14, 1, 13, 1, 12, 1
layout 8, 4, 4, 4, 0, 4
big_endian 1
}
rgbcoldef
{
id col_capcom_cps
desc Capcom CPS 1/2
# CPS 1/2 color format
# 15 | |0
# BrBrBrBrRRRRGGGGBBBB
# 4 bits each of RGB and 4 bits of 'bright' component
# This version uses the Bright bits as
# the shared lower four bits of each color
# This makes the colors somewhat inaccurate
# as they will be slightly brighter
# However, this version is compatible with
# converting to CPS raw format as it takes
# all eight bits of data into account.
# Use this coldef if you plan to convert
# from PNG to raw CPS data
bitdepth 8
layout 12, 4, 12, 4, 12, 4
layout 8, 4, 4, 4, 0, 4
big_endian 1
}
rgbcoldef
{
id col_capcom_cps_accurate
desc Capcom CPS 1/2 (more accurate colors)
# CPS 1/2 color format
# 15 | |0
# BrBrBrBrRRRRGGGGBBBB
# 4 bits each of RGB and 4 bits of 'bright' component
# This version ignores the bright bits, using only
# the RGB values. The colors generated will be exact
# to the output from e.g. MAME, but this coldef
# will not convert to raw CPS data properly as the
# bright bits will not be set, and the color will be
# 'dark' from the point of view of the hardware.
# Use this coldef if you only plan to convert from
# raw CPS data to PNG images
bitdepth 4
color_passes 1
layout 8, 4, 4, 4, 0, 4
big_endian 1
}
rgbcoldef
{
id col_sega_md
desc Sega Megadrive
# 3 bit BGR
# 15| |0
# xxxxBBBx GGGxRRRx
bitdepth 3
layout 1, 3, 5, 3, 9, 3
big_endian 1
}
refcoldef
{
id col_nintendo_vb
desc Nintendo Virtual Boy
# VB "colors" are based on four levels of intensity
# The first level is always black, but the other
# three are variable and set by the game code
# Therefore it's impossible to make a 'standard'
# reference palette. The values below were sampled
# from Tetris 3D, which has a nice middle ground
# (based on output from MAME)
refpal #000000,#2f0000,#8f0000,#cf0000
# alternatively, here is a reference palette based
# on the Wario Land VB title screen, which leans a
# bit brighter
# refpal #000000,#3f0000,#df0000,#ff0000
}
refcoldef
{
id col_nintendo_fc
desc Nintendo Famicom
big_endian 0
# a 'standard' 2C02 PPU palette, from:
# https://wiki.nesdev.com/w/index.php/PPU_palettes
refpal #545454,#001E74,#08102C,#300088,#440064,#5C0030,#540400,#3C1800,#202A00,#083A00,#004000,#003C00,#00323C,#000000,#000000,#000000,#989698,#084CC4,#3032EC,#5C1EE4,#8814B0,#A01464,#982220,#783C00,#545A00,#287200,#087C00,#007628,#006678,#000000,#000000,#000000,#ECEEEC,#4C9AEC,#787CEC,#B062EC,#E454EC,#EC58B4,#EC6A64,#D48820,#A0AA00,#74C400,#4CD020,#38CC6C,#38B4CC,#3C3C3C,#000000,#000000,#ECEEEC,#A8CCEC,#BCBCEC,#D4B2EC,#ECAEEC,#ECAED4,#ECB4B0,#E4C490,#CCD278,#B4DE78,#A8E290,#98E2B4,#A0D6E4,#A0A2A0,#000000,#000000
# Some other palette examples: http://emulation.gametechwiki.com/index.php/Famicom_Color_Palette
}
refcoldef
{
id col_nintendo_gb
desc Nintendo Game Boy
# black & white "colors" are based on luminance only
# so we need an RGB equivalent palette
# this is based on the yellow-green tint on the original system
refpal #fffb87,#b1ae4e,#84804e,#4e4e4e
}
refcoldef
{
id col_nintendo_gb_pocket
desc Nintendo Game Boy Pocket
# this is based on the light gray/black tint of the GB Pocket screen
refpal #c4cfa1,#8b956d,#6b7353,#414141
}