# Layer mixing, palette and the colour output ## The mixer: K053251, or a PROM | Row | Mixer | Evidence | | --- | --- | --- | | tmnt (TMNT, M.I.A.), aliens | a 256-byte priority PROM (tmnt carries two PROMs, `963a30.g7` and `963a31.g19`) | OBSERVED (`-listxml` `proms` region, [census.md](census.md)); that `g7` is the priority PROM is HYPOTHESIS | | cuebrick | neither PROM nor K053251 in the set | OBSERVED; fixed priority (HYPOTHESIS) | | punkshot, tmnt2, xmen, simpsons | **K053251** | OBSERVED (`-listxml`) | The K053251 takes the tilemap layers' and sprites' colour codes with priority bits and picks the pixel shown, under 16 write-only registers on the main CPU's bus (OBSERVED: punkshot writes `0A0060-0A007F`, ssriders `5C0700-5C071F`, xmen `108060-10807F`, simpsons `1FB0-1FBF`; no read handler in any map). Its priority rules are **HYPOTHESIS** from the common description; its die trace (furrtek) is set aside. 23 MAME Konami parents in 12 drivers use it. ## Palette (DOC for the GX063/GX064 board, Konami schematic sheet 4) - Two **SR16KSL4** static RAMs (2 K x 8 each) form a 2,048-entry x 16-bit palette (U27, U28), one per byte lane; the main CPU's 4 KB palette window (`140000-140FFF` on ssriders) is this RAM (OBSERVED in the map, DOC in the schematic). - Three **LS157** multiplexers switch the RAM's address between the CPU (MAB, MLWR/MUWR, COLOR select) and the mixer's colour code **CO0-CO10** (11 bits = 2,048 entries); the CPU's data path goes through two LS245 buffers. - The word read for each pixel is latched by three **LS174** (U34-U36) and drives open-collector **LS07** buffers into resistor ladders, then three **052535** parts per channel group (sheet 4, right half): the colour DACs. The control lines **SHAD**, **BRIT**, **DIM0-2**, **DIMMOD** and **DIMPOL** reach that stage, so shadow, highlight and dimming are done in the analogue output stage, after the palette, not by palette arithmetic. - **NHBLK**, **NVBLK** and the 6 MHz dot clock enter through an LS164 shift register (U22) that delays blanking to match the pipeline. What the schematic does not say: the bit layout of the palette word (5-5-5 xBGR is the HYPOTHESIS, to be confirmed against the games' own palette writes and MAME's pictures), the resistor values (not legible in our copy at the resolution scanned), and the 052535's transfer curve (no data sheet known). These decide the exact output colours; until a measurement exists, the colour curve is FITTED (to MAME's output, the only detector) and said so. The family's rule "sound good enough" does not cover pictures: this is an open item (U16). ## Unknowns U16 the 052535's curve and how SHAD/BRIT/DIM change it; U17 the K053251's priority rules and its shadow handling; U18 the tmnt PROMs' contents' meaning (inputs and outputs).