mirror of
https://github.com/holub/mame
synced 2025-07-06 18:39:28 +03:00
harddriv.c: a few more functions moved in the driver state. (nw)
This commit is contained in:
parent
448611e3f1
commit
f159c04207
@ -37,11 +37,10 @@ void harddriv_state::hdsnd_init()
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void update_68k_interrupts(running_machine &machine)
|
||||
void harddriv_state::update_68k_interrupts()
|
||||
{
|
||||
harddriv_state *state = machine.driver_data<harddriv_state>();
|
||||
state->m_soundcpu->set_input_line(1, state->m_mainflag ? ASSERT_LINE : CLEAR_LINE);
|
||||
state->m_soundcpu->set_input_line(3, state->m_irq68k ? ASSERT_LINE : CLEAR_LINE);
|
||||
m_soundcpu->set_input_line(1, m_mainflag ? ASSERT_LINE : CLEAR_LINE);
|
||||
m_soundcpu->set_input_line(3, m_irq68k ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -66,18 +65,17 @@ READ16_MEMBER(harddriv_state::hd68k_snd_status_r)
|
||||
}
|
||||
|
||||
|
||||
static TIMER_CALLBACK( delayed_68k_w )
|
||||
TIMER_CALLBACK_MEMBER( harddriv_state::delayed_68k_w )
|
||||
{
|
||||
harddriv_state *state = machine.driver_data<harddriv_state>();
|
||||
state->m_maindata = param;
|
||||
state->m_mainflag = 1;
|
||||
update_68k_interrupts(machine);
|
||||
m_maindata = param;
|
||||
m_mainflag = 1;
|
||||
update_68k_interrupts();
|
||||
}
|
||||
|
||||
|
||||
WRITE16_MEMBER(harddriv_state::hd68k_snd_data_w)
|
||||
{
|
||||
machine().scheduler().synchronize(FUNC(delayed_68k_w), data);
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(harddriv_state::delayed_68k_w), this), data);
|
||||
logerror("%06X:main write to sound=%04X\n", space.device().safe_pcbase(), data);
|
||||
}
|
||||
|
||||
@ -87,7 +85,7 @@ WRITE16_MEMBER(harddriv_state::hd68k_snd_reset_w)
|
||||
m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
|
||||
m_soundcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
|
||||
m_mainflag = m_soundflag = 0;
|
||||
update_68k_interrupts(machine());
|
||||
update_68k_interrupts();
|
||||
logerror("%06X:Reset sound\n", space.device().safe_pcbase());
|
||||
}
|
||||
|
||||
@ -102,7 +100,7 @@ WRITE16_MEMBER(harddriv_state::hd68k_snd_reset_w)
|
||||
READ16_MEMBER(harddriv_state::hdsnd68k_data_r)
|
||||
{
|
||||
m_mainflag = 0;
|
||||
update_68k_interrupts(machine());
|
||||
update_68k_interrupts();
|
||||
logerror("%06X:sound read from main=%04X\n", space.device().safe_pcbase(), m_maindata);
|
||||
return m_maindata;
|
||||
}
|
||||
@ -206,7 +204,7 @@ WRITE16_MEMBER(harddriv_state::hdsnd68k_speech_w)
|
||||
WRITE16_MEMBER(harddriv_state::hdsnd68k_irqclr_w)
|
||||
{
|
||||
m_irq68k = 0;
|
||||
update_68k_interrupts(machine());
|
||||
update_68k_interrupts();
|
||||
}
|
||||
|
||||
|
||||
@ -318,7 +316,7 @@ WRITE16_MEMBER(harddriv_state::hdsnddsp_gen68kirq_w)
|
||||
{
|
||||
/* generate 68k IRQ */
|
||||
m_irq68k = 1;
|
||||
update_68k_interrupts(machine());
|
||||
update_68k_interrupts();
|
||||
}
|
||||
|
||||
|
||||
|
@ -296,6 +296,8 @@ public:
|
||||
/*----------- defined in audio/harddriv.c -----------*/
|
||||
|
||||
void hdsnd_init();
|
||||
void update_68k_interrupts();
|
||||
TIMER_CALLBACK_MEMBER( delayed_68k_w );
|
||||
|
||||
/*----------- defined in machine/harddriv.c -----------*/
|
||||
|
||||
@ -377,6 +379,9 @@ public:
|
||||
DECLARE_WRITE16_MEMBER( hdds3_sdsp_control_w );
|
||||
DECLARE_READ16_MEMBER( hdds3_xdsp_control_r );
|
||||
DECLARE_WRITE16_MEMBER( hdds3_xdsp_control_w );
|
||||
|
||||
void hdds3sdsp_reset_timer();
|
||||
void hdds3xdsp_reset_timer();
|
||||
|
||||
/* DSK board */
|
||||
DECLARE_WRITE16_MEMBER( hd68k_dsk_control_w );
|
||||
|
@ -25,16 +25,6 @@
|
||||
#define LOG_COMMANDS 0
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Static globals
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void hdds3sdsp_reset_timer(running_machine &machine);
|
||||
static void hdds3xdsp_reset_timer(running_machine &machine);
|
||||
|
||||
#if 0
|
||||
#pragma mark * DRIVER/MULTISYNC BOARD
|
||||
#endif
|
||||
@ -1169,7 +1159,7 @@ WRITE16_MEMBER( harddriv_state::hdds3_sdsp_control_w )
|
||||
if (m_ds3sdsp_regs[0x1b] != data)
|
||||
{
|
||||
m_ds3sdsp_regs[0x1b] = data;
|
||||
hdds3sdsp_reset_timer(space.machine());
|
||||
hdds3sdsp_reset_timer();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1178,7 +1168,7 @@ WRITE16_MEMBER( harddriv_state::hdds3_sdsp_control_w )
|
||||
if (m_ds3sdsp_regs[0x1c] != data)
|
||||
{
|
||||
m_ds3sdsp_regs[0x1c] = data;
|
||||
hdds3sdsp_reset_timer(space.machine());
|
||||
hdds3sdsp_reset_timer();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1248,17 +1238,15 @@ TIMER_DEVICE_CALLBACK( ds3sdsp_internal_timer_callback )
|
||||
}
|
||||
|
||||
|
||||
static void hdds3sdsp_reset_timer(running_machine &machine)
|
||||
void harddriv_state::hdds3sdsp_reset_timer()
|
||||
{
|
||||
harddriv_state *state = machine.driver_data<harddriv_state>();
|
||||
|
||||
if (!state->m_ds3sdsp_timer_en)
|
||||
if (!m_ds3sdsp_timer_en)
|
||||
return;
|
||||
|
||||
UINT16 count = state->m_ds3sdsp_regs[0x1c];
|
||||
UINT16 scale = state->m_ds3sdsp_regs[0x1b] + 1;
|
||||
UINT16 count = m_ds3sdsp_regs[0x1c];
|
||||
UINT16 scale = m_ds3sdsp_regs[0x1b] + 1;
|
||||
|
||||
state->m_ds3sdsp_internal_timer->adjust(state->m_ds3sdsp->cycles_to_attotime(count * scale));
|
||||
m_ds3sdsp_internal_timer->adjust(m_ds3sdsp->cycles_to_attotime(count * scale));
|
||||
}
|
||||
|
||||
void hdds3sdsp_timer_enable_callback(adsp21xx_device &device, int enable)
|
||||
@ -1268,7 +1256,7 @@ void hdds3sdsp_timer_enable_callback(adsp21xx_device &device, int enable)
|
||||
state->m_ds3sdsp_timer_en = enable;
|
||||
|
||||
if (enable)
|
||||
hdds3sdsp_reset_timer(device.machine());
|
||||
state->hdds3sdsp_reset_timer();
|
||||
else
|
||||
state->m_ds3sdsp_internal_timer->adjust(attotime::never);
|
||||
}
|
||||
@ -1289,17 +1277,15 @@ TIMER_DEVICE_CALLBACK( ds3xdsp_internal_timer_callback )
|
||||
}
|
||||
|
||||
|
||||
static void hdds3xdsp_reset_timer(running_machine &machine)
|
||||
void harddriv_state::hdds3xdsp_reset_timer()
|
||||
{
|
||||
harddriv_state *state = machine.driver_data<harddriv_state>();
|
||||
|
||||
if (!state->m_ds3xdsp_timer_en)
|
||||
if (!m_ds3xdsp_timer_en)
|
||||
return;
|
||||
|
||||
UINT16 count = state->m_ds3xdsp_regs[0x1c];
|
||||
UINT16 scale = state->m_ds3xdsp_regs[0x1b] + 1;
|
||||
UINT16 count = m_ds3xdsp_regs[0x1c];
|
||||
UINT16 scale = m_ds3xdsp_regs[0x1b] + 1;
|
||||
|
||||
state->m_ds3xdsp_internal_timer->adjust(state->m_ds3xdsp->cycles_to_attotime(count * scale));
|
||||
m_ds3xdsp_internal_timer->adjust(m_ds3xdsp->cycles_to_attotime(count * scale));
|
||||
}
|
||||
|
||||
|
||||
@ -1310,7 +1296,7 @@ void hdds3xdsp_timer_enable_callback(adsp21xx_device &device, int enable)
|
||||
state->m_ds3xdsp_timer_en = enable;
|
||||
|
||||
if (enable)
|
||||
hdds3xdsp_reset_timer(device.machine());
|
||||
state->hdds3xdsp_reset_timer();
|
||||
else
|
||||
state->m_ds3xdsp_internal_timer->adjust(attotime::never);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user