summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/cps2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/cps2.c')
-rw-r--r--src/mame/drivers/cps2.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index 15b9b9c90b6..e848c84f2f1 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -764,7 +764,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
* Sound ?
*
*************************************/
-
+
TIMER_CALLBACK_MEMBER(cps_state::cps2_update_digital_volume)
{
int vol_button_state;
@@ -773,10 +773,10 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
if (vol_button_state & 0x01) m_cps2digitalvolumelevel -= 1;
if (vol_button_state & 0x02) m_cps2digitalvolumelevel += 1;
-
+
if (m_cps2digitalvolumelevel > 39) m_cps2digitalvolumelevel = 39;
if (m_cps2digitalvolumelevel < 0) m_cps2digitalvolumelevel = 0;
-
+
machine().device<qsound_device>("qsound")->set_output_gain(0, m_cps2digitalvolumelevel / 39.0);
machine().device<qsound_device>("qsound")->set_output_gain(1, m_cps2digitalvolumelevel / 39.0);
}
@@ -784,7 +784,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
static READ16_HANDLER( cps2_qsound_volume_r )
{
cps_state *state = space.machine().driver_data<cps_state>();
-
+
UINT16 cps2_vol_states[40] =
{
0xf010, 0xf008, 0xf004, 0xf002, 0xf001, 0xe810, 0xe808, 0xe804, 0xe802, 0xe801,
@@ -792,11 +792,11 @@ static READ16_HANDLER( cps2_qsound_volume_r )
0xe110, 0xe108, 0xe104, 0xe102, 0xe101, 0xe090, 0xe088, 0xe084, 0xe082, 0xe081,
0xe050, 0xe048, 0xe044, 0xe042, 0xe041, 0xe030, 0xe028, 0xe024, 0xe022, 0xe021
};
-
+
UINT16 result;
-
+
result = cps2_vol_states[state->m_cps2digitalvolumelevel];
-
+
/* Extra adapter memory (0x660000-0x663fff) available when bit 14 = 0 */
/* Network adapter (ssf2tb) present when bit 15 = 0 */
/* Only game known to use both these so far is SSF2TB */
@@ -959,7 +959,7 @@ static INPUT_PORTS_START( cps2_4p4b )
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit)
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line)
-
+
/* fake inputs for digital volume buttons */
PORT_START( "DIGITALVOL" )
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VOLUME_DOWN )
@@ -8201,15 +8201,15 @@ ROM_END
static void init_digital_volume(running_machine &machine)
{
cps_state *state = machine.driver_data<cps_state>();
-
+
state->m_cps2digitalvolumelevel = 39; /* maximum */
state->m_cps2disabledigitalvolume = 0;
-
+
/* create a timer to update our volume state from the fake switches - read it every 6 frames or so to enable some granularity */
state->m_digital_volume_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(cps_state::cps2_update_digital_volume),state));
state->m_digital_volume_timer->adjust(attotime::from_msec(100), 0, attotime::from_msec(100));
}
-
+
DRIVER_INIT_MEMBER(cps_state,cps2)
{
@@ -8220,9 +8220,9 @@ DRIVER_INIT_MEMBER(cps_state,cps2)
DRIVER_INIT_CALL(cps2_video);
m_cps2networkpresent = 0;
-
+
init_digital_volume(machine());
-
+
machine().device("maincpu")->set_clock_scale(0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
}
@@ -8254,7 +8254,7 @@ DRIVER_INIT_MEMBER(cps_state,pzloop2)
DRIVER_INIT_MEMBER(cps_state,singbrd)
{
DRIVER_INIT_CALL(cps2);
-
+
/* the single board games don't have a digital volume switch */
m_cps2disabledigitalvolume = 1;
m_digital_volume_timer->adjust(attotime::never, 0, attotime::never);
@@ -8305,7 +8305,7 @@ DRIVER_INIT_MEMBER(cps_state,gigaman2)
machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x618000, 0x619fff, FUNC(gigaman2_dummyqsound_r), FUNC(gigaman2_dummyqsound_w)); // no qsound..
space.set_decrypted_region(0x000000, (length) - 1, &rom[length/4]);
m68k_set_encrypted_opcode_range(machine().device("maincpu"), 0, length);
-
+
/* no digital volume switches on this? */
m_digital_volume_timer->adjust(attotime::never, 0, attotime::never);
}