Previous 15994 Revisions Next

r6312 Friday 6th November, 2009 at 03:31:07 UTC by Harmony
[PocketStation] Improved interrupt behavior, more games work (BlockOut, Cars, others) [Harmony]
[src/mess/drivers]pockstat.c

src/mess/drivers/pockstat.c
r6311r6312
5858
5959#define VERBOSE_LEVEL      (0)
6060
61#define ENABLE_VERBOSE_LOG   (0)
61#define ENABLE_VERBOSE_LOG   (1)
6262
6363#if ENABLE_VERBOSE_LOG
6464INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ... )
r6311r6312
281281
282282static UINT32 ps_intc_get_interrupt_line(running_machine *machine, UINT32 line)
283283{
284   return intc_regs.hold & line;
284   return intc_regs.status & line;
285285}
286286
287287static void ps_intc_set_interrupt_line(running_machine *machine, UINT32 line, int state)
r6311r6312
291291      if(state)
292292      {
293293         intc_regs.status |= line & PS_INT_STATUS_MASK;
294         line &= intc_regs.enable;
295         line &= ~intc_regs.mask;
296         intc_regs.hold |= line;
294         intc_regs.hold |= line &~ PS_INT_STATUS_MASK;
295         //printf( " Setting %08x, status = %08x, hold = %08x\n", line, intc_regs.status, intc_regs.hold );
297296      }
298297      else
299298      {
300299         intc_regs.status &= ~line;
301300         intc_regs.hold &= ~line;
301         //printf( "Clearing %08x, status = %08x, hold = %08x\n", line, intc_regs.status, intc_regs.hold );
302302      }
303303   }
304   if(intc_regs.hold & PS_INT_IRQ_MASK)
304   if(intc_regs.hold & intc_regs.enable & PS_INT_IRQ_MASK)
305305   {
306306      cpu_set_input_line(cputag_get_cpu(machine, "maincpu"), ARM7_IRQ_LINE, ASSERT_LINE);
307307   }
r6311r6312
309309   {
310310      cpu_set_input_line(cputag_get_cpu(machine, "maincpu"), ARM7_IRQ_LINE, CLEAR_LINE);
311311   }
312   if(intc_regs.hold & PS_INT_FIQ_MASK)
312   if(intc_regs.hold & intc_regs.enable & PS_INT_FIQ_MASK)
313313   {
314314      cpu_set_input_line(cputag_get_cpu(machine, "maincpu"), ARM7_FIRQ_LINE, ASSERT_LINE);
315315   }
r6311r6312
357357         break;
358358      case 0x0008/4:
359359         verboselog(space->machine, 0, "ps_intc_w: Interrupt Enable = %08x & %08x\n", data, mem_mask );
360         COMBINE_DATA(&intc_regs.enable);
361         intc_regs.mask &= ~intc_regs.enable;
360         intc_regs.enable |= data;
361         //COMBINE_DATA(&intc_regs.enable);
362         intc_regs.status &= intc_regs.enable;
363         intc_regs.hold &= intc_regs.enable;
364         ps_intc_set_interrupt_line(space->machine, 0, 0);
362365         break;
363366      case 0x000c/4:
364367         verboselog(space->machine, 0, "ps_intc_w: Interrupt Mask = %08x & %08x\n", data, mem_mask );
368         intc_regs.enable &= ~data;
365369         COMBINE_DATA(&intc_regs.mask);
366         intc_regs.enable &= ~intc_regs.mask;
370         intc_regs.status &= intc_regs.enable;
371         intc_regs.hold &= intc_regs.enable;
372         ps_intc_set_interrupt_line(space->machine, 0, 0);
367373         break;
368374      case 0x0010/4:
369375         verboselog(space->machine, 0, "ps_intc_w: Interrupt Acknowledge = %08x & %08x\n", data, mem_mask );
r6311r6312
423429          verboselog(space->machine, 0, "ps_timer_r: Timer %d Count = %08x & %08x\n", offset / (0x10/4), timer_regs.timer[offset / (0x10/4)].count, mem_mask );
424430          if(timer_regs.timer[offset / (0x10/4)].control & 4)
425431          {
426            timer_regs.timer[offset / (0x10/4)].count -= 0x100;
432            timer_regs.timer[offset / (0x10/4)].count -= 0x10;
427433            if(timer_regs.timer[offset / (0x10/4)].count > timer_regs.timer[offset / (0x10/4)].period)
428434            {
429435               timer_regs.timer[offset / (0x10/4)].count = timer_regs.timer[offset / (0x10/4)].period;
r6311r6312
783789   }
784790}
785791
792static READ32_HANDLER( ps_audio_r )
793{
794   verboselog(space->machine, 0, "ps_audio_r: Unknown Read: %08x = %08x & %08x\n", 0xd800000 + (offset << 2), 0x10, mem_mask);
795   return 0x10;
796}
797
798static WRITE32_HANDLER( ps_audio_w )
799{
800   verboselog(space->machine, 0, "ps_audio_w: Unknown Write: %08x = %08x & %08x\n", 0xd800000 + (offset << 2), data, mem_mask);
801}
802
786803static ADDRESS_MAP_START(pockstat_mem, ADDRESS_SPACE_PROGRAM, 32)
787804   AM_RANGE(0x00000000, 0x000007ff) AM_RAM
788805   AM_RANGE(0x02000000, 0x02ffffff) AM_READ(ps_rombank_r)
r6311r6312
795812   AM_RANGE(0x0b800000, 0x0b80000f) AM_READWRITE(ps_rtc_r, ps_rtc_w)
796813   AM_RANGE(0x0d000000, 0x0d000003) AM_READWRITE(ps_lcd_r, ps_lcd_w)
797814   AM_RANGE(0x0d000100, 0x0d00017f) AM_RAM AM_BASE(&lcd_buffer)
815   AM_RANGE(0x0d80000c, 0x0d80000f) AM_READWRITE(ps_audio_r, ps_audio_w)
798816ADDRESS_MAP_END
799817
800818/* Input ports */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team