src/mess/drivers/fm7.c
| r4957 | r4958 | |
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | READ8_HANDLER( fm7_sub_keyboard_r) |
| 426 | { |
| 427 | UINT8 ret; |
| 428 | switch(offset) |
| 429 | { |
| 430 | case 0: |
| 431 | ret = (current_scancode >> 1) & 0x80; |
| 432 | return ret; |
| 433 | case 1: |
| 434 | return current_scancode & 0xff; |
| 435 | default: |
| 436 | return 0x00; |
| 437 | } |
| 438 | } |
| 439 | |
| 425 | 440 | READ8_HANDLER( fm7_cassette_printer_r ) |
| 426 | 441 | { |
| 427 | 442 | // bit 7: cassette input |
| r4957 | r4958 | |
| 550 | 565 | shared_ram[offset] = data; |
| 551 | 566 | } |
| 552 | 567 | |
| 568 | static READ8_HANDLER( fm7_unknown_r ) |
| 569 | { |
| 570 | // Port 0xFDFC is read by Dig Dug. Controller port, perhaps? |
| 571 | // Must return 0xff for it to read the keyboard. |
| 572 | // Mappy uses ports FD15 and FD16. On the FM77AV, this is the YM2203, |
| 573 | // but on the FM-7, this is nothing, so we return 0xff for it to |
| 574 | // read the keyboard correctly. |
| 575 | return 0xff; |
| 576 | } |
| 577 | |
| 553 | 578 | static TIMER_CALLBACK( fm7_timer_irq ) |
| 554 | 579 | { |
| 555 | 580 | if(irq_mask & IRQ_FLAG_TIMER) |
| r4957 | r4958 | |
| 579 | 604 | irq_flags |= IRQ_FLAG_KEY; |
| 580 | 605 | cputag_set_input_line(machine,"maincpu",M6809_IRQ_LINE,ASSERT_LINE); |
| 581 | 606 | } |
| 582 | | cputag_set_input_line(machine,"sub",M6809_FIRQ_LINE,ASSERT_LINE); |
| 607 | else |
| 608 | { |
| 609 | cputag_set_input_line(machine,"sub",M6809_FIRQ_LINE,ASSERT_LINE); |
| 610 | } |
| 583 | 611 | logerror("KEY: sent scancode 0x%03x\n",scancode); |
| 584 | 612 | } |
| 585 | 613 | |
| r4957 | r4958 | |
| 659 | 687 | AM_RANGE(0xfd0d,0xfd0d) AM_READWRITE(fm7_psg_select_r,fm7_psg_select_w) |
| 660 | 688 | AM_RANGE(0xfd0e,0xfd0e) AM_READWRITE(fm7_psg_data_r, fm7_psg_data_w) |
| 661 | 689 | AM_RANGE(0xfd0f,0xfd0f) AM_READWRITE(fm7_rom_en_r,fm7_rom_en_w) |
| 690 | AM_RANGE(0xfd15,0xfd16) AM_READ(fm7_unknown_r) |
| 662 | 691 | AM_RANGE(0xfd18,0xfd1f) AM_READWRITE(fm7_fdc_r,fm7_fdc_w) |
| 663 | 692 | AM_RANGE(0xfd24,0xfd2b) AM_RAM |
| 664 | 693 | AM_RANGE(0xfd38,0xfd3f) AM_READWRITE(fm7_palette_r,fm7_palette_w) |
| 694 | AM_RANGE(0xfdf0,0xfdff) AM_READ(fm7_unknown_r) |
| 665 | 695 | // Boot ROM |
| 666 | 696 | AM_RANGE(0xfe00,0xffdf) AM_ROM AM_REGION("basic",0x0000) |
| 667 | 697 | AM_RANGE(0xffe0,0xffef) AM_RAM |
| r4957 | r4958 | |
| 684 | 714 | AM_RANGE(0xd000,0xd37f) AM_RAM // Work RAM |
| 685 | 715 | AM_RANGE(0xd380,0xd3ff) AM_RAM AM_BASE(&shared_ram) |
| 686 | 716 | // I/O space (D400-D7FF) |
| 687 | | AM_RANGE(0xd400,0xd401) AM_READ(fm7_keyboard_r) |
| 717 | AM_RANGE(0xd400,0xd401) AM_READ(fm7_sub_keyboard_r) |
| 688 | 718 | AM_RANGE(0xd402,0xd402) AM_READ(fm7_cancel_ack) |
| 689 | 719 | AM_RANGE(0xd404,0xd404) AM_READ(fm7_attn_irq_r) |
| 690 | 720 | AM_RANGE(0xd408,0xd408) AM_READWRITE(fm7_crt_r,fm7_crt_w) |