Previous 15994 Revisions Next

r4958 Sunday 7th June, 2009 at 01:25:08 UTC by Barry Rodewald
[FM7] Made some unused I/O ports return 0xff. This makes some games actually read the keyboard.
[src/mess/drivers]fm7.c

src/mess/drivers/fm7.c
r4957r4958
422422   }
423423}
424424
425READ8_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
425440READ8_HANDLER( fm7_cassette_printer_r )
426441{
427442   // bit 7: cassette input
r4957r4958
550565      shared_ram[offset] = data;
551566}
552567
568static 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
553578static TIMER_CALLBACK( fm7_timer_irq )
554579{
555580   if(irq_mask & IRQ_FLAG_TIMER)
r4957r4958
579604      irq_flags |= IRQ_FLAG_KEY;
580605      cputag_set_input_line(machine,"maincpu",M6809_IRQ_LINE,ASSERT_LINE);
581606   }
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   }
583611   logerror("KEY: sent scancode 0x%03x\n",scancode);
584612}
585613
r4957r4958
659687   AM_RANGE(0xfd0d,0xfd0d) AM_READWRITE(fm7_psg_select_r,fm7_psg_select_w)
660688   AM_RANGE(0xfd0e,0xfd0e) AM_READWRITE(fm7_psg_data_r, fm7_psg_data_w)
661689   AM_RANGE(0xfd0f,0xfd0f) AM_READWRITE(fm7_rom_en_r,fm7_rom_en_w)
690   AM_RANGE(0xfd15,0xfd16) AM_READ(fm7_unknown_r)
662691   AM_RANGE(0xfd18,0xfd1f) AM_READWRITE(fm7_fdc_r,fm7_fdc_w)
663692   AM_RANGE(0xfd24,0xfd2b) AM_RAM
664693   AM_RANGE(0xfd38,0xfd3f) AM_READWRITE(fm7_palette_r,fm7_palette_w)
694   AM_RANGE(0xfdf0,0xfdff) AM_READ(fm7_unknown_r)
665695   // Boot ROM
666696   AM_RANGE(0xfe00,0xffdf) AM_ROM AM_REGION("basic",0x0000)
667697   AM_RANGE(0xffe0,0xffef) AM_RAM
r4957r4958
684714   AM_RANGE(0xd000,0xd37f) AM_RAM // Work RAM
685715   AM_RANGE(0xd380,0xd3ff) AM_RAM AM_BASE(&shared_ram)
686716   // 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)
688718   AM_RANGE(0xd402,0xd402) AM_READ(fm7_cancel_ack)
689719   AM_RANGE(0xd404,0xd404) AM_READ(fm7_attn_irq_r)
690720   AM_RANGE(0xd408,0xd408) AM_READWRITE(fm7_crt_r,fm7_crt_w)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team