mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
konppc.cpp: Use device finders and eliminate machine().device(tag) (nw)
This commit is contained in:
parent
a3c4142402
commit
f565f3bdbb
2 changed files with 17 additions and 17 deletions
|
@ -3,9 +3,6 @@
|
||||||
/* Konami PowerPC-based 3D games common functions */
|
/* Konami PowerPC-based 3D games common functions */
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "cpu/sharc/sharc.h"
|
|
||||||
#include "machine/k033906.h"
|
|
||||||
#include "video/voodoo.h"
|
|
||||||
#include "konppc.h"
|
#include "konppc.h"
|
||||||
|
|
||||||
#define DSP_BANK_SIZE 0x10000
|
#define DSP_BANK_SIZE 0x10000
|
||||||
|
@ -18,6 +15,8 @@ DEFINE_DEVICE_TYPE(KONPPC, konppc_device, "konppc", "Konami PowerPC Common Funct
|
||||||
|
|
||||||
konppc_device::konppc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
konppc_device::konppc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||||
: device_t(mconfig, KONPPC, tag, owner, clock)
|
: device_t(mconfig, KONPPC, tag, owner, clock)
|
||||||
|
, m_dsp(*this, {"^dsp", "^dsp2"})
|
||||||
|
, m_k033906(*this, "^k033906_%u", 1U)
|
||||||
, m_voodoo(*this, "^voodoo%u", 0U)
|
, m_voodoo(*this, "^voodoo%u", 0U)
|
||||||
, cgboard_type(0)
|
, cgboard_type(0)
|
||||||
, num_cgboards(0)
|
, num_cgboards(0)
|
||||||
|
@ -126,10 +125,7 @@ READ32_MEMBER( konppc_device::cgboard_dsp_comm_r_ppc )
|
||||||
|
|
||||||
WRITE32_MEMBER( konppc_device::cgboard_dsp_comm_w_ppc )
|
WRITE32_MEMBER( konppc_device::cgboard_dsp_comm_w_ppc )
|
||||||
{
|
{
|
||||||
const char *dsptag = (cgboard_id == 0) ? "dsp" : "dsp2";
|
cpu_device &dsp = *m_dsp[cgboard_id];
|
||||||
const char *pcitag = (cgboard_id == 0) ? "k033906_1" : "k033906_2";
|
|
||||||
device_t *dsp = machine().device(dsptag);
|
|
||||||
k033906_device *k033906 = machine().device<k033906_device>(pcitag);
|
|
||||||
// osd_printf_debug("%s dsp_cmd_w: (board %d) %08X, %08X, %08X\n", machine().describe_context().c_str(), cgboard_id, data, offset, mem_mask);
|
// osd_printf_debug("%s dsp_cmd_w: (board %d) %08X, %08X, %08X\n", machine().describe_context().c_str(), cgboard_id, data, offset, mem_mask);
|
||||||
|
|
||||||
if (cgboard_id < MAX_CG_BOARDS)
|
if (cgboard_id < MAX_CG_BOARDS)
|
||||||
|
@ -144,19 +140,19 @@ WRITE32_MEMBER( konppc_device::cgboard_dsp_comm_w_ppc )
|
||||||
if (data & 0x80000000)
|
if (data & 0x80000000)
|
||||||
dsp_state[cgboard_id] |= 0x10;
|
dsp_state[cgboard_id] |= 0x10;
|
||||||
|
|
||||||
if (k033906 != nullptr) /* zr107.c has no PCI and some games only have one PCI Bridge */
|
if (m_k033906[cgboard_id].found()) /* zr107.c has no PCI and some games only have one PCI Bridge */
|
||||||
k033906->set_reg((data & 0x20000000) ? 1 : 0);
|
m_k033906[cgboard_id]->set_reg((data & 0x20000000) ? 1 : 0);
|
||||||
|
|
||||||
if (data & 0x10000000)
|
if (data & 0x10000000)
|
||||||
dsp->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
|
dsp.set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
|
||||||
else
|
else
|
||||||
dsp->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
|
dsp.set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
|
||||||
|
|
||||||
if (data & 0x02000000)
|
if (data & 0x02000000)
|
||||||
dsp->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
|
dsp.set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
|
||||||
|
|
||||||
if (data & 0x04000000)
|
if (data & 0x04000000)
|
||||||
dsp->execute().set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE);
|
dsp.set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ACCESSING_BITS_0_7)
|
if (ACCESSING_BITS_0_7)
|
||||||
|
@ -211,13 +207,13 @@ void konppc_device::dsp_comm_sharc_w(address_space &space, int board, int offset
|
||||||
case CGBOARD_TYPE_ZR107:
|
case CGBOARD_TYPE_ZR107:
|
||||||
case CGBOARD_TYPE_GTICLUB:
|
case CGBOARD_TYPE_GTICLUB:
|
||||||
{
|
{
|
||||||
//machine.device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG0, ASSERT_LINE);
|
//m_dsp[0]->set_input_line(SHARC_INPUT_FLAG0, ASSERT_LINE);
|
||||||
machine().device<adsp21062_device>("dsp")->set_flag_input(0, ASSERT_LINE);
|
m_dsp[0]->set_flag_input(0, ASSERT_LINE);
|
||||||
|
|
||||||
if (offset == 1)
|
if (offset == 1)
|
||||||
{
|
{
|
||||||
if (data & 0x03)
|
if (data & 0x03)
|
||||||
machine().device<adsp21062_device>("dsp")->set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE);
|
m_dsp[0]->set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "cpu/sharc/sharc.h"
|
||||||
|
#include "machine/k033906.h"
|
||||||
#include "video/voodoo.h"
|
#include "video/voodoo.h"
|
||||||
|
|
||||||
#define MCFG_KONPPC_CGBOARD_NUMBER(_num) \
|
#define MCFG_KONPPC_CGBOARD_NUMBER(_num) \
|
||||||
|
@ -74,7 +76,9 @@ protected:
|
||||||
void nwk_fifo_w(int board, uint32_t data);
|
void nwk_fifo_w(int board, uint32_t data);
|
||||||
private:
|
private:
|
||||||
// device finders
|
// device finders
|
||||||
required_device_array<voodoo_device, 2> m_voodoo;
|
optional_device_array<adsp21062_device, 2> m_dsp;
|
||||||
|
optional_device_array<k033906_device, 2> m_k033906;
|
||||||
|
optional_device_array<voodoo_device, 2> m_voodoo;
|
||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
uint32_t dsp_comm_ppc[MAX_CG_BOARDS][2];
|
uint32_t dsp_comm_ppc[MAX_CG_BOARDS][2];
|
||||||
|
|
Loading…
Reference in a new issue