src/mess/drivers/fm7.c
| r4947 | r4948 | |
| 54 | 54 | emu_timer* fm7_subtimer; // sub-CPU timer, every 1 second? |
| 55 | 55 | emu_timer* fm7_keyboard_timer; |
| 56 | 56 | static UINT8 sub_busy; |
| 57 | static UINT8 sub_halt; |
| 57 | 58 | static UINT8 basic_rom_en; |
| 58 | 59 | static UINT8 attn_irq; |
| 59 | 60 | static UINT8 vram_access; // VRAM access flag |
| r4947 | r4948 | |
| 232 | 233 | RAM[0xfff0+offset] = data; |
| 233 | 234 | } |
| 234 | 235 | |
| 235 | | READ8_HANDLER( shared_r ) |
| 236 | | { |
| 237 | | return shared_ram[offset]; |
| 238 | | } |
| 239 | | |
| 240 | | WRITE8_HANDLER( shared_w ) |
| 241 | | { |
| 242 | | shared_ram[offset] = data; |
| 243 | | } |
| 244 | | |
| 245 | 236 | READ8_HANDLER( fm7_fd04_r ) |
| 246 | 237 | { |
| 247 | 238 | UINT8 ret = 0xff; |
| r4947 | r4948 | |
| 281 | 272 | WRITE8_HANDLER( fm7_subintf_w ) |
| 282 | 273 | { |
| 283 | 274 | cputag_set_input_line(space->machine,"sub",INPUT_LINE_HALT,(data & 0x80) ? ASSERT_LINE : CLEAR_LINE); |
| 275 | sub_halt = data & 0x80; |
| 284 | 276 | sub_busy = data & 0x80; |
| 285 | 277 | if(data & 0x40) |
| 286 | 278 | cputag_set_input_line(space->machine,"sub",M6809_IRQ_LINE,ASSERT_LINE); |
| r4947 | r4948 | |
| 289 | 281 | |
| 290 | 282 | READ8_HANDLER( fm7_sub_busyflag_r ) |
| 291 | 283 | { |
| 292 | | sub_busy = 0x00; |
| 284 | if(sub_halt == 0) // Sub CPU is still busy when halted |
| 285 | sub_busy = 0x00; |
| 293 | 286 | return 0x00; |
| 294 | 287 | } |
| 295 | 288 | |
| r4947 | r4948 | |
| 568 | 561 | if(irq_mask & IRQ_FLAG_KEY) |
| 569 | 562 | { |
| 570 | 563 | irq_flags |= IRQ_FLAG_KEY; |
| 571 | | // cputag_set_input_line(machine,"maincpu",M6809_IRQ_LINE,ASSERT_LINE); |
| 564 | cputag_set_input_line(machine,"maincpu",M6809_IRQ_LINE,ASSERT_LINE); |
| 572 | 565 | } |
| 573 | 566 | cputag_set_input_line(machine,"sub",M6809_FIRQ_LINE,ASSERT_LINE); |
| 574 | 567 | logerror("KEY: sent scancode 0x%03x\n",scancode); |
| r4947 | r4948 | |
| 639 | 632 | AM_RANGE(0x0000,0x7fff) AM_RAM |
| 640 | 633 | AM_RANGE(0x8000,0xfbff) AM_RAMBANK(1) // also F-BASIC ROM, when enabled |
| 641 | 634 | AM_RANGE(0xfc00,0xfc7f) AM_RAM |
| 642 | | AM_RANGE(0xfc80,0xfcff) AM_READWRITE(shared_r,shared_w) // shared RAM with sub-CPU |
| 635 | AM_RANGE(0xfc80,0xfcff) AM_RAM AM_SHARE(2) AM_BASE(&shared_ram) // shared RAM with sub-CPU |
| 643 | 636 | // I/O space (FD00-FDFF) |
| 644 | 637 | AM_RANGE(0xfd00,0xfd01) AM_READWRITE(fm7_keyboard_r,fm7_cassette_printer_w) |
| 645 | 638 | AM_RANGE(0xfd02,0xfd02) AM_READWRITE(fm7_cassette_printer_r,fm7_irq_mask_w) // IRQ mask |
| r4947 | r4948 | |
| 673 | 666 | AM_RANGE(0x0000,0xbfff) AM_READWRITE(fm7_vram_r,fm7_vram_w) // VRAM |
| 674 | 667 | AM_RANGE(0xc000,0xcfff) AM_RAM // Console RAM |
| 675 | 668 | AM_RANGE(0xd000,0xd37f) AM_RAM // Work RAM |
| 676 | | AM_RANGE(0xd380,0xd3ff) AM_READWRITE(shared_r,shared_w) // shared RAM |
| 669 | AM_RANGE(0xd380,0xd3ff) AM_RAM AM_SHARE(2) AM_BASE(&shared_ram) |
| 677 | 670 | // I/O space (D400-D7FF) |
| 678 | 671 | AM_RANGE(0xd400,0xd401) AM_READ(fm7_keyboard_r) |
| 679 | 672 | AM_RANGE(0xd402,0xd402) AM_READ(fm7_cancel_ack) |
| r4947 | r4948 | |
| 806 | 799 | |
| 807 | 800 | static DRIVER_INIT(fm7) |
| 808 | 801 | { |
| 809 | | shared_ram = auto_alloc_array(machine,UINT8,0x80); |
| 802 | // shared_ram = auto_alloc_array(machine,UINT8,0x80); |
| 810 | 803 | fm7_video_ram = auto_alloc_array(machine,UINT8,0xc000); |
| 811 | 804 | fm7_timer = timer_alloc(machine,fm7_timer_irq,NULL); |
| 812 | 805 | fm7_subtimer = timer_alloc(machine,fm7_subtimer_irq,NULL); |