trunk/src/mess/machine/pc9801_slot.c
| r19637 | r19638 | |
| 1 | | /********************************************************************** |
| 2 | | |
| 3 | | Slot interface for PC-98xx family |
| 4 | | |
| 5 | | **********************************************************************/ |
| 6 | | |
| 7 | | #include "pc9801_slot.h" |
| 8 | | |
| 9 | | |
| 10 | | |
| 11 | | //************************************************************************** |
| 12 | | // GLOBAL VARIABLES |
| 13 | | //************************************************************************** |
| 14 | | |
| 15 | | const device_type PC9801BUS_SLOT = &device_creator<pc9801_slot_device>; |
| 16 | | |
| 17 | | |
| 18 | | |
| 19 | | //************************************************************************** |
| 20 | | // DEVICE PC9801 CARD INTERFACE |
| 21 | | //************************************************************************** |
| 22 | | |
| 23 | | #if 0 |
| 24 | | //------------------------------------------------- |
| 25 | | // device_abc1600bus_card_interface - constructor |
| 26 | | //------------------------------------------------- |
| 27 | | |
| 28 | | device_pc9801bus_card_interface::device_pc9801bus_card_interface(const machine_config &mconfig, device_t &device) |
| 29 | | : device_slot_card_interface(mconfig, device) |
| 30 | | { |
| 31 | | } |
| 32 | | |
| 33 | | |
| 34 | | //------------------------------------------------- |
| 35 | | // ~device_abc1600bus_card_interface - destructor |
| 36 | | //------------------------------------------------- |
| 37 | | |
| 38 | | device_pc9801bus_card_interface::~device_pc9801bus_card_interface() |
| 39 | | { |
| 40 | | } |
| 41 | | #endif |
| 42 | | |
| 43 | | |
| 44 | | //************************************************************************** |
| 45 | | // LIVE DEVICE |
| 46 | | //************************************************************************** |
| 47 | | |
| 48 | | //------------------------------------------------- |
| 49 | | // pc9801_slot_device - constructor |
| 50 | | //------------------------------------------------- |
| 51 | | |
| 52 | | pc9801_slot_device::pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 53 | | device_t(mconfig, PC9801BUS_SLOT, "PC-9801 sound bus slot", tag, owner, clock), |
| 54 | | device_slot_interface(mconfig, *this) |
| 55 | | { |
| 56 | | } |
| 57 | | |
| 58 | | |
| 59 | | //------------------------------------------------- |
| 60 | | // device_config_complete - perform any |
| 61 | | // operations now that the configuration is |
| 62 | | // complete |
| 63 | | //------------------------------------------------- |
| 64 | | |
| 65 | | void pc9801_slot_device::device_config_complete() |
| 66 | | { |
| 67 | | // ... |
| 68 | | } |
| 69 | | |
| 70 | | |
| 71 | | //------------------------------------------------- |
| 72 | | // device_start - device-specific startup |
| 73 | | //------------------------------------------------- |
| 74 | | |
| 75 | | void pc9801_slot_device::device_start() |
| 76 | | { |
| 77 | | // m_card = dynamic_cast<device_pc9801_slot_card_interface *>(get_card_device()); |
| 78 | | } |
| 79 | | |
| 80 | | |
| 81 | | |
trunk/src/mess/machine/pc9801_slot.h
| r19637 | r19638 | |
| 1 | | /********************************************************************** |
| 2 | | |
| 3 | | |
| 4 | | **********************************************************************/ |
| 5 | | |
| 6 | | #pragma once |
| 7 | | |
| 8 | | #ifndef __PC9801_SLOTBUS__ |
| 9 | | #define __PC9801_SLOTBUS__ |
| 10 | | |
| 11 | | #include "emu.h" |
| 12 | | |
| 13 | | |
| 14 | | //************************************************************************** |
| 15 | | // CONSTANTS |
| 16 | | //************************************************************************** |
| 17 | | |
| 18 | | |
| 19 | | |
| 20 | | //************************************************************************** |
| 21 | | // INTERFACE CONFIGURATION MACROS |
| 22 | | //************************************************************************** |
| 23 | | |
| 24 | | |
| 25 | | #define MCFG_PC9801BUS_SLOT_ADD(_tag, _slot_intf, _def_slot, _def_inp) \ |
| 26 | | MCFG_DEVICE_ADD(_tag, PC9801BUS_SLOT, 0) \ |
| 27 | | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
| 28 | | |
| 29 | | |
| 30 | | |
| 31 | | //************************************************************************** |
| 32 | | // TYPE DEFINITIONS |
| 33 | | //************************************************************************** |
| 34 | | |
| 35 | | |
| 36 | | |
| 37 | | |
| 38 | | //class pc9801_slot_device; |
| 39 | | |
| 40 | | #if 0 |
| 41 | | class device_pc9801_slot_card_interface : public device_slot_card_interface |
| 42 | | { |
| 43 | | friend class pc9801_slot_device; |
| 44 | | |
| 45 | | public: |
| 46 | | // construction/destruction |
| 47 | | device_pc9801_slot_card_interface(const machine_config &mconfig, device_t &device); |
| 48 | | virtual ~device_pc9801_card_interface(); |
| 49 | | }; |
| 50 | | #endif |
| 51 | | |
| 52 | | // ======================> pc9801_slot_device |
| 53 | | |
| 54 | | class pc9801_slot_device : public device_t, |
| 55 | | public device_slot_interface |
| 56 | | { |
| 57 | | public: |
| 58 | | // construction/destruction |
| 59 | | pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 60 | | |
| 61 | | // device-level overrides |
| 62 | | virtual void device_start(); |
| 63 | | virtual void device_config_complete(); |
| 64 | | //private: |
| 65 | | // device_pc9801_slot_card_interface *m_card; |
| 66 | | |
| 67 | | }; |
| 68 | | |
| 69 | | |
| 70 | | // device type definition |
| 71 | | extern const device_type PC9801BUS_SLOT; |
| 72 | | |
| 73 | | |
| 74 | | |
| 75 | | #endif |
trunk/src/mess/machine/pc9801_cbus.c
| r0 | r19638 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | CCBUS Slot interface for PC-98xx family |
| 4 | |
| 5 | **********************************************************************/ |
| 6 | |
| 7 | #include "pc9801_cbus.h" |
| 8 | |
| 9 | |
| 10 | |
| 11 | //************************************************************************** |
| 12 | // GLOBAL VARIABLES |
| 13 | //************************************************************************** |
| 14 | |
| 15 | const device_type PC9801CBUS_SLOT = &device_creator<pc9801_slot_device>; |
| 16 | |
| 17 | |
| 18 | |
| 19 | //************************************************************************** |
| 20 | // DEVICE PC9801 CARD INTERFACE |
| 21 | //************************************************************************** |
| 22 | |
| 23 | #if 0 |
| 24 | //------------------------------------------------- |
| 25 | // device_pc9801cbus_card_interface - constructor |
| 26 | //------------------------------------------------- |
| 27 | |
| 28 | device_pc9801cbus_card_interface::device_pc9801cbus_card_interface(const machine_config &mconfig, device_t &device) |
| 29 | : device_slot_card_interface(mconfig, device) |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | |
| 34 | //------------------------------------------------- |
| 35 | // ~device_pc9801cbus_card_interface - destructor |
| 36 | //------------------------------------------------- |
| 37 | |
| 38 | device_pc9801cbus_card_interface::~device_pc9801cbus_card_interface() |
| 39 | { |
| 40 | } |
| 41 | #endif |
| 42 | |
| 43 | |
| 44 | //************************************************************************** |
| 45 | // LIVE DEVICE |
| 46 | //************************************************************************** |
| 47 | |
| 48 | //------------------------------------------------- |
| 49 | // pc9801_slot_device - constructor |
| 50 | //------------------------------------------------- |
| 51 | |
| 52 | pc9801_slot_device::pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 53 | device_t(mconfig, PC9801CBUS_SLOT, "PC-9801 sound cbus slot", tag, owner, clock), |
| 54 | device_slot_interface(mconfig, *this) |
| 55 | { |
| 56 | } |
| 57 | |
| 58 | |
| 59 | //------------------------------------------------- |
| 60 | // device_config_complete - perform any |
| 61 | // operations now that the configuration is |
| 62 | // complete |
| 63 | //------------------------------------------------- |
| 64 | |
| 65 | void pc9801_slot_device::device_config_complete() |
| 66 | { |
| 67 | // ... |
| 68 | } |
| 69 | |
| 70 | |
| 71 | //------------------------------------------------- |
| 72 | // device_start - device-specific startup |
| 73 | //------------------------------------------------- |
| 74 | |
| 75 | void pc9801_slot_device::device_start() |
| 76 | { |
| 77 | // m_card = dynamic_cast<device_pc9801_slot_card_interface *>(get_card_device()); |
| 78 | } |
| 79 | |
| 80 | |
| 81 | |
trunk/src/mess/machine/pc9801_cbus.h
| r0 | r19638 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | |
| 4 | **********************************************************************/ |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #ifndef __PC9801_SLOTCBUS__ |
| 9 | #define __PC9801_SLOTCBUS__ |
| 10 | |
| 11 | #include "emu.h" |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | |
| 19 | |
| 20 | //************************************************************************** |
| 21 | // INTERFACE CONFIGURATION MACROS |
| 22 | //************************************************************************** |
| 23 | |
| 24 | |
| 25 | #define MCFG_PC9801CBUS_SLOT_ADD(_tag, _slot_intf, _def_slot, _def_inp) \ |
| 26 | MCFG_DEVICE_ADD(_tag, PC9801CBUS_SLOT, 0) \ |
| 27 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
| 28 | |
| 29 | |
| 30 | |
| 31 | //************************************************************************** |
| 32 | // TYPE DEFINITIONS |
| 33 | //************************************************************************** |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | //class pc9801_slot_device; |
| 39 | |
| 40 | #if 0 |
| 41 | class device_pc9801_slot_card_interface : public device_slot_card_interface |
| 42 | { |
| 43 | friend class pc9801_slot_device; |
| 44 | |
| 45 | public: |
| 46 | // construction/destruction |
| 47 | device_pc9801_slot_card_interface(const machine_config &mconfig, device_t &device); |
| 48 | virtual ~device_pc9801_card_interface(); |
| 49 | }; |
| 50 | #endif |
| 51 | |
| 52 | // ======================> pc9801_slot_device |
| 53 | |
| 54 | class pc9801_slot_device : public device_t, |
| 55 | public device_slot_interface |
| 56 | { |
| 57 | public: |
| 58 | // construction/destruction |
| 59 | pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 60 | |
| 61 | // device-level overrides |
| 62 | virtual void device_start(); |
| 63 | virtual void device_config_complete(); |
| 64 | //private: |
| 65 | // device_pc9801_slot_card_interface *m_card; |
| 66 | |
| 67 | }; |
| 68 | |
| 69 | |
| 70 | // device type definition |
| 71 | extern const device_type PC9801CBUS_SLOT; |
| 72 | |
| 73 | |
| 74 | |
| 75 | #endif |
trunk/src/mess/machine/pc9801_86.c
| r0 | r19638 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | NEC PC-9801-86 sound card |
| 4 | |
| 5 | Almost the same thing as PC-9801-86, but this one has YM2608 instead of |
| 6 | YM2203 |
| 7 | |
| 8 | ***************************************************************************/ |
| 9 | |
| 10 | #include "emu.h" |
| 11 | #include "machine/pc9801_86.h" |
| 12 | #include "machine/pic8259.h" |
| 13 | #include "sound/2608intf.h" |
| 14 | |
| 15 | #define MAIN_CLOCK_X1 XTAL_1_9968MHz |
| 16 | |
| 17 | //************************************************************************** |
| 18 | // GLOBAL VARIABLES |
| 19 | //************************************************************************** |
| 20 | |
| 21 | // device type definition |
| 22 | const device_type PC9801_86 = &device_creator<pc9801_86_device>; |
| 23 | |
| 24 | |
| 25 | READ8_MEMBER(pc9801_86_device::opn_porta_r) |
| 26 | { |
| 27 | if(m_joy_sel == 0x80) |
| 28 | return ioport("OPNA_PA1")->read(); |
| 29 | |
| 30 | if(m_joy_sel == 0xc0) |
| 31 | return ioport("OPNA_PA2")->read(); |
| 32 | |
| 33 | // 0x81? |
| 34 | // printf("%02x\n",m_joy_sel); |
| 35 | return 0xff; |
| 36 | } |
| 37 | |
| 38 | WRITE8_MEMBER(pc9801_86_device::opn_portb_w){ m_joy_sel = data; } |
| 39 | |
| 40 | static void pc9801_sound_irq( device_t *device, int irq ) |
| 41 | { |
| 42 | // pc9801_state *state = device->machine().driver_data<pc9801_state>(); |
| 43 | |
| 44 | /* TODO: seems to die very often */ |
| 45 | pic8259_ir4_w(device->machine().device("pic8259_slave"), irq); |
| 46 | } |
| 47 | |
| 48 | static const ym2608_interface pc98_ym2608_intf = |
| 49 | { |
| 50 | { |
| 51 | AY8910_LEGACY_OUTPUT, |
| 52 | AY8910_DEFAULT_LOADS, |
| 53 | DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, pc9801_86_device,opn_porta_r), |
| 54 | DEVCB_NULL,//(pc9801_state,opn_portb_r), |
| 55 | DEVCB_NULL,//(pc9801_state,opn_porta_w), |
| 56 | DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, pc9801_86_device,opn_portb_w), |
| 57 | }, |
| 58 | pc9801_sound_irq |
| 59 | }; |
| 60 | |
| 61 | static MACHINE_CONFIG_FRAGMENT( pc9801_86_config ) |
| 62 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 63 | MCFG_SOUND_ADD("opna", YM2608, MAIN_CLOCK_X1*4) // unknown clock / divider |
| 64 | MCFG_SOUND_CONFIG(pc98_ym2608_intf) |
| 65 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 66 | MACHINE_CONFIG_END |
| 67 | |
| 68 | //------------------------------------------------- |
| 69 | // machine_config_additions - device-specific |
| 70 | // machine configurations |
| 71 | //------------------------------------------------- |
| 72 | |
| 73 | machine_config_constructor pc9801_86_device::device_mconfig_additions() const |
| 74 | { |
| 75 | return MACHINE_CONFIG_NAME( pc9801_86_config ); |
| 76 | } |
| 77 | |
| 78 | |
| 79 | //------------------------------------------------- |
| 80 | // input_ports - device-specific input ports |
| 81 | //------------------------------------------------- |
| 82 | |
| 83 | static INPUT_PORTS_START( pc9801_86 ) |
| 84 | PORT_START("OPNA_PA1") |
| 85 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Up") |
| 86 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Down") |
| 87 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Left") |
| 88 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Right") |
| 89 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 1") |
| 90 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2") |
| 91 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 92 | |
| 93 | PORT_START("OPNA_PA2") |
| 94 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Up") |
| 95 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Down") |
| 96 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Left") |
| 97 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Right") |
| 98 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1") |
| 99 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2") |
| 100 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 101 | INPUT_PORTS_END |
| 102 | |
| 103 | ioport_constructor pc9801_86_device::device_input_ports() const |
| 104 | { |
| 105 | return INPUT_PORTS_NAME( pc9801_86 ); |
| 106 | } |
| 107 | |
| 108 | //************************************************************************** |
| 109 | // LIVE DEVICE |
| 110 | //************************************************************************** |
| 111 | |
| 112 | //------------------------------------------------- |
| 113 | // pc9801_86_device - constructor |
| 114 | //------------------------------------------------- |
| 115 | |
| 116 | pc9801_86_device::pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 117 | : device_t(mconfig, PC9801_86, "pc9801_86", tag, owner, clock), |
| 118 | // m_maincpu(*owner, "maincpu"), |
| 119 | m_opna(*this, "opna") |
| 120 | { |
| 121 | |
| 122 | } |
| 123 | |
| 124 | |
| 125 | //------------------------------------------------- |
| 126 | // device_validity_check - perform validity checks |
| 127 | // on this device |
| 128 | //------------------------------------------------- |
| 129 | |
| 130 | void pc9801_86_device::device_validity_check(validity_checker &valid) const |
| 131 | { |
| 132 | } |
| 133 | |
| 134 | //------------------------------------------------- |
| 135 | // device_start - device-specific startup |
| 136 | //------------------------------------------------- |
| 137 | |
| 138 | void pc9801_86_device::install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler) |
| 139 | { |
| 140 | int buswidth = machine().firstcpu->space_config(AS_IO)->m_databus_width; |
| 141 | switch(buswidth) |
| 142 | { |
| 143 | case 8: |
| 144 | machine().firstcpu->space(AS_IO).install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0); |
| 145 | break; |
| 146 | case 16: |
| 147 | machine().firstcpu->space(AS_IO).install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffff); |
| 148 | break; |
| 149 | case 32: |
| 150 | machine().firstcpu->space(AS_IO).install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); |
| 151 | break; |
| 152 | default: |
| 153 | fatalerror("PC-9801-86: Bus width %d not supported\n", buswidth); |
| 154 | break; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | |
| 159 | void pc9801_86_device::device_start() |
| 160 | { |
| 161 | install_device(0x0188, 0x018f, 0, 0, read8_delegate(FUNC(pc9801_86_device::pc9801_86_r), this), write8_delegate(FUNC(pc9801_86_device::pc9801_86_w), this) ); |
| 162 | // install_device(0xa460, 0xa463, 0, 0, read8_delegate(FUNC(pc9801_86_device::pc9801_86_ext_r), this), write8_delegate(FUNC(pc9801_86_device::pc9801_86_ext_w), this) ); |
| 163 | } |
| 164 | |
| 165 | |
| 166 | //------------------------------------------------- |
| 167 | // device_reset - device-specific reset |
| 168 | //------------------------------------------------- |
| 169 | |
| 170 | void pc9801_86_device::device_reset() |
| 171 | { |
| 172 | } |
| 173 | |
| 174 | |
| 175 | //************************************************************************** |
| 176 | // READ/WRITE HANDLERS |
| 177 | //************************************************************************** |
| 178 | |
| 179 | |
| 180 | READ8_MEMBER(pc9801_86_device::pc9801_86_r) |
| 181 | { |
| 182 | if((offset & 1) == 0) |
| 183 | return ym2608_r(m_opna, space, offset >> 1); |
| 184 | else // odd |
| 185 | { |
| 186 | printf("PC9801-86: Read to undefined port [%02x]\n",offset+0x188); |
| 187 | return 0xff; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | |
| 192 | WRITE8_MEMBER(pc9801_86_device::pc9801_86_w) |
| 193 | { |
| 194 | if((offset & 1) == 0) |
| 195 | ym2608_w(m_opna,space, offset >> 1,data); |
| 196 | else // odd |
| 197 | printf("PC9801-86: Write to undefined port [%02x] %02x\n",offset+0x188,data); |
| 198 | } |
| 199 | |
| 200 | #if 0 |
| 201 | READ8_MEMBER( pc9801_86_device::pc9801_86_ext_r ) |
| 202 | { |
| 203 | if(offset == 0) |
| 204 | { |
| 205 | printf("OPNA EXT read ID [%02x]\n",offset); |
| 206 | return 0xff; |
| 207 | } |
| 208 | |
| 209 | printf("OPNA EXT read unk [%02x]\n",offset); |
| 210 | return 0xff; |
| 211 | } |
| 212 | |
| 213 | WRITE8_MEMBER( pc9801_86_device::pc9801_86_ext_w ) |
| 214 | { |
| 215 | if(offset == 0) |
| 216 | { |
| 217 | printf("OPNA EXT write mask %02x -> [%02x]\n",data,offset); |
| 218 | return; |
| 219 | } |
| 220 | |
| 221 | printf("OPNA EXT write unk %02x -> [%02x]\n",data,offset); |
| 222 | } |
| 223 | #endif |
trunk/src/mess/machine/pc9801_86.h
| r0 | r19638 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Template for skeleton device |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | |
| 8 | #pragma once |
| 9 | |
| 10 | #ifndef __PC9801_86DEV_H__ |
| 11 | #define __PC9801_86DEV_H__ |
| 12 | |
| 13 | #include "machine/pic8259.h" |
| 14 | #include "sound/2608intf.h" |
| 15 | |
| 16 | #define MCFG_PC9801_86_SLOT_ADD(_tag, _slot_intf, _def_slot, _def_inp) \ |
| 17 | MCFG_DEVICE_ADD(_tag, PC9801_86, 0) \ |
| 18 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
| 19 | |
| 20 | |
| 21 | //************************************************************************** |
| 22 | // TYPE DEFINITIONS |
| 23 | //************************************************************************** |
| 24 | |
| 25 | // ======================> pc9801_86_device |
| 26 | |
| 27 | class pc9801_86_device : public device_t |
| 28 | { |
| 29 | public: |
| 30 | // construction/destruction |
| 31 | pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 32 | |
| 33 | // optional information overrides |
| 34 | virtual machine_config_constructor device_mconfig_additions() const; |
| 35 | virtual ioport_constructor device_input_ports() const; |
| 36 | |
| 37 | DECLARE_READ8_MEMBER(opn_porta_r); |
| 38 | DECLARE_WRITE8_MEMBER(opn_portb_w); |
| 39 | DECLARE_READ8_MEMBER(pc9801_86_r); |
| 40 | DECLARE_WRITE8_MEMBER(pc9801_86_w); |
| 41 | // DECLARE_READ8_MEMBER(pc9801_86_ext_r); |
| 42 | // DECLARE_WRITE8_MEMBER(pc9801_86_ext_w); |
| 43 | |
| 44 | // required_device<cpu_device> m_maincpu; |
| 45 | required_device<ym2608_device> m_opna; |
| 46 | protected: |
| 47 | // device-level overrides |
| 48 | virtual void device_validity_check(validity_checker &valid) const; |
| 49 | virtual void device_start(); |
| 50 | virtual void device_reset(); |
| 51 | virtual void device_config_complete() { m_shortname = "pc9801_86"; } |
| 52 | void install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler); |
| 53 | |
| 54 | private: |
| 55 | UINT8 m_joy_sel; |
| 56 | |
| 57 | }; |
| 58 | |
| 59 | |
| 60 | // device type definition |
| 61 | extern const device_type PC9801_86; |
| 62 | |
| 63 | |
| 64 | |
| 65 | //************************************************************************** |
| 66 | // GLOBAL VARIABLES |
| 67 | //************************************************************************** |
| 68 | |
| 69 | |
| 70 | |
| 71 | #endif |
trunk/src/mess/drivers/pc9801.c
| r19637 | r19638 | |
| 328 | 328 | #include "machine/ram.h" |
| 329 | 329 | #include "formats/pc98fdi_dsk.h" |
| 330 | 330 | #include "machine/pc9801_26.h" |
| 331 | | #include "machine/pc9801_slot.h" |
| 331 | #include "machine/pc9801_86.h" |
| 332 | #include "machine/pc9801_cbus.h" |
| 332 | 333 | |
| 333 | 334 | |
| 334 | 335 | #define UPD1990A_TAG "upd1990a" |
| r19637 | r19638 | |
| 507 | 508 | DECLARE_WRITE8_MEMBER(pc9821_vram256_w); |
| 508 | 509 | DECLARE_READ8_MEMBER(opn_porta_r); |
| 509 | 510 | DECLARE_WRITE8_MEMBER(opn_portb_w); |
| 510 | | DECLARE_READ8_MEMBER(pc9801_ext_opna_r); |
| 511 | | DECLARE_WRITE8_MEMBER(pc9801_ext_opna_w); |
| 511 | // DECLARE_READ8_MEMBER(pc9801_ext_opna_r); |
| 512 | // DECLARE_WRITE8_MEMBER(pc9801_ext_opna_w); |
| 512 | 513 | DECLARE_WRITE8_MEMBER(pc9801rs_nmi_w); |
| 513 | 514 | DECLARE_READ8_MEMBER(pc9801rs_midi_r); |
| 514 | 515 | |
| r19637 | r19638 | |
| 2028 | 2029 | } |
| 2029 | 2030 | } |
| 2030 | 2031 | |
| 2031 | | READ8_MEMBER( pc9801_state::pc9801_ext_opna_r ) |
| 2032 | | { |
| 2033 | | if(offset == 0) |
| 2034 | | { |
| 2035 | | printf("OPNA EXT read ID [%02x]\n",offset); |
| 2036 | | return 0xff; |
| 2037 | | } |
| 2038 | 2032 | |
| 2039 | | printf("OPNA EXT read unk [%02x]\n",offset); |
| 2040 | | return 0xff; |
| 2041 | | } |
| 2042 | | |
| 2043 | | WRITE8_MEMBER( pc9801_state::pc9801_ext_opna_w ) |
| 2044 | | { |
| 2045 | | if(offset == 0) |
| 2046 | | { |
| 2047 | | printf("OPNA EXT write mask %02x -> [%02x]\n",data,offset); |
| 2048 | | return; |
| 2049 | | } |
| 2050 | | |
| 2051 | | printf("OPNA EXT write unk %02x -> [%02x]\n",data,offset); |
| 2052 | | } |
| 2053 | | |
| 2054 | | |
| 2055 | 2033 | WRITE8_MEMBER( pc9801_state::pc9801rs_nmi_w ) |
| 2056 | 2034 | { |
| 2057 | 2035 | if(offset == 0) |
| r19637 | r19638 | |
| 2094 | 2072 | AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffffffff) |
| 2095 | 2073 | AM_RANGE(0x043c, 0x043f) AM_WRITE8(pc9801rs_bank_w, 0xffffffff) //ROM/RAM bank |
| 2096 | 2074 | AM_RANGE(0x7fd8, 0x7fdf) AM_READWRITE8(pc9801_mouse_r, pc9801_mouse_w, 0xffffffff) // <undefined> / mouse ppi8255 ports |
| 2097 | | AM_RANGE(0xa460, 0xa463) AM_READWRITE8(pc9801_ext_opna_r, pc9801_ext_opna_w, 0xffffffff) |
| 2075 | // AM_RANGE(0xa460, 0xa463) AM_READWRITE8(pc9801_ext_opna_r, pc9801_ext_opna_w, 0xffffffff) |
| 2098 | 2076 | AM_RANGE(0xbfd8, 0xbfdf) AM_WRITE8(pc9801rs_mouse_freq_w, 0xffffffff) |
| 2099 | 2077 | AM_RANGE(0xe0d0, 0xe0d3) AM_READ8(pc9801rs_midi_r, 0xffffffff) |
| 2100 | 2078 | ADDRESS_MAP_END |
| r19637 | r19638 | |
| 2157 | 2135 | AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffff) |
| 2158 | 2136 | AM_RANGE(0x043c, 0x043f) AM_WRITE8(pc9801rs_bank_w, 0xffff) //ROM/RAM bank |
| 2159 | 2137 | AM_RANGE(0x7fd8, 0x7fdf) AM_READWRITE8(pc9801_mouse_r, pc9801_mouse_w, 0xffff) // <undefined> / mouse ppi8255 ports |
| 2160 | | AM_RANGE(0xa460, 0xa463) AM_READWRITE8(pc9801_ext_opna_r, pc9801_ext_opna_w, 0xffff) |
| 2138 | // AM_RANGE(0xa460, 0xa463) AM_READWRITE8(pc9801_ext_opna_r, pc9801_ext_opna_w, 0xffff) |
| 2161 | 2139 | |
| 2162 | 2140 | ADDRESS_MAP_END |
| 2163 | 2141 | |
| r19637 | r19638 | |
| 2497 | 2475 | AM_RANGE(0x8d1c, 0x8d1f) AM_READWRITE8(sdip_9_r,sdip_9_w,0xffffffff) |
| 2498 | 2476 | AM_RANGE(0x8e1c, 0x8e1f) AM_READWRITE8(sdip_a_r,sdip_a_w,0xffffffff) |
| 2499 | 2477 | AM_RANGE(0x8f1c, 0x8f1f) AM_READWRITE8(sdip_b_r,sdip_b_w,0xffffffff) |
| 2500 | | AM_RANGE(0xa460, 0xa463) AM_READWRITE8(pc9801_ext_opna_r, pc9801_ext_opna_w, 0xffffffff) |
| 2478 | // AM_RANGE(0xa460, 0xa463) AM_READWRITE8(pc9801_ext_opna_r, pc9801_ext_opna_w, 0xffffffff) |
| 2501 | 2479 | // AM_RANGE(0xa460, 0xa46f) cs4231 PCM extended port / <undefined> |
| 2502 | 2480 | // AM_RANGE(0xbfdb, 0xbfdb) mouse timing port |
| 2503 | 2481 | // AM_RANGE(0xc0d0, 0xc0d3) MIDI port, option 0 / <undefined> |
| r19637 | r19638 | |
| 3298 | 3276 | SLOT_INTERFACE( "525hd", FLOPPY_525_HD ) |
| 3299 | 3277 | SLOT_INTERFACE_END |
| 3300 | 3278 | |
| 3301 | | static SLOT_INTERFACE_START( pc9801_sound ) |
| 3279 | static SLOT_INTERFACE_START( pc9801_cbus ) |
| 3302 | 3280 | // PC-9801-14 |
| 3303 | 3281 | SLOT_INTERFACE( "pc9801_26", PC9801_26 ) |
| 3282 | SLOT_INTERFACE( "pc9801_86", PC9801_86 ) |
| 3304 | 3283 | // PC-9801-86 |
| 3305 | 3284 | // PC-9801-26 + PC-9801-86 (?) |
| 3306 | 3285 | // PC-9801-86 + Chibi-Oto |
| r19637 | r19638 | |
| 3609 | 3588 | MCFG_TIMER_DRIVER_ADD_PERIODIC("mouse_timer", pc9801_state, mouse_irq_cb, attotime::from_hz(120)) |
| 3610 | 3589 | MACHINE_CONFIG_END |
| 3611 | 3590 | |
| 3591 | static MACHINE_CONFIG_FRAGMENT( pc9801_cbus ) |
| 3592 | MCFG_PC9801CBUS_SLOT_ADD("cbus0", pc9801_cbus, NULL, NULL) |
| 3593 | // TODO: six max slots |
| 3594 | MACHINE_CONFIG_END |
| 3612 | 3595 | |
| 3613 | 3596 | static MACHINE_CONFIG_START( pc9801, pc9801_state ) |
| 3614 | 3597 | MCFG_CPU_ADD("maincpu", I8086, 5000000) //unknown clock |
| r19637 | r19638 | |
| 3627 | 3610 | MCFG_I8255_ADD( "ppi8255_prn", ppi_printer_intf ) |
| 3628 | 3611 | MCFG_I8255_ADD( "ppi8255_fdd", ppi_fdd_intf ) |
| 3629 | 3612 | MCFG_FRAGMENT_ADD(pc9801_mouse) |
| 3613 | MCFG_FRAGMENT_ADD(pc9801_cbus) |
| 3630 | 3614 | MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, pc9801_upd1990a_intf) |
| 3631 | 3615 | MCFG_I8251_ADD(UPD8251_TAG, pc9801_uart_interface) |
| 3632 | 3616 | |
| r19637 | r19638 | |
| 3639 | 3623 | |
| 3640 | 3624 | MCFG_SOFTWARE_LIST_ADD("disk_list","pc98") |
| 3641 | 3625 | |
| 3642 | | MCFG_PC9801BUS_SLOT_ADD("sound_bus", pc9801_sound, NULL, NULL) |
| 3643 | 3626 | |
| 3644 | 3627 | #if 0 |
| 3645 | 3628 | MCFG_RAM_ADD(RAM_TAG) |
| r19637 | r19638 | |
| 3702 | 3685 | MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", 0, pc9801_state::floppy_formats) |
| 3703 | 3686 | MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", 0, pc9801_state::floppy_formats) |
| 3704 | 3687 | |
| 3705 | | MCFG_PC9801BUS_SLOT_ADD("sound_bus", pc9801_sound, NULL, NULL) |
| 3688 | MCFG_FRAGMENT_ADD(pc9801_cbus) |
| 3706 | 3689 | |
| 3707 | 3690 | MCFG_RAM_ADD(RAM_TAG) |
| 3708 | 3691 | MCFG_RAM_DEFAULT_SIZE("1664K") |
| r19637 | r19638 | |
| 3767 | 3750 | MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", 0, pc9801_state::floppy_formats) |
| 3768 | 3751 | MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", 0, pc9801_state::floppy_formats) |
| 3769 | 3752 | |
| 3770 | | MCFG_PC9801BUS_SLOT_ADD("sound_bus", pc9801_sound, NULL, NULL) |
| 3753 | MCFG_FRAGMENT_ADD(pc9801_cbus) |
| 3771 | 3754 | |
| 3772 | 3755 | MCFG_RAM_ADD(RAM_TAG) |
| 3773 | 3756 | MCFG_RAM_DEFAULT_SIZE("1664K") |