summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/konami/hornet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/konami/hornet.cpp')
-rw-r--r--src/mame/konami/hornet.cpp76
1 files changed, 30 insertions, 46 deletions
diff --git a/src/mame/konami/hornet.cpp b/src/mame/konami/hornet.cpp
index 5ba2910f4cb..2172dae5227 100644
--- a/src/mame/konami/hornet.cpp
+++ b/src/mame/konami/hornet.cpp
@@ -3,7 +3,6 @@
/* Konami Hornet System
Driver by Ville Linde
-
***************************************************************************
Konami 'Hornet' Hardware, Konami, 1997-2000
@@ -345,8 +344,7 @@ Jumpers set on GFX PCB to scope monitor:
27G XC9536 Xilinx, CPLD, Konami no. Q830B1
21C MC44200FT Motorola, 3 Channel video D/A converter
-***************************************************************************
-*/
+***************************************************************************/
#include "emu.h"
@@ -435,9 +433,6 @@ protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
- // TODO: Needs verification on real hardware
- static const int m_sound_timer_usec = 2800;
-
required_shared_ptr<uint32_t> m_workram;
optional_shared_ptr_array<uint32_t, 2> m_sharc_dataram;
required_device<ppc4xx_device> m_maincpu;
@@ -462,19 +457,18 @@ protected:
output_finder<2> m_pcb_digit;
memory_view m_cg_view;
- emu_timer *m_sound_irq_timer = nullptr;
-
+ bool m_sound_irq_enabled = false;
bool m_sndres = false;
uint8_t sysreg_r(offs_t offset);
void sysreg_w(offs_t offset, uint8_t data);
void soundtimer_en_w(uint16_t data);
- void soundtimer_count_w(uint16_t data);
+ void soundtimer_ack_w(uint16_t data);
double adc12138_input_callback(uint8_t input);
void jamma_jvs_w(uint8_t data);
template <uint8_t Which> uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- TIMER_CALLBACK_MEMBER(sound_irq);
+ INTERRUPT_GEN_MEMBER(sound_irq);
void hornet_map(address_map &map) ATTR_COLD;
void hornet_lan_map(address_map &map) ATTR_COLD;
@@ -859,31 +853,19 @@ void terabrst_state::gun_w(offs_t offset, uint16_t data)
/******************************************************************/
-TIMER_CALLBACK_MEMBER(hornet_state::sound_irq)
+INTERRUPT_GEN_MEMBER(hornet_state::sound_irq)
{
- m_audiocpu->set_input_line(M68K_IRQ_1, ASSERT_LINE);
+ if (m_sound_irq_enabled)
+ m_audiocpu->set_input_line(M68K_IRQ_1, ASSERT_LINE);
}
-
void hornet_state::soundtimer_en_w(uint16_t data)
{
- if (BIT(data, 0))
- {
- // Reset and disable timer
- m_sound_irq_timer->adjust(attotime::from_usec(m_sound_timer_usec));
- m_sound_irq_timer->enable(false);
- }
- else
- {
- // Enable timer
- m_sound_irq_timer->enable(true);
- }
+ m_sound_irq_enabled = !BIT(data, 0);
}
-void hornet_state::soundtimer_count_w(uint16_t data)
+void hornet_state::soundtimer_ack_w(uint16_t data)
{
- // Reset the count
- m_sound_irq_timer->adjust(attotime::from_usec(m_sound_timer_usec));
m_audiocpu->set_input_line(M68K_IRQ_1, CLEAR_LINE);
}
@@ -952,7 +934,7 @@ void hornet_state::sound_memmap(address_map &map)
map(0x480000, 0x480001).nopw();
map(0x4c0000, 0x4c0001).nopw();
map(0x500000, 0x500001).w(FUNC(hornet_state::soundtimer_en_w)).nopr();
- map(0x600000, 0x600001).w(FUNC(hornet_state::soundtimer_count_w)).nopr();
+ map(0x600000, 0x600001).w(FUNC(hornet_state::soundtimer_ack_w)).nopr();
}
/*****************************************************************************/
@@ -1272,8 +1254,7 @@ void hornet_state::machine_start()
// configure fast RAM regions for DRC
m_maincpu->ppcdrc_add_fastram(0x00000000, 0x003fffff, false, m_workram);
- m_sound_irq_timer = timer_alloc(FUNC(hornet_state::sound_irq), this);
-
+ save_item(NAME(m_sound_irq_enabled));
save_item(NAME(m_sndres));
}
@@ -1307,6 +1288,8 @@ void hornet_state::machine_reset()
if (m_cgboard_bank[1])
m_cgboard_bank[1]->set_entry(0);
}
+
+ m_sound_irq_enabled = false;
}
void terabrst_state::machine_reset()
@@ -1337,19 +1320,20 @@ double hornet_state::adc12138_input_callback(uint8_t input)
void hornet_state::hornet(machine_config &config)
{
// basic machine hardware
- PPC403GA(config, m_maincpu, XTAL(64'000'000) / 2); // PowerPC 403GA 32MHz
+ PPC403GA(config, m_maincpu, 64_MHz_XTAL / 2); // PowerPC 403GA 32MHz
// The default serial clock used by the ppc4xx code results in JVS comm at 57600 baud,
// so set serial clock to 7.3728MHz (xtal on PCB) to allow for 115200 baud.
// With the slower clock rate the in and out rx ptr slowly desyncs (does not read
// last byte sometimes) on frequent large responses and eventually fatal errors with
// the message "ppc4xx_spu_rx_data: buffer overrun!".
- m_maincpu->set_serial_clock(XTAL(7'372'800));
+ m_maincpu->set_serial_clock(7.3728_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &hornet_state::hornet_map);
- M68000(config, m_audiocpu, XTAL(64'000'000) / 4); // 16MHz
+ M68000(config, m_audiocpu, 64_MHz_XTAL / 4); // 16MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &hornet_state::sound_memmap);
+ m_audiocpu->set_periodic_int(FUNC(hornet_state::sound_irq), attotime::from_hz(16.9344_MHz_XTAL / 384 / 128)); // 344.5Hz (44100 / 128)
- ADSP21062(config, m_dsp[0], XTAL(36'000'000));
+ ADSP21062(config, m_dsp[0], 36_MHz_XTAL);
m_dsp[0]->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM);
m_dsp[0]->set_addrmap(AS_DATA, &hornet_state::sharc_map<0>);
@@ -1357,10 +1341,10 @@ void hornet_state::hornet(machine_config &config)
WATCHDOG_TIMER(config, m_watchdog);
-// PCB description at top doesn't mention any EEPROM on the base board...
-// EEPROM_93C46_16BIT(config, "eeprom");
+ // PCB description at top doesn't mention any EEPROM on the base board...
+ // EEPROM_93C46_16BIT(config, "eeprom");
- VOODOO_1(config, m_voodoo[0], XTAL(50'000'000));
+ VOODOO_1(config, m_voodoo[0], 50_MHz_XTAL);
m_voodoo[0]->set_fbmem(2);
m_voodoo[0]->set_tmumem(4,0);
m_voodoo[0]->set_status_cycles(1000); // optimization to consume extra cycles when polling status
@@ -1374,18 +1358,18 @@ void hornet_state::hornet(machine_config &config)
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
// default 24KHz parameter in both 037122 and voodoo, input clock correct? (58~Hz Vsync, 50MHz/3 or 64MHz/4?)
- screen.set_raw(XTAL(64'000'000) / 4, 644, 41, 41 + 512, 428, 27, 27 + 384);
+ screen.set_raw(64_MHz_XTAL / 4, 644, 41, 41 + 512, 428, 27, 27 + 384);
screen.set_screen_update(FUNC(hornet_state::screen_update<0>));
K037122(config, m_k037122[0], 0);
m_k037122[0]->set_screen("screen");
- K056800(config, m_k056800, XTAL(16'934'400));
+ K056800(config, m_k056800, 16.9344_MHz_XTAL);
m_k056800->int_callback().set_inputline(m_audiocpu, M68K_IRQ_2);
SPEAKER(config, "speaker", 2).front();
- RF5C400(config, "rfsnd", XTAL(16'934'400)) // value from Guru readme, gives 44100 Hz sample rate
+ RF5C400(config, "rfsnd", 16.9344_MHz_XTAL) // value from Guru readme, gives 44100 Hz sample rate
.add_route(0, "speaker", 1.0, 0)
.add_route(1, "speaker", 1.0, 1);
@@ -1432,13 +1416,13 @@ void hornet_state::nbapbp(machine_config &config)
KONAMI_WINDY2_JVS_IO_2L6B_PANEL(config, "windy2_jvsio", 0, m_jvs_host);
}
-void terabrst_state::terabrst(machine_config &config) //todo: add K056800 from I/O board
+void terabrst_state::terabrst(machine_config &config) // TODO: add K056800 from I/O board
{
hornet(config);
m_maincpu->set_addrmap(AS_PROGRAM, &terabrst_state::terabrst_map);
- M68000(config, m_gn680, XTAL(32'000'000) / 2); // 16MHz
+ M68000(config, m_gn680, 32_MHz_XTAL / 2); // 16MHz
m_gn680->set_addrmap(AS_PROGRAM, &terabrst_state::gn680_memmap);
}
@@ -1448,7 +1432,7 @@ void hornet_state::sscope(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &hornet_state::sscope_map);
- ADSP21062(config, m_dsp[1], XTAL(36'000'000));
+ ADSP21062(config, m_dsp[1], 36_MHz_XTAL);
m_dsp[1]->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM);
m_dsp[1]->set_addrmap(AS_DATA, &hornet_state::sharc_map<1>);
@@ -1459,7 +1443,7 @@ void hornet_state::sscope(machine_config &config)
m_voodoo[0]->set_screen("lscreen");
- VOODOO_1(config, m_voodoo[1], XTAL(50'000'000));
+ VOODOO_1(config, m_voodoo[1], 50_MHz_XTAL);
m_voodoo[1]->set_fbmem(2);
m_voodoo[1]->set_tmumem(4, 0);
m_voodoo[1]->set_status_cycles(1000); // optimization to consume extra cycles when polling status
@@ -1475,12 +1459,12 @@ void hornet_state::sscope(machine_config &config)
screen_device &lscreen(SCREEN(config, "lscreen", SCREEN_TYPE_RASTER));
// default 24KHz parameter in both 037122 and voodoo, input clock correct? (58~Hz Vsync, 50MHz/3 or 64MHz/4?)
- lscreen.set_raw(XTAL(64'000'000) / 4, 644, 41, 41 + 512, 428, 27, 27 + 384);
+ lscreen.set_raw(64_MHz_XTAL / 4, 644, 41, 41 + 512, 428, 27, 27 + 384);
lscreen.set_screen_update(FUNC(hornet_state::screen_update<0>));
screen_device &rscreen(SCREEN(config, "rscreen", SCREEN_TYPE_RASTER)); // for scope
// scope screen is 15khz, verified default parameter in both 037122 and voodoo, input clock correct? (60~Hz Vsync, 50MHz/3 or 64MHz/4?)
- rscreen.set_raw(XTAL(64'000'000) / 4, 1017, 106, 106 + 768, 262, 17, 17 + 236);
+ rscreen.set_raw(64_MHz_XTAL / 4, 1017, 106, 106 + 768, 262, 17, 17 + 236);
rscreen.set_screen_update(FUNC(hornet_state::screen_update<1>));
// Comes from the GQ830-PWB(J) board