Previous 15994 Revisions Next

r4948 Friday 5th June, 2009 at 23:10:13 UTC by Barry Rodewald
[FM7] Stopped sub-CPU busy flag from being disabled when halted. Removed shared RAM read/write handlers.
[src/mess/drivers]fm7.c

src/mess/drivers/fm7.c
r4947r4948
5454emu_timer* fm7_subtimer;  // sub-CPU timer, every 1 second?
5555emu_timer* fm7_keyboard_timer;
5656static UINT8 sub_busy;
57static UINT8 sub_halt;
5758static UINT8 basic_rom_en;
5859static UINT8 attn_irq;
5960static UINT8 vram_access;  // VRAM access flag
r4947r4948
232233   RAM[0xfff0+offset] = data;
233234}
234235
235READ8_HANDLER( shared_r )
236{
237   return shared_ram[offset];
238}
239
240WRITE8_HANDLER( shared_w )
241{
242   shared_ram[offset] = data;
243}
244
245236READ8_HANDLER( fm7_fd04_r )
246237{
247238   UINT8 ret = 0xff;
r4947r4948
281272WRITE8_HANDLER( fm7_subintf_w )
282273{
283274   cputag_set_input_line(space->machine,"sub",INPUT_LINE_HALT,(data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
275   sub_halt = data & 0x80;
284276   sub_busy = data & 0x80;
285277   if(data & 0x40)
286278      cputag_set_input_line(space->machine,"sub",M6809_IRQ_LINE,ASSERT_LINE);
r4947r4948
289281
290282READ8_HANDLER( fm7_sub_busyflag_r )
291283{
292   sub_busy = 0x00;
284   if(sub_halt == 0)  // Sub CPU is still busy when halted
285      sub_busy = 0x00;
293286   return 0x00;
294287}
295288
r4947r4948
568561   if(irq_mask & IRQ_FLAG_KEY)
569562   {
570563      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);
572565   }
573566   cputag_set_input_line(machine,"sub",M6809_FIRQ_LINE,ASSERT_LINE);
574567   logerror("KEY: sent scancode 0x%03x\n",scancode);
r4947r4948
639632   AM_RANGE(0x0000,0x7fff) AM_RAM
640633   AM_RANGE(0x8000,0xfbff) AM_RAMBANK(1) // also F-BASIC ROM, when enabled
641634   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
643636   // I/O space (FD00-FDFF)
644637   AM_RANGE(0xfd00,0xfd01) AM_READWRITE(fm7_keyboard_r,fm7_cassette_printer_w)
645638   AM_RANGE(0xfd02,0xfd02) AM_READWRITE(fm7_cassette_printer_r,fm7_irq_mask_w)  // IRQ mask
r4947r4948
673666   AM_RANGE(0x0000,0xbfff) AM_READWRITE(fm7_vram_r,fm7_vram_w) // VRAM
674667   AM_RANGE(0xc000,0xcfff) AM_RAM // Console RAM
675668   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)
677670   // I/O space (D400-D7FF)
678671   AM_RANGE(0xd400,0xd401) AM_READ(fm7_keyboard_r)
679672   AM_RANGE(0xd402,0xd402) AM_READ(fm7_cancel_ack)
r4947r4948
806799
807800static DRIVER_INIT(fm7)
808801{
809   shared_ram = auto_alloc_array(machine,UINT8,0x80);
802//   shared_ram = auto_alloc_array(machine,UINT8,0x80);
810803   fm7_video_ram = auto_alloc_array(machine,UINT8,0xc000);
811804   fm7_timer = timer_alloc(machine,fm7_timer_irq,NULL);
812805   fm7_subtimer = timer_alloc(machine,fm7_subtimer_irq,NULL);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team