src/mess/machine/8530scc.c
| r7469 | r7470 | |
| 23 | 23 | TYPE DEFINITIONS |
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | typedef enum |
| 27 | { |
| 28 | IRQ_NONE, |
| 29 | IRQ_A_RX, |
| 30 | IRQ_A_RX_SPECIAL, |
| 31 | IRQ_B_RX, |
| 32 | IRQ_B_RX_SPECIAL, |
| 33 | IRQ_A_TX, |
| 34 | IRQ_B_TX, |
| 35 | IRQ_A_EXT, |
| 36 | IRQ_B_EXT |
| 37 | } SCCIRQType; |
| 38 | |
| 39 | typedef struct |
| 40 | { |
| 41 | int txIRQEnable; |
| 42 | int rxIRQEnable; |
| 43 | int extIRQEnable; |
| 44 | int txIRQPending; |
| 45 | int rxIRQPending; |
| 46 | int extIRQPending; |
| 47 | int txEnable; |
| 48 | int rxEnable; |
| 49 | int txUnderrun; |
| 50 | int txUnderrunEnable; |
| 51 | int syncHunt; |
| 52 | int DCDEnable; |
| 53 | int CTSEnable; |
| 54 | |
| 55 | UINT8 reg_val[16]; |
| 56 | } sccChan; |
| 57 | |
| 26 | 58 | typedef struct _scc8530_t scc8530_t; |
| 27 | 59 | struct _scc8530_t |
| 28 | 60 | { |
| 29 | 61 | int mode; |
| 30 | 62 | int reg; |
| 31 | 63 | int status; |
| 64 | int IRQV; |
| 65 | int MasterIRQEnable; |
| 66 | int ExtStatusIRQEnable; |
| 67 | int lastIRQStat; |
| 68 | SCCIRQType IRQType; |
| 32 | 69 | |
| 33 | | UINT8 reg_val_a[16]; |
| 34 | | UINT8 reg_val_b[16]; |
| 70 | sccChan channel[2]; |
| 35 | 71 | }; |
| 36 | 72 | |
| 37 | 73 | |
| r7469 | r7470 | |
| 59 | 95 | ***************************************************************************/ |
| 60 | 96 | |
| 61 | 97 | /*------------------------------------------------- |
| 98 | scc_initchannel |
| 99 | -------------------------------------------------*/ |
| 100 | static void scc8530_initchannel(scc8530_t *scc, int ch) |
| 101 | { |
| 102 | scc->channel[ch].syncHunt = 1; |
| 103 | } |
| 104 | |
| 105 | /*------------------------------------------------- |
| 106 | scc_resetchannel |
| 107 | -------------------------------------------------*/ |
| 108 | static void scc8530_resetchannel(scc8530_t *scc, int ch) |
| 109 | { |
| 110 | memset(&scc->channel[ch], 0, sizeof(sccChan)); |
| 111 | |
| 112 | scc->channel[ch].txUnderrun = 1; |
| 113 | } |
| 114 | |
| 115 | /*------------------------------------------------- |
| 62 | 116 | DEVICE_START( scc8530 ) |
| 63 | 117 | -------------------------------------------------*/ |
| 64 | 118 | |
| r7469 | r7470 | |
| 69 | 123 | } |
| 70 | 124 | |
| 71 | 125 | |
| 126 | /*------------------------------------------------- |
| 127 | DEVICE_RESET( scc8530 ) |
| 128 | -------------------------------------------------*/ |
| 129 | static DEVICE_RESET( scc8530 ) |
| 130 | { |
| 131 | scc8530_t *scc = get_token(device); |
| 72 | 132 | |
| 133 | scc->IRQType = IRQ_NONE; |
| 134 | scc->MasterIRQEnable = 0; |
| 135 | scc->IRQV = 0; |
| 136 | |
| 137 | scc8530_initchannel(scc, 0); |
| 138 | scc8530_initchannel(scc, 1); |
| 139 | scc8530_resetchannel(scc, 0); |
| 140 | scc8530_resetchannel(scc, 1); |
| 141 | } |
| 142 | |
| 73 | 143 | /*------------------------------------------------- |
| 74 | 144 | scc_set_status |
| 75 | 145 | -------------------------------------------------*/ |
| r7469 | r7470 | |
| 80 | 150 | scc->status = status; |
| 81 | 151 | } |
| 82 | 152 | |
| 83 | | |
| 84 | | |
| 85 | 153 | /*------------------------------------------------- |
| 86 | 154 | scc_acknowledge |
| 87 | 155 | -------------------------------------------------*/ |
| r7469 | r7470 | |
| 89 | 157 | static void scc_acknowledge(running_device *device) |
| 90 | 158 | { |
| 91 | 159 | const scc8530_interface *intf = get_interface(device); |
| 92 | | if ((intf != NULL) && (intf->acknowledge != NULL)) |
| 93 | | (*intf->acknowledge)(device); |
| 160 | if ((intf != NULL) && (intf->irq != NULL)) |
| 161 | (*intf->irq)(device, 0); |
| 94 | 162 | } |
| 95 | 163 | |
| 164 | /*------------------------------------------------- |
| 165 | scc_updateirqs |
| 166 | -------------------------------------------------*/ |
| 96 | 167 | |
| 168 | static void scc_updateirqs(running_device *device) |
| 169 | { |
| 170 | scc8530_t *scc = get_token(device); |
| 171 | int irqstat; |
| 97 | 172 | |
| 173 | irqstat = 0; |
| 174 | if (scc->MasterIRQEnable) |
| 175 | { |
| 176 | if ((scc->channel[0].txIRQEnable) && (scc->channel[0].txIRQPending)) |
| 177 | { |
| 178 | scc->IRQType = IRQ_B_TX; |
| 179 | irqstat = 1; |
| 180 | } |
| 181 | else if ((scc->channel[1].txIRQEnable) && (scc->channel[1].txIRQPending)) |
| 182 | { |
| 183 | scc->IRQType = IRQ_A_TX; |
| 184 | irqstat = 1; |
| 185 | } |
| 186 | else if ((scc->channel[0].extIRQEnable) && (scc->channel[0].extIRQPending)) |
| 187 | { |
| 188 | scc->IRQType = IRQ_B_EXT; |
| 189 | irqstat = 1; |
| 190 | } |
| 191 | else if ((scc->channel[1].extIRQEnable) && (scc->channel[1].extIRQPending)) |
| 192 | { |
| 193 | scc->IRQType = IRQ_A_EXT; |
| 194 | irqstat = 1; |
| 195 | } |
| 196 | } |
| 197 | else |
| 198 | { |
| 199 | scc->IRQType = IRQ_NONE; |
| 200 | } |
| 201 | |
| 202 | // printf("SCC: irqstat %d, last %d\n", irqstat, scc->lastIRQStat); |
| 203 | // printf("ch0: en %d pd %d ch1: en %d pd %d\n", scc->channel[0].txIRQEnable, scc->channel[0].txIRQPending, scc->channel[1].txIRQEnable, scc->channel[1].txIRQPending); |
| 204 | |
| 205 | // don't spam the driver with unnecessary transitions |
| 206 | if (irqstat != scc->lastIRQStat) |
| 207 | { |
| 208 | const scc8530_interface *intf = get_interface(device); |
| 209 | |
| 210 | scc->lastIRQStat = irqstat; |
| 211 | |
| 212 | // tell the driver the new IRQ line status if possible |
| 213 | if ((intf != NULL) && (intf->irq != NULL)) |
| 214 | { |
| 215 | (*intf->irq)(device, irqstat); |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 98 | 220 | /*------------------------------------------------- |
| 99 | 221 | scc_getareg |
| 100 | 222 | -------------------------------------------------*/ |
| r7469 | r7470 | |
| 104 | 226 | scc8530_t *scc = get_token(device); |
| 105 | 227 | |
| 106 | 228 | /* Not yet implemented */ |
| 107 | | logerror("SCC: port A reg %i read 0x%02x\n", scc->reg, scc->reg_val_a[scc->reg]); |
| 108 | | return scc->reg_val_a[scc->reg]; |
| 229 | logerror("SCC: port A reg %i read 0x%02x\n", scc->reg, scc->channel[0].reg_val[scc->reg]); |
| 230 | return scc->channel[0].reg_val[scc->reg]; |
| 109 | 231 | } |
| 110 | 232 | |
| 111 | 233 | |
| r7469 | r7470 | |
| 118 | 240 | { |
| 119 | 241 | scc8530_t *scc = get_token(device); |
| 120 | 242 | |
| 121 | | logerror("SCC: port B reg %i read 0x%02x\n", scc->reg, scc->reg_val_b[scc->reg]); |
| 243 | logerror("SCC: port B reg %i read 0x%02x\n", scc->reg, scc->channel[1].reg_val[scc->reg]); |
| 122 | 244 | |
| 123 | 245 | if (scc->reg == 2) |
| 124 | 246 | { |
| r7469 | r7470 | |
| 128 | 250 | return scc->status; |
| 129 | 251 | } |
| 130 | 252 | |
| 131 | | return scc->reg_val_b[scc->reg]; |
| 253 | return scc->channel[1].reg_val[scc->reg]; |
| 132 | 254 | } |
| 133 | 255 | |
| 134 | 256 | |
| 135 | 257 | |
| 136 | 258 | /*------------------------------------------------- |
| 137 | | scc_putareg |
| 259 | scc_putreg |
| 138 | 260 | -------------------------------------------------*/ |
| 139 | 261 | |
| 140 | | static void scc_putareg(running_device *device, int data) |
| 262 | static void scc_putreg(running_device *device, int ch, int data) |
| 141 | 263 | { |
| 142 | 264 | scc8530_t *scc = get_token(device); |
| 265 | sccChan *pChan = &scc->channel[ch]; |
| 143 | 266 | |
| 144 | | if (scc->reg == 0) |
| 267 | scc->channel[ch].reg_val[scc->reg] = data; |
| 268 | logerror("SCC: port %c reg %i write 0x%02x\n", 'A'+ch, scc->reg, data); |
| 269 | |
| 270 | // temporary hack |
| 271 | if ((ch == 1) && (scc->reg == 0)) |
| 145 | 272 | { |
| 146 | 273 | if (data & 0x10) |
| 147 | 274 | scc_acknowledge(device); |
| 275 | |
| 276 | return; |
| 148 | 277 | } |
| 149 | | scc->reg_val_a[scc->reg] = data; |
| 150 | | logerror("SCC: port A reg %i write 0x%02x\n", scc->reg, data); |
| 151 | | } |
| 152 | 278 | |
| 279 | switch (scc->reg) |
| 280 | { |
| 281 | case 0: // command register |
| 282 | switch ((data >> 3) & 7) |
| 283 | { |
| 284 | case 1: // select high registers (handled elsewhere) |
| 285 | break; |
| 153 | 286 | |
| 287 | case 2: // reset external and status IRQs |
| 288 | pChan->syncHunt = 0; |
| 289 | break; |
| 154 | 290 | |
| 155 | | /*------------------------------------------------- |
| 156 | | scc_putbreg |
| 157 | | -------------------------------------------------*/ |
| 291 | case 5: // ack Tx IRQ |
| 292 | pChan->txIRQPending = 0; |
| 293 | scc_updateirqs(device); |
| 294 | break; |
| 158 | 295 | |
| 159 | | static void scc_putbreg(running_device *device, int data) |
| 160 | | { |
| 161 | | scc8530_t *scc = get_token(device); |
| 296 | case 0: // nothing |
| 297 | case 3: // send SDLC abort |
| 298 | case 4: // enable IRQ on next Rx byte |
| 299 | case 6: // reset errors |
| 300 | case 7: // reset highest IUS |
| 301 | // we don't handle these yet |
| 302 | break; |
| 162 | 303 | |
| 163 | | if (scc->reg == 0) |
| 164 | | { |
| 165 | | if (data & 0x10) |
| 166 | | scc_acknowledge(device); |
| 304 | } |
| 305 | break; |
| 306 | |
| 307 | case 1: // Tx/Rx IRQ and data transfer mode defintion |
| 308 | scc->ExtStatusIRQEnable = (data & 1); |
| 309 | pChan->txIRQEnable = (data & 2) ? 1 : 0; |
| 310 | pChan->rxIRQEnable = (data >> 3) & 3; |
| 311 | scc_updateirqs(device); |
| 312 | break; |
| 313 | |
| 314 | case 2: // IRQ vector |
| 315 | scc->IRQV = data; |
| 316 | break; |
| 317 | |
| 318 | case 3: // Rx parameters and controls |
| 319 | pChan->rxEnable = (data & 1); |
| 320 | pChan->syncHunt = (data & 0x10) ? 1 : 0; |
| 321 | break; |
| 322 | |
| 323 | case 5: // Tx parameters and controls |
| 324 | // printf("ch %d TxEnable = %d [%02x]\n", ch, data & 8, data); |
| 325 | pChan->txEnable = data & 8; |
| 326 | break; |
| 327 | |
| 328 | case 4: // Tx/Rx misc parameters and modes |
| 329 | case 6: // sync chars/SDLC address field |
| 330 | case 7: // sync char/SDLC flag |
| 331 | break; |
| 332 | |
| 333 | case 9: // master IRQ control |
| 334 | scc->MasterIRQEnable = (data & 8) ? 1 : 0; |
| 335 | scc_updateirqs(device); |
| 336 | |
| 337 | // channel reset command |
| 338 | switch ((data>>6) & 3) |
| 339 | { |
| 340 | case 0: // do nothing |
| 341 | break; |
| 342 | |
| 343 | case 1: // reset channel B |
| 344 | scc8530_resetchannel(scc, 0); |
| 345 | break; |
| 346 | |
| 347 | case 2: // reset channel A |
| 348 | scc8530_resetchannel(scc, 1); |
| 349 | break; |
| 350 | |
| 351 | case 3: // force h/w reset (entire chip) |
| 352 | scc->IRQType = IRQ_NONE; |
| 353 | scc->MasterIRQEnable = 0; |
| 354 | scc->IRQV = 0; |
| 355 | |
| 356 | scc8530_initchannel(scc, 0); |
| 357 | scc8530_initchannel(scc, 1); |
| 358 | scc8530_resetchannel(scc, 0); |
| 359 | scc8530_resetchannel(scc, 1); |
| 360 | |
| 361 | // make sure we stop yanking the IRQ line if we were |
| 362 | scc_updateirqs(device); |
| 363 | break; |
| 364 | |
| 365 | } |
| 366 | break; |
| 367 | |
| 368 | case 10: // misc transmitter/receiver control bits |
| 369 | case 11: // clock mode control |
| 370 | case 12: // lower byte of baud rate gen |
| 371 | case 13: // upper byte of baud rate gen |
| 372 | break; |
| 373 | |
| 374 | case 14: // misc control bits |
| 375 | if (data & 0x10) logerror("SCC8530 ch %d: Loopback mode enabled, not supported!\n", ch); |
| 376 | break; |
| 377 | |
| 378 | case 15: // external/status interrupt control |
| 379 | pChan->DCDEnable = (data & 8) ? 1 : 0; |
| 380 | pChan->CTSEnable = (data & 0x20) ? 1 : 0; |
| 381 | pChan->txUnderrunEnable = (data & 0x40) ? 1 : 0; |
| 382 | break; |
| 167 | 383 | } |
| 168 | | scc->reg_val_b[scc->reg] = data; |
| 169 | | logerror("SCC: port B reg %i write 0x%02x\n", scc->reg, data); |
| 170 | 384 | } |
| 171 | 385 | |
| 172 | | |
| 173 | | |
| 174 | 386 | /*------------------------------------------------- |
| 175 | 387 | scc8530_get_reg_a |
| 176 | 388 | -------------------------------------------------*/ |
| r7469 | r7470 | |
| 178 | 390 | UINT8 scc8530_get_reg_a(running_device *device, int reg) |
| 179 | 391 | { |
| 180 | 392 | scc8530_t *scc = get_token(device); |
| 181 | | return scc->reg_val_a[reg]; |
| 393 | return scc->channel[0].reg_val[reg]; |
| 182 | 394 | } |
| 183 | 395 | |
| 184 | 396 | |
| r7469 | r7470 | |
| 190 | 402 | UINT8 scc8530_get_reg_b(running_device *device, int reg) |
| 191 | 403 | { |
| 192 | 404 | scc8530_t *scc = get_token(device); |
| 193 | | return scc->reg_val_b[reg]; |
| 405 | return scc->channel[1].reg_val[reg]; |
| 194 | 406 | } |
| 195 | 407 | |
| 196 | 408 | |
| r7469 | r7470 | |
| 202 | 414 | void scc8530_set_reg_a(running_device *device, int reg, UINT8 data) |
| 203 | 415 | { |
| 204 | 416 | scc8530_t *scc = get_token(device); |
| 205 | | scc->reg_val_a[reg] = data; |
| 417 | scc->channel[0].reg_val[reg] = data; |
| 206 | 418 | } |
| 207 | 419 | |
| 208 | 420 | |
| r7469 | r7470 | |
| 214 | 426 | void scc8530_set_reg_b(running_device *device, int reg, UINT8 data) |
| 215 | 427 | { |
| 216 | 428 | scc8530_t *scc = get_token(device); |
| 217 | | scc->reg_val_b[reg] = data; |
| 429 | scc->channel[1].reg_val[reg] = data; |
| 218 | 430 | } |
| 219 | 431 | |
| 220 | 432 | |
| r7469 | r7470 | |
| 277 | 489 | WRITE8_DEVICE_HANDLER(scc8530_w) |
| 278 | 490 | { |
| 279 | 491 | scc8530_t *scc = get_token(device); |
| 492 | sccChan *pChan; |
| 280 | 493 | |
| 281 | 494 | offset &= 3; |
| 282 | 495 | |
| r7469 | r7470 | |
| 297 | 510 | else |
| 298 | 511 | { |
| 299 | 512 | scc->mode = 0; |
| 300 | | scc_putbreg(device, data); |
| 513 | scc_putreg(device, 1, data); |
| 301 | 514 | } |
| 302 | 515 | break; |
| 303 | 516 | |
| r7469 | r7470 | |
| 316 | 529 | else |
| 317 | 530 | { |
| 318 | 531 | scc->mode = 0; |
| 319 | | scc_putareg(device, data); |
| 532 | scc_putreg(device, 0, data); |
| 320 | 533 | } |
| 321 | 534 | break; |
| 322 | 535 | |
| 323 | 536 | case 2: |
| 324 | 537 | /* Channel B (Printer Port) Data */ |
| 325 | | /* Not yet implemented */ |
| 538 | pChan = &scc->channel[1]; |
| 539 | |
| 540 | if (pChan->txEnable) |
| 541 | { |
| 542 | pChan->txUnderrun = 1; |
| 543 | pChan->txIRQPending = 1; |
| 544 | scc_updateirqs(device); |
| 545 | } |
| 326 | 546 | break; |
| 327 | 547 | |
| 328 | 548 | case 3: |
| 329 | 549 | /* Channel A (Modem Port) Data */ |
| 330 | | /* Not yet implemented */ |
| 550 | pChan = &scc->channel[0]; |
| 551 | |
| 552 | if (pChan->txEnable) |
| 553 | { |
| 554 | pChan->txUnderrun = 1; |
| 555 | pChan->txIRQPending = 1; |
| 556 | scc_updateirqs(device); |
| 557 | } |
| 331 | 558 | break; |
| 332 | 559 | } |
| 333 | 560 | } |
| r7469 | r7470 | |
| 350 | 577 | /* --- the following bits of info are returned as pointers to functions --- */ |
| 351 | 578 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(scc8530); break; |
| 352 | 579 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 353 | | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 580 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(scc8530); break; |
| 354 | 581 | |
| 355 | 582 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 356 | 583 | case DEVINFO_STR_NAME: strcpy(info->s, "Zilog 8530 SCC"); break; |
| 357 | 584 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Zilog 8530 SCC"); break; |
| 358 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 585 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.5"); break; |
| 359 | 586 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 360 | 587 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 361 | 588 | } |
src/mess/machine/mac.c
| r7469 | r7470 | |
| 931 | 931 | |
| 932 | 932 | if ((mac->mac_scsiirq_enable) && ((mac->mac_model == MODEL_MAC_SE) || (mac->mac_model == MODEL_MAC_CLASSIC))) |
| 933 | 933 | { |
| 934 | | printf("SCSI IRQ -> %d\n", state); |
| 935 | 934 | scsi_interrupt = state; |
| 936 | 935 | mac_field_interrupts(machine); |
| 937 | 936 | } |
| r7469 | r7470 | |
| 940 | 939 | /* ************************************************************************* |
| 941 | 940 | * SCC |
| 942 | 941 | * |
| 943 | | * Serial Control Chip |
| 942 | * Serial Communications Controller |
| 944 | 943 | * *************************************************************************/ |
| 945 | 944 | |
| 946 | | void mac_scc_ack(running_device *device) |
| 945 | void mac_scc_irq(running_device *device, int status) |
| 947 | 946 | { |
| 948 | | set_scc_interrupt(device->machine, 0); |
| 947 | set_scc_interrupt(device->machine, status); |
| 949 | 948 | } |
| 950 | 949 | |
| 951 | 950 | |
| r7469 | r7470 | |
| 954 | 953 | { |
| 955 | 954 | running_device *scc = devtag_get_device(machine, "scc"); |
| 956 | 955 | static int last_was_x = 0; |
| 957 | | |
| 958 | 956 | if (x && y) |
| 959 | 957 | { |
| 960 | 958 | if (last_was_x) |
| r7469 | r7470 | |
| 2210 | 2208 | |
| 2211 | 2209 | // printf("VIA1 IN_A (PC %x)\n", cpu_get_pc(devtag_get_device(device->machine, "maincpu"))); |
| 2212 | 2210 | |
| 2213 | | if (mac->mac_model >= MODEL_MAC_PORTABLE && mac->mac_model <= MODEL_MAC_PB100) |
| 2211 | switch (mac->mac_model) |
| 2214 | 2212 | { |
| 2215 | | return mac->pm_data_recv; |
| 2216 | | } |
| 2213 | case MODEL_MAC_PORTABLE: |
| 2214 | case MODEL_MAC_PB100: |
| 2215 | // printf("Read PM data %x\n", mac->pm_data_recv); |
| 2216 | return mac->pm_data_recv; |
| 2217 | 2217 | |
| 2218 | | if ((mac->mac_model == MODEL_MAC_CLASSIC) || |
| 2219 | | (mac->mac_model == MODEL_MAC_II) || (mac->mac_model == MODEL_MAC_II_FDHD) || |
| 2220 | | (mac->mac_model == MODEL_MAC_IIX) || (mac->mac_model == MODEL_MAC_POWERMAC_6100)) |
| 2221 | | { |
| 2222 | | return 0x81; // bit 0 must be set to avoid attempting to boot from AppleTalk |
| 2223 | | } |
| 2218 | case MODEL_MAC_CLASSIC: |
| 2219 | case MODEL_MAC_II: |
| 2220 | case MODEL_MAC_II_FDHD: |
| 2221 | case MODEL_MAC_IIX: |
| 2222 | case MODEL_MAC_POWERMAC_6100: |
| 2223 | return 0x81; // bit 0 must be set on most Macs to avoid attempting to boot from AppleTalk |
| 2224 | 2224 | |
| 2225 | | if (mac->mac_model == MODEL_MAC_SE30) |
| 2226 | | { |
| 2227 | | return 0x81 | PA6; |
| 2228 | | } |
| 2225 | case MODEL_MAC_SE30: |
| 2226 | return 0x81 | PA6; |
| 2229 | 2227 | |
| 2230 | | if ((mac->mac_model == MODEL_MAC_LC) || (mac->mac_model == MODEL_MAC_LC_II)) // these both use the V8 ASIC and should in theory ID the same |
| 2231 | | { |
| 2232 | | return 0x81 | PA6 | PA4 | PA2; |
| 2233 | | } |
| 2228 | case MODEL_MAC_LC: |
| 2229 | case MODEL_MAC_LC_II: |
| 2230 | return 0x81 | PA6 | PA4 | PA2; |
| 2234 | 2231 | |
| 2235 | | if (mac->mac_model == MODEL_MAC_IICI) |
| 2236 | | { |
| 2237 | | return 0x81 | PA6 | PA2 | PA1; |
| 2238 | | } |
| 2232 | case MODEL_MAC_IICI: |
| 2233 | return 0x81 | PA6 | PA2 | PA1; |
| 2239 | 2234 | |
| 2240 | | if (mac->mac_model == MODEL_MAC_IISI) |
| 2241 | | { |
| 2242 | | return 0x81 | PA4 | PA2 | PA1; |
| 2243 | | } |
| 2235 | case MODEL_MAC_IISI: |
| 2236 | return 0x81 | PA4 | PA2 | PA1; |
| 2244 | 2237 | |
| 2245 | | if (mac->mac_model == MODEL_MAC_IIFX) |
| 2246 | | { |
| 2247 | | return 0x81 | PA6 | PA1; |
| 2248 | | } |
| 2238 | case MODEL_MAC_IIFX: |
| 2239 | return 0x81 | PA6 | PA1; |
| 2249 | 2240 | |
| 2250 | | if (mac->mac_model == MODEL_MAC_IICX) |
| 2251 | | { |
| 2252 | | return 0x81 | PA6; |
| 2241 | case MODEL_MAC_IICX: |
| 2242 | return 0x81 | PA6; |
| 2243 | |
| 2244 | default: |
| 2245 | return 0x80; |
| 2246 | |
| 2253 | 2247 | } |
| 2254 | 2248 | |
| 2255 | 2249 | return 0x80; |
| r7469 | r7470 | |
| 2263 | 2257 | // portable/PB100 is pretty different |
| 2264 | 2258 | if (mac->mac_model >= MODEL_MAC_PORTABLE && mac->mac_model <= MODEL_MAC_PB100) |
| 2265 | 2259 | { |
| 2260 | // printf("Read VIA B: PM_ACK %x\n", mac->pm_ack); |
| 2266 | 2261 | val = 0x80 | mac->pm_ack; // SCC wait/request |
| 2267 | 2262 | } |
| 2268 | 2263 | else |
| r7469 | r7470 | |
| 2313 | 2308 | |
| 2314 | 2309 | if (mac->mac_model >= MODEL_MAC_PORTABLE && mac->mac_model <= MODEL_MAC_PB100) |
| 2315 | 2310 | { |
| 2311 | printf("%02x to PM\n", data); |
| 2316 | 2312 | mac->pm_data_send = data; |
| 2317 | 2313 | return; |
| 2318 | 2314 | } |
| r7469 | r7470 | |
| 2357 | 2353 | mac_enable_sound(sound, (data & 0x80) == 0); |
| 2358 | 2354 | sony_set_sel_line(fdc,(data & 0x20) >> 5); |
| 2359 | 2355 | mac->mac_drive_select = ((data & 0x10) >> 4); |
| 2356 | // printf("PM_REQ = %x, was %x\n", data & 1, mac->pm_req); |
| 2360 | 2357 | mac->pm_req = data & 1; |
| 2361 | 2358 | return; |
| 2362 | 2359 | } |