system1: increase quantum for games with mcu, hook up sn ready pin

This commit is contained in:
hap 2024-11-08 19:54:55 +01:00
parent f8705815bd
commit 607153c23c
2 changed files with 20 additions and 11 deletions

View File

@ -305,6 +305,7 @@ seem to have access to.
#include "emu.h"
#include "system1.h"
#include "machine/input_merger.h"
#include "machine/segacrpt_device.h"
#include "cpu/z80/mc8123.h"
@ -574,7 +575,7 @@ void system1_state::mcu_io_w(offs_t offset, u8 data)
default:
logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
m_mcu->pc(), m_mcu_control, offset, data);
m_mcu->pc(), m_mcu_control, offset, data);
break;
}
}
@ -595,7 +596,7 @@ u8 system1_state::mcu_io_r(offs_t offset)
default:
logerror("%03X: MCU movx read mode %02X offset %04X\n",
m_mcu->pc(), m_mcu_control, offset);
m_mcu->pc(), m_mcu_control, offset);
return 0xff;
}
}
@ -2215,6 +2216,12 @@ void system1_state::sys1ppi(machine_config &config)
/* 2nd SN's clock is selectable via jumper */
SN76489A(config, m_sn[1], SOUND_CLOCK/2).add_route(ALL_OUTPUTS, "mono", 0.50);
input_merger_device &sn_ready(INPUT_MERGER_ANY_LOW(config, "sn_ready"));
sn_ready.output_handler().set_inputline(m_soundcpu, Z80_INPUT_LINE_WAIT);
m_sn[0]->ready_cb().set("sn_ready", FUNC(input_merger_device::in_w<0>));
m_sn[1]->ready_cb().set("sn_ready", FUNC(input_merger_device::in_w<1>));
}
/* reduced visible area for scrolling games */
@ -2500,6 +2507,8 @@ void system1_state::mcu(machine_config &config)
m_mcu->set_addrmap(AS_IO, &system1_state::mcu_io_map);
m_mcu->port_out_cb<1>().set(FUNC(system1_state::mcu_control_w));
config.set_maximum_quantum(attotime::from_hz(m_maincpu->clock() / 16));
m_screen->screen_vblank().set_inputline("mcu", MCS51_INT0_LINE);
// This interrupt is driven by pin 15 of a PAL16R4 (315-5138 on Choplifter), based on the vertical count.
// The actual duty cycle likely differs from VBLANK, which is another output from the same PAL.
@ -5773,8 +5782,8 @@ GAME( 1986, gardia, 0, sys1piox_317_0006, gardia, system1_state, i
GAME( 1986, brain, 0, sys1pio, brain, system1_state, init_bank44, ROT0, "Coreland / Sega", "Brain", MACHINE_SUPPORTS_SAVE )
/* System 2 */
GAME( 1985, choplift, 0, sys2rowm, choplift, system1_state, init_bank0c, ROT0, "Sega (licensed from Dan Gorlin)", "Choplifter (8751 315-5151)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, chopliftu, choplift, sys2row, choplift, system1_state, init_bank0c, ROT0, "Sega (licensed from Dan Gorlin)", "Choplifter (unprotected)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, choplift, 0, sys2rowm, choplift, system1_state, init_bank0c, ROT0, "Sega", "Choplifter (8751 315-5151)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, chopliftu, choplift, sys2row, choplift, system1_state, init_bank0c, ROT0, "Sega", "Choplifter (unprotected)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, chopliftbl, choplift, sys2row, choplift, system1_state, init_bank0c, ROT0, "bootleg", "Choplifter (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, shtngmst, 0, sys2m, shtngmst, system1_state, init_shtngmst, ROT0, "Sega", "Shooting Master (8751 315-5159a)", MACHINE_SUPPORTS_SAVE )
GAME( 1986, gardiab, gardia, sys2_317_0007, gardia, system1_state, init_bank44, ROT270, "bootleg", "Gardia (317-0007?, bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )

View File

@ -346,9 +346,6 @@ void system1_state::videoram_w(offs_t offset, u8 data)
{
videoram_wait_states(m_maincpu);
offset |= 0x1000 * ((m_videoram_bank >> 1) % (m_tilemap_pages / 2));
m_videoram[offset] = data;
m_tilemap_page[offset / 0x800]->mark_tile_dirty((offset % 0x800) / 2);
/* force a partial update if the page is changing */
if (m_tilemap_pages > 2 && offset >= 0x740 && offset < 0x748 && offset % 2 == 0)
@ -356,6 +353,9 @@ void system1_state::videoram_w(offs_t offset, u8 data)
//m_screen->update_now();
m_screen->update_partial(m_screen->vpos());
}
m_videoram[offset] = data;
m_tilemap_page[offset / 0x800]->mark_tile_dirty((offset % 0x800) / 2);
}
void system1_state::videoram_bank_w(u8 data)
@ -536,10 +536,10 @@ void system1_state::video_update_common(screen_device &screen, bitmap_ind16 &bit
/* using the sprite, background, and foreground pixels, look up the color behavior */
const u8 lookup_index = (((sprpix & 0xf) == 0) << 0) |
(((fgpix & 7) == 0) << 1) |
(((fgpix >> 9) & 3) << 2) |
(((bgpix & 7) == 0) << 4) |
(((bgpix >> 9) & 3) << 5);
(((fgpix & 7) == 0) << 1) |
(((fgpix >> 9) & 3) << 2) |
(((bgpix & 7) == 0) << 4) |
(((bgpix >> 9) & 3) << 5);
u8 lookup_value = m_lookup_prom[lookup_index];
/* compute collisions based on two of the PROM bits */