Previous 199869 Revisions Next

r21212 Wednesday 20th February, 2013 at 15:26:43 UTC by David Haywood
some sprite compression notes from Charles & Andrew, if they're not wanted in here I'll strip them out.
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21211r21212
245245
246246******************************************************************************************************/
247247
248/*
248249
250some Sprite compression notes from Charles and Andrew
251
252OK so here's what we know. Andrew and I were playing with the ROMs and
253Guru traced out connections on the board at the time:
254
255The ten graphics ROMs are IC1-IC10. Each is 16 bits, and all have a
256common enable and common A20 input. All data lines are unique; nothing
257is shared.
258
259There are two independent address buses:
260- One drives A0-A19 of IC1-IC5
261- The other drives A0-A19 of IC6-IC10
262
263So the ROMs are arranged as 4,194,304 x 160-bit words (very wide), and
264are divided into two banks of 2,097,152 x 160-bit words per bank,
265where the common A20 input selects which bank is currently being used.
266This bank bit may not come from the graphics hardware and could just
267be a spare I/O pin on some other chip, we don't know.
268
269Then, within the current bank selected, the video chip can generate
270independent addresses for IC1-5 and IC6-10 in parallel, so that it can
271read 80 bits from IC1-5 at one address, and 80 bits from IC6-10 at
272another address simultaneously. Or it can drive the same address and
273read a 160-bit word at once. Regardless both addresses are restricted
274to the same bank as defined through A20.
275
276From looking at the ROMs there seem to be structures that may be
277tables. A table would be needed to associate a tile number with RLE
278data in ROM, so that would be a likely function of tables in the ROM.
279It may be that the split address design allows the chip to read table
280data from one 80-bit port while reading in graphics data from the
281other.
282
283Now this next bit is just an interpretation of what's in the patent,
284so you probably already know it:
285
286The primitive unit of graphics data is a 10-bit word (hence all the
287multiples of 10 listed above, e.g. 80 and 160-bit words) The top two
288bits define the type:
289
2900,x : $000 : Type A (3-bit color code, 5-bit run length, 1 bit "cell" flag)
2911,x : $800 : Type B (7-bit color code, 2-bit run length)
2921,1 : $C00 : Type C (8-bit color code)
293
294Because the top two bits (which identify the type) are shared with the
295color code, this limits the range of colors somewhat. E.g. one of the
296patent diagrams shows the upper 4 bits of a Type A pixel moved into
297the bottom four bits of the color RAM index, but for type A the most
298significant bit is always zero. So that 4-bit quantity is always 0-7
299which is why type A has a limit of 8 colors.
300
301This is why one of the later diagrams shows the Type B pixel ANDed
302with 7F and the Type C pixel ANDed with 3FF, to indicate the two
303indicator bits are being stripped out and the remaining value is
304somewhat truncated.
305
306We figured due to the colorful graphics in the game there would be a
307large groups of Type C pixels, but we could never find an
308rearrangement of data and address bits that yielded a large number of
309words with bits 9,8 set. Some of the data looks like it's linear, and
310some of it looks like bitplanes. Perhaps tables are linear and
311graphics are planar.
312
313We tried the usual stuff; assuming the 16-bit words from each ROM was
314a 160-pixel wide array of 10-bit elements (linear), or assuming each
315bit from each ROM was a single bit of a 10-bit word so 16 bits defined
31616 10-bit words in parallel (planar), and never got useful output.
317
318There may be some weird data/address scrambling done to put data in an
319order easiest for the hardware to process, which would be
320non-intuitive.
321
322Also the two indicator bits may have different polarities, maybe 0,0
323is Type C instead of 1,1.
324
325*/
326
327
249328#include "emu.h"
250329#include "debugger.h"
251330#include "cpu/sh2/sh2.h"

Previous 199869 Revisions Next


© 1997-2024 The MAME Team