Previous 15994 Revisions Next

r4954 Saturday 6th June, 2009 at 23:27:15 UTC by Barry Rodewald
[FM7] Made shared RAM only accessible to the main CPU when the sub CPU is halted.
[src/mess/drivers]fm7.c

src/mess/drivers/fm7.c
r4953r4954
436436      ret |= 0x80;
437437   
438438   ret |= 0x40;
439   
440   ret |= 0x3f;  // Printer status, joystick inputs
439441
440442   return ret;
441443}
r4953r4954
533535   fm7_update_psg(space->machine);
534536}
535537
538// Shared RAM is only usable on the main CPU if the sub CPU is halted
539static READ8_HANDLER( fm7_main_shared_r )
540{
541   if(sub_halt != 0)
542      return shared_ram[offset];
543   else
544      return 0xff;
545}
546
547static WRITE8_HANDLER( fm7_main_shared_w )
548{
549   if(sub_halt != 0)
550      shared_ram[offset] = data;
551}
552
536553static TIMER_CALLBACK( fm7_timer_irq )
537554{
538555   if(irq_mask & IRQ_FLAG_TIMER)
r4953r4954
631648   AM_RANGE(0x0000,0x7fff) AM_RAM
632649   AM_RANGE(0x8000,0xfbff) AM_RAMBANK(1) // also F-BASIC ROM, when enabled
633650   AM_RANGE(0xfc00,0xfc7f) AM_RAM
634   AM_RANGE(0xfc80,0xfcff) AM_RAM AM_SHARE(2) AM_BASE(&shared_ram) // shared RAM with sub-CPU
651   AM_RANGE(0xfc80,0xfcff) AM_RAM AM_READWRITE(fm7_main_shared_r,fm7_main_shared_w)
635652   // I/O space (FD00-FDFF)
636653   AM_RANGE(0xfd00,0xfd01) AM_READWRITE(fm7_keyboard_r,fm7_cassette_printer_w)
637654   AM_RANGE(0xfd02,0xfd02) AM_READWRITE(fm7_cassette_printer_r,fm7_irq_mask_w)  // IRQ mask
r4953r4954
665682   AM_RANGE(0x0000,0xbfff) AM_READWRITE(fm7_vram_r,fm7_vram_w) // VRAM
666683   AM_RANGE(0xc000,0xcfff) AM_RAM // Console RAM
667684   AM_RANGE(0xd000,0xd37f) AM_RAM // Work RAM
668   AM_RANGE(0xd380,0xd3ff) AM_RAM AM_SHARE(2) AM_BASE(&shared_ram)
685   AM_RANGE(0xd380,0xd3ff) AM_RAM AM_BASE(&shared_ram)
669686   // I/O space (D400-D7FF)
670687   AM_RANGE(0xd400,0xd401) AM_READ(fm7_keyboard_r)
671688   AM_RANGE(0xd402,0xd402) AM_READ(fm7_cancel_ack)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team