Previous 15994 Revisions Next

r6277 Wednesday 4th November, 2009 at 01:47:08 UTC by Harmony
[CDI] Changed dipsettings to confsettings [Harmony]
[PocketStation] Fixed timer issues enough to make the BIOS being to display something [Harmony]
[src/mess/drivers]cdi.c pockstat.c

src/mess/drivers/cdi.c
r6276r6277
42384238   PORT_BIT(0xfc, IP_ACTIVE_HIGH, IPT_UNUSED)
42394239
42404240   PORT_START("DEBUG")
4241   PORT_DIPNAME( 0x01, 0x00, "Plane A Disable")
4242   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
4243   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
4244   PORT_DIPNAME( 0x02, 0x00, "Plane B Disable")
4245   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
4246   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
4247   PORT_DIPNAME( 0x04, 0x00, "Force Backdrop Color")
4248   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
4249   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
4250   PORT_DIPNAME( 0xf0, 0x00, "Backdrop Color")
4251   PORT_DIPSETTING(    0x00, "Black" )
4252   PORT_DIPSETTING(    0x10, "Half-Bright Blue" )
4253   PORT_DIPSETTING(    0x20, "Half-Bright Green" )
4254   PORT_DIPSETTING(    0x30, "Half-Bright Cyan" )
4255   PORT_DIPSETTING(    0x40, "Half-Bright Red" )
4256   PORT_DIPSETTING(    0x50, "Half-Bright Magenta" )
4257   PORT_DIPSETTING(    0x60, "Half-Bright Yellow" )
4258   PORT_DIPSETTING(    0x70, "Half-Bright White" )
4259   PORT_DIPSETTING(    0x80, "Black (Alternate)" )
4260   PORT_DIPSETTING(    0x90, "Blue" )
4261   PORT_DIPSETTING(    0xa0, "Green" )
4262   PORT_DIPSETTING(    0xb0, "Cyan" )
4263   PORT_DIPSETTING(    0xc0, "Red" )
4264   PORT_DIPSETTING(    0xd0, "Magenta" )
4265   PORT_DIPSETTING(    0xe0, "Yellow" )
4266   PORT_DIPSETTING(    0xf0, "White" )
4241   PORT_CONFNAME( 0x01, 0x00, "Plane A Disable")
4242   PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
4243   PORT_CONFSETTING(    0x01, DEF_STR( On ) )
4244   PORT_CONFNAME( 0x02, 0x00, "Plane B Disable")
4245   PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
4246   PORT_CONFSETTING(    0x02, DEF_STR( On ) )
4247   PORT_CONFNAME( 0x04, 0x00, "Force Backdrop Color")
4248   PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
4249   PORT_CONFSETTING(    0x04, DEF_STR( On ) )
4250   PORT_CONFNAME( 0xf0, 0x00, "Backdrop Color")
4251   PORT_CONFSETTING(    0x00, "Black" )
4252   PORT_CONFSETTING(    0x10, "Half-Bright Blue" )
4253   PORT_CONFSETTING(    0x20, "Half-Bright Green" )
4254   PORT_CONFSETTING(    0x30, "Half-Bright Cyan" )
4255   PORT_CONFSETTING(    0x40, "Half-Bright Red" )
4256   PORT_CONFSETTING(    0x50, "Half-Bright Magenta" )
4257   PORT_CONFSETTING(    0x60, "Half-Bright Yellow" )
4258   PORT_CONFSETTING(    0x70, "Half-Bright White" )
4259   PORT_CONFSETTING(    0x80, "Black (Alternate)" )
4260   PORT_CONFSETTING(    0x90, "Blue" )
4261   PORT_CONFSETTING(    0xa0, "Green" )
4262   PORT_CONFSETTING(    0xb0, "Cyan" )
4263   PORT_CONFSETTING(    0xc0, "Red" )
4264   PORT_CONFSETTING(    0xd0, "Magenta" )
4265   PORT_CONFSETTING(    0xe0, "Yellow" )
4266   PORT_CONFSETTING(    0xf0, "White" )
42674267INPUT_PORTS_END
42684268
42694269static MACHINE_RESET( cdi )
src/mess/drivers/pockstat.c
r6276r6277
6868   }
6969}
7070
71static UINT32 *lcd_buffer;
72
7173// Flash TLB
7274static READ32_HANDLER( ps_ftlb_r );
7375static WRITE32_HANDLER( ps_ftlb_w );
r6276r6277
8789static READ32_HANDLER( ps_clock_r );
8890static WRITE32_HANDLER( ps_clock_w );
8991
92// RTC
93static TIMER_CALLBACK( rtc_int_reset );
94static TIMER_CALLBACK( rtc_tick );
95static READ32_HANDLER( ps_rtc_r );
96static WRITE32_HANDLER( ps_rtc_w );
97
9098typedef struct
9199{
92100   UINT32 control;
r6276r6277
131139   UINT32 count;
132140   UINT32 control;
133141   emu_timer *timer;
142   emu_timer *int_reset_timer; // Probably not right
134143} ps_timer_t;
135144
136145typedef struct
r6276r6277
153162   UINT32 time;
154163   UINT32 date;
155164   emu_timer *timer;
165   emu_timer *int_timer;
156166} ps_rtc_regs_t;
157167
158168static ps_ftlb_regs_t ftlb_regs;
r6276r6277
487497   }
488498}
489499
500static TIMER_CALLBACK( rtc_int_reset )
501{
502   ps_intc_set_interrupt_line(machine, PS_INT_RTC, 0); // Probably not right
503}
504
490505static TIMER_CALLBACK( rtc_tick )
491506{
492507   ps_intc_set_interrupt_line(machine, PS_INT_RTC, 1);
493508   timer_adjust_oneshot(rtc_regs.timer, ATTOTIME_IN_HZ(1), 0);
509   timer_adjust_oneshot(rtc_regs.int_timer, ATTOTIME_IN_HZ(10000), 0); // Probably not right
494510}
495511
496512static READ32_HANDLER( ps_rtc_r )
r6276r6277
504520         verboselog(space->machine, 0, "ps_rtc_r: RTC Control = %08x & %08x\n", rtc_regs.control, mem_mask );
505521         return rtc_regs.control;
506522      case 0x0008/4:
507         verboselog(space->machine, 0, "ps_rtc_r: RTC Time = %08x & %08x\n", 0x01010101, mem_mask );
508         return 0x01010101;
523         verboselog(space->machine, 0, "ps_rtc_r: RTC Time = %08x & %08x\n", 0x01000000, mem_mask );
524         return 0x01000000;
509525      case 0x000c/4:
510         verboselog(space->machine, 0, "ps_rtc_r: RTC Date = %08x & %08x\n", 0x00990101, mem_mask );
526         verboselog(space->machine, 0, "ps_rtc_r: RTC Date = %08x & %08x\n", 0x19990101, mem_mask );
511527         return 0x00990101;
512528      default:
513529         verboselog(space->machine, 0, "ps_rtc_r: Unknown Register %08x & %08x\n", 0x0b800000 + (offset << 2), mem_mask );
r6276r6277
550566   AM_RANGE(0x0a800000, 0x0a80002b) AM_READWRITE(ps_timer_r, ps_timer_w)
551567   AM_RANGE(0x0b000000, 0x0b000007) AM_READWRITE(ps_clock_r, ps_clock_w)
552568   AM_RANGE(0x0b800000, 0x0b80000f) AM_READWRITE(ps_rtc_r, ps_rtc_w)
569   AM_RANGE(0x0d000100, 0x0d00017f) AM_RAM AM_BASE(&lcd_buffer)
553570/*  AM_RANGE(0x02000000, 0x0201ffff) Flash ROM
554571    AM_RANGE(0x08000000, 0x0801ffff) Same as 0x02 above. Mirrors every 128KB.
555572    AM_RANGE(0x0b000000, 0x0b000003) Internal CPU Clock control
r6276r6277
576593
577594   rtc_regs.timer = timer_alloc(machine, rtc_tick, 0);
578595   timer_adjust_oneshot(rtc_regs.timer, attotime_never, index);
596
597   rtc_regs.int_timer = timer_alloc(machine, rtc_int_reset, 0);
598   timer_adjust_oneshot(rtc_regs.int_timer, attotime_never, index);
579599}
580600
581601static MACHINE_RESET( pockstat )
r6276r6277
583603   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), REG_GENPC, 0x4000000);
584604}
585605
586static VIDEO_START( pockstat )
587{
588}
589
590606static VIDEO_UPDATE( pockstat )
591607{
608   int x = 0;
609   int y = 0;
610   for(y = 0; y < 32; y++)
611   {
612      UINT32 *scanline = BITMAP_ADDR32(bitmap, y, 0);
613      for(x = 0; x < 32; x++)
614      {
615         if(lcd_buffer[y] & (1 << x))
616         {
617            scanline[x] = 0x00000000;
618         }
619         else
620         {
621            scanline[x] = 0x00ffffff;
622         }
623      }
624   }
592625   return 0;
593626}
594627
r6276r6277
604637   MDRV_SCREEN_ADD("screen", LCD)
605638   MDRV_SCREEN_REFRESH_RATE(50)
606639   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
607   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
640   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
608641   MDRV_SCREEN_SIZE(32, 32)
609642   MDRV_SCREEN_VISIBLE_AREA(0, 32-1, 0, 32-1)
610643   MDRV_PALETTE_LENGTH(2)
611644   MDRV_PALETTE_INIT(black_and_white)
612645
613   MDRV_VIDEO_START(pockstat)
646   MDRV_VIDEO_START(generic_bitmapped)
614647   MDRV_VIDEO_UPDATE(pockstat)
615648MACHINE_DRIVER_END
616649

Previous 15994 Revisions Next


© 1998-2018 The MESS Team