src/mess/machine/wangpc_lores.c
| r15308 | r15309 | |
| 1 | | /********************************************************************** |
| 2 | | |
| 3 | | Wang PC Low-Resolution Video Controller emulation |
| 4 | | |
| 5 | | Copyright MESS Team. |
| 6 | | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | | |
| 8 | | **********************************************************************/ |
| 9 | | |
| 10 | | #include "wangpc_lores.h" |
| 11 | | |
| 12 | | |
| 13 | | |
| 14 | | //************************************************************************** |
| 15 | | // MACROS/CONSTANTS |
| 16 | | //************************************************************************** |
| 17 | | |
| 18 | | #define OPTION_ID 0x10 |
| 19 | | |
| 20 | | #define MC6845_TAG "mc6845" |
| 21 | | #define SCREEN_TAG "screen" |
| 22 | | |
| 23 | | #define RAM_SIZE 0x8000 |
| 24 | | |
| 25 | | |
| 26 | | |
| 27 | | //************************************************************************** |
| 28 | | // DEVICE DEFINITIONS |
| 29 | | //************************************************************************** |
| 30 | | |
| 31 | | const device_type WANGPC_LORES_VIDEO = &device_creator<wangpc_lores_video_device>; |
| 32 | | |
| 33 | | |
| 34 | | //------------------------------------------------- |
| 35 | | // mc6845_interface crtc_intf |
| 36 | | //------------------------------------------------- |
| 37 | | |
| 38 | | void wangpc_lores_video_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 39 | | { |
| 40 | | /* const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 41 | | for (int column = 0; column < x_count; column++) |
| 42 | | { |
| 43 | | UINT8 code = m_video_ram[((ma + column) & 0x7ff)]; |
| 44 | | UINT16 addr = (code << 3) | (ra & 0x07); |
| 45 | | UINT8 data = m_char_rom[addr & 0x7ff]; |
| 46 | | |
| 47 | | if (column == cursor_x) |
| 48 | | { |
| 49 | | data = 0xff; |
| 50 | | } |
| 51 | | |
| 52 | | for (int bit = 0; bit < 8; bit++) |
| 53 | | { |
| 54 | | int x = (column * 8) + bit; |
| 55 | | int color = BIT(data, 7) ? 7 : 0; |
| 56 | | |
| 57 | | bitmap.pix32(y, x) = palette[color]; |
| 58 | | |
| 59 | | data <<= 1; |
| 60 | | } |
| 61 | | }*/ |
| 62 | | } |
| 63 | | |
| 64 | | static MC6845_UPDATE_ROW( wangpc_lores_video_update_row ) |
| 65 | | { |
| 66 | | wangpc_lores_video_device *lores = downcast<wangpc_lores_video_device *>(device->owner()); |
| 67 | | lores->crtc_update_row(device,bitmap,cliprect,ma,ra,y,x_count,cursor_x,param); |
| 68 | | } |
| 69 | | |
| 70 | | WRITE_LINE_MEMBER( wangpc_lores_video_device::vsync_w ) |
| 71 | | { |
| 72 | | if (BIT(m_option, 3) && state) |
| 73 | | { |
| 74 | | m_irq3 = ASSERT_LINE; |
| 75 | | m_bus->irq3_w(m_irq3); |
| 76 | | } |
| 77 | | } |
| 78 | | |
| 79 | | static const mc6845_interface crtc_intf = |
| 80 | | { |
| 81 | | SCREEN_TAG, |
| 82 | | 8, |
| 83 | | NULL, |
| 84 | | wangpc_lores_video_update_row, |
| 85 | | NULL, |
| 86 | | DEVCB_NULL, |
| 87 | | DEVCB_NULL, |
| 88 | | DEVCB_NULL, |
| 89 | | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_lores_video_device, vsync_w), |
| 90 | | NULL |
| 91 | | }; |
| 92 | | |
| 93 | | |
| 94 | | //------------------------------------------------- |
| 95 | | // MACHINE_CONFIG_FRAGMENT( wangpc_lores_video ) |
| 96 | | //------------------------------------------------- |
| 97 | | |
| 98 | | static MACHINE_CONFIG_FRAGMENT( wangpc_lores_video ) |
| 99 | | MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 100 | | MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update) |
| 101 | | MCFG_SCREEN_SIZE(80*8, 25*9) |
| 102 | | MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*9-1) |
| 103 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 104 | | MCFG_SCREEN_REFRESH_RATE(60) |
| 105 | | |
| 106 | | MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_14_31818MHz, crtc_intf) |
| 107 | | MACHINE_CONFIG_END |
| 108 | | |
| 109 | | |
| 110 | | //------------------------------------------------- |
| 111 | | // machine_config_additions - device-specific |
| 112 | | // machine configurations |
| 113 | | //------------------------------------------------- |
| 114 | | |
| 115 | | machine_config_constructor wangpc_lores_video_device::device_mconfig_additions() const |
| 116 | | { |
| 117 | | return MACHINE_CONFIG_NAME( wangpc_lores_video ); |
| 118 | | } |
| 119 | | |
| 120 | | |
| 121 | | |
| 122 | | //************************************************************************** |
| 123 | | // LIVE DEVICE |
| 124 | | //************************************************************************** |
| 125 | | |
| 126 | | //------------------------------------------------- |
| 127 | | // wangpc_lores_video_device - constructor |
| 128 | | //------------------------------------------------- |
| 129 | | |
| 130 | | wangpc_lores_video_device::wangpc_lores_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 131 | | device_t(mconfig, WANGPC_LORES_VIDEO, "Wang PC Low Resolution Video Card", tag, owner, clock), |
| 132 | | device_wangpcbus_card_interface(mconfig, *this), |
| 133 | | m_crtc(*this, MC6845_TAG), |
| 134 | | m_option(0), |
| 135 | | m_irq3(CLEAR_LINE) |
| 136 | | { |
| 137 | | } |
| 138 | | |
| 139 | | |
| 140 | | //------------------------------------------------- |
| 141 | | // device_start - device-specific startup |
| 142 | | //------------------------------------------------- |
| 143 | | |
| 144 | | void wangpc_lores_video_device::device_start() |
| 145 | | { |
| 146 | | m_slot = dynamic_cast<wangpcbus_slot_device *>(owner()); |
| 147 | | |
| 148 | | m_video_ram = auto_alloc_array(machine(), UINT16, RAM_SIZE); |
| 149 | | |
| 150 | | // state saving |
| 151 | | save_pointer(NAME(m_video_ram), RAM_SIZE); |
| 152 | | } |
| 153 | | |
| 154 | | |
| 155 | | //------------------------------------------------- |
| 156 | | // device_reset - device-specific reset |
| 157 | | //------------------------------------------------- |
| 158 | | |
| 159 | | void wangpc_lores_video_device::device_reset() |
| 160 | | { |
| 161 | | } |
| 162 | | |
| 163 | | |
| 164 | | //------------------------------------------------- |
| 165 | | // wangpcbus_mrdc_r - memory read |
| 166 | | //------------------------------------------------- |
| 167 | | |
| 168 | | UINT16 wangpc_lores_video_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 169 | | { |
| 170 | | UINT16 data = 0xffff; |
| 171 | | |
| 172 | | if (BIT(m_option, 0) && (offset >= 0xe0000/2) && (offset < 0xf0000/2)) |
| 173 | | { |
| 174 | | data = m_video_ram[offset]; |
| 175 | | } |
| 176 | | |
| 177 | | return data; |
| 178 | | } |
| 179 | | |
| 180 | | |
| 181 | | //------------------------------------------------- |
| 182 | | // wangpcbus_amwc_w - memory write |
| 183 | | //------------------------------------------------- |
| 184 | | |
| 185 | | void wangpc_lores_video_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) |
| 186 | | { |
| 187 | | if (BIT(m_option, 0) && (offset >= 0xe0000/2) && (offset < 0xf0000/2)) |
| 188 | | { |
| 189 | | m_video_ram[offset] = data; |
| 190 | | } |
| 191 | | } |
| 192 | | |
| 193 | | |
| 194 | | //------------------------------------------------- |
| 195 | | // wangpcbus_iorc_r - I/O read |
| 196 | | //------------------------------------------------- |
| 197 | | |
| 198 | | UINT16 wangpc_lores_video_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 199 | | { |
| 200 | | UINT16 data = 0xffff; |
| 201 | | |
| 202 | | if (sad(offset)) |
| 203 | | { |
| 204 | | logerror("Lores read %04x %04x\n", offset << 1, mem_mask); |
| 205 | | |
| 206 | | switch (offset & 0x7f) |
| 207 | | { |
| 208 | | case 0x02/2: |
| 209 | | data = 0xff00 | m_crtc->register_r(space, 0); |
| 210 | | break; |
| 211 | | |
| 212 | | case 0x30/2: |
| 213 | | data = 0xffe3; |
| 214 | | data |= m_crtc->de_r() << 2; |
| 215 | | data |= m_crtc->vsync_r() << 3; |
| 216 | | data |= m_crtc->hsync_r() << 4; |
| 217 | | break; |
| 218 | | |
| 219 | | case 0xfe/2: |
| 220 | | data = 0xff00 | (m_irq3 << 7) | OPTION_ID; |
| 221 | | break; |
| 222 | | } |
| 223 | | } |
| 224 | | |
| 225 | | return data; |
| 226 | | } |
| 227 | | |
| 228 | | |
| 229 | | //------------------------------------------------- |
| 230 | | // wangpcbus_aiowc_w - I/O write |
| 231 | | //------------------------------------------------- |
| 232 | | |
| 233 | | void wangpc_lores_video_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask) |
| 234 | | { |
| 235 | | if (sad(offset)) |
| 236 | | { |
| 237 | | logerror("Lores write %04x %04x\n", offset << 1, mem_mask); |
| 238 | | |
| 239 | | switch (offset & 0x7f) |
| 240 | | { |
| 241 | | case 0x00/2: |
| 242 | | if (ACCESSING_BITS_0_7) |
| 243 | | m_crtc->address_w(space, 0, data & 0xff); |
| 244 | | break; |
| 245 | | |
| 246 | | case 0x02/2: |
| 247 | | if (ACCESSING_BITS_0_7) |
| 248 | | m_crtc->register_w(space, 0, data & 0xff); |
| 249 | | break; |
| 250 | | |
| 251 | | case 0x10/2: |
| 252 | | if (ACCESSING_BITS_0_7) |
| 253 | | m_option = data & 0xff; |
| 254 | | break; |
| 255 | | |
| 256 | | case 0x20/2: |
| 257 | | m_scroll = data; |
| 258 | | break; |
| 259 | | |
| 260 | | case 0x70/2: |
| 261 | | m_irq3 = CLEAR_LINE; |
| 262 | | m_bus->irq3_w(m_irq3); |
| 263 | | break; |
| 264 | | } |
| 265 | | } |
| 266 | | } |
src/mess/machine/wangpc_lores.h
| r15308 | r15309 | |
| 1 | | /********************************************************************** |
| 2 | | |
| 3 | | Wang PC Low-Resolution Video Controller emulation |
| 4 | | |
| 5 | | Copyright MESS Team. |
| 6 | | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | | |
| 8 | | **********************************************************************/ |
| 9 | | |
| 10 | | #pragma once |
| 11 | | |
| 12 | | #ifndef __WANGPC_LORES_VIDEO__ |
| 13 | | #define __WANGPC_LORES_VIDEO__ |
| 14 | | |
| 15 | | |
| 16 | | #include "emu.h" |
| 17 | | #include "machine/wangpcbus.h" |
| 18 | | #include "video/mc6845.h" |
| 19 | | |
| 20 | | |
| 21 | | |
| 22 | | //************************************************************************** |
| 23 | | // TYPE DEFINITIONS |
| 24 | | //************************************************************************** |
| 25 | | |
| 26 | | // ======================> wangpc_lores_video_device |
| 27 | | |
| 28 | | class wangpc_lores_video_device : public device_t, |
| 29 | | public device_wangpcbus_card_interface |
| 30 | | { |
| 31 | | public: |
| 32 | | // construction/destruction |
| 33 | | wangpc_lores_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 34 | | |
| 35 | | // optional information overrides |
| 36 | | virtual machine_config_constructor device_mconfig_additions() const; |
| 37 | | |
| 38 | | // not really public |
| 39 | | void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); |
| 40 | | DECLARE_WRITE_LINE_MEMBER( vsync_w ); |
| 41 | | |
| 42 | | protected: |
| 43 | | // device-level overrides |
| 44 | | virtual void device_start(); |
| 45 | | virtual void device_reset(); |
| 46 | | virtual void device_config_complete() { m_shortname = "wangpc_lores"; } |
| 47 | | |
| 48 | | // device_wangpcbus_card_interface overrides |
| 49 | | virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask); |
| 50 | | virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data); |
| 51 | | virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask); |
| 52 | | virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data); |
| 53 | | |
| 54 | | private: |
| 55 | | wangpcbus_slot_device *m_slot; |
| 56 | | |
| 57 | | // internal state |
| 58 | | required_device<mc6845_device> m_crtc; |
| 59 | | |
| 60 | | UINT16 *m_video_ram; |
| 61 | | UINT8 m_attr[16]; |
| 62 | | UINT8 m_option; |
| 63 | | UINT16 m_scroll; |
| 64 | | int m_irq3; |
| 65 | | }; |
| 66 | | |
| 67 | | |
| 68 | | // device type definition |
| 69 | | extern const device_type WANGPC_LORES_VIDEO; |
| 70 | | |
| 71 | | |
| 72 | | #endif |
src/mess/machine/wangpc_lvc.c
| r0 | r15309 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Wang PC Low-Resolution Video Controller emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "wangpc_lvc.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // MACROS/CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define OPTION_ID 0x10 |
| 19 | |
| 20 | #define MC6845_TAG "mc6845" |
| 21 | #define SCREEN_TAG "screen" |
| 22 | |
| 23 | #define RAM_SIZE 0x8000 |
| 24 | |
| 25 | |
| 26 | |
| 27 | //************************************************************************** |
| 28 | // DEVICE DEFINITIONS |
| 29 | //************************************************************************** |
| 30 | |
| 31 | const device_type WANGPC_LVC = &device_creator<wangpc_lvc_device>; |
| 32 | |
| 33 | |
| 34 | //------------------------------------------------- |
| 35 | // mc6845_interface crtc_intf |
| 36 | //------------------------------------------------- |
| 37 | |
| 38 | void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 39 | { |
| 40 | /* const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 41 | for (int column = 0; column < x_count; column++) |
| 42 | { |
| 43 | UINT8 code = m_video_ram[((ma + column) & 0x7ff)]; |
| 44 | UINT16 addr = (code << 3) | (ra & 0x07); |
| 45 | UINT8 data = m_char_rom[addr & 0x7ff]; |
| 46 | |
| 47 | if (column == cursor_x) |
| 48 | { |
| 49 | data = 0xff; |
| 50 | } |
| 51 | |
| 52 | for (int bit = 0; bit < 8; bit++) |
| 53 | { |
| 54 | int x = (column * 8) + bit; |
| 55 | int color = BIT(data, 7) ? 7 : 0; |
| 56 | |
| 57 | bitmap.pix32(y, x) = palette[color]; |
| 58 | |
| 59 | data <<= 1; |
| 60 | } |
| 61 | }*/ |
| 62 | } |
| 63 | |
| 64 | static MC6845_UPDATE_ROW( wangpc_lvc_update_row ) |
| 65 | { |
| 66 | wangpc_lvc_device *lores = downcast<wangpc_lvc_device *>(device->owner()); |
| 67 | lores->crtc_update_row(device,bitmap,cliprect,ma,ra,y,x_count,cursor_x,param); |
| 68 | } |
| 69 | |
| 70 | WRITE_LINE_MEMBER( wangpc_lvc_device::vsync_w ) |
| 71 | { |
| 72 | if (BIT(m_option, 3) && state) |
| 73 | { |
| 74 | m_irq3 = ASSERT_LINE; |
| 75 | m_bus->irq3_w(m_irq3); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | static const mc6845_interface crtc_intf = |
| 80 | { |
| 81 | SCREEN_TAG, |
| 82 | 8, |
| 83 | NULL, |
| 84 | wangpc_lvc_update_row, |
| 85 | NULL, |
| 86 | DEVCB_NULL, |
| 87 | DEVCB_NULL, |
| 88 | DEVCB_NULL, |
| 89 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_lvc_device, vsync_w), |
| 90 | NULL |
| 91 | }; |
| 92 | |
| 93 | |
| 94 | //------------------------------------------------- |
| 95 | // MACHINE_CONFIG_FRAGMENT( wangpc_lvc ) |
| 96 | //------------------------------------------------- |
| 97 | |
| 98 | static MACHINE_CONFIG_FRAGMENT( wangpc_lvc ) |
| 99 | MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 100 | MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update) |
| 101 | MCFG_SCREEN_SIZE(80*8, 25*9) |
| 102 | MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*9-1) |
| 103 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 104 | MCFG_SCREEN_REFRESH_RATE(60) |
| 105 | |
| 106 | MCFG_PALETTE_LENGTH(16) |
| 107 | |
| 108 | MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_14_31818MHz, crtc_intf) |
| 109 | MACHINE_CONFIG_END |
| 110 | |
| 111 | |
| 112 | //------------------------------------------------- |
| 113 | // machine_config_additions - device-specific |
| 114 | // machine configurations |
| 115 | //------------------------------------------------- |
| 116 | |
| 117 | machine_config_constructor wangpc_lvc_device::device_mconfig_additions() const |
| 118 | { |
| 119 | return MACHINE_CONFIG_NAME( wangpc_lvc ); |
| 120 | } |
| 121 | |
| 122 | |
| 123 | |
| 124 | //************************************************************************** |
| 125 | // LIVE DEVICE |
| 126 | //************************************************************************** |
| 127 | |
| 128 | //------------------------------------------------- |
| 129 | // wangpc_lvc_device - constructor |
| 130 | //------------------------------------------------- |
| 131 | |
| 132 | wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 133 | device_t(mconfig, WANGPC_LVC, "Wang PC Low Resolution Video Card", tag, owner, clock), |
| 134 | device_wangpcbus_card_interface(mconfig, *this), |
| 135 | m_crtc(*this, MC6845_TAG), |
| 136 | m_option(0), |
| 137 | m_irq3(CLEAR_LINE) |
| 138 | { |
| 139 | } |
| 140 | |
| 141 | |
| 142 | //------------------------------------------------- |
| 143 | // device_start - device-specific startup |
| 144 | //------------------------------------------------- |
| 145 | |
| 146 | void wangpc_lvc_device::device_start() |
| 147 | { |
| 148 | // allocate memory |
| 149 | m_video_ram = auto_alloc_array(machine(), UINT16, RAM_SIZE); |
| 150 | |
| 151 | // state saving |
| 152 | save_pointer(NAME(m_video_ram), RAM_SIZE); |
| 153 | } |
| 154 | |
| 155 | |
| 156 | //------------------------------------------------- |
| 157 | // device_reset - device-specific reset |
| 158 | //------------------------------------------------- |
| 159 | |
| 160 | void wangpc_lvc_device::device_reset() |
| 161 | { |
| 162 | } |
| 163 | |
| 164 | |
| 165 | //------------------------------------------------- |
| 166 | // wangpcbus_mrdc_r - memory read |
| 167 | //------------------------------------------------- |
| 168 | |
| 169 | UINT16 wangpc_lvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 170 | { |
| 171 | UINT16 data = 0xffff; |
| 172 | |
| 173 | if (BIT(m_option, 0) && (offset >= 0xe0000/2) && (offset < 0xf0000/2)) |
| 174 | { |
| 175 | data = m_video_ram[offset]; |
| 176 | } |
| 177 | |
| 178 | return data; |
| 179 | } |
| 180 | |
| 181 | |
| 182 | //------------------------------------------------- |
| 183 | // wangpcbus_amwc_w - memory write |
| 184 | //------------------------------------------------- |
| 185 | |
| 186 | void wangpc_lvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) |
| 187 | { |
| 188 | if (BIT(m_option, 0) && (offset >= 0xe0000/2) && (offset < 0xf0000/2)) |
| 189 | { |
| 190 | m_video_ram[offset] = data; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | |
| 195 | //------------------------------------------------- |
| 196 | // wangpcbus_iorc_r - I/O read |
| 197 | //------------------------------------------------- |
| 198 | |
| 199 | UINT16 wangpc_lvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 200 | { |
| 201 | UINT16 data = 0xffff; |
| 202 | |
| 203 | if (sad(offset)) |
| 204 | { |
| 205 | switch (offset & 0x7f) |
| 206 | { |
| 207 | case 0x02/2: |
| 208 | data = 0xff00 | m_crtc->register_r(space, 0); |
| 209 | break; |
| 210 | |
| 211 | case 0x30/2: |
| 212 | data = 0xffe3; |
| 213 | data |= m_crtc->de_r() << 2; |
| 214 | data |= m_crtc->vsync_r() << 3; |
| 215 | data |= m_crtc->hsync_r() << 4; |
| 216 | break; |
| 217 | |
| 218 | case 0xfe/2: |
| 219 | data = 0xff00 | (m_irq3 << 7) | OPTION_ID; |
| 220 | break; |
| 221 | } |
| 222 | |
| 223 | logerror("Lores read %04x %04x %04x\n", offset << 1, mem_mask, data); |
| 224 | } |
| 225 | |
| 226 | return data; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | //------------------------------------------------- |
| 231 | // wangpcbus_aiowc_w - I/O write |
| 232 | //------------------------------------------------- |
| 233 | |
| 234 | void wangpc_lvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask) |
| 235 | { |
| 236 | if (sad(offset)) |
| 237 | { |
| 238 | logerror("Lores write %04x %04x %04x\n", offset << 1, mem_mask, data); |
| 239 | |
| 240 | switch (offset & 0x7f) |
| 241 | { |
| 242 | case 0x00/2: |
| 243 | if (ACCESSING_BITS_0_7) |
| 244 | m_crtc->address_w(space, 0, data & 0xff); |
| 245 | break; |
| 246 | |
| 247 | case 0x02/2: |
| 248 | if (ACCESSING_BITS_0_7) |
| 249 | m_crtc->register_w(space, 0, data & 0xff); |
| 250 | break; |
| 251 | |
| 252 | case 0x10/2: |
| 253 | if (ACCESSING_BITS_0_7) |
| 254 | m_option = data & 0xff; |
| 255 | break; |
| 256 | |
| 257 | case 0x20/2: |
| 258 | m_scroll = data; |
| 259 | break; |
| 260 | |
| 261 | case 0x70/2: |
| 262 | m_irq3 = CLEAR_LINE; |
| 263 | m_bus->irq3_w(m_irq3); |
| 264 | break; |
| 265 | } |
| 266 | } |
| 267 | } |
src/mess/machine/wangpc_rtc.c
| r0 | r15309 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Wang PC-PM040-B Remote Telecommunication controller emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "wangpc_rtc.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // MACROS/CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define OPTION_ID 0x1c |
| 19 | |
| 20 | #define Z80_TAG "z80" |
| 21 | #define AM9517A_TAG "am9517" |
| 22 | #define Z80CTC_0_TAG "z80ctc_0" |
| 23 | #define Z80CTC_1_TAG "z80ctc_1" |
| 24 | #define Z80SIO_TAG "z80sio" |
| 25 | |
| 26 | |
| 27 | |
| 28 | //************************************************************************** |
| 29 | // DEVICE DEFINITIONS |
| 30 | //************************************************************************** |
| 31 | |
| 32 | const device_type WANGPC_RTC = &device_creator<wangpc_rtc_device>; |
| 33 | |
| 34 | |
| 35 | //------------------------------------------------- |
| 36 | // ROM( wangpc_rtc ) |
| 37 | //------------------------------------------------- |
| 38 | |
| 39 | ROM_START( wangpc_rtc ) |
| 40 | ROM_REGION( 0x1000, Z80_TAG, 0 ) |
| 41 | ROM_LOAD( "remotecomms-l28.bin", 0x0000, 0x1000, CRC(c05a1bee) SHA1(6b3f0d787d014b1fd3925812c905ddb63c5055f1) ) |
| 42 | ROM_END |
| 43 | |
| 44 | |
| 45 | //------------------------------------------------- |
| 46 | // rom_region - device-specific ROM region |
| 47 | //------------------------------------------------- |
| 48 | |
| 49 | const rom_entry *wangpc_rtc_device::device_rom_region() const |
| 50 | { |
| 51 | return ROM_NAME( wangpc_rtc ); |
| 52 | } |
| 53 | |
| 54 | |
| 55 | //------------------------------------------------- |
| 56 | // ADDRESS_MAP( wangpc_rtc_mem ) |
| 57 | //------------------------------------------------- |
| 58 | |
| 59 | static ADDRESS_MAP_START( wangpc_rtc_mem, AS_PROGRAM, 8, wangpc_rtc_device ) |
| 60 | AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION(Z80_TAG, 0) |
| 61 | AM_RANGE(0x1000, 0xffff) AM_RAM |
| 62 | ADDRESS_MAP_END |
| 63 | |
| 64 | |
| 65 | //------------------------------------------------- |
| 66 | // ADDRESS_MAP( wangpc_rtc_io ) |
| 67 | //------------------------------------------------- |
| 68 | |
| 69 | static ADDRESS_MAP_START( wangpc_rtc_io, AS_IO, 8, wangpc_rtc_device ) |
| 70 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 71 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_cd_ba_r, z80dart_cd_ba_w) |
| 72 | AM_RANGE(0x10, 0x1f) AM_DEVREADWRITE_LEGACY(AM9517A_TAG, i8237_r, i8237_w) |
| 73 | AM_RANGE(0x20, 0x23) AM_DEVREADWRITE_LEGACY(Z80CTC_0_TAG, z80ctc_r, z80ctc_w) |
| 74 | AM_RANGE(0x30, 0x30) //AM_WRITE(clear_char_w) |
| 75 | AM_RANGE(0x31, 0x31) //AM_WRITE(set_char_w) |
| 76 | AM_RANGE(0x40, 0x40) AM_READ_PORT("SW1") //AM_WRITE(control_w) |
| 77 | AM_RANGE(0x44, 0x44) //AM_READ(i8086_status_r) AM_WRITE(reset_w) |
| 78 | AM_RANGE(0x48, 0x48) //AM_WRITE(dte_ready_w) |
| 79 | AM_RANGE(0x4c, 0x4c) //AM_READWRITE(8232_acu_r, 8232_acu_w) |
| 80 | AM_RANGE(0x50, 0x50) //AM_READ(outbound_data_r) |
| 81 | AM_RANGE(0x51, 0x52) //AM_WRITE(status_w) |
| 82 | AM_RANGE(0x54, 0x54) //AM_WRITE(enable_inbound_data_w) |
| 83 | AM_RANGE(0x51, 0x52) //AM_WRITE(inbound_data_w) |
| 84 | AM_RANGE(0x60, 0x63) AM_DEVREADWRITE_LEGACY(Z80CTC_1_TAG, z80ctc_r, z80ctc_w) |
| 85 | AM_RANGE(0x70, 0x70) //AM_READWRITE(led_toggle_r, odd_parity_w) |
| 86 | AM_RANGE(0x71, 0x71) //AM_WRITE(even_parity_w) |
| 87 | ADDRESS_MAP_END |
| 88 | |
| 89 | |
| 90 | //------------------------------------------------- |
| 91 | // z80_daisy_config wangpc_rtc_daisy_chain |
| 92 | //------------------------------------------------- |
| 93 | |
| 94 | static const z80_daisy_config wangpc_rtc_daisy_chain[] = |
| 95 | { |
| 96 | { Z80SIO_TAG }, |
| 97 | { Z80CTC_0_TAG }, |
| 98 | { Z80CTC_1_TAG }, |
| 99 | { NULL } |
| 100 | }; |
| 101 | |
| 102 | |
| 103 | //------------------------------------------------- |
| 104 | // I8237_INTERFACE( dmac_intf ) |
| 105 | //------------------------------------------------- |
| 106 | |
| 107 | static I8237_INTERFACE( dmac_intf ) |
| 108 | { |
| 109 | DEVCB_NULL, |
| 110 | DEVCB_NULL, |
| 111 | DEVCB_NULL, |
| 112 | DEVCB_NULL, |
| 113 | { DEVCB_NULL, |
| 114 | DEVCB_NULL, |
| 115 | DEVCB_NULL, |
| 116 | DEVCB_NULL, }, |
| 117 | { DEVCB_NULL, |
| 118 | DEVCB_NULL, |
| 119 | DEVCB_NULL, |
| 120 | DEVCB_NULL, }, |
| 121 | { DEVCB_NULL, |
| 122 | DEVCB_NULL, |
| 123 | DEVCB_NULL, |
| 124 | DEVCB_NULL } |
| 125 | }; |
| 126 | |
| 127 | |
| 128 | //------------------------------------------------- |
| 129 | // Z80CTC_INTERFACE( ctc0_intf ) |
| 130 | //------------------------------------------------- |
| 131 | |
| 132 | static Z80CTC_INTERFACE( ctc0_intf ) |
| 133 | { |
| 134 | 0, |
| 135 | DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), |
| 136 | DEVCB_NULL, |
| 137 | DEVCB_NULL, |
| 138 | DEVCB_NULL |
| 139 | }; |
| 140 | |
| 141 | |
| 142 | //------------------------------------------------- |
| 143 | // Z80CTC_INTERFACE( ctc1_intf ) |
| 144 | //------------------------------------------------- |
| 145 | |
| 146 | static Z80CTC_INTERFACE( ctc1_intf ) |
| 147 | { |
| 148 | 0, |
| 149 | DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), |
| 150 | DEVCB_NULL, |
| 151 | DEVCB_NULL, |
| 152 | DEVCB_NULL |
| 153 | }; |
| 154 | |
| 155 | |
| 156 | //------------------------------------------------- |
| 157 | // Z80DART_INTERFACE( sio_intf ) |
| 158 | //------------------------------------------------- |
| 159 | |
| 160 | static Z80DART_INTERFACE( sio_intf ) |
| 161 | { |
| 162 | 0, 0, 0, 0, |
| 163 | |
| 164 | DEVCB_NULL, |
| 165 | DEVCB_NULL, |
| 166 | DEVCB_NULL, |
| 167 | DEVCB_NULL, |
| 168 | DEVCB_NULL, |
| 169 | DEVCB_NULL, |
| 170 | |
| 171 | DEVCB_NULL, |
| 172 | DEVCB_NULL, |
| 173 | DEVCB_NULL, |
| 174 | DEVCB_NULL, |
| 175 | DEVCB_NULL, |
| 176 | DEVCB_NULL, |
| 177 | |
| 178 | DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0) |
| 179 | }; |
| 180 | |
| 181 | |
| 182 | //------------------------------------------------- |
| 183 | // MACHINE_CONFIG_FRAGMENT( wangpc_rtc ) |
| 184 | //------------------------------------------------- |
| 185 | |
| 186 | static MACHINE_CONFIG_FRAGMENT( wangpc_rtc ) |
| 187 | MCFG_CPU_ADD(Z80_TAG, Z80, 2000000) |
| 188 | MCFG_CPU_CONFIG(wangpc_rtc_daisy_chain) |
| 189 | MCFG_CPU_PROGRAM_MAP(wangpc_rtc_mem) |
| 190 | MCFG_CPU_IO_MAP(wangpc_rtc_io) |
| 191 | |
| 192 | MCFG_I8237_ADD(AM9517A_TAG, 2000000, dmac_intf) |
| 193 | MCFG_Z80CTC_ADD(Z80CTC_0_TAG, 2000000, ctc0_intf) |
| 194 | MCFG_Z80CTC_ADD(Z80CTC_1_TAG, 2000000, ctc1_intf) |
| 195 | MCFG_Z80DART_ADD(Z80SIO_TAG, 2000000, sio_intf) |
| 196 | MACHINE_CONFIG_END |
| 197 | |
| 198 | |
| 199 | //------------------------------------------------- |
| 200 | // machine_config_additions - device-specific |
| 201 | // machine configurations |
| 202 | //------------------------------------------------- |
| 203 | |
| 204 | machine_config_constructor wangpc_rtc_device::device_mconfig_additions() const |
| 205 | { |
| 206 | return MACHINE_CONFIG_NAME( wangpc_rtc ); |
| 207 | } |
| 208 | |
| 209 | |
| 210 | //------------------------------------------------- |
| 211 | // INPUT_PORTS( wangpc_rtc ) |
| 212 | //------------------------------------------------- |
| 213 | |
| 214 | INPUT_PORTS_START( wangpc_rtc ) |
| 215 | PORT_START("SW1") |
| 216 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") |
| 217 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 218 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 219 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") |
| 220 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 221 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 222 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") |
| 223 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 224 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 225 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") |
| 226 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 227 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 228 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") |
| 229 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 230 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 231 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") |
| 232 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 233 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 234 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") |
| 235 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 236 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 237 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") |
| 238 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 239 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 240 | INPUT_PORTS_END |
| 241 | |
| 242 | |
| 243 | //------------------------------------------------- |
| 244 | // input_ports - device-specific input ports |
| 245 | //------------------------------------------------- |
| 246 | |
| 247 | ioport_constructor wangpc_rtc_device::device_input_ports() const |
| 248 | { |
| 249 | return INPUT_PORTS_NAME( wangpc_rtc ); |
| 250 | } |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | //************************************************************************** |
| 256 | // LIVE DEVICE |
| 257 | //************************************************************************** |
| 258 | |
| 259 | //------------------------------------------------- |
| 260 | // wangpc_rtc_device - constructor |
| 261 | //------------------------------------------------- |
| 262 | |
| 263 | wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 264 | device_t(mconfig, WANGPC_RTC, "Wang PC-PM040-B", tag, owner, clock), |
| 265 | device_wangpcbus_card_interface(mconfig, *this), |
| 266 | m_maincpu(*this, Z80_TAG), |
| 267 | m_dmac(*this, AM9517A_TAG), |
| 268 | m_ctc0(*this, Z80CTC_0_TAG), |
| 269 | m_ctc1(*this, Z80CTC_1_TAG), |
| 270 | m_sio(*this, Z80SIO_TAG) |
| 271 | { |
| 272 | } |
| 273 | |
| 274 | |
| 275 | //------------------------------------------------- |
| 276 | // device_start - device-specific startup |
| 277 | //------------------------------------------------- |
| 278 | |
| 279 | void wangpc_rtc_device::device_start() |
| 280 | { |
| 281 | } |
| 282 | |
| 283 | |
| 284 | //------------------------------------------------- |
| 285 | // device_reset - device-specific reset |
| 286 | //------------------------------------------------- |
| 287 | |
| 288 | void wangpc_rtc_device::device_reset() |
| 289 | { |
| 290 | } |
| 291 | |
| 292 | |
| 293 | //------------------------------------------------- |
| 294 | // wangpcbus_mrdc_r - memory read |
| 295 | //------------------------------------------------- |
| 296 | |
| 297 | UINT16 wangpc_rtc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 298 | { |
| 299 | UINT16 data = 0xffff; |
| 300 | |
| 301 | return data; |
| 302 | } |
| 303 | |
| 304 | |
| 305 | //------------------------------------------------- |
| 306 | // wangpcbus_amwc_w - memory write |
| 307 | //------------------------------------------------- |
| 308 | |
| 309 | void wangpc_rtc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) |
| 310 | { |
| 311 | } |
| 312 | |
| 313 | |
| 314 | //------------------------------------------------- |
| 315 | // wangpcbus_iorc_r - I/O read |
| 316 | //------------------------------------------------- |
| 317 | |
| 318 | UINT16 wangpc_rtc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 319 | { |
| 320 | UINT16 data = 0xffff; |
| 321 | |
| 322 | if (sad(offset)) |
| 323 | { |
| 324 | switch (offset & 0x7f) |
| 325 | { |
| 326 | case 0xfe/2: |
| 327 | data = 0xff00 | OPTION_ID; |
| 328 | break; |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | return data; |
| 333 | } |
| 334 | |
| 335 | |
| 336 | //------------------------------------------------- |
| 337 | // wangpcbus_aiowc_w - I/O write |
| 338 | //------------------------------------------------- |
| 339 | |
| 340 | void wangpc_rtc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask) |
| 341 | { |
| 342 | if (sad(offset)) |
| 343 | { |
| 344 | switch (offset & 0x7f) |
| 345 | { |
| 346 | case 0xfc/2: |
| 347 | device_reset(); |
| 348 | break; |
| 349 | } |
| 350 | } |
| 351 | } |
src/mess/machine/wangpc_wdc.c
| r0 | r15309 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Wang PC-PM001 Winchester Disk Controller emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "wangpc_wdc.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // MACROS/CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define OPTION_ID 0x01 |
| 19 | |
| 20 | #define Z80_TAG "z80" |
| 21 | #define SASIBUS_TAG "sasi" |
| 22 | |
| 23 | |
| 24 | |
| 25 | //************************************************************************** |
| 26 | // DEVICE DEFINITIONS |
| 27 | //************************************************************************** |
| 28 | |
| 29 | const device_type WANGPC_WDC = &device_creator<wangpc_wdc_device>; |
| 30 | |
| 31 | |
| 32 | //------------------------------------------------- |
| 33 | // ROM( wangpc_wdc ) |
| 34 | //------------------------------------------------- |
| 35 | |
| 36 | ROM_START( wangpc_wdc ) |
| 37 | ROM_REGION( 0x1000, Z80_TAG, 0 ) |
| 38 | ROM_LOAD( "378-9040 r9.l19", 0x0000, 0x1000, CRC(282770d2) SHA1(a0e3bad5041e0dfd6087907015b07a093b576bc0) ) |
| 39 | |
| 40 | ROM_REGION( 0x1000, "address", 0 ) |
| 41 | ROM_LOAD( "378-9041.l54", 0x0000, 0x1000, CRC(94e9a17d) SHA1(060c576d70069ece2d0dbce86ffc448df2b169e7) ) |
| 42 | ROM_END |
| 43 | |
| 44 | |
| 45 | //------------------------------------------------- |
| 46 | // rom_region - device-specific ROM region |
| 47 | //------------------------------------------------- |
| 48 | |
| 49 | const rom_entry *wangpc_wdc_device::device_rom_region() const |
| 50 | { |
| 51 | return ROM_NAME( wangpc_wdc ); |
| 52 | } |
| 53 | |
| 54 | |
| 55 | //------------------------------------------------- |
| 56 | // ADDRESS_MAP( wangpc_wdc_mem ) |
| 57 | //------------------------------------------------- |
| 58 | |
| 59 | static ADDRESS_MAP_START( wangpc_wdc_mem, AS_PROGRAM, 8, wangpc_wdc_device ) |
| 60 | AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION(Z80_TAG, 0) |
| 61 | ADDRESS_MAP_END |
| 62 | |
| 63 | |
| 64 | //------------------------------------------------- |
| 65 | // ADDRESS_MAP( wangpc_wdc_io ) |
| 66 | //------------------------------------------------- |
| 67 | |
| 68 | static ADDRESS_MAP_START( wangpc_wdc_io, AS_IO, 8, wangpc_wdc_device ) |
| 69 | ADDRESS_MAP_END |
| 70 | |
| 71 | |
| 72 | //------------------------------------------------- |
| 73 | // SCSIBus_interface sasi_intf |
| 74 | //------------------------------------------------- |
| 75 | |
| 76 | static const SCSIConfigTable sasi_dev_table = |
| 77 | { |
| 78 | 1, |
| 79 | { |
| 80 | { SCSI_ID_0, "harddisk0", SCSI_DEVICE_HARDDISK } |
| 81 | } |
| 82 | }; |
| 83 | |
| 84 | static const SCSIBus_interface sasi_intf = |
| 85 | { |
| 86 | &sasi_dev_table, |
| 87 | NULL, |
| 88 | DEVCB_NULL, |
| 89 | DEVCB_NULL, |
| 90 | DEVCB_NULL, |
| 91 | DEVCB_NULL, |
| 92 | DEVCB_NULL, |
| 93 | DEVCB_NULL, |
| 94 | DEVCB_NULL |
| 95 | }; |
| 96 | |
| 97 | |
| 98 | //------------------------------------------------- |
| 99 | // MACHINE_CONFIG_FRAGMENT( wangpc_wdc ) |
| 100 | //------------------------------------------------- |
| 101 | |
| 102 | static MACHINE_CONFIG_FRAGMENT( wangpc_wdc ) |
| 103 | MCFG_CPU_ADD(Z80_TAG, Z80, 2000000) |
| 104 | //MCFG_CPU_CONFIG(wangpc_wdc_daisy_chain) |
| 105 | MCFG_CPU_PROGRAM_MAP(wangpc_wdc_mem) |
| 106 | MCFG_CPU_IO_MAP(wangpc_wdc_io) |
| 107 | |
| 108 | MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf) |
| 109 | MCFG_HARDDISK_ADD("harddisk0") |
| 110 | MACHINE_CONFIG_END |
| 111 | |
| 112 | |
| 113 | //------------------------------------------------- |
| 114 | // machine_config_additions - device-specific |
| 115 | // machine configurations |
| 116 | //------------------------------------------------- |
| 117 | |
| 118 | machine_config_constructor wangpc_wdc_device::device_mconfig_additions() const |
| 119 | { |
| 120 | return MACHINE_CONFIG_NAME( wangpc_wdc ); |
| 121 | } |
| 122 | |
| 123 | |
| 124 | |
| 125 | //************************************************************************** |
| 126 | // LIVE DEVICE |
| 127 | //************************************************************************** |
| 128 | |
| 129 | //------------------------------------------------- |
| 130 | // wangpc_wdc_device - constructor |
| 131 | //------------------------------------------------- |
| 132 | |
| 133 | wangpc_wdc_device::wangpc_wdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 134 | device_t(mconfig, WANGPC_WDC, "Wang PC-PM001", tag, owner, clock), |
| 135 | device_wangpcbus_card_interface(mconfig, *this), |
| 136 | m_maincpu(*this, Z80_TAG), |
| 137 | m_sasibus(*this, SASIBUS_TAG) |
| 138 | { |
| 139 | } |
| 140 | |
| 141 | |
| 142 | //------------------------------------------------- |
| 143 | // device_start - device-specific startup |
| 144 | //------------------------------------------------- |
| 145 | |
| 146 | void wangpc_wdc_device::device_start() |
| 147 | { |
| 148 | } |
| 149 | |
| 150 | |
| 151 | //------------------------------------------------- |
| 152 | // device_reset - device-specific reset |
| 153 | //------------------------------------------------- |
| 154 | |
| 155 | void wangpc_wdc_device::device_reset() |
| 156 | { |
| 157 | } |
| 158 | |
| 159 | |
| 160 | //------------------------------------------------- |
| 161 | // wangpcbus_mrdc_r - memory read |
| 162 | //------------------------------------------------- |
| 163 | |
| 164 | UINT16 wangpc_wdc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 165 | { |
| 166 | UINT16 data = 0xffff; |
| 167 | |
| 168 | return data; |
| 169 | } |
| 170 | |
| 171 | |
| 172 | //------------------------------------------------- |
| 173 | // wangpcbus_amwc_w - memory write |
| 174 | //------------------------------------------------- |
| 175 | |
| 176 | void wangpc_wdc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) |
| 177 | { |
| 178 | } |
| 179 | |
| 180 | |
| 181 | //------------------------------------------------- |
| 182 | // wangpcbus_iorc_r - I/O read |
| 183 | //------------------------------------------------- |
| 184 | |
| 185 | UINT16 wangpc_wdc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 186 | { |
| 187 | UINT16 data = 0xffff; |
| 188 | |
| 189 | if (sad(offset)) |
| 190 | { |
| 191 | switch (offset & 0x7f) |
| 192 | { |
| 193 | case 0xfe/2: |
| 194 | data = 0xff00 | OPTION_ID; |
| 195 | break; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | return data; |
| 200 | } |
| 201 | |
| 202 | |
| 203 | //------------------------------------------------- |
| 204 | // wangpcbus_aiowc_w - I/O write |
| 205 | //------------------------------------------------- |
| 206 | |
| 207 | void wangpc_wdc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask) |
| 208 | { |
| 209 | if (sad(offset)) |
| 210 | { |
| 211 | switch (offset & 0x7f) |
| 212 | { |
| 213 | case 0xfc/2: |
| 214 | device_reset(); |
| 215 | break; |
| 216 | } |
| 217 | } |
| 218 | } |
src/mess/machine/wangpc_lic.c
| r0 | r15309 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Wang PC Network card emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "wangpc_lic.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // MACROS/CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define OPTION_ID 0x30 |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // DEVICE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | const device_type WANGPC_LIC = &device_creator<wangpc_lic_device>; |
| 27 | |
| 28 | |
| 29 | //------------------------------------------------- |
| 30 | // ROM( wangpc_lic ) |
| 31 | //------------------------------------------------- |
| 32 | |
| 33 | ROM_START( wangpc_lic ) |
| 34 | ROM_REGION( 0x1000, "network", 0 ) |
| 35 | ROM_LOAD( "7025.l22", 0x0000, 0x1000, CRC(487e5f04) SHA1(81e52e70e0c6e34715119b121ec19a7758cd6772) ) |
| 36 | ROM_END |
| 37 | |
| 38 | |
| 39 | //------------------------------------------------- |
| 40 | // rom_region - device-specific ROM region |
| 41 | //------------------------------------------------- |
| 42 | |
| 43 | const rom_entry *wangpc_lic_device::device_rom_region() const |
| 44 | { |
| 45 | return ROM_NAME( wangpc_lic ); |
| 46 | } |
| 47 | |
| 48 | |
| 49 | //------------------------------------------------- |
| 50 | // MACHINE_CONFIG_FRAGMENT( wangpc_lic ) |
| 51 | //------------------------------------------------- |
| 52 | |
| 53 | static MACHINE_CONFIG_FRAGMENT( wangpc_lic ) |
| 54 | MACHINE_CONFIG_END |
| 55 | |
| 56 | |
| 57 | //------------------------------------------------- |
| 58 | // machine_config_additions - device-specific |
| 59 | // machine configurations |
| 60 | //------------------------------------------------- |
| 61 | |
| 62 | machine_config_constructor wangpc_lic_device::device_mconfig_additions() const |
| 63 | { |
| 64 | return MACHINE_CONFIG_NAME( wangpc_lic ); |
| 65 | } |
| 66 | |
| 67 | |
| 68 | |
| 69 | //************************************************************************** |
| 70 | // LIVE DEVICE |
| 71 | //************************************************************************** |
| 72 | |
| 73 | //------------------------------------------------- |
| 74 | // wangpc_lic_device - constructor |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | wangpc_lic_device::wangpc_lic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 78 | device_t(mconfig, WANGPC_LIC, "Wang PC-PM070", tag, owner, clock), |
| 79 | device_wangpcbus_card_interface(mconfig, *this) |
| 80 | { |
| 81 | } |
| 82 | |
| 83 | |
| 84 | //------------------------------------------------- |
| 85 | // device_start - device-specific startup |
| 86 | //------------------------------------------------- |
| 87 | |
| 88 | void wangpc_lic_device::device_start() |
| 89 | { |
| 90 | } |
| 91 | |
| 92 | |
| 93 | //------------------------------------------------- |
| 94 | // device_reset - device-specific reset |
| 95 | //------------------------------------------------- |
| 96 | |
| 97 | void wangpc_lic_device::device_reset() |
| 98 | { |
| 99 | } |
| 100 | |
| 101 | |
| 102 | //------------------------------------------------- |
| 103 | // wangpcbus_mrdc_r - memory read |
| 104 | //------------------------------------------------- |
| 105 | |
| 106 | UINT16 wangpc_lic_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 107 | { |
| 108 | UINT16 data = 0xffff; |
| 109 | |
| 110 | return data; |
| 111 | } |
| 112 | |
| 113 | |
| 114 | //------------------------------------------------- |
| 115 | // wangpcbus_amwc_w - memory write |
| 116 | //------------------------------------------------- |
| 117 | |
| 118 | void wangpc_lic_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) |
| 119 | { |
| 120 | } |
| 121 | |
| 122 | |
| 123 | //------------------------------------------------- |
| 124 | // wangpcbus_iorc_r - I/O read |
| 125 | //------------------------------------------------- |
| 126 | |
| 127 | UINT16 wangpc_lic_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) |
| 128 | { |
| 129 | UINT16 data = 0xffff; |
| 130 | |
| 131 | if (sad(offset)) |
| 132 | { |
| 133 | switch (offset & 0x7f) |
| 134 | { |
| 135 | case 0xfe/2: |
| 136 | data = 0xff00 | OPTION_ID; |
| 137 | break; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | return data; |
| 142 | } |
| 143 | |
| 144 | |
| 145 | //------------------------------------------------- |
| 146 | // wangpcbus_aiowc_w - I/O write |
| 147 | //------------------------------------------------- |
| 148 | |
| 149 | void wangpc_lic_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask) |
| 150 | { |
| 151 | if (sad(offset)) |
| 152 | { |
| 153 | switch (offset & 0x7f) |
| 154 | { |
| 155 | case 0xfc/2: |
| 156 | device_reset(); |
| 157 | break; |
| 158 | } |
| 159 | } |
| 160 | } |
src/mess/drivers/wangpc.c
| r15308 | r15309 | |
| 16 | 16 | // MACROS/CONSTANTS
|
| 17 | 17 | //**************************************************************************
|
| 18 | 18 | |
| 19 | #define LOG 1
|
| 20 | |
| 19 | 21 | enum
|
| 20 | 22 | {
|
| 21 | 23 | LED_DIAGNOSTIC = 0
|
| r15308 | r15309 | |
| 47 | 49 | m_fdc_tc_enable = BIT(data, 0);
|
| 48 | 50 | m_fdc_dma_enable = BIT(data, 1);
|
| 49 | 51 | |
| 52 | if (LOG) logerror("Enable /EOP %u\n", m_fdc_tc_enable);
|
| 53 | if (LOG) logerror("Disable /DREQ2 %u\n", m_fdc_dma_enable);
|
| 54 | |
| 50 | 55 | update_fdc_tc();
|
| 51 | 56 | update_fdc_drq();
|
| 52 | 57 | }
|
| r15308 | r15309 | |
| 54 | 59 | |
| 55 | 60 | READ8_MEMBER( wangpc_state::deselect_drive1_r )
|
| 56 | 61 | {
|
| 57 | | m_ds1 = 1;
|
| 62 | if (LOG) logerror("Deselect drive 1\n");
|
| 58 | 63 | |
| 64 | m_ds1 = 1;
|
| 65 | |
| 59 | 66 | return 0;
|
| 60 | 67 | }
|
| 61 | 68 | |
| 62 | 69 | |
| 63 | 70 | WRITE8_MEMBER( wangpc_state::deselect_drive1_w )
|
| 64 | 71 | {
|
| 72 | if (LOG) logerror("Deselect drive 1\n");
|
| 73 | |
| 65 | 74 | m_ds1 = 1;
|
| 66 | 75 | }
|
| 67 | 76 | |
| 68 | 77 | |
| 69 | 78 | READ8_MEMBER( wangpc_state::select_drive1_r )
|
| 70 | 79 | {
|
| 80 | if (LOG) logerror("Select drive 1\n");
|
| 81 | |
| 71 | 82 | m_ds1 = 0;
|
| 72 | 83 | |
| 73 | 84 | return 0;
|
| r15308 | r15309 | |
| 76 | 87 | |
| 77 | 88 | WRITE8_MEMBER( wangpc_state::select_drive1_w )
|
| 78 | 89 | {
|
| 90 | if (LOG) logerror("Select drive 1\n");
|
| 91 | |
| 79 | 92 | m_ds1 = 0;
|
| 80 | 93 | }
|
| 81 | 94 | |
| 82 | 95 | |
| 83 | 96 | READ8_MEMBER( wangpc_state::deselect_drive2_r )
|
| 84 | 97 | {
|
| 98 | if (LOG) logerror("Deselect drive 2\n");
|
| 99 | |
| 85 | 100 | m_ds2 = 1;
|
| 86 | 101 | |
| 87 | 102 | return 0;
|
| r15308 | r15309 | |
| 90 | 105 | |
| 91 | 106 | WRITE8_MEMBER( wangpc_state::deselect_drive2_w )
|
| 92 | 107 | {
|
| 108 | if (LOG) logerror("Deselect drive 2\n");
|
| 109 | |
| 93 | 110 | m_ds2 = 1;
|
| 94 | 111 | }
|
| 95 | 112 | |
| 96 | 113 | |
| 97 | 114 | READ8_MEMBER( wangpc_state::select_drive2_r )
|
| 98 | 115 | {
|
| 116 | if (LOG) logerror("Select drive 2\n");
|
| 117 | |
| 99 | 118 | m_ds2 = 0;
|
| 100 | 119 | |
| 101 | 120 | return 0;
|
| r15308 | r15309 | |
| 104 | 123 | |
| 105 | 124 | WRITE8_MEMBER( wangpc_state::select_drive2_w )
|
| 106 | 125 | {
|
| 126 | if (LOG) logerror("Select drive 2\n");
|
| 127 | |
| 107 | 128 | m_ds2 = 0;
|
| 108 | 129 | }
|
| 109 | 130 | |
| 110 | 131 | |
| 111 | 132 | READ8_MEMBER( wangpc_state::motor1_off_r )
|
| 112 | 133 | {
|
| 134 | if (LOG) logerror("Motor 1 off\n");
|
| 135 |
|
| 113 | 136 | floppy_mon_w(m_floppy0, 1);
|
| 114 | 137 | |
| 115 | 138 | return 0;
|
| r15308 | r15309 | |
| 118 | 141 | |
| 119 | 142 | WRITE8_MEMBER( wangpc_state::motor1_off_w )
|
| 120 | 143 | {
|
| 144 | if (LOG) logerror("Motor 1 off\n");
|
| 145 | |
| 121 | 146 | floppy_mon_w(m_floppy0, 1);
|
| 122 | 147 | }
|
| 123 | 148 | |
| 124 | 149 | |
| 125 | 150 | READ8_MEMBER( wangpc_state::motor1_on_r )
|
| 126 | 151 | {
|
| 152 | if (LOG) logerror("Motor 1 on\n");
|
| 153 | |
| 127 | 154 | floppy_mon_w(m_floppy0, 0);
|
| 128 | 155 | |
| 129 | 156 | return 0;
|
| r15308 | r15309 | |
| 132 | 159 | |
| 133 | 160 | WRITE8_MEMBER( wangpc_state::motor1_on_w )
|
| 134 | 161 | {
|
| 162 | if (LOG) logerror("Motor 1 on\n");
|
| 163 | |
| 135 | 164 | floppy_mon_w(m_floppy0, 0);
|
| 136 | 165 | }
|
| 137 | 166 | |
| 138 | 167 | |
| 139 | 168 | READ8_MEMBER( wangpc_state::motor2_off_r )
|
| 140 | 169 | {
|
| 170 | if (LOG) logerror("Motor 2 off\n");
|
| 171 | |
| 141 | 172 | floppy_mon_w(m_floppy1, 1);
|
| 142 | 173 | |
| 143 | 174 | return 0;
|
| r15308 | r15309 | |
| 146 | 177 | |
| 147 | 178 | WRITE8_MEMBER( wangpc_state::motor2_off_w )
|
| 148 | 179 | {
|
| 180 | if (LOG) logerror("Motor 2 off\n");
|
| 181 | |
| 149 | 182 | floppy_mon_w(m_floppy1, 1);
|
| 150 | 183 | }
|
| 151 | 184 | |
| 152 | 185 | |
| 153 | 186 | READ8_MEMBER( wangpc_state::motor2_on_r )
|
| 154 | 187 | {
|
| 188 | if (LOG) logerror("Motor 2 on\n");
|
| 189 | |
| 155 | 190 | floppy_mon_w(m_floppy1, 0);
|
| 156 | 191 | |
| 157 | 192 | return 0;
|
| r15308 | r15309 | |
| 160 | 195 | |
| 161 | 196 | WRITE8_MEMBER( wangpc_state::motor2_on_w )
|
| 162 | 197 | {
|
| 198 | if (LOG) logerror("Motor 2 on\n");
|
| 199 | |
| 163 | 200 | floppy_mon_w(m_floppy1, 0);
|
| 164 | 201 | }
|
| 165 | 202 | |
| 166 | 203 | |
| 167 | 204 | READ8_MEMBER( wangpc_state::fdc_reset_r )
|
| 168 | 205 | {
|
| 206 | if (LOG) logerror("FDC reset\n");
|
| 207 | |
| 169 | 208 | upd765_reset_w(m_fdc, 1);
|
| 170 | 209 | upd765_reset_w(m_fdc, 0);
|
| 171 | 210 | |
| r15308 | r15309 | |
| 175 | 214 | |
| 176 | 215 | WRITE8_MEMBER( wangpc_state::fdc_reset_w )
|
| 177 | 216 | {
|
| 217 | if (LOG) logerror("FDC reset\n");
|
| 218 | |
| 178 | 219 | upd765_reset_w(m_fdc, 1);
|
| 179 | 220 | upd765_reset_w(m_fdc, 0);
|
| 180 | 221 | }
|
| r15308 | r15309 | |
| 182 | 223 | |
| 183 | 224 | READ8_MEMBER( wangpc_state::fdc_tc_r )
|
| 184 | 225 | {
|
| 226 | if (LOG) logerror("FDC TC\n");
|
| 227 | |
| 185 | 228 | upd765_tc_w(m_fdc, 1);
|
| 186 | 229 | upd765_tc_w(m_fdc, 0);
|
| 187 | 230 | |
| r15308 | r15309 | |
| 191 | 234 | |
| 192 | 235 | WRITE8_MEMBER( wangpc_state::fdc_tc_w )
|
| 193 | 236 | {
|
| 237 | if (LOG) logerror("FDC TC\n");
|
| 238 | |
| 194 | 239 | upd765_tc_w(m_fdc, 1);
|
| 195 | 240 | upd765_tc_w(m_fdc, 0);
|
| 196 | 241 | }
|
| r15308 | r15309 | |
| 203 | 248 | |
| 204 | 249 | WRITE8_MEMBER( wangpc_state::dma_page_w )
|
| 205 | 250 | {
|
| 251 | if (LOG) logerror("DMA page %u: %01x\n", offset, data & 0x0f);
|
| 252 | |
| 206 | 253 | m_dma_page[offset] = data & 0x0f;
|
| 207 | 254 | }
|
| 208 | 255 | |
| r15308 | r15309 | |
| 243 | 290 | |
| 244 | 291 | WRITE8_MEMBER( wangpc_state::timer0_irq_clr_w )
|
| 245 | 292 | {
|
| 293 | if (LOG) logerror("Timer 0 IRQ clear\n");
|
| 294 | |
| 246 | 295 | pic8259_ir0_w(m_pic, CLEAR_LINE);
|
| 247 | 296 | }
|
| 248 | 297 | |
| r15308 | r15309 | |
| 253 | 302 | |
| 254 | 303 | READ8_MEMBER( wangpc_state::timer2_irq_clr_r )
|
| 255 | 304 | {
|
| 305 | if (LOG) logerror("Timer 2 IRQ clear\n");
|
| 306 | |
| 256 | 307 | m_timer2_irq = 1;
|
| 257 | 308 | check_level1_interrupts();
|
| 258 | 309 | |
| r15308 | r15309 | |
| 266 | 317 | |
| 267 | 318 | WRITE8_MEMBER( wangpc_state::nmi_mask_w )
|
| 268 | 319 | {
|
| 320 | if (LOG) logerror("NMI mask %02x\n", data);
|
| 269 | 321 | }
|
| 270 | 322 | |
| 271 | 323 | |
| r15308 | r15309 | |
| 275 | 327 | |
| 276 | 328 | READ8_MEMBER( wangpc_state::led_on_r )
|
| 277 | 329 | {
|
| 330 | if (LOG) logerror("LED on\n");
|
| 331 | |
| 278 | 332 | output_set_led_value(LED_DIAGNOSTIC, 1);
|
| 279 | 333 | |
| 280 | 334 | return 0;
|
| r15308 | r15309 | |
| 287 | 341 | |
| 288 | 342 | WRITE8_MEMBER( wangpc_state::fpu_mask_w )
|
| 289 | 343 | {
|
| 344 | if (LOG) logerror("FPU mask %02x\n", data);
|
| 290 | 345 | }
|
| 291 | 346 | |
| 292 | 347 | |
| r15308 | r15309 | |
| 296 | 351 | |
| 297 | 352 | WRITE8_MEMBER( wangpc_state::uart_tbre_clr_w )
|
| 298 | 353 | {
|
| 354 | if (LOG) logerror("TBRE clear\n");
|
| 355 | |
| 299 | 356 | m_uart_tbre = 0;
|
| 300 | 357 | check_level2_interrupts();
|
| 301 | 358 | }
|
| r15308 | r15309 | |
| 320 | 377 | |
| 321 | 378 | WRITE8_MEMBER( wangpc_state::uart_w )
|
| 322 | 379 | {
|
| 380 | if (LOG) logerror("UART write %02x\n", data);
|
| 381 | |
| 382 | switch (data)
|
| 383 | {
|
| 384 | case 0x10: m_led[0] = 1; break;
|
| 385 | case 0x11: m_led[0] = 0; break;
|
| 386 | case 0x12: m_led[1] = 1; break;
|
| 387 | case 0x13: m_led[1] = 0; break;
|
| 388 | case 0x14: m_led[2] = 1; break;
|
| 389 | case 0x15: m_led[2] = 0; break;
|
| 390 | case 0x16: m_led[3] = 1; break;
|
| 391 | case 0x17: m_led[3] = 0; break;
|
| 392 | case 0x18: m_led[4] = 1; break;
|
| 393 | case 0x19: m_led[4] = 0; break;
|
| 394 | case 0x1a: m_led[5] = 1; break;
|
| 395 | case 0x1b: m_led[5] = 0; break;
|
| 396 | case 0x1c: m_led[0] = m_led[1] = m_led[2] = m_led[3] = m_led[4] = m_led[5] = 1; break;
|
| 397 | case 0x1d: m_led[0] = m_led[1] = m_led[2] = m_led[3] = m_led[4] = m_led[5] = 0; break;
|
| 398 | }
|
| 399 | |
| 400 | popmessage("%u%u%u%u%u%u", m_led[0], m_led[1], m_led[2], m_led[3], m_led[4], m_led[5]);
|
| 401 | |
| 323 | 402 | m_uart_tbre = 0;
|
| 324 | 403 | check_level2_interrupts();
|
| 325 | 404 | |
| r15308 | r15309 | |
| 362 | 441 | |
| 363 | 442 | READ8_MEMBER( wangpc_state::busy_clr_r )
|
| 364 | 443 | {
|
| 444 | if (LOG) logerror("BUSY clear\n");
|
| 445 | |
| 365 | 446 | m_busy = 1;
|
| 366 | 447 | check_level1_interrupts();
|
| 367 | 448 | |
| r15308 | r15309 | |
| 375 | 456 | |
| 376 | 457 | WRITE8_MEMBER( wangpc_state::acknlg_clr_w )
|
| 377 | 458 | {
|
| 459 | if (LOG) logerror("ACKNLG clear\n");
|
| 460 | |
| 378 | 461 | m_acknlg = 1;
|
| 379 | 462 | check_level1_interrupts();
|
| 380 | 463 | }
|
| r15308 | r15309 | |
| 386 | 469 | |
| 387 | 470 | READ8_MEMBER( wangpc_state::led_off_r )
|
| 388 | 471 | {
|
| 472 | if (LOG) logerror("LED off\n");
|
| 473 | |
| 389 | 474 | output_set_led_value(LED_DIAGNOSTIC, 0);
|
| 390 | 475 | |
| 391 | 476 | return 0;
|
| r15308 | r15309 | |
| 398 | 483 | |
| 399 | 484 | WRITE8_MEMBER( wangpc_state::parity_nmi_clr_w )
|
| 400 | 485 | {
|
| 486 | if (LOG) logerror("Parity NMI clear\n");
|
| 401 | 487 | }
|
| 402 | 488 | |
| 403 | 489 | |
| r15308 | r15309 | |
| 651 | 737 | |
| 652 | 738 | void wangpc_state::check_level2_interrupts()
|
| 653 | 739 | {
|
| 654 | | int state = !m_dma_eop | m_uart_dr | m_uart_tbre | upd765_int_r(m_fdc) | m_fpu_irq;
|
| 740 | int state = !m_dma_eop | m_uart_dr /*| m_uart_tbre*/ | upd765_int_r(m_fdc) | m_fpu_irq;
|
| 655 | 741 | |
| 656 | 742 | pic8259_ir2_w(m_pic, state);
|
| 657 | 743 | }
|
| r15308 | r15309 | |
| 840 | 926 | {
|
| 841 | 927 | if (state)
|
| 842 | 928 | {
|
| 929 | if (LOG) logerror("DR set\n");
|
| 930 | |
| 843 | 931 | m_uart_dr = 1;
|
| 844 | 932 | check_level2_interrupts();
|
| 845 | 933 | }
|
| r15308 | r15309 | |
| 849 | 937 | {
|
| 850 | 938 | if (state)
|
| 851 | 939 | {
|
| 940 | if (LOG) logerror("TBRE set\n");
|
| 941 | |
| 852 | 942 | m_uart_tbre = 1;
|
| 853 | 943 | check_level2_interrupts();
|
| 854 | 944 | }
|
| r15308 | r15309 | |
| 885 | 975 | |
| 886 | 976 | WRITE_LINE_MEMBER( wangpc_state::fdc_int_w )
|
| 887 | 977 | {
|
| 978 | if (LOG) logerror("FDC INT %u\n", state);
|
| 979 | |
| 888 | 980 | check_level2_interrupts();
|
| 889 | 981 | }
|
| 890 | 982 | |
| 891 | 983 | WRITE_LINE_MEMBER( wangpc_state::fdc_drq_w )
|
| 892 | 984 | {
|
| 985 | if (LOG) logerror("FDC DRQ %u\n", state);
|
| 986 | |
| 893 | 987 | m_fdc_drq = state;
|
| 894 | 988 | update_fdc_drq();
|
| 895 | 989 | }
|
| r15308 | r15309 | |
| 928 | 1022 | |
| 929 | 1023 | WRITE_LINE_MEMBER( wangpc_state::ack_w )
|
| 930 | 1024 | {
|
| 1025 | if (LOG) logerror("ACKNLG %u\n", state);
|
| 1026 | |
| 931 | 1027 | m_acknlg = state;
|
| 932 | 1028 | check_level1_interrupts();
|
| 933 | 1029 | }
|
| 934 | 1030 | |
| 935 | 1031 | WRITE_LINE_MEMBER( wangpc_state::busy_w )
|
| 936 | 1032 | {
|
| 1033 | if (LOG) logerror("BUSY %u\n", state);
|
| 1034 | |
| 937 | 1035 | m_busy = state;
|
| 938 | 1036 | check_level1_interrupts();
|
| 939 | 1037 | }
|
| r15308 | r15309 | |
| 962 | 1060 | |
| 963 | 1061 | WRITE_LINE_MEMBER( wangpc_state::bus_irq2_w )
|
| 964 | 1062 | {
|
| 1063 | if (LOG) logerror("Bus IRQ2 %u\n", state);
|
| 1064 | |
| 965 | 1065 | check_level2_interrupts();
|
| 966 | 1066 | }
|
| 967 | 1067 | |
| r15308 | r15309 | |
| 980 | 1080 | };
|
| 981 | 1081 | |
| 982 | 1082 | static SLOT_INTERFACE_START( wangpc_cards )
|
| 983 | | SLOT_INTERFACE("lores", WANGPC_LORES_VIDEO)
|
| 1083 | SLOT_INTERFACE("lic", WANGPC_LIC) // local interconnect option card
|
| 1084 | SLOT_INTERFACE("lvc", WANGPC_LVC) // low-resolution video controller
|
| 1085 | SLOT_INTERFACE("rtc", WANGPC_RTC) // remote telecommunications controller
|
| 1086 | SLOT_INTERFACE("wdc", WANGPC_WDC) // Winchester disk controller
|
| 1087 | //SLOT_INTERFACE("mvc", WANGPC_MVC) // medium-resolution video controller
|
| 1088 | //SLOT_INTERFACE("mcc", WANGPC_MCC) // multiport communications controller
|
| 1089 | //SLOT_INTERFACE("tig", WANGPC_TIG) // text/image/graphics controller
|
| 984 | 1090 | SLOT_INTERFACE_END
|
| 985 | 1091 | |
| 986 | 1092 | |
| r15308 | r15309 | |
| 1047 | 1153 | // bus
|
| 1048 | 1154 | MCFG_WANGPC_BUS_ADD(bus_intf)
|
| 1049 | 1155 | MCFG_WANGPC_BUS_SLOT_ADD("slot1", 1, wangpc_cards, NULL, NULL)
|
| 1050 | | MCFG_WANGPC_BUS_SLOT_ADD("slot2", 2, wangpc_cards, "lores", NULL)
|
| 1156 | MCFG_WANGPC_BUS_SLOT_ADD("slot2", 2, wangpc_cards, "lvc", NULL)
|
| 1051 | 1157 | MCFG_WANGPC_BUS_SLOT_ADD("slot3", 3, wangpc_cards, NULL, NULL)
|
| 1052 | 1158 | MCFG_WANGPC_BUS_SLOT_ADD("slot4", 4, wangpc_cards, NULL, NULL)
|
| 1053 | 1159 | MCFG_WANGPC_BUS_SLOT_ADD("slot5", 5, wangpc_cards, NULL, NULL)
|
| r15308 | r15309 | |
| 1069 | 1175 | |
| 1070 | 1176 | ROM_START( wangpc )
|
| 1071 | 1177 | ROM_REGION16_LE( 0x4000, I8086_TAG, 0)
|
| 1072 | | ROM_LOAD16_BYTE( "motherboard-l94.bin", 0x0001, 0x2000, CRC(f9f41304) SHA1(1815295809ef11573d724ede47446f9ac7aee713) )
|
| 1073 | | ROM_LOAD16_BYTE( "motherboard-l115.bin", 0x0000, 0x2000, CRC(67b37684) SHA1(70d9f68eb88cc2bc9f53f949cc77411c09a4266e) )
|
| 1074 | | |
| 1075 | | ROM_REGION( 0x1000, "remotecomms", 0 )
|
| 1076 | | ROM_LOAD( "remotecomms-l28.bin", 0x0000, 0x1000, CRC(c05a1bee) SHA1(6b3f0d787d014b1fd3925812c905ddb63c5055f1) )
|
| 1077 | | |
| 1078 | | ROM_REGION( 0x1000, "network", 0 )
|
| 1079 | | ROM_LOAD( "network-l22.bin", 0x0000, 0x1000, CRC(487e5f04) SHA1(81e52e70e0c6e34715119b121ec19a7758cd6772) )
|
| 1080 | | |
| 1081 | | ROM_REGION( 0x1000, "hdc1", 0 )
|
| 1082 | | ROM_LOAD( "hdc-l54.bin", 0x0000, 0x1000, CRC(94e9a17d) SHA1(060c576d70069ece2d0dbce86ffc448df2b169e7) )
|
| 1083 | | |
| 1084 | | ROM_REGION( 0x1000, "hdc2", 0 )
|
| 1085 | | ROM_LOAD( "hdc-l19.bin", 0x0000, 0x1000, CRC(282770d2) SHA1(a0e3bad5041e0dfd6087907015b07a093b576bc0) )
|
| 1178 | ROM_LOAD16_BYTE( "0001 r2.l94", 0x0001, 0x2000, CRC(f9f41304) SHA1(1815295809ef11573d724ede47446f9ac7aee713) )
|
| 1179 | ROM_LOAD16_BYTE( "379-0000 r2.l115", 0x0000, 0x2000, CRC(67b37684) SHA1(70d9f68eb88cc2bc9f53f949cc77411c09a4266e) )
|
| 1086 | 1180 | ROM_END
|
| 1087 | 1181 | |
| 1088 | 1182 | |