src/mess/machine/6551.c
| r3719 | r3720 | |
| 1 | /********************************************************************* |
| 2 | |
| 3 | 6551.h |
| 4 | |
| 5 | MOS Technology 6551 Asynchronous Communications Interface Adapter |
| 6 | |
| 7 | A1 A0 Write Read |
| 8 | 0 0 Transmit Data Register Receiver Data Register |
| 9 | 0 1 Programmed Reset Status Register |
| 10 | 1 0 Command Register |
| 11 | 1 1 Control Register |
| 12 | |
| 13 | *********************************************************************/ |
| 14 | |
| 1 | 15 | #include "driver.h" |
| 16 | #include "deprecat.h" |
| 2 | 17 | #include "6551.h" |
| 3 | 18 | #include "includes/serial.h" |
| 4 | 19 | |
| r3719 | r3720 | |
| 7 | 22 | TYPE DEFINITIONS |
| 8 | 23 | ***************************************************************************/ |
| 9 | 24 | |
| 10 | | typedef struct _acia6551 acia6551; |
| 11 | | struct _acia6551 |
| 25 | typedef struct _acia6551_t acia6551_t; |
| 26 | struct _acia6551_t |
| 12 | 27 | { |
| 13 | 28 | unsigned char transmit_data_register; |
| 14 | 29 | unsigned char receive_data_register; |
| r3719 | r3720 | |
| 38 | 53 | FUNCTION PROTOTYPES |
| 39 | 54 | ***************************************************************************/ |
| 40 | 55 | |
| 41 | | static void acia_6551_receive_char(unsigned char ch); |
| 42 | | static void acia_6551_refresh_ints(void); |
| 56 | static void acia_6551_receive_char(const device_config *device, unsigned char ch); |
| 57 | static void acia_6551_refresh_ints(const device_config *device); |
| 43 | 58 | |
| 44 | | static acia6551 acia; |
| 45 | 59 | |
| 46 | 60 | |
| 47 | 61 | /*************************************************************************** |
| 62 | INLINE FUNCTIONS |
| 63 | ***************************************************************************/ |
| 64 | |
| 65 | INLINE acia6551_t *get_token(const device_config *device) |
| 66 | { |
| 67 | assert(device->type == ACIA6551); |
| 68 | return (acia6551_t *) device->token; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | |
| 73 | /*************************************************************************** |
| 48 | 74 | IMPLEMENTATION |
| 49 | 75 | ***************************************************************************/ |
| 50 | 76 | |
| 51 | | /* |
| 52 | | A1 A0 Write Read |
| 53 | | 0 0 Transmit Data Register Receiver Data Register |
| 54 | | 0 1 Programmed Reset Status Register |
| 55 | | 1 0 Command Register |
| 56 | | 1 1 Control Register |
| 57 | | */ |
| 77 | /*------------------------------------------------- |
| 78 | acia_6551_in_callback - called when other side |
| 79 | has updated state |
| 80 | -------------------------------------------------*/ |
| 58 | 81 | |
| 59 | | /* called when other side has updated state */ |
| 60 | 82 | static void acia_6551_in_callback(int id, unsigned long state) |
| 61 | 83 | { |
| 62 | | acia.connection.input_state = state; |
| 84 | const device_config *device; |
| 85 | acia6551_t *acia; |
| 86 | |
| 87 | /* NPW 29-Nov-2008 - These two lines are a hack and indicate why our "serial" infrastructure needs to be updated */ |
| 88 | device = device_list_find_by_tag(Machine->config->devicelist, ACIA6551, "acia"); |
| 89 | acia = get_token(device); |
| 90 | |
| 91 | acia->connection.input_state = state; |
| 63 | 92 | } |
| 64 | 93 | |
| 65 | 94 | |
| 95 | |
| 96 | /*------------------------------------------------- |
| 97 | TIMER_CALLBACK(acia_6551_timer_callback) |
| 98 | -------------------------------------------------*/ |
| 99 | |
| 66 | 100 | static TIMER_CALLBACK(acia_6551_timer_callback) |
| 67 | 101 | { |
| 102 | const device_config *device = ptr; |
| 103 | acia6551_t *acia = get_token(device); |
| 104 | |
| 68 | 105 | /* get bit received from other side and update receive register */ |
| 69 | | receive_register_update_bit(&acia.receive_reg, get_in_data_bit(acia.connection.input_state)); |
| 106 | receive_register_update_bit(&acia->receive_reg, get_in_data_bit(acia->connection.input_state)); |
| 70 | 107 | |
| 71 | | if (acia.receive_reg.flags & RECEIVE_REGISTER_FULL) |
| 108 | if (acia->receive_reg.flags & RECEIVE_REGISTER_FULL) |
| 72 | 109 | { |
| 73 | | receive_register_extract(&acia.receive_reg, &acia.data_form); |
| 74 | | acia_6551_receive_char(acia.receive_reg.byte_received); |
| 110 | receive_register_extract(&acia->receive_reg, &acia->data_form); |
| 111 | acia_6551_receive_char(device, acia->receive_reg.byte_received); |
| 75 | 112 | } |
| 76 | 113 | |
| 77 | 114 | /* transmit register full? */ |
| 78 | | if ((acia.status_register & (1<<4))==0) |
| 115 | if ((acia->status_register & (1<<4))==0) |
| 79 | 116 | { |
| 80 | 117 | /* if transmit reg is empty */ |
| 81 | | if (acia.transmit_reg.flags & TRANSMIT_REGISTER_EMPTY) |
| 118 | if (acia->transmit_reg.flags & TRANSMIT_REGISTER_EMPTY) |
| 82 | 119 | { |
| 83 | 120 | /* set it up */ |
| 84 | | transmit_register_setup(&acia.transmit_reg, &acia.data_form, acia.transmit_data_register); |
| 121 | transmit_register_setup(&acia->transmit_reg, &acia->data_form, acia->transmit_data_register); |
| 85 | 122 | /* acia transmit reg now empty */ |
| 86 | | acia.status_register |=(1<<4); |
| 123 | acia->status_register |=(1<<4); |
| 87 | 124 | /* and refresh ints */ |
| 88 | | acia_6551_refresh_ints(); |
| 125 | acia_6551_refresh_ints(device); |
| 89 | 126 | } |
| 90 | 127 | } |
| 91 | 128 | |
| 92 | 129 | /* if transmit is not empty... transmit data */ |
| 93 | | if ((acia.transmit_reg.flags & TRANSMIT_REGISTER_EMPTY)==0) |
| 130 | if ((acia->transmit_reg.flags & TRANSMIT_REGISTER_EMPTY)==0) |
| 94 | 131 | { |
| 95 | 132 | // logerror("UART6551\n"); |
| 96 | | transmit_register_send_bit(&acia.transmit_reg, &acia.connection); |
| 133 | transmit_register_send_bit(&acia->transmit_reg, &acia->connection); |
| 97 | 134 | } |
| 98 | 135 | } |
| 99 | 136 | |
| 100 | | void acia_6551_init(void) |
| 137 | |
| 138 | |
| 139 | /*------------------------------------------------- |
| 140 | DEVICE_START( acia6551 ) |
| 141 | -------------------------------------------------*/ |
| 142 | |
| 143 | DEVICE_START( acia6551 ) |
| 101 | 144 | { |
| 145 | acia6551_t *acia = get_token(device); |
| 146 | |
| 102 | 147 | serial_helper_setup(); |
| 103 | 148 | |
| 104 | | memset(&acia, 0, sizeof(acia)); |
| 149 | memset(acia, 0, sizeof(*acia)); |
| 105 | 150 | /* transmit data reg is empty */ |
| 106 | | acia.status_register |= (1<<4); |
| 107 | | acia.timer = timer_alloc(acia_6551_timer_callback, NULL); |
| 151 | acia->status_register |= (1<<4); |
| 152 | acia->timer = timer_alloc(acia_6551_timer_callback, (void *) device); |
| 108 | 153 | |
| 109 | | serial_connection_init(&acia.connection); |
| 110 | | serial_connection_set_in_callback(&acia.connection, acia_6551_in_callback); |
| 111 | | transmit_register_reset(&acia.transmit_reg); |
| 112 | | receive_register_reset(&acia.receive_reg); |
| 154 | serial_connection_init(&acia->connection); |
| 155 | serial_connection_set_in_callback(&acia->connection, acia_6551_in_callback); |
| 156 | transmit_register_reset(&acia->transmit_reg); |
| 157 | receive_register_reset(&acia->receive_reg); |
| 158 | return DEVICE_START_OK; |
| 113 | 159 | } |
| 114 | 160 | |
| 115 | | /* set callback for interrupt request */ |
| 116 | | void acia_6551_set_irq_callback(void (*callback)(int)) |
| 117 | | { |
| 118 | | acia.irq_callback = callback; |
| 119 | | } |
| 120 | 161 | |
| 121 | | /* update interrupt output */ |
| 122 | | static void acia_6551_refresh_ints(void) |
| 162 | |
| 163 | /*------------------------------------------------- |
| 164 | acia_6551_refresh_ints - update interrupt output |
| 165 | -------------------------------------------------*/ |
| 166 | |
| 167 | static void acia_6551_refresh_ints(const device_config *device) |
| 123 | 168 | { |
| 169 | acia6551_t *acia = get_token(device); |
| 124 | 170 | int interrupt_state; |
| 125 | 171 | |
| 126 | 172 | interrupt_state = 0; |
| r3719 | r3720 | |
| 128 | 174 | /* receive interrupts */ |
| 129 | 175 | |
| 130 | 176 | /* receive data register full? */ |
| 131 | | if (acia.status_register & (1<<3)) |
| 177 | if (acia->status_register & (1<<3)) |
| 132 | 178 | { |
| 133 | 179 | /* receiver interrupt enable? */ |
| 134 | | if ((acia.command_register & (1<<1))==0) |
| 180 | if ((acia->command_register & (1<<1))==0) |
| 135 | 181 | { |
| 136 | 182 | /* trigger a interrupt */ |
| 137 | 183 | interrupt_state = 1; |
| r3719 | r3720 | |
| 139 | 185 | } |
| 140 | 186 | |
| 141 | 187 | /* set state of irq bit in status register */ |
| 142 | | acia.status_register &= ~(1<<7); |
| 188 | acia->status_register &= ~(1<<7); |
| 143 | 189 | |
| 144 | 190 | if (interrupt_state) |
| 145 | 191 | { |
| 146 | | acia.status_register |=(1<<7); |
| 192 | acia->status_register |=(1<<7); |
| 147 | 193 | } |
| 148 | 194 | |
| 149 | | if (acia.irq_callback) |
| 150 | | acia.irq_callback(interrupt_state); |
| 195 | if (acia->irq_callback != NULL) |
| 196 | (*acia->irq_callback)(interrupt_state); |
| 151 | 197 | } |
| 152 | 198 | |
| 153 | 199 | |
| 154 | | static void acia_6551_receive_char(unsigned char ch) |
| 200 | |
| 201 | /*------------------------------------------------- |
| 202 | acia_6551_receive_char |
| 203 | -------------------------------------------------*/ |
| 204 | |
| 205 | static void acia_6551_receive_char(const device_config *device, unsigned char ch) |
| 155 | 206 | { |
| 207 | acia6551_t *acia = get_token(device); |
| 208 | |
| 156 | 209 | /* receive register full? */ |
| 157 | | if (acia.status_register & (1<<3)) |
| 210 | if (acia->status_register & (1<<3)) |
| 158 | 211 | { |
| 159 | 212 | /* set overrun error */ |
| 160 | | acia.status_register |= (1<<2); |
| 213 | acia->status_register |= (1<<2); |
| 161 | 214 | return; |
| 162 | 215 | } |
| 163 | 216 | |
| 164 | 217 | /* set new byte */ |
| 165 | | acia.receive_data_register = ch; |
| 218 | acia->receive_data_register = ch; |
| 166 | 219 | /* receive register is full */ |
| 167 | | acia.status_register |= (1<<3); |
| 220 | acia->status_register |= (1<<3); |
| 168 | 221 | /* update ints */ |
| 169 | | acia_6551_refresh_ints(); |
| 222 | acia_6551_refresh_ints(device); |
| 170 | 223 | } |
| 171 | 224 | |
| 172 | | READ8_HANDLER(acia_6551_r) |
| 225 | |
| 226 | |
| 227 | /*------------------------------------------------- |
| 228 | acia_6551_r |
| 229 | -------------------------------------------------*/ |
| 230 | |
| 231 | READ8_DEVICE_HANDLER(acia_6551_r) |
| 173 | 232 | { |
| 233 | acia6551_t *acia = get_token(device); |
| 234 | |
| 174 | 235 | unsigned char data; |
| 175 | 236 | |
| 176 | 237 | data = 0x0ff; |
| r3719 | r3720 | |
| 180 | 241 | { |
| 181 | 242 | /* clear parity error, framing error and overrun error */ |
| 182 | 243 | /* when read of data reigster is done */ |
| 183 | | acia.status_register &=~((1<<0) | (1<<1) | (1<<2)); |
| 244 | acia->status_register &=~((1<<0) | (1<<1) | (1<<2)); |
| 184 | 245 | /* clear receive data register full flag */ |
| 185 | | acia.status_register &=~(1<<3); |
| 246 | acia->status_register &=~(1<<3); |
| 186 | 247 | /* return data */ |
| 187 | | data = acia.receive_data_register; |
| 248 | data = acia->receive_data_register; |
| 188 | 249 | } |
| 189 | 250 | break; |
| 190 | 251 | |
| r3719 | r3720 | |
| 201 | 262 | */ |
| 202 | 263 | case 1: |
| 203 | 264 | { |
| 204 | | data = acia.status_register; |
| 265 | data = acia->status_register; |
| 205 | 266 | /* clear interrupt */ |
| 206 | | acia.status_register &= ~(1<<7); |
| 267 | acia->status_register &= ~(1<<7); |
| 207 | 268 | } |
| 208 | 269 | break; |
| 209 | 270 | |
| 210 | 271 | case 2: |
| 211 | | data = acia.command_register; |
| 272 | data = acia->command_register; |
| 212 | 273 | break; |
| 213 | 274 | |
| 214 | 275 | case 3: |
| 215 | | data = acia.control_register; |
| 276 | data = acia->control_register; |
| 216 | 277 | break; |
| 217 | 278 | |
| 218 | 279 | default: |
| r3719 | r3720 | |
| 224 | 285 | return data; |
| 225 | 286 | } |
| 226 | 287 | |
| 227 | | static void acia_6551_update_data_form(void) |
| 288 | |
| 289 | |
| 290 | /*------------------------------------------------- |
| 291 | acia_6551_update_data_form |
| 292 | -------------------------------------------------*/ |
| 293 | |
| 294 | static void acia_6551_update_data_form(const device_config *device) |
| 228 | 295 | { |
| 229 | | acia.data_form.word_length = 8-((acia.control_register>>5) & 0x03); |
| 230 | | acia.data_form.stop_bit_count = (acia.control_register>>7)+1; |
| 296 | acia6551_t *acia = get_token(device); |
| 231 | 297 | |
| 232 | | if (acia.command_register & (1<<5)) |
| 298 | acia->data_form.word_length = 8-((acia->control_register>>5) & 0x03); |
| 299 | acia->data_form.stop_bit_count = (acia->control_register>>7)+1; |
| 300 | |
| 301 | if (acia->command_register & (1<<5)) |
| 233 | 302 | { |
| 234 | | acia.data_form.parity = SERIAL_PARITY_ODD; |
| 303 | acia->data_form.parity = SERIAL_PARITY_ODD; |
| 235 | 304 | } |
| 236 | 305 | else |
| 237 | 306 | { |
| 238 | | acia.data_form.parity = SERIAL_PARITY_NONE; |
| 307 | acia->data_form.parity = SERIAL_PARITY_NONE; |
| 239 | 308 | } |
| 240 | 309 | |
| 241 | | receive_register_setup(&acia.receive_reg, &acia.data_form); |
| 310 | receive_register_setup(&acia->receive_reg, &acia->data_form); |
| 242 | 311 | } |
| 243 | 312 | |
| 244 | 313 | |
| 245 | | WRITE8_HANDLER(acia_6551_w) |
| 314 | |
| 315 | /*------------------------------------------------- |
| 316 | acia_6551_w |
| 317 | -------------------------------------------------*/ |
| 318 | |
| 319 | WRITE8_DEVICE_HANDLER(acia_6551_w) |
| 246 | 320 | { |
| 321 | acia6551_t *acia = get_token(device); |
| 322 | |
| 247 | 323 | logerror("6551 W %04x %02x\n",offset & 0x03, data); |
| 248 | 324 | |
| 249 | 325 | switch (offset & 0x03) |
| r3719 | r3720 | |
| 251 | 327 | case 0: |
| 252 | 328 | { |
| 253 | 329 | /* clear transmit data register empty */ |
| 254 | | acia.status_register &= ~(1<<4); |
| 330 | acia->status_register &= ~(1<<4); |
| 255 | 331 | /* store byte */ |
| 256 | | acia.transmit_data_register = data; |
| 332 | acia->transmit_data_register = data; |
| 257 | 333 | |
| 258 | 334 | } |
| 259 | 335 | break; |
| r3719 | r3720 | |
| 295 | 371 | |
| 296 | 372 | case 2: |
| 297 | 373 | { |
| 298 | | acia.command_register = data; |
| 374 | acia->command_register = data; |
| 299 | 375 | |
| 300 | 376 | /* update state of dtr */ |
| 301 | | acia.connection.State &=~SERIAL_STATE_DTR; |
| 302 | | if (acia.command_register & (1<<0)) |
| 377 | acia->connection.State &=~SERIAL_STATE_DTR; |
| 378 | if (acia->command_register & (1<<0)) |
| 303 | 379 | { |
| 304 | | acia.connection.State |=SERIAL_STATE_DTR; |
| 380 | acia->connection.State |=SERIAL_STATE_DTR; |
| 305 | 381 | } |
| 306 | 382 | |
| 307 | 383 | /* update state of rts */ |
| 308 | | switch ((acia.command_register>>2) & 0x03) |
| 384 | switch ((acia->command_register>>2) & 0x03) |
| 309 | 385 | { |
| 310 | 386 | case 0: |
| 311 | 387 | { |
| 312 | | acia.connection.State &=~SERIAL_STATE_RTS; |
| 388 | acia->connection.State &=~SERIAL_STATE_RTS; |
| 313 | 389 | } |
| 314 | 390 | break; |
| 315 | 391 | |
| r3719 | r3720 | |
| 317 | 393 | case 2: |
| 318 | 394 | case 3: |
| 319 | 395 | { |
| 320 | | acia.connection.State |=SERIAL_STATE_RTS; |
| 396 | acia->connection.State |=SERIAL_STATE_RTS; |
| 321 | 397 | } |
| 322 | 398 | break; |
| 323 | 399 | } |
| 324 | 400 | |
| 325 | | serial_connection_out(&acia.connection); |
| 401 | serial_connection_out(&acia->connection); |
| 326 | 402 | |
| 327 | | acia_6551_update_data_form(); |
| 403 | acia_6551_update_data_form(device); |
| 328 | 404 | } |
| 329 | 405 | break; |
| 330 | 406 | |
| r3719 | r3720 | |
| 366 | 442 | { |
| 367 | 443 | unsigned char previous_control_register; |
| 368 | 444 | |
| 369 | | previous_control_register = acia.control_register; |
| 445 | previous_control_register = acia->control_register; |
| 370 | 446 | |
| 371 | 447 | if (((previous_control_register^data) & 0x07)!=0) |
| 372 | 448 | { |
| r3719 | r3720 | |
| 375 | 451 | rate = data & 0x07; |
| 376 | 452 | |
| 377 | 453 | /* baud rate changed? */ |
| 378 | | timer_reset(acia.timer, attotime_never); |
| 454 | timer_reset(acia->timer, attotime_never); |
| 379 | 455 | |
| 380 | 456 | if (rate==0) |
| 381 | 457 | { |
| r3719 | r3720 | |
| 481 | 557 | break; |
| 482 | 558 | } |
| 483 | 559 | |
| 484 | | timer_adjust_periodic(acia.timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud_rate)); |
| 560 | timer_adjust_periodic(acia->timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud_rate)); |
| 485 | 561 | } |
| 486 | 562 | } |
| 487 | 563 | |
| 488 | | acia.control_register = data; |
| 489 | | acia_6551_update_data_form(); |
| 564 | acia->control_register = data; |
| 565 | acia_6551_update_data_form(device); |
| 490 | 566 | } |
| 491 | 567 | break; |
| 492 | 568 | |
| r3719 | r3720 | |
| 497 | 573 | } |
| 498 | 574 | |
| 499 | 575 | |
| 500 | | void acia_6551_connect_to_serial_device(const device_config *image) |
| 576 | /*------------------------------------------------- |
| 577 | acia_6551_connect_to_serial_device |
| 578 | -------------------------------------------------*/ |
| 579 | |
| 580 | void acia_6551_connect_to_serial_device(const device_config *device, const device_config *image) |
| 501 | 581 | { |
| 502 | | serial_device_connect(image, &acia.connection); |
| 582 | acia6551_t *acia = get_token(device); |
| 583 | serial_device_connect(image, &acia->connection); |
| 503 | 584 | } |
| 585 | |
| 586 | |
| 587 | |
| 588 | /*------------------------------------------------- |
| 589 | DEVICE_SET_INFO( acia6551 ) |
| 590 | -------------------------------------------------*/ |
| 591 | |
| 592 | static DEVICE_SET_INFO( acia6551 ) |
| 593 | { |
| 594 | switch (state) |
| 595 | { |
| 596 | /* no parameters to set */ |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | |
| 601 | |
| 602 | /*------------------------------------------------- |
| 603 | DEVICE_GET_INFO( acia6551 ) |
| 604 | -------------------------------------------------*/ |
| 605 | |
| 606 | DEVICE_GET_INFO( acia6551 ) |
| 607 | { |
| 608 | switch (state) |
| 609 | { |
| 610 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 611 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(acia6551_t); break; |
| 612 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 613 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 614 | |
| 615 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 616 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(acia6551); break; |
| 617 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(acia6551); break; |
| 618 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 619 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 620 | |
| 621 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 622 | case DEVINFO_STR_NAME: info->s = "MOS Technology 6551 ACIA"; break; |
| 623 | case DEVINFO_STR_FAMILY: info->s = "MOS Technology 6551 ACIA"; break; |
| 624 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; |
| 625 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; |
| 626 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 627 | } |
| 628 | } |
src/mess/drivers/coco.c
| r3719 | r3720 | |
| 111 | 111 | AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK(15) |
| 112 | 112 | AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK(16) |
| 113 | 113 | AM_RANGE(0xff00, 0xff03) AM_READWRITE(pia_0_r, pia_0_w) AM_MIRROR(0x0018) |
| 114 | | AM_RANGE(0xff04, 0xff07) AM_READWRITE(acia_6551_r, acia_6551_w) AM_MIRROR(0x0018) |
| 114 | AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w) AM_MIRROR(0x0018) |
| 115 | 115 | AM_RANGE(0xff20, 0xff3f) AM_READWRITE(pia_1_r, coco_pia_1_w) |
| 116 | 116 | AM_RANGE(0xff40, 0xff8f) AM_READWRITE(coco_cartridge_r, coco_cartridge_w) |
| 117 | 117 | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| r3719 | r3720 | |
| 145 | 145 | AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK(15) |
| 146 | 146 | AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK(16) |
| 147 | 147 | AM_RANGE(0xff00, 0xff03) AM_READWRITE(pia_0_r,pia_0_w) AM_MIRROR(0x0018) |
| 148 | | AM_RANGE(0xff04, 0xff07) AM_READWRITE(acia_6551_r,acia_6551_w) AM_MIRROR(0x0018) |
| 148 | AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r,acia_6551_w) AM_MIRROR(0x0018) |
| 149 | 149 | AM_RANGE(0xff20, 0xff3f) AM_READWRITE(pia_1_r,coco_pia_1_w) |
| 150 | 150 | AM_RANGE(0xff40, 0xff8f) AM_READWRITE(coco_cartridge_r, coco_cartridge_w) |
| 151 | 151 | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| r3719 | r3720 | |
| 223 | 223 | AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK(15) |
| 224 | 224 | AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK(16) |
| 225 | 225 | AM_RANGE(0xff00, 0xff03) AM_READWRITE(pia_0_r, pia_0_w) |
| 226 | | AM_RANGE(0xff04, 0xff07) AM_READWRITE(acia_6551_r, acia_6551_w) |
| 226 | AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w) |
| 227 | 227 | AM_RANGE(0xff20, 0xff23) AM_READWRITE(pia_1_r, coco_pia_1_w) |
| 228 | 228 | AM_RANGE(0xff24, 0xff27) AM_READWRITE(pia_2_r, pia_2_w) /* Third PIA on Dragon Alpha */ |
| 229 | 229 | AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(alpha_modem_r, alpha_modem_w) /* Modem, dummy to stop eror log ! */ |
| r3719 | r3720 | |
| 694 | 694 | /* snapshot/quickload */ |
| 695 | 695 | MDRV_SNAPSHOT_ADD(coco_pak, "pak", 0) |
| 696 | 696 | |
| 697 | /* cassette */ |
| 697 | 698 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 699 | |
| 700 | /* acia */ |
| 701 | MDRV_DEVICE_ADD("acia", ACIA6551) |
| 698 | 702 | MACHINE_DRIVER_END |
| 699 | 703 | |
| 700 | 704 | static MACHINE_DRIVER_START( d64plus ) |
| r3719 | r3720 | |
| 722 | 726 | /* snapshot/quickload */ |
| 723 | 727 | MDRV_SNAPSHOT_ADD(coco_pak, "pak", 0) |
| 724 | 728 | |
| 729 | /* cassette */ |
| 725 | 730 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 731 | |
| 732 | /* acia */ |
| 733 | MDRV_DEVICE_ADD("acia", ACIA6551) |
| 726 | 734 | MACHINE_DRIVER_END |
| 727 | 735 | |
| 728 | 736 | static MACHINE_DRIVER_START( dgnalpha ) |
| r3719 | r3720 | |
| 753 | 761 | /* snapshot/quickload */ |
| 754 | 762 | MDRV_SNAPSHOT_ADD(coco_pak, "pak", 0) |
| 755 | 763 | |
| 764 | /* cassette */ |
| 756 | 765 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 766 | |
| 767 | /* acia */ |
| 768 | MDRV_DEVICE_ADD("acia", ACIA6551) |
| 757 | 769 | MACHINE_DRIVER_END |
| 758 | 770 | |
| 759 | 771 | static MACHINE_DRIVER_START( tanodr64 ) |
| r3719 | r3720 | |
| 781 | 793 | /* snapshot/quickload */ |
| 782 | 794 | MDRV_SNAPSHOT_ADD(coco_pak, "pak", 0) |
| 783 | 795 | |
| 796 | /* cassette */ |
| 784 | 797 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 798 | |
| 799 | /* acia */ |
| 800 | MDRV_DEVICE_ADD("acia", ACIA6551) |
| 785 | 801 | MACHINE_DRIVER_END |
| 786 | 802 | |
| 787 | 803 | static MACHINE_DRIVER_START( coco ) |
| r3719 | r3720 | |
| 813 | 829 | /* devices */ |
| 814 | 830 | MDRV_DEVICE_ADD("disto", MSM6242) |
| 815 | 831 | |
| 832 | /* cassette */ |
| 816 | 833 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 817 | 834 | MACHINE_DRIVER_END |
| 818 | 835 | |
| r3719 | r3720 | |
| 845 | 862 | /* devices */ |
| 846 | 863 | MDRV_DEVICE_ADD("disto", MSM6242) |
| 847 | 864 | |
| 865 | /* cassette */ |
| 848 | 866 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 849 | 867 | MACHINE_DRIVER_END |
| 850 | 868 | |
| r3719 | r3720 | |
| 877 | 895 | /* devices */ |
| 878 | 896 | MDRV_DEVICE_ADD("disto", MSM6242) |
| 879 | 897 | |
| 898 | /* cassette */ |
| 880 | 899 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 881 | 900 | MACHINE_DRIVER_END |
| 882 | 901 | |
| r3719 | r3720 | |
| 919 | 938 | MDRV_DEVICE_ADD("vhd", COCO_VHD) |
| 920 | 939 | MDRV_DEVICE_ADD("disto", MSM6242) |
| 921 | 940 | |
| 941 | /* cassette */ |
| 922 | 942 | MDRV_CASSETTE_ADD( "cassette", coco_cassette_config ) |
| 923 | 943 | MACHINE_DRIVER_END |
| 924 | 944 | |
src/mess/drivers/thomson.c
| r3719 | r3720 | |
| 425 | 425 | AM_RANGE ( 0xe7cc, 0xe7cf ) AM_READWRITE ( pia_1_alt_r, pia_1_alt_w ) |
| 426 | 426 | AM_RANGE ( 0xe7d0, 0xe7df ) AM_READWRITE ( to7_floppy_r, to7_floppy_w ) |
| 427 | 427 | AM_RANGE ( 0xe7e0, 0xe7e3 ) AM_READWRITE ( pia_2_alt_r, pia_2_alt_w ) |
| 428 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_READWRITE ( acia_6551_r, acia_6551_w ) |
| 428 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w ) |
| 429 | 429 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w ) |
| 430 | 430 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_READWRITE ( pia_3_alt_r, pia_3_alt_w ) |
| 431 | 431 | AM_RANGE ( 0xe7fe, 0xe7ff ) AM_READWRITE ( to7_modem_mea8000_r, |
| r3719 | r3720 | |
| 752 | 752 | MDRV_SOUND_ADD ( "speech", DAC, 0 ) |
| 753 | 753 | MDRV_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.) /* speech synthesis */ |
| 754 | 754 | |
| 755 | | /* printer */ |
| 756 | | MDRV_DEVICE_ADD("printer", PRINTER) |
| 755 | /* printer */ |
| 756 | MDRV_DEVICE_ADD("printer", PRINTER) |
| 757 | 757 | |
| 758 | /* cassette */ |
| 758 | 759 | MDRV_CASSETTE_ADD( "cassette", to7_cassette_config ) |
| 760 | |
| 761 | /* acia */ |
| 762 | MDRV_DEVICE_ADD("acia", ACIA6551) |
| 759 | 763 | MACHINE_DRIVER_END |
| 760 | 764 | |
| 761 | 765 | static MACHINE_DRIVER_START ( t9000 ) |
| r3719 | r3720 | |
| 831 | 835 | AM_RANGE ( 0xe7e0, 0xe7e3 ) AM_READWRITE ( pia_2_alt_r, pia_2_alt_w ) |
| 832 | 836 | AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE ( to770_gatearray_r, |
| 833 | 837 | to770_gatearray_w ) |
| 834 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_READWRITE ( acia_6551_r, acia_6551_w ) |
| 838 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w ) |
| 835 | 839 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w ) |
| 836 | 840 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_READWRITE ( pia_3_alt_r, pia_3_alt_w ) |
| 837 | 841 | AM_RANGE ( 0xe7fe, 0xe7ff ) AM_READWRITE ( to7_modem_mea8000_r, |
| r3719 | r3720 | |
| 1026 | 1030 | AM_RANGE ( 0xa7e0, 0xa7e3 ) AM_READWRITE ( pia_2_alt_r, pia_2_alt_w ) |
| 1027 | 1031 | AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE ( mo5_gatearray_r, |
| 1028 | 1032 | mo5_gatearray_w ) |
| 1029 | | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_READWRITE ( acia_6551_r, acia_6551_w ) |
| 1033 | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w ) |
| 1030 | 1034 | AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w ) |
| 1031 | 1035 | AM_RANGE ( 0xa7fe, 0xa7ff ) AM_READWRITE ( mea8000_r, mea8000_w ) |
| 1032 | 1036 | AM_RANGE ( 0xb000, 0xefff ) AM_READWRITE ( SMH_BANK(THOM_CART_BANK), mo5_cartridge_w ) |
| r3719 | r3720 | |
| 1240 | 1244 | AM_RANGE ( 0xe7de, 0xe7df ) AM_READWRITE ( to9_kbd_r, to9_kbd_w ) |
| 1241 | 1245 | AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE ( to9_gatearray_r, |
| 1242 | 1246 | to9_gatearray_w ) |
| 1243 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_READWRITE ( acia_6551_r, acia_6551_w ) |
| 1247 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w ) |
| 1244 | 1248 | /* AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w ) */ |
| 1245 | 1249 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w ) |
| 1246 | 1250 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_READWRITE ( pia_3_alt_r, pia_3_alt_w ) |
| r3719 | r3720 | |
| 1571 | 1575 | AM_RANGE ( 0xe7da, 0xe7dd ) AM_READWRITE ( to8_vreg_r, to8_vreg_w ) |
| 1572 | 1576 | AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE ( to8_gatearray_r, |
| 1573 | 1577 | to8_gatearray_w ) |
| 1574 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_READWRITE ( acia_6551_r, acia_6551_w ) |
| 1578 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w ) |
| 1575 | 1579 | /* AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w ) */ |
| 1576 | 1580 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w ) |
| 1577 | 1581 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_READWRITE ( pia_3_alt_r, pia_3_alt_w ) |
| r3719 | r3720 | |
| 1783 | 1787 | AM_RANGE ( 0xe7de, 0xe7df ) AM_READWRITE ( to9_kbd_r, to9_kbd_w ) |
| 1784 | 1788 | AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE ( to8_gatearray_r, |
| 1785 | 1789 | to8_gatearray_w ) |
| 1786 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_READWRITE ( acia_6551_r, acia_6551_w ) |
| 1790 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w ) |
| 1787 | 1791 | /* AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w ) */ |
| 1788 | 1792 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w ) |
| 1789 | 1793 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_READWRITE ( pia_3_alt_r, pia_3_alt_w ) |
| r3719 | r3720 | |
| 1948 | 1952 | AM_RANGE ( 0xa7da, 0xa7dd ) AM_READWRITE ( mo6_vreg_r, mo6_vreg_w ) |
| 1949 | 1953 | AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE ( mo6_gatearray_r, |
| 1950 | 1954 | mo6_gatearray_w ) |
| 1951 | | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_READWRITE ( acia_6551_r, acia_6551_w ) |
| 1955 | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w ) |
| 1952 | 1956 | /* AM_RANGE ( 0xa7f0, 0xa7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w )*/ |
| 1953 | 1957 | AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w ) |
| 1954 | 1958 | AM_RANGE ( 0xa7fe, 0xa7ff ) AM_READWRITE ( mea8000_r, mea8000_w ) |
| r3719 | r3720 | |
| 2269 | 2273 | AM_RANGE ( 0xa7e0, 0xa7e3 ) AM_READWRITE ( mo5nr_prn_r, mo5nr_prn_w ) |
| 2270 | 2274 | AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE ( mo6_gatearray_r, |
| 2271 | 2275 | mo6_gatearray_w ) |
| 2272 | | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_READWRITE ( acia_6551_r, acia_6551_w ) |
| 2276 | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE(ACIA6551, "acia", acia_6551_r, acia_6551_w ) |
| 2273 | 2277 | /* AM_RANGE ( 0xa7f0, 0xa7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w ) */ |
| 2274 | 2278 | AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w ) |
| 2275 | 2279 | AM_RANGE ( 0xa7f8, 0xa7fb ) AM_READWRITE ( pia_3_alt_r, pia_3_alt_w ) |