summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2018-02-10 13:56:27 -0500
committerGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2018-02-10 13:56:27 -0500
commit668410eabfbbfe75711f94fb3efcc5fcfb021de5 (patch) (github)
treee4efbe24ee8d19664db84fbd22f2ae98d64bc8de
parent2d56e8c98e52107fee01f95e0b0eaa87e0a9d09e (diff)
downloadmame-668410eabfbbfe75711f94fb3efcc5fcfb021de5.tar.bz2
mame-668410eabfbbfe75711f94fb3efcc5fcfb021de5.zip
inder_sb.cpp: Clean up code, register state for saving (nw)
-rw-r--r--src/mame/machine/inder_sb.cpp63
-rw-r--r--src/mame/machine/inder_sb.h9
2 files changed, 6 insertions, 66 deletions
diff --git a/src/mame/machine/inder_sb.cpp b/src/mame/machine/inder_sb.cpp
index 05e29e3ad5b..5a571a27510 100644
--- a/src/mame/machine/inder_sb.cpp
+++ b/src/mame/machine/inder_sb.cpp
@@ -56,57 +56,6 @@ WRITE16_MEMBER(inder_sb_device::megaphx_0x050000_w)
}
-void inder_sb_device::update_sound_irqs(void)
-{
- if (m_soundirq) m_audiocpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
- else m_audiocpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
-}
-
-WRITE_LINE_MEMBER(inder_sb_device::z80ctc_ch0)
-{
-// int bank = m_soundbank[0] & 7; membank("snddata")->set_entry(bank);
-// m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
- if (state) m_soundirq |= 0x1;
- else m_soundirq &= ~0x1;
-
- update_sound_irqs();
-}
-
-
-WRITE_LINE_MEMBER(inder_sb_device::z80ctc_ch1)
-{
-// int bank = m_soundbank[1] & 7; membank("snddata")->set_entry(bank);
-// m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
- if (state) m_soundirq |= 0x2;
- else m_soundirq &= ~0x2;
-
- update_sound_irqs();
-}
-
-
-WRITE_LINE_MEMBER(inder_sb_device::z80ctc_ch2)
-{
-// int bank = m_soundbank[2] & 7; membank("snddata")->set_entry(bank);
-// m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
- if (state) m_soundirq |= 0x4;
- else m_soundirq &= ~0x4;
-
- update_sound_irqs();
-}
-
-
-
-
-WRITE_LINE_MEMBER(inder_sb_device::z80ctc_ch3)
-{
-// int bank = m_soundbank[3] & 7; membank("snddata")->set_entry(bank);
-// m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
- if (state) m_soundirq |= 0x8;
- else m_soundirq &= ~0x8;
-
- update_sound_irqs();
-}
-
@@ -210,11 +159,7 @@ MACHINE_CONFIG_START(inder_sb_device::device_add_mconfig)
MCFG_DEVICE_ADD("ctc", Z80CTC, 4000000) // unk freq
// runs in IM2 , vector set to 0x20 , values there are 0xCC, 0x02, 0xE6, 0x02, 0x09, 0x03, 0x23, 0x03 (so 02cc, 02e6, 0309, 0323, all of which are valid irq handlers)
- MCFG_Z80CTC_INTR_CB(WRITELINE(inder_sb_device, z80ctc_ch0))
- MCFG_Z80CTC_ZC0_CB(WRITELINE(inder_sb_device, z80ctc_ch1))
- MCFG_Z80CTC_ZC1_CB(WRITELINE(inder_sb_device, z80ctc_ch2))
- MCFG_Z80CTC_ZC2_CB(WRITELINE(inder_sb_device, z80ctc_ch3))
- // was this correct?!?
+ MCFG_Z80CTC_INTR_CB(INPUTLINE("audiocpu", 0))
MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("dac0", DAC_8BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
@@ -237,9 +182,13 @@ void inder_sb_device::device_start()
{
m_sounddata_bank->configure_entries(0, 8, memregion("user2")->base(), 0x8000);
m_sounddata_bank->set_entry(0);
+
+ save_item(NAME(m_soundbank));
+ save_item(NAME(m_soundsent));
+ save_item(NAME(m_sounddata));
+ save_item(NAME(m_soundback));
}
void inder_sb_device::device_reset()
{
- m_soundirq = 0;
}
diff --git a/src/mame/machine/inder_sb.h b/src/mame/machine/inder_sb.h
index 488ce27512b..742834ffebf 100644
--- a/src/mame/machine/inder_sb.h
+++ b/src/mame/machine/inder_sb.h
@@ -42,8 +42,6 @@ public:
DECLARE_READ16_MEMBER(megaphx_0x050002_r);
DECLARE_WRITE16_MEMBER(megaphx_0x050000_w);
- void update_sound_irqs(void);
-
protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
@@ -60,13 +58,6 @@ private:
int m_soundsent;
uint8_t m_sounddata;
uint8_t m_soundback;
-
- int m_soundirq;
-
- DECLARE_WRITE_LINE_MEMBER(z80ctc_ch0);
- DECLARE_WRITE_LINE_MEMBER(z80ctc_ch1);
- DECLARE_WRITE_LINE_MEMBER(z80ctc_ch2);
- DECLARE_WRITE_LINE_MEMBER(z80ctc_ch3);
};
#endif // MAME_MACHINE_INDER_SB_H