improve trench colors in space encounters and simulate screen flash

effect.
This commit is contained in:
qwijibo 2016-04-30 16:30:09 -05:00
parent 97e2520a6a
commit cdfb62795a
3 changed files with 57 additions and 30 deletions

View File

@ -58,7 +58,6 @@
"Extra Inning" as "Ball Park II". "Extra Inning" as "Ball Park II".
Known issues/to-do's: Known issues/to-do's:
* Space Encounters: verify trench colors
* Space Encounters: verify strobe light frequency * Space Encounters: verify strobe light frequency
* Phantom II: cloud generator is implemented according to the schematics, * Phantom II: cloud generator is implemented according to the schematics,
but it doesn't look right. Cloud color mixing to be verified as well but it doesn't look right. Cloud color mixing to be verified as well
@ -2119,28 +2118,12 @@ MACHINE_START_MEMBER(mw8080bw_state,spcenctr)
save_item(NAME(m_spcenctr_trench_width)); save_item(NAME(m_spcenctr_trench_width));
save_item(NAME(m_spcenctr_trench_center)); save_item(NAME(m_spcenctr_trench_center));
save_item(NAME(m_spcenctr_trench_slope)); save_item(NAME(m_spcenctr_trench_slope));
save_item(NAME(m_spcenctr_bright_control));
save_item(NAME(m_spcenctr_brightness));
MACHINE_START_CALL_MEMBER(mw8080bw); MACHINE_START_CALL_MEMBER(mw8080bw);
} }
#if 0
UINT8 mw8080bw_state::spcenctr_get_trench_width()
{
return m_spcenctr_trench_width;
}
UINT8 mw8080bw_state::spcenctr_get_trench_center()
{
return m_spcenctr_trench_center;
}
UINT8 mw8080bw_state::spcenctr_get_trench_slope(UINT8 addr )
{
return m_spcenctr_trench_slope[addr & 0x0f];
}
#endif
WRITE8_MEMBER(mw8080bw_state::spcenctr_io_w) WRITE8_MEMBER(mw8080bw_state::spcenctr_io_w)
{ /* A7 A6 A5 A4 A3 A2 A1 A0 */ { /* A7 A6 A5 A4 A3 A2 A1 A0 */
@ -2166,7 +2149,15 @@ WRITE8_MEMBER(mw8080bw_state::spcenctr_io_w)
m_spcenctr_trench_center = data; /* - - - - - 1 0 0 */ m_spcenctr_trench_center = data; /* - - - - - 1 0 0 */
else if ((offset & 0x07) == 0x07) else if ((offset & 0x07) == 0x07)
m_spcenctr_trench_width = data; /* - - - - - 1 1 1 */ m_spcenctr_trench_width = data; /* - - - - - 1 1 1 */
else if ((offset & 0x07) == 0x00)
// hex flip-flop B5
// bit 3: /BRITE
// bit 2: /NO_PLANET
// bit 1: /SET_WSL
// bit 0: COIN_COUNTER
m_spcenctr_bright_control = ~data & 0x08; /* - - - - - 0 0 0 */
else else
logerror("%04x: Unmapped I/O port write to %02x = %02x\n", space.device().safe_pc(), offset, data); logerror("%04x: Unmapped I/O port write to %02x = %02x\n", space.device().safe_pc(), offset, data);

View File

@ -82,6 +82,8 @@ public:
UINT8 m_spcenctr_trench_width; UINT8 m_spcenctr_trench_width;
UINT8 m_spcenctr_trench_center; UINT8 m_spcenctr_trench_center;
UINT8 m_spcenctr_trench_slope[16]; /* 16x4 bit RAM */ UINT8 m_spcenctr_trench_slope[16]; /* 16x4 bit RAM */
UINT8 m_spcenctr_bright_control;
UINT8 m_spcenctr_brightness;
/* timer */ /* timer */
emu_timer *m_interrupt_timer; emu_timer *m_interrupt_timer;

View File

@ -68,13 +68,31 @@ UINT32 mw8080bw_state::screen_update_mw8080bw(screen_device &screen, bitmap_rgb3
* *
*************************************/ *************************************/
/* video signals mixed via R2 open collector nand gates and 'brite' RC circuit
#define PHANTOM2_BOTTOM_TRENCH_DARK_RGB32_PEN rgb_t::black * when /BRITE lo, cap C23 discharge rapidly, disabling Q2, overpowering all other video signals
#define PHANTOM2_BOTTOM_TRENCH_LIGHT_RGB32_PEN rgb_t(0x5a, 0x5a, 0x5a) * when /BRITE hi, cap C23 charge through 10k res, brite voltage decrease to 0 over approx 0.4 sec
#define PHANTOM2_TOP_TRENCH_DARK_RGB32_PEN rgb_t::black
#define PHANTOM2_TOP_TRENCH_LIGHT_RGB32_PEN rgb_t::white * inverted video data is fed into R2 nand gates:
#define PHANTOM2_SIDE_TRENCH_DARK_RGB32_PEN rgb_t::black * when /VIDEO lo, all gates open for max brightness
#define PHANTOM2_SIDE_TRENCH_LIGHT_RGB32_PEN rgb_t(0x72, 0x72, 0x72) * max V = (5 - 0.7) * 470 / (470 + 100) = 3.5 V
* when /video hi, pin 5 always gnd, max = 3 V, min = 1 V
* (guess) pin 11 state controls trench color
* (guess) pin 3 low for trench side
* (guess) pin 8 low for trench floor
* thus, trench side: 1.4 or 2.2 V
* trench floor: 1.3 or 2.0 V
* trech top: 1.8 or 3 V
* scaled to 3.2 V = 255, 1.2 V = 0 (arbitrary values chosen to match video)
*/
#define SPCENCTR_TOP_TRENCH_DARK_RGB32_PEN rgb_t(0x4d, 0x4d, 0x4d)
#define SPCENCTR_TOP_TRENCH_LIGHT_RGB32_PEN rgb_t(0xe6, 0xe6, 0xe6)
#define SPCENCTR_SIDE_TRENCH_DARK_RGB32_PEN rgb_t(0x1a, 0x1a, 0x1a)
#define SPCENCTR_SIDE_TRENCH_LIGHT_RGB32_PEN rgb_t(0x80, 0x80, 0x80)
#define SPCENCTR_BOTTOM_TRENCH_DARK_RGB32_PEN rgb_t(0x0d, 0x0d, 0x0d)
#define SPCENCTR_BOTTOM_TRENCH_LIGHT_RGB32_PEN rgb_t(0x66, 0x66, 0x66)
#define SPCENCTR_BRIGHTNESS_DECAY 10
UINT32 mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) UINT32 mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
@ -93,6 +111,13 @@ UINT32 mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rgb3
memset(line_buf, 0, 256); memset(line_buf, 0, 256);
if(m_spcenctr_bright_control)
m_spcenctr_brightness = 255;
else if(m_spcenctr_brightness > SPCENCTR_BRIGHTNESS_DECAY)
m_spcenctr_brightness -= SPCENCTR_BRIGHTNESS_DECAY;
else
m_spcenctr_brightness = 0;
while (1) while (1)
{ {
/* plot the current pixel */ /* plot the current pixel */
@ -105,13 +130,13 @@ UINT32 mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rgb3
line_buf[x] = draw_line; line_buf[x] = draw_line;
if (!bit) if (!bit)
pen = draw_line ? PHANTOM2_TOP_TRENCH_LIGHT_RGB32_PEN : PHANTOM2_TOP_TRENCH_DARK_RGB32_PEN; pen = draw_line ? SPCENCTR_TOP_TRENCH_LIGHT_RGB32_PEN : SPCENCTR_TOP_TRENCH_DARK_RGB32_PEN;
} }
/* sides of trench? */ /* sides of trench? */
else if (!(floor_width & 0x80) && (draw_trench || draw_floor)) else if (!(floor_width & 0x80) && (draw_trench || draw_floor))
{ {
if (!bit) if (!bit)
pen = line_buf[x] ? PHANTOM2_SIDE_TRENCH_LIGHT_RGB32_PEN : PHANTOM2_SIDE_TRENCH_DARK_RGB32_PEN; pen = line_buf[x] ? SPCENCTR_SIDE_TRENCH_LIGHT_RGB32_PEN : SPCENCTR_SIDE_TRENCH_DARK_RGB32_PEN;
} }
/* bottom of trench? */ /* bottom of trench? */
else if (draw_floor) else if (draw_floor)
@ -119,9 +144,12 @@ UINT32 mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rgb3
line_buf[x] = line_buf[x - 1]; line_buf[x] = line_buf[x - 1];
if (!bit) if (!bit)
pen = line_buf[x] ? PHANTOM2_BOTTOM_TRENCH_LIGHT_RGB32_PEN : PHANTOM2_BOTTOM_TRENCH_DARK_RGB32_PEN; pen = line_buf[x] ? SPCENCTR_BOTTOM_TRENCH_LIGHT_RGB32_PEN : SPCENCTR_BOTTOM_TRENCH_DARK_RGB32_PEN;
} }
if(m_spcenctr_brightness > (pen & 0xff))
pen = rgb_t(m_spcenctr_brightness, m_spcenctr_brightness, m_spcenctr_brightness);
bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, x) = pen; bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, x) = pen;
center = center + 1; center = center + 1;
@ -143,7 +171,13 @@ UINT32 mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rgb3
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
pen = (video_data & 0x01) ? rgb_t::white : rgb_t::black; if(video_data & 0x01)
pen = rgb_t::white;
else if(m_spcenctr_brightness)
pen = rgb_t(m_spcenctr_brightness, m_spcenctr_brightness, m_spcenctr_brightness);
else
pen = rgb_t::black;
bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, 256 + i) = pen; bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, 256 + i) = pen;
video_data = video_data >> 1; video_data = video_data >> 1;