Previous 15994 Revisions Next

r3090 Saturday 23rd August, 2008 at 10:05:04 UTC by Robbbert
[MBEE] Connected up the colour prom
[src/mess/drivers]mbee.c

src/mess/drivers/mbee.c
r3089r3090
240240   GFXDECODE_ENTRY( "main", 0x11000, mbee_charlayout, 0, 4096 )
241241GFXDECODE_END
242242
243static PALETTE_INIT( mbee )
243static PALETTE_INIT( mbeeic )
244244{
245245   UINT16 i;
246   UINT8 r, b, g;
247   UINT8 level[] = { 0, 0x80, 0xff };   /* off, half, full intensity */
246   UINT8 r, b, g, k;
247   UINT8 level[] = { 0, 0x80, 0xff, 0xff };   /* off, half, full intensity */
248248
249   /* The foreground colours are determined by an undumped PROM, these are a best guess */
250   UINT8 fgt[] = { 0, 18, 6, 24, 2, 20, 8, 26,
251         0, 21, 15, 19, 11, 7, 5, 26,
252         0, 9, 3, 12, 1, 10, 4, 13,
253         0, 25, 23, 22, 17, 16, 14, 26 };
249   /* space for colortable (64 background and 32 foreground) */
250   machine->colortable = colortable_alloc(machine, 96);
254251
255   UINT8 bgt[] = { 0, 1, 3, 4, 9, 10, 12, 13,   /* low intensity */
256         0, 2, 3, 5, 9, 11, 12, 14,   /* red at full */
257         0, 1, 6, 7, 9, 10, 15, 16,   /* green at full */
258         0, 2, 6, 8, 9, 11, 15, 17,   /* red and green at full */
259         0, 1, 3, 4, 18, 19, 21, 22,   /* blue at full */
260         0, 2, 3, 5, 18, 20, 21, 23,   /* blue and red at full */
261         0, 1, 6, 7, 18, 19, 24, 25,   /* blue and green at full */
262         0, 2, 6, 8, 18, 20, 24, 26 };   /* full intensity */
252   /* set up background colortable */
253   for (i = 0; i < 64; i++)
254   {
255      r = level[((i>>0)&1)|((i>>2)&2)];
256      g = level[((i>>1)&1)|((i>>3)&2)];
257      b = level[((i>>2)&1)|((i>>4)&2)];
258      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
259   }
263260
264   /* space for colortable */
265   machine->colortable = colortable_alloc(machine, 27);
261   /* set up foreground colortable by reading the prom */
262   for (i = 0; i < 32; i++)
263   {
264      k = color_prom[i];
265      r = level[((k>>2)&1)|((k>>4)&2)];
266      g = level[((k>>1)&1)|((k>>3)&2)];
267      b = level[((k>>0)&1)|((k>>2)&2)];
268      colortable_palette_set_color(machine->colortable, i|64, MAKE_RGB(r, g, b));
269   }
266270
267   /* create 27 unique colours */
268   for (b = 0; b < 3; b++)
269      for (g = 0; g < 3; g++)
270         for (r = 0; r < 3; r++)
271            colortable_palette_set_color(machine->colortable, b*9+g*3+r, MAKE_RGB(level[r], level[g], level[b]));
271   /* set up background palette */
272   for (i = 0; i < 64; i++)
273      for (r = 0; r < 32; r++)
274         colortable_entry_set_value(machine->colortable, ((i<<5)|r)<<1, i);
272275
273276   /* set up foreground palette */
274   for (i = 1; i < 8192; i+=2) colortable_entry_set_value(machine->colortable, i, fgt[(i>>1)&0x1f]);
275
276   /* set up background palette */
277277   for (i = 0; i < 64; i++)
278278      for (r = 0; r < 32; r++)
279         colortable_entry_set_value(machine->colortable, ((i<<5)|r)<<1, bgt[i]);
279         colortable_entry_set_value(machine->colortable, (((i<<5)|r)<<1)|1, r|64);
280280}
281281
282282static const struct z80_irq_daisy_chain mbee_daisy_chain[] =
r3089r3090
341341   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
342342   MDRV_SCREEN_SIZE(70*8, 310)
343343   MDRV_SCREEN_VISIBLE_AREA(0*8, 70*8-1, 0, 19*16-1)
344   MDRV_PALETTE_LENGTH(4096*2)
345   MDRV_PALETTE_INIT(mbee)
344   MDRV_PALETTE_LENGTH(0x1000)
345   MDRV_PALETTE_INIT(mbeeic)
346346
347347   MDRV_VIDEO_START(mbeeic)
348348   MDRV_VIDEO_UPDATE(mbeeic)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team