mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
(MESS) sms.c: Reduce tagmap lookups for sscope and fixed validation error when using the lphaser controller on a driver with sscope support. [Enik Land]
Fixed crashes from reading the reset port on some drivers. [Wilbert Pol]
This commit is contained in:
parent
704e073cba
commit
6f3962f6d0
@ -42,6 +42,7 @@ public:
|
||||
m_port_reset(*this, "RESET"),
|
||||
m_port_start(*this, "START"),
|
||||
m_port_scope(*this, "SEGASCOPE"),
|
||||
m_port_scope_binocular(*this, "SSCOPE_BINOCULAR"),
|
||||
m_port_persist(*this, "PERSISTENCE"),
|
||||
m_is_gamegear(0),
|
||||
m_is_region_japan(0),
|
||||
@ -67,6 +68,7 @@ public:
|
||||
optional_ioport m_port_reset;
|
||||
optional_ioport m_port_start;
|
||||
optional_ioport m_port_scope;
|
||||
optional_ioport m_port_scope_binocular;
|
||||
optional_ioport m_port_persist;
|
||||
|
||||
device_t *m_left_lcd;
|
||||
|
@ -244,7 +244,14 @@ READ8_MEMBER(sms_state::sms_input_port_dd_r)
|
||||
sms_get_inputs(space);
|
||||
|
||||
// Reset Button
|
||||
m_port_dd_reg &= ~0x10 | (m_port_reset->read_safe(0x01) & 0x01) << 4;
|
||||
if ( m_port_reset )
|
||||
{
|
||||
m_port_dd_reg &= ~0x10 | (m_port_reset->read() & 0x01) << 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_port_dd_reg |= 0x10;
|
||||
}
|
||||
|
||||
// Check if TR of controller port 2 is set to output (0)
|
||||
if (!(m_io_ctrl_reg & 0x04))
|
||||
@ -298,7 +305,7 @@ WRITE8_MEMBER(sms_state::sms_ym2413_data_port_w)
|
||||
{
|
||||
if (m_has_fm)
|
||||
{
|
||||
logerror("data_port_w %x %x\n", offset, data);
|
||||
//logerror("data_port_w %x %x\n", offset, data);
|
||||
m_ym->write(space, 1, data);
|
||||
}
|
||||
}
|
||||
@ -313,7 +320,7 @@ READ8_MEMBER(sms_state::gg_input_port_2_r)
|
||||
|
||||
READ8_MEMBER(sms_state::sms_sscope_r)
|
||||
{
|
||||
int sscope = m_port_scope->read_safe(0x00);
|
||||
int sscope = m_port_scope->read();
|
||||
|
||||
if ( sscope )
|
||||
{
|
||||
@ -329,7 +336,7 @@ WRITE8_MEMBER(sms_state::sms_sscope_w)
|
||||
{
|
||||
m_mainram[0x1FF8 + offset] = data;
|
||||
|
||||
int sscope = m_port_scope->read_safe(0x00);
|
||||
int sscope = m_port_scope->read();
|
||||
|
||||
if ( sscope )
|
||||
{
|
||||
@ -969,7 +976,7 @@ VIDEO_RESET_MEMBER(sms_state,sms1)
|
||||
{
|
||||
if (m_port_scope->read())
|
||||
{
|
||||
UINT8 sscope_binocular_hack = ioport("SSCOPE_BINOCULAR")->read();
|
||||
UINT8 sscope_binocular_hack = m_port_scope_binocular->read();
|
||||
|
||||
if (sscope_binocular_hack & 0x01)
|
||||
m_prevleft_bitmap.fill(RGB_BLACK);
|
||||
@ -1041,7 +1048,7 @@ UINT32 sms_state::screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap
|
||||
// save a copy of current bitmap for the binocular hack
|
||||
if (sscope)
|
||||
{
|
||||
sscope_binocular_hack = ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
|
||||
sscope_binocular_hack = m_port_scope_binocular->read();
|
||||
|
||||
if (&screen == m_left_lcd)
|
||||
{
|
||||
@ -1061,7 +1068,7 @@ UINT32 sms_state::screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap
|
||||
// use the copied bitmap for the binocular hack
|
||||
if (sscope)
|
||||
{
|
||||
sscope_binocular_hack = ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
|
||||
sscope_binocular_hack = m_port_scope_binocular->read();
|
||||
|
||||
if (&screen == m_left_lcd)
|
||||
{
|
||||
@ -1080,7 +1087,7 @@ UINT32 sms_state::screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap
|
||||
}
|
||||
}
|
||||
}
|
||||
bitmap.fill(RGB_BLACK);
|
||||
bitmap.fill(RGB_BLACK, cliprect);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -77,6 +77,9 @@ sms_light_phaser_device::sms_light_phaser_device(const machine_config &mconfig,
|
||||
m_lphaser_x(*this, "LPHASER_X"),
|
||||
m_lphaser_y(*this, "LPHASER_Y")
|
||||
{
|
||||
// Workaround for failed validation that occurs when running on a driver
|
||||
// with Sega Scope emulation, which adds 2 screens for left/right lens.
|
||||
m_screen_tag = ":screen";
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user