Previous 199869 Revisions Next

r30596 Thursday 22nd May, 2014 at 16:00:23 UTC by hap
added resnet info
[src/mame/video]finalizr.c

trunk/src/mame/video/finalizr.c
r30595r30596
77***************************************************************************/
88
99#include "emu.h"
10#include "video/resnet.h"
1011#include "includes/finalizr.h"
1112
1213
14/***************************************************************************
15
16  The palette PROMs are connected to the RGB output this way:
17
18  bit 7 -- 220  ohm resistor  -- \
19        -- 470  ohm resistor  -- | -- 470 ohm pulldown resistor -- GREEN
20        -- 1   kohm resistor  -- |
21        -- 2.2 kohm resistor  -- /
22        -- 220  ohm resistor  -- \
23        -- 470  ohm resistor  -- | -- 470 ohm pulldown resistor -- RED
24        -- 1   kohm resistor  -- |
25  bit 0 -- 2.2 kohm resistor  -- /
26
27
28  bit 3 -- 220  ohm resistor  -- \
29        -- 470  ohm resistor  -- | -- 470 ohm pulldown resistor -- BLUE
30        -- 1   kohm resistor  -- |
31  bit 0 -- 2.2 kohm resistor  -- /
32
33***************************************************************************/
34
1335PALETTE_INIT_MEMBER(finalizr_state, finalizr)
1436{
1537   const UINT8 *color_prom = memregion("proms")->base();
38   static const int resistances[4] = { 2200, 1000, 470, 220 };
39   double rweights[4], gweights[4], bweights[4];
1640   int i;
1741
42   /* compute the color output resistor weights */
43   compute_resistor_weights(0, 255, -1.0,
44         4, &resistances[0], rweights, 470, 0,
45         4, &resistances[0], gweights, 470, 0,
46         4, &resistances[0], bweights, 470, 0);
47
1848   /* create a lookup table for the palette */
1949   for (i = 0; i < 0x20; i++)
2050   {
21      int r = pal4bit(color_prom[i + 0x00] >> 0);
22      int g = pal4bit(color_prom[i + 0x00] >> 4);
23      int b = pal4bit(color_prom[i + 0x20] >> 0);
51      int bit0, bit1, bit2, bit3;
52      int r, g, b;
2453
54      /* red component */
55      bit0 = (color_prom[i] >> 0) & 0x01;
56      bit1 = (color_prom[i] >> 1) & 0x01;
57      bit2 = (color_prom[i] >> 2) & 0x01;
58      bit3 = (color_prom[i] >> 3) & 0x01;
59      r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
60
61      /* green component */
62      bit0 = (color_prom[i] >> 4) & 0x01;
63      bit1 = (color_prom[i] >> 5) & 0x01;
64      bit2 = (color_prom[i] >> 6) & 0x01;
65      bit3 = (color_prom[i] >> 7) & 0x01;
66      g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
67
68      /* blue component */
69      bit0 = (color_prom[i + 0x20] >> 0) & 0x01;
70      bit1 = (color_prom[i + 0x20] >> 1) & 0x01;
71      bit2 = (color_prom[i + 0x20] >> 2) & 0x01;
72      bit3 = (color_prom[i + 0x20] >> 3) & 0x01;
73      b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
74
2575      palette.set_indirect_color(i, rgb_t(r, g, b));
2676   }
2777

Previous 199869 Revisions Next


© 1997-2024 The MAME Team