trunk/src/mess/machine/sms.c
| r20418 | r20419 | |
| 239 | 239 | case 0x04: /* Sports Pad */ |
| 240 | 240 | if (data != m_sports_pad_last_data_1) |
| 241 | 241 | { |
| 242 | | UINT32 cpu_cycles = downcast<cpu_device *>(&space.device())->total_cycles(); |
| 242 | UINT32 cpu_cycles = m_main_cpu->total_cycles(); |
| 243 | 243 | |
| 244 | 244 | m_sports_pad_last_data_1 = data; |
| 245 | 245 | if (cpu_cycles - m_last_sports_pad_time_1 > 512) |
| r20418 | r20419 | |
| 261 | 261 | case 0x40: /* Sports Pad */ |
| 262 | 262 | if (data != m_sports_pad_last_data_2) |
| 263 | 263 | { |
| 264 | | UINT32 cpu_cycles = downcast<cpu_device *>(&space.device())->total_cycles(); |
| 264 | UINT32 cpu_cycles = m_main_cpu->total_cycles(); |
| 265 | 265 | |
| 266 | 266 | m_sports_pad_last_data_2 = data; |
| 267 | 267 | if (cpu_cycles - m_last_sports_pad_time_2 > 2048) |
| r20418 | r20419 | |
| 856 | 856 | |
| 857 | 857 | READ8_MEMBER(sms_state::sms_sscope_r) |
| 858 | 858 | { |
| 859 | | int sscope = machine().root_device().ioport("SEGASCOPE")->read_safe(0x00); |
| 859 | int sscope = ioport("SEGASCOPE")->read_safe(0x00); |
| 860 | 860 | |
| 861 | 861 | if ( sscope ) |
| 862 | 862 | { |
| r20418 | r20419 | |
| 872 | 872 | { |
| 873 | 873 | m_mainram[0x1FF8 + offset] = data; |
| 874 | 874 | |
| 875 | | int sscope = machine().root_device().ioport("SEGASCOPE")->read_safe(0x00); |
| 875 | int sscope = ioport("SEGASCOPE")->read_safe(0x00); |
| 876 | 876 | |
| 877 | 877 | if ( sscope ) |
| 878 | 878 | { |
| r20418 | r20419 | |
| 1919 | 1919 | m_ym = machine().device("ym2413"); |
| 1920 | 1920 | m_left_lcd = machine().device("left_lcd"); |
| 1921 | 1921 | m_right_lcd = machine().device("right_lcd"); |
| 1922 | | m_space = &machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 1922 | m_space = &m_main_cpu->space(AS_PROGRAM); |
| 1923 | 1923 | |
| 1924 | 1924 | /* Check if lightgun has been chosen as input: if so, enable crosshair */ |
| 1925 | 1925 | machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(sms_state::lightgun_tick),this)); |
| r20418 | r20419 | |
| 2080 | 2080 | logerror("0x%04X: sms_store_control write 0x%02X\n", space.device().safe_pc(), data); |
| 2081 | 2081 | if (data & 0x02) |
| 2082 | 2082 | { |
| 2083 | | machine().device<cpu_device>("maincpu")->resume(SUSPEND_REASON_HALT); |
| 2083 | m_main_cpu->resume(SUSPEND_REASON_HALT); |
| 2084 | 2084 | } |
| 2085 | 2085 | else |
| 2086 | 2086 | { |
| 2087 | 2087 | /* Pull reset line of CPU #0 low */ |
| 2088 | | machine().device("maincpu")->reset(); |
| 2089 | | machine().device<cpu_device>("maincpu")->suspend(SUSPEND_REASON_HALT, 1); |
| 2088 | m_main_cpu->reset(); |
| 2089 | m_main_cpu->suspend(SUSPEND_REASON_HALT, 1); |
| 2090 | 2090 | } |
| 2091 | 2091 | m_store_control = data; |
| 2092 | 2092 | } |
| r20418 | r20419 | |
| 2186 | 2186 | |
| 2187 | 2187 | if (&screen != m_main_scr) |
| 2188 | 2188 | { |
| 2189 | | sscope = machine().root_device().ioport("SEGASCOPE")->read_safe(0x00); |
| 2189 | sscope = ioport("SEGASCOPE")->read_safe(0x00); |
| 2190 | 2190 | if (!sscope) |
| 2191 | 2191 | { |
| 2192 | 2192 | // without SegaScope, both LCDs for glasses go black |
| r20418 | r20419 | |
| 2214 | 2214 | // save a copy of current bitmap for the binocular hack |
| 2215 | 2215 | if (sscope) |
| 2216 | 2216 | { |
| 2217 | | sscope_binocular_hack = machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00); |
| 2217 | sscope_binocular_hack = ioport("SSCOPE_BINOCULAR")->read_safe(0x00); |
| 2218 | 2218 | |
| 2219 | 2219 | if (&screen == m_left_lcd) |
| 2220 | 2220 | { |
| r20418 | r20419 | |
| 2234 | 2234 | // use the copied bitmap for the binocular hack |
| 2235 | 2235 | if (sscope) |
| 2236 | 2236 | { |
| 2237 | | sscope_binocular_hack = machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00); |
| 2237 | sscope_binocular_hack = ioport("SSCOPE_BINOCULAR")->read_safe(0x00); |
| 2238 | 2238 | |
| 2239 | 2239 | if (&screen == m_left_lcd) |
| 2240 | 2240 | { |