mirror of
https://github.com/holub/mame
synced 2025-06-07 13:23:50 +03:00
pc9801: move cbus to bus and add WIP mpu401 [Carl]
This commit is contained in:
parent
5ada035d17
commit
38436b340d
@ -3087,3 +3087,23 @@ if (BUSES["PC1512"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/pc1512/mouse.h",
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/bus/cbus/pc9801_cbus.h,BUSES["CBUS"] = true
|
||||
---------------------------------------------------
|
||||
|
||||
if (BUSES["CBUS"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/bus/cbus/pc9801_26.cpp",
|
||||
MAME_DIR .. "src/devices/bus/cbus/pc9801_26.h",
|
||||
MAME_DIR .. "src/devices/bus/cbus/pc9801_86.cpp",
|
||||
MAME_DIR .. "src/devices/bus/cbus/pc9801_86.h",
|
||||
MAME_DIR .. "src/devices/bus/cbus/pc9801_118.cpp",
|
||||
MAME_DIR .. "src/devices/bus/cbus/pc9801_118.h",
|
||||
MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.cpp",
|
||||
MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.h",
|
||||
MAME_DIR .. "src/devices/bus/cbus/pc9801_cbus.cpp",
|
||||
MAME_DIR .. "src/devices/bus/cbus/pc9801_cbus.h",
|
||||
}
|
||||
end
|
||||
|
@ -636,6 +636,7 @@ BUSES["BW2"] = true
|
||||
BUSES["C64"] = true
|
||||
BUSES["CBM2"] = true
|
||||
BUSES["CBMIEC"] = true
|
||||
BUSES["CBUS"] = true
|
||||
BUSES["CENTRONICS"] = true
|
||||
BUSES["CGENIE_EXPANSION"] = true
|
||||
BUSES["CGENIE_PARALLEL"] = true
|
||||
@ -2382,14 +2383,6 @@ files {
|
||||
MAME_DIR .. "src/mame/drivers/pc88va.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/pc100.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/pc9801.cpp",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_26.cpp",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_26.h",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_86.cpp",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_86.h",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_118.cpp",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_118.h",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_cbus.cpp",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_cbus.h",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_kbd.cpp",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_kbd.h",
|
||||
MAME_DIR .. "src/mame/machine/pc9801_cd.cpp",
|
||||
|
84
src/devices/bus/cbus/mpu_pc98.cpp
Normal file
84
src/devices/bus/cbus/mpu_pc98.cpp
Normal file
@ -0,0 +1,84 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:R. Belmont,Kevin Horton
|
||||
/***************************************************************************
|
||||
|
||||
MPU-401 MIDI device interface
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "mpu_pc98.h"
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/pic8259.h"
|
||||
|
||||
#define MPU_CORE_TAG "mpu401"
|
||||
|
||||
|
||||
/*
|
||||
DIP-SWs
|
||||
1-2-3-4
|
||||
0xc0d0
|
||||
1 0xc4d0
|
||||
1 0xc8d0
|
||||
...
|
||||
1 0xe0d0 (default)
|
||||
...
|
||||
1 1 1 1 0xfcd0
|
||||
|
||||
5-6-7-8
|
||||
1 irq12
|
||||
1 irq6 (default)
|
||||
1 irq5
|
||||
1 irq3
|
||||
*/
|
||||
|
||||
WRITE_LINE_MEMBER( mpu_pc98_device::mpu_irq_out )
|
||||
{
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(MPU_PC98, mpu_pc98_device, "mpu_pc98", "Roland MPU-401 MIDI Interface (CBUS)")
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
MACHINE_CONFIG_MEMBER( mpu_pc98_device::device_add_mconfig )
|
||||
MCFG_MPU401_ADD(MPU_CORE_TAG, WRITELINE(mpu_pc98_device, mpu_irq_out))
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
mpu_pc98_device::mpu_pc98_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, MPU_PC98, tag, owner, clock)
|
||||
, m_mpu401(*this, MPU_CORE_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
DEVICE_ADDRESS_MAP_START(map, 16, mpu_pc98_device)
|
||||
AM_RANGE(0, 3) AM_DEVREADWRITE8(MPU_CORE_TAG, mpu401_device, mpu_r, mpu_w, 0xff)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void mpu_pc98_device::device_start()
|
||||
{
|
||||
address_space &iospace = machine().firstcpu->space(AS_IO);
|
||||
iospace.install_device(0xe0d0, 0xe0d3, *this, map, 16, 0xffffffffffffffffU >> (64 - iospace.data_width()));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void mpu_pc98_device::device_reset()
|
||||
{
|
||||
}
|
42
src/devices/bus/cbus/mpu_pc98.h
Normal file
42
src/devices/bus/cbus/mpu_pc98.h
Normal file
@ -0,0 +1,42 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:R. Belmont,Kevin Horton
|
||||
#ifndef MAME_BUS_CBUS_MPU401_H
|
||||
#define MAME_BUS_CBUS_MPU401_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "bus/cbus/pc9801_cbus.h"
|
||||
#include "machine/mpu401.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> isa8_mpu401_device
|
||||
|
||||
class mpu_pc98_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
mpu_pc98_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
DECLARE_ADDRESS_MAP(map, 8);
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
// called back by the MPU401 core to set the IRQ line state
|
||||
DECLARE_WRITE_LINE_MEMBER(mpu_irq_out);
|
||||
|
||||
required_device<mpu401_device> m_mpu401;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(MPU_PC98, mpu_pc98_device)
|
||||
|
||||
#endif // MAME_BUS_CBUS_MPU401_H
|
@ -13,7 +13,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/pc9801_118.h"
|
||||
#include "bus/cbus/pc9801_118.h"
|
||||
|
||||
#include "machine/pic8259.h"
|
||||
#include "sound/2608intf.h"
|
@ -6,8 +6,8 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_MACHINE_PC9801_118_H
|
||||
#define MAME_MACHINE_PC9801_118_H
|
||||
#ifndef MAME_BUS_CBUS_PC9801_118_H
|
||||
#define MAME_BUS_CBUS_PC9801_118_H
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -68,4 +68,4 @@ DECLARE_DEVICE_TYPE(PC9801_118, pc9801_118_device)
|
||||
|
||||
|
||||
|
||||
#endif // MAME_MACHINE_PC9801_118_H
|
||||
#endif // MAME_BUS_CBUS_PC9801_118_H
|
@ -12,7 +12,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/pc9801_26.h"
|
||||
#include "bus/cbus/pc9801_26.h"
|
||||
|
||||
#include "machine/pic8259.h"
|
||||
#include "sound/2203intf.h"
|
@ -6,8 +6,8 @@ Template for skeleton device
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_MACHINE_PC9801_26_H
|
||||
#define MAME_MACHINE_PC9801_26_H
|
||||
#ifndef MAME_BUS_CBUS_PC9801_26_H
|
||||
#define MAME_BUS_CBUS_PC9801_26_H
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -64,4 +64,4 @@ DECLARE_DEVICE_TYPE(PC9801_26, pc9801_26_device)
|
||||
|
||||
|
||||
|
||||
#endif // MAME_MACHINE_PC9801_26_H
|
||||
#endif // MAME_BUS_CBUS_PC9801_26_H
|
@ -16,7 +16,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/pc9801_86.h"
|
||||
#include "bus/cbus/pc9801_86.h"
|
||||
#include "sound/volt_reg.h"
|
||||
#include "speaker.h"
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_MACHINE_PC9801_86_H
|
||||
#define MAME_MACHINE_PC9801_86_H
|
||||
#ifndef MAME_BUS_CBUS_PC9801_86_H
|
||||
#define MAME_BUS_CBUS_PC9801_86_H
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -77,4 +77,4 @@ DECLARE_DEVICE_TYPE(PC9801_86, pc9801_86_device)
|
||||
|
||||
|
||||
|
||||
#endif // MAME_MACHINE_PC9801_86_H
|
||||
#endif // MAME_BUS_CBUS_PC9801_86_H
|
@ -410,10 +410,11 @@ Keyboard TX commands:
|
||||
|
||||
#include "video/upd7220.h"
|
||||
|
||||
#include "machine/pc9801_26.h"
|
||||
#include "machine/pc9801_86.h"
|
||||
#include "machine/pc9801_118.h"
|
||||
#include "machine/pc9801_cbus.h"
|
||||
#include "bus/cbus/pc9801_26.h"
|
||||
#include "bus/cbus/pc9801_86.h"
|
||||
#include "bus/cbus/pc9801_118.h"
|
||||
#include "bus/cbus/mpu_pc98.h"
|
||||
#include "bus/cbus/pc9801_cbus.h"
|
||||
#include "machine/pc9801_kbd.h"
|
||||
#include "machine/pc9801_cd.h"
|
||||
|
||||
@ -693,7 +694,7 @@ public:
|
||||
private:
|
||||
uint8_t m_sdip_read(uint16_t port, uint8_t sdip_offset);
|
||||
void m_sdip_write(uint16_t port, uint8_t sdip_offset,uint8_t data);
|
||||
uint16_t egc_do_partial_op(int plane, uint16_t src, uint16_t pat, uint16_t dst);
|
||||
uint16_t egc_do_partial_op(int plane, uint16_t src, uint16_t pat, uint16_t dst) const;
|
||||
uint16_t egc_shift(int plane, uint16_t val);
|
||||
public:
|
||||
DECLARE_MACHINE_START(pc9801_common);
|
||||
@ -1326,7 +1327,7 @@ uint16_t pc9801_state::egc_shift(int plane, uint16_t val)
|
||||
return out;
|
||||
}
|
||||
|
||||
uint16_t pc9801_state::egc_do_partial_op(int plane, uint16_t src, uint16_t pat, uint16_t dst)
|
||||
uint16_t pc9801_state::egc_do_partial_op(int plane, uint16_t src, uint16_t pat, uint16_t dst) const
|
||||
{
|
||||
uint16_t out = 0;
|
||||
|
||||
@ -1453,7 +1454,8 @@ uint16_t pc9801_state::egc_blit_r(uint32_t offset, uint16_t mem_mask)
|
||||
if(m_egc.first && !m_egc.init)
|
||||
{
|
||||
m_egc.leftover[0] = m_egc.leftover[1] = m_egc.leftover[2] = m_egc.leftover[3] = 0;
|
||||
m_egc.init = true;
|
||||
if(((m_egc.regs[6] >> 4) & 0xf) >= (m_egc.regs[6] & 0xf)) // check if we have enough bits
|
||||
m_egc.init = true;
|
||||
}
|
||||
for(int i = 0; i < 4; i++)
|
||||
m_egc.src[i] = egc_shift(i, m_video_ram_2[plane_off + (((i + 1) & 3) * 0x4000)]);
|
||||
@ -3002,6 +3004,7 @@ static SLOT_INTERFACE_START( pc9801_cbus )
|
||||
// Speak Board
|
||||
// Spark Board
|
||||
// AMD-98 (AmuseMent boarD)
|
||||
SLOT_INTERFACE( "mpu_pc98", MPU_PC98 )
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
// Jast Sound, could be put independently
|
||||
|
Loading…
Reference in New Issue
Block a user