src/mess/machine/a2videoterm.c
| r15433 | r15434 | |
| 34 | 34 | //************************************************************************** |
| 35 | 35 | |
| 36 | 36 | const device_type A2BUS_VIDEOTERM = &device_creator<a2bus_videoterm_device>; |
| 37 | const device_type A2BUS_IBSAP16 = &device_creator<a2bus_ap16_device>; |
| 37 | 38 | |
| 38 | 39 | #define VIDEOTERM_ROM_REGION "vterm_rom" |
| 39 | 40 | #define VIDEOTERM_GFX_REGION "vterm_gfx" |
| r15433 | r15434 | |
| 54 | 55 | DEVCB_NULL, /* on_de_changed */ |
| 55 | 56 | DEVCB_NULL, /* on_cur_changed */ |
| 56 | 57 | DEVCB_NULL, /* on hsync changed */ |
| 57 | | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_videoterm_device, vsync_changed), /* on_vsync_changed */ |
| 58 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_videx80_device, vsync_changed), /* on_vsync_changed */ |
| 58 | 59 | NULL |
| 59 | 60 | }; |
| 60 | 61 | |
| r15433 | r15434 | |
| 83 | 84 | ROM_LOAD( "videx videoterm character rom symbol.bin", 0x004800, 0x000800, CRC(82bce582) SHA1(29dfa8c5257dbf25651c6bffa9cdb453482aa70e) ) |
| 84 | 85 | ROM_END |
| 85 | 86 | |
| 87 | ROM_START( a2ap16 ) |
| 88 | ROM_REGION(0x2000, VIDEOTERM_ROM_REGION, 0) |
| 89 | ROM_LOAD( "space 84 video ap16.bin", 0x000000, 0x002000, CRC(0e188da2) SHA1(9a29250b6cc7b576fdc67769944de35e6f54b9d5) ) |
| 90 | |
| 91 | ROM_REGION(0x4000, VIDEOTERM_GFX_REGION, 0) |
| 92 | ROM_LOAD( "space 84 video chargen ap16.bin", 0x000000, 0x002000, CRC(b9447088) SHA1(19c95f91a67b948fc00a14621d574d629479d451) ) |
| 93 | ROM_END |
| 94 | |
| 86 | 95 | /*************************************************************************** |
| 87 | 96 | FUNCTION PROTOTYPES |
| 88 | 97 | ***************************************************************************/ |
| r15433 | r15434 | |
| 92 | 101 | // machine configurations |
| 93 | 102 | //------------------------------------------------- |
| 94 | 103 | |
| 95 | | machine_config_constructor a2bus_videoterm_device::device_mconfig_additions() const |
| 104 | machine_config_constructor a2bus_videx80_device::device_mconfig_additions() const |
| 96 | 105 | { |
| 97 | 106 | return MACHINE_CONFIG_NAME( a2videoterm ); |
| 98 | 107 | } |
| r15433 | r15434 | |
| 106 | 115 | return ROM_NAME( a2videoterm ); |
| 107 | 116 | } |
| 108 | 117 | |
| 118 | const rom_entry *a2bus_ap16_device::device_rom_region() const |
| 119 | { |
| 120 | return ROM_NAME( a2ap16 ); |
| 121 | } |
| 122 | |
| 109 | 123 | //************************************************************************** |
| 110 | 124 | // LIVE DEVICE |
| 111 | 125 | //************************************************************************** |
| 112 | 126 | |
| 113 | | a2bus_videoterm_device::a2bus_videoterm_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 127 | a2bus_videx80_device::a2bus_videx80_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 114 | 128 | device_t(mconfig, type, name, tag, owner, clock), |
| 115 | 129 | device_a2bus_card_interface(mconfig, *this), |
| 116 | 130 | m_crtc(*this, VIDEOTERM_MC6845_NAME) |
| 117 | 131 | { |
| 118 | | m_shortname = "a2vidtrm"; |
| 119 | 132 | } |
| 120 | 133 | |
| 121 | 134 | a2bus_videoterm_device::a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 122 | | device_t(mconfig, A2BUS_VIDEOTERM, "Videx VideoTerm", tag, owner, clock), |
| 123 | | device_a2bus_card_interface(mconfig, *this), |
| 124 | | m_crtc(*this, VIDEOTERM_MC6845_NAME) |
| 135 | a2bus_videx80_device(mconfig, A2BUS_VIDEOTERM, "Videx VideoTerm", tag, owner, clock) |
| 125 | 136 | { |
| 126 | 137 | m_shortname = "a2vidtrm"; |
| 127 | 138 | } |
| 128 | 139 | |
| 140 | a2bus_ap16_device::a2bus_ap16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 141 | a2bus_videx80_device(mconfig, A2BUS_VIDEOTERM, "IBS AP-16 80 column card", tag, owner, clock) |
| 142 | { |
| 143 | m_shortname = "a2ap16"; |
| 144 | } |
| 145 | |
| 129 | 146 | //------------------------------------------------- |
| 130 | 147 | // device_start - device-specific startup |
| 131 | 148 | //------------------------------------------------- |
| 132 | 149 | |
| 133 | | void a2bus_videoterm_device::device_start() |
| 150 | void a2bus_videx80_device::device_start() |
| 134 | 151 | { |
| 135 | 152 | // set_a2bus_device makes m_slot valid |
| 136 | 153 | set_a2bus_device(); |
| r15433 | r15434 | |
| 148 | 165 | save_item(NAME(m_rambank)); |
| 149 | 166 | } |
| 150 | 167 | |
| 151 | | void a2bus_videoterm_device::device_reset() |
| 168 | void a2bus_videx80_device::device_reset() |
| 152 | 169 | { |
| 153 | 170 | m_rambank = 0; |
| 154 | 171 | m_framecnt = 0; |
| r15433 | r15434 | |
| 159 | 176 | read_c0nx - called for reads from this card's c0nx space |
| 160 | 177 | -------------------------------------------------*/ |
| 161 | 178 | |
| 162 | | UINT8 a2bus_videoterm_device::read_c0nx(address_space &space, UINT8 offset) |
| 179 | UINT8 a2bus_videx80_device::read_c0nx(address_space &space, UINT8 offset) |
| 163 | 180 | { |
| 164 | 181 | // printf("Read c0n%x (PC=%x)\n", offset, cpu_get_pc(&space.device())); |
| 165 | 182 | |
| r15433 | r15434 | |
| 178 | 195 | write_c0nx - called for writes to this card's c0nx space |
| 179 | 196 | -------------------------------------------------*/ |
| 180 | 197 | |
| 181 | | void a2bus_videoterm_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) |
| 198 | void a2bus_videx80_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) |
| 182 | 199 | { |
| 183 | 200 | // printf("Write %02x to c0n%x (PC=%x)\n", data, offset, cpu_get_pc(&space.device())); |
| 184 | 201 | |
| r15433 | r15434 | |
| 198 | 215 | read_cnxx - called for reads from this card's cnxx space |
| 199 | 216 | -------------------------------------------------*/ |
| 200 | 217 | |
| 201 | | UINT8 a2bus_videoterm_device::read_cnxx(address_space &space, UINT8 offset) |
| 218 | UINT8 a2bus_videx80_device::read_cnxx(address_space &space, UINT8 offset) |
| 202 | 219 | { |
| 203 | | // one slot image at the start of the ROM, it appears |
| 220 | // one slot image at the end of the ROM, it appears |
| 204 | 221 | return m_rom[offset+0x300]; |
| 205 | 222 | } |
| 206 | 223 | |
| 224 | UINT8 a2bus_ap16_device::read_cnxx(address_space &space, UINT8 offset) |
| 225 | { |
| 226 | // one slot image at the end of the ROM, it appears |
| 227 | return m_rom[offset+0x1f00]; |
| 228 | } |
| 229 | |
| 207 | 230 | /*------------------------------------------------- |
| 208 | 231 | write_cnxx - called for writes to this card's cnxx space |
| 209 | 232 | the firmware writes here to switch in our $C800 a lot |
| 210 | 233 | -------------------------------------------------*/ |
| 211 | | void a2bus_videoterm_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) |
| 234 | void a2bus_videx80_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) |
| 212 | 235 | { |
| 213 | 236 | } |
| 214 | 237 | |
| r15433 | r15434 | |
| 216 | 239 | read_c800 - called for reads from this card's c800 space |
| 217 | 240 | -------------------------------------------------*/ |
| 218 | 241 | |
| 219 | | UINT8 a2bus_videoterm_device::read_c800(address_space &space, UINT16 offset) |
| 242 | UINT8 a2bus_videx80_device::read_c800(address_space &space, UINT16 offset) |
| 220 | 243 | { |
| 221 | 244 | // ROM at c800-cbff |
| 222 | 245 | // bankswitched RAM at cc00-cdff |
| r15433 | r15434 | |
| 234 | 257 | /*------------------------------------------------- |
| 235 | 258 | write_c800 - called for writes to this card's c800 space |
| 236 | 259 | -------------------------------------------------*/ |
| 237 | | void a2bus_videoterm_device::write_c800(address_space &space, UINT16 offset, UINT8 data) |
| 260 | void a2bus_videx80_device::write_c800(address_space &space, UINT16 offset, UINT8 data) |
| 238 | 261 | { |
| 239 | 262 | if (offset >= 0x400) |
| 240 | 263 | { |
| r15433 | r15434 | |
| 245 | 268 | |
| 246 | 269 | static MC6845_UPDATE_ROW( videoterm_update_row ) |
| 247 | 270 | { |
| 248 | | a2bus_videoterm_device *vterm = downcast<a2bus_videoterm_device *>(device->owner()); |
| 271 | a2bus_videx80_device *vterm = downcast<a2bus_videx80_device *>(device->owner()); |
| 249 | 272 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 250 | 273 | UINT32 *p = &bitmap.pix32(y); |
| 251 | 274 | UINT16 chr_base = ra; //( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; |
| r15433 | r15434 | |
| 278 | 301 | } |
| 279 | 302 | } |
| 280 | 303 | |
| 281 | | WRITE_LINE_MEMBER( a2bus_videoterm_device::vsync_changed ) |
| 304 | WRITE_LINE_MEMBER( a2bus_videx80_device::vsync_changed ) |
| 282 | 305 | { |
| 283 | 306 | if ( state ) |
| 284 | 307 | { |
src/mess/machine/a2videoterm.h
| r15433 | r15434 | |
| 17 | 17 | // TYPE DEFINITIONS |
| 18 | 18 | //************************************************************************** |
| 19 | 19 | |
| 20 | | class a2bus_videoterm_device: |
| 20 | class a2bus_videx80_device: |
| 21 | 21 | public device_t, |
| 22 | 22 | public device_a2bus_card_interface |
| 23 | 23 | { |
| 24 | 24 | public: |
| 25 | 25 | // construction/destruction |
| 26 | | a2bus_videoterm_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 27 | | a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 26 | a2bus_videx80_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 28 | 27 | |
| 29 | 28 | // optional information overrides |
| 30 | 29 | virtual machine_config_constructor device_mconfig_additions() const; |
| 31 | | virtual const rom_entry *device_rom_region() const; |
| 32 | 30 | |
| 33 | 31 | DECLARE_WRITE_LINE_MEMBER(vsync_changed); |
| 34 | 32 | |
| r15433 | r15434 | |
| 54 | 52 | int m_rambank; |
| 55 | 53 | }; |
| 56 | 54 | |
| 55 | class a2bus_videoterm_device : public a2bus_videx80_device |
| 56 | { |
| 57 | public: |
| 58 | a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 59 | |
| 60 | virtual const rom_entry *device_rom_region() const; |
| 61 | }; |
| 62 | |
| 63 | class a2bus_ap16_device : public a2bus_videx80_device |
| 64 | { |
| 65 | public: |
| 66 | a2bus_ap16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 67 | |
| 68 | virtual const rom_entry *device_rom_region() const; |
| 69 | |
| 70 | virtual UINT8 read_cnxx(address_space &space, UINT8 offset); |
| 71 | }; |
| 72 | |
| 73 | |
| 57 | 74 | // device type definition |
| 58 | 75 | extern const device_type A2BUS_VIDEOTERM; |
| 76 | extern const device_type A2BUS_IBSAP16; |
| 59 | 77 | |
| 60 | 78 | #endif /* __A2BUS_VIDEOTERM__ */ |
| 61 | 79 | |