Previous 199869 Revisions Next

r17764 Sunday 9th September, 2012 at 20:08:57 UTC by hap
resnet.h hates me
[src/mame/video]homerun.c

trunk/src/mame/video/homerun.c
r17763r17764
5353
5454WRITE8_MEMBER(homerun_state::homerun_color_w)
5555{
56   /* from PCB photo:
57       bit 7:  470 ohm resistor \
58       bit 6:  220 ohm resistor -  --> 470 ohm resistor  --> blue
59       bit 5:  470 ohm resistor \
60       bit 4:  220 ohm resistor -  --> 470 ohm resistor  --> green
61       bit 3:  1  kohm resistor /
62       bit 2:  470 ohm resistor \
63       bit 1:  220 ohm resistor -  --> 470 ohm resistor  --> red
64       bit 0:  1  kohm resistor /
65   */
66
67   // let's implement it the old fashioned way until it's found out how exactly the resnet is hooked up
5668   int r, g, b;
5769   int bit0, bit1, bit2;
70
5871   bit0 = (data >> 0) & 0x01;
5972   bit1 = (data >> 1) & 0x01;
6073   bit2 = (data >> 2) & 0x01;
r17763r17764
6780   bit1 = (data >> 6) & 0x01;
6881   bit2 = (data >> 7) & 0x01;
6982   b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
83
7084   palette_set_color(machine(), offset, MAKE_RGB(r,g,b));
7185}
7286

Previous 199869 Revisions Next


© 1997-2024 The MAME Team