src/mess/drivers/atarist.c
| r1009 | r1010 | |
| 446 | 446 | if (~data & 0x80) ikbd.keylatch = readinputportbytag("P47"); |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | /* DMA Sound */ |
| 450 | |
| 451 | static struct DMASOUND |
| 452 | { |
| 453 | UINT32 base, cntr, end; |
| 454 | UINT16 ctrl, mode; |
| 455 | } dmasound; |
| 456 | |
| 457 | static READ16_HANDLER( atariste_sound_dma_control_r ) |
| 458 | { |
| 459 | return dmasound.ctrl; |
| 460 | } |
| 461 | |
| 462 | static READ16_HANDLER( atariste_sound_dma_base_r ) |
| 463 | { |
| 464 | switch (offset) |
| 465 | { |
| 466 | case 0x00: |
| 467 | return (dmasound.base >> 16) & 0x3f; |
| 468 | case 0x01: |
| 469 | return (dmasound.base >> 8) & 0xff; |
| 470 | case 0x02: |
| 471 | return dmasound.base & 0xff; |
| 472 | } |
| 473 | |
| 474 | return 0; |
| 475 | } |
| 476 | |
| 477 | static READ16_HANDLER( atariste_sound_dma_counter_r ) |
| 478 | { |
| 479 | switch (offset) |
| 480 | { |
| 481 | case 0x00: |
| 482 | return (dmasound.cntr >> 16) & 0x3f; |
| 483 | case 0x01: |
| 484 | return (dmasound.cntr >> 8) & 0xff; |
| 485 | case 0x02: |
| 486 | return dmasound.cntr & 0xff; |
| 487 | } |
| 488 | |
| 489 | return 0; |
| 490 | } |
| 491 | |
| 492 | static READ16_HANDLER( atariste_sound_dma_end_r ) |
| 493 | { |
| 494 | switch (offset) |
| 495 | { |
| 496 | case 0x00: |
| 497 | return (dmasound.end >> 16) & 0x3f; |
| 498 | case 0x01: |
| 499 | return (dmasound.end >> 8) & 0xff; |
| 500 | case 0x02: |
| 501 | return dmasound.end & 0xff; |
| 502 | } |
| 503 | |
| 504 | return 0; |
| 505 | } |
| 506 | |
| 507 | static READ16_HANDLER( atariste_sound_mode_r ) |
| 508 | { |
| 509 | return dmasound.mode; |
| 510 | } |
| 511 | |
| 512 | static WRITE16_HANDLER( atariste_sound_dma_control_w ) |
| 513 | { |
| 514 | dmasound.ctrl = data; |
| 515 | } |
| 516 | |
| 517 | static WRITE16_HANDLER( atariste_sound_dma_base_w ) |
| 518 | { |
| 519 | switch (offset) |
| 520 | { |
| 521 | case 0x00: |
| 522 | dmasound.base = (dmasound.base & 0x00fffe) | (data & 0x3f) << 16; |
| 523 | break; |
| 524 | case 0x01: |
| 525 | dmasound.base = (dmasound.base & 0x3f00fe) | (data & 0xff) << 8; |
| 526 | break; |
| 527 | case 0x02: |
| 528 | dmasound.base = (dmasound.base & 0x3fff00) | (data & 0xfe); |
| 529 | break; |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | static WRITE16_HANDLER( atariste_sound_dma_end_w ) |
| 534 | { |
| 535 | switch (offset) |
| 536 | { |
| 537 | case 0x00: |
| 538 | dmasound.end = (dmasound.end & 0x00fffe) | (data & 0x3f) << 16; |
| 539 | break; |
| 540 | case 0x01: |
| 541 | dmasound.end = (dmasound.end & 0x3f00fe) | (data & 0xff) << 8; |
| 542 | break; |
| 543 | case 0x02: |
| 544 | dmasound.end = (dmasound.end & 0x3fff00) | (data & 0xfe); |
| 545 | break; |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | static WRITE16_HANDLER( atariste_sound_mode_w ) |
| 550 | { |
| 551 | dmasound.mode = data; |
| 552 | } |
| 553 | |
| 449 | 554 | /* Microwire */ |
| 450 | 555 | |
| 451 | 556 | static struct MICROWIRE |
| r1009 | r1010 | |
| 639 | 744 | AM_RANGE(0xff8608, 0xff860d) AM_READWRITE(atarist_fdc_dma_base_r, atarist_fdc_dma_base_w) |
| 640 | 745 | AM_RANGE(0xff8800, 0xff8801) AM_READWRITE(AY8910_read_port_0_msb_r, AY8910_control_port_0_msb_w) |
| 641 | 746 | AM_RANGE(0xff8802, 0xff8803) AM_WRITE(AY8910_write_port_0_msb_w) |
| 642 | | // AM_RANGE(0xff8900, 0xff8901) AM_READWRITE(atariste_sound_dma_control_r, atariste_sound_dma_control_w) |
| 643 | | // AM_RANGE(0xff8902, 0xff8906) AM_READWRITE(atariste_sound_dma_base_r, atariste_sound_dma_base_w) |
| 644 | | // AM_RANGE(0xff8908, 0xff890d) AM_READ(atariste_sound_dma_counter_r) |
| 645 | | // AM_RANGE(0xff890e, 0xff8912) AM_READWRITE(atariste_sound_dma_end_r, atariste_sound_dma_end_w) |
| 646 | | // AM_RANGE(0xff8920, 0xff8920) AM_READWRITE(atariste_sound_mode_r, atariste_sound_mode_w) |
| 747 | AM_RANGE(0xff8900, 0xff8901) AM_READWRITE(atariste_sound_dma_control_r, atariste_sound_dma_control_w) |
| 748 | AM_RANGE(0xff8902, 0xff8907) AM_READWRITE(atariste_sound_dma_base_r, atariste_sound_dma_base_w) |
| 749 | AM_RANGE(0xff8908, 0xff890d) AM_READ(atariste_sound_dma_counter_r) |
| 750 | AM_RANGE(0xff890e, 0xff8913) AM_READWRITE(atariste_sound_dma_end_r, atariste_sound_dma_end_w) |
| 751 | AM_RANGE(0xff8920, 0xff8921) AM_READWRITE(atariste_sound_mode_r, atariste_sound_mode_w) |
| 647 | 752 | AM_RANGE(0xff8922, 0xff8923) AM_READWRITE(atariste_microwire_data_r, atariste_microwire_data_w) |
| 648 | 753 | AM_RANGE(0xff8924, 0xff8925) AM_READWRITE(atariste_microwire_mask_r, atariste_microwire_mask_w) |
| 649 | 754 | AM_RANGE(0xff8a00, 0xff8a1f) AM_READWRITE(atarist_blitter_halftone_r, atarist_blitter_halftone_w) |
| r1009 | r1010 | |
| 694 | 799 | AM_RANGE(0xff8608, 0xff860d) AM_READWRITE(atarist_fdc_dma_base_r, atarist_fdc_dma_base_w) |
| 695 | 800 | AM_RANGE(0xff8800, 0xff8801) AM_READWRITE(AY8910_read_port_0_msb_r, AY8910_control_port_0_msb_w) |
| 696 | 801 | AM_RANGE(0xff8802, 0xff8803) AM_WRITE(AY8910_write_port_0_msb_w) |
| 697 | | // AM_RANGE(0xff8900, 0xff8901) AM_READWRITE(atariste_sound_dma_control_r, atariste_sound_dma_control_w) |
| 698 | | // AM_RANGE(0xff8902, 0xff8906) AM_READWRITE(atariste_sound_dma_base_r, atariste_sound_dma_base_w) |
| 699 | | // AM_RANGE(0xff8908, 0xff890d) AM_READ(atariste_sound_dma_counter_r) |
| 700 | | // AM_RANGE(0xff890e, 0xff8912) AM_READWRITE(atariste_sound_dma_end_r, atariste_sound_dma_end_w) |
| 701 | | // AM_RANGE(0xff8920, 0xff8920) AM_READWRITE(atariste_sound_mode_r, atariste_sound_mode_w) |
| 802 | AM_RANGE(0xff8900, 0xff8901) AM_READWRITE(atariste_sound_dma_control_r, atariste_sound_dma_control_w) |
| 803 | AM_RANGE(0xff8902, 0xff8907) AM_READWRITE(atariste_sound_dma_base_r, atariste_sound_dma_base_w) |
| 804 | AM_RANGE(0xff8908, 0xff890d) AM_READ(atariste_sound_dma_counter_r) |
| 805 | AM_RANGE(0xff890e, 0xff8913) AM_READWRITE(atariste_sound_dma_end_r, atariste_sound_dma_end_w) |
| 806 | AM_RANGE(0xff8920, 0xff8921) AM_READWRITE(atariste_sound_mode_r, atariste_sound_mode_w) |
| 702 | 807 | AM_RANGE(0xff8922, 0xff8923) AM_READWRITE(atariste_microwire_data_r, atariste_microwire_data_w) |
| 703 | 808 | AM_RANGE(0xff8924, 0xff8925) AM_READWRITE(atariste_microwire_mask_r, atariste_microwire_mask_w) |
| 704 | 809 | AM_RANGE(0xff8a00, 0xff8a1f) AM_READWRITE(atarist_blitter_halftone_r, atarist_blitter_halftone_w) |
| r1009 | r1010 | |
| 1164 | 1269 | |
| 1165 | 1270 | memset(&mwire, 0, sizeof(mwire)); |
| 1166 | 1271 | |
| 1272 | state_save_register_global(dmasound.base); |
| 1273 | state_save_register_global(dmasound.cntr); |
| 1274 | state_save_register_global(dmasound.end); |
| 1275 | state_save_register_global(dmasound.ctrl); |
| 1276 | state_save_register_global(dmasound.mode); |
| 1277 | |
| 1167 | 1278 | state_save_register_global(mwire.data); |
| 1168 | 1279 | state_save_register_global(mwire.mask); |
| 1169 | 1280 | state_save_register_global(mwire.shift); |