src/mess/drivers/cdi.c
| r6276 | r6277 | |
| 4238 | 4238 | PORT_BIT(0xfc, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 4239 | 4239 | |
| 4240 | 4240 | 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" ) |
| 4267 | 4267 | INPUT_PORTS_END |
| 4268 | 4268 | |
| 4269 | 4269 | static MACHINE_RESET( cdi ) |
src/mess/drivers/pockstat.c
| r6276 | r6277 | |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | static UINT32 *lcd_buffer; |
| 72 | |
| 71 | 73 | // Flash TLB |
| 72 | 74 | static READ32_HANDLER( ps_ftlb_r ); |
| 73 | 75 | static WRITE32_HANDLER( ps_ftlb_w ); |
| r6276 | r6277 | |
| 87 | 89 | static READ32_HANDLER( ps_clock_r ); |
| 88 | 90 | static WRITE32_HANDLER( ps_clock_w ); |
| 89 | 91 | |
| 92 | // RTC |
| 93 | static TIMER_CALLBACK( rtc_int_reset ); |
| 94 | static TIMER_CALLBACK( rtc_tick ); |
| 95 | static READ32_HANDLER( ps_rtc_r ); |
| 96 | static WRITE32_HANDLER( ps_rtc_w ); |
| 97 | |
| 90 | 98 | typedef struct |
| 91 | 99 | { |
| 92 | 100 | UINT32 control; |
| r6276 | r6277 | |
| 131 | 139 | UINT32 count; |
| 132 | 140 | UINT32 control; |
| 133 | 141 | emu_timer *timer; |
| 142 | emu_timer *int_reset_timer; // Probably not right |
| 134 | 143 | } ps_timer_t; |
| 135 | 144 | |
| 136 | 145 | typedef struct |
| r6276 | r6277 | |
| 153 | 162 | UINT32 time; |
| 154 | 163 | UINT32 date; |
| 155 | 164 | emu_timer *timer; |
| 165 | emu_timer *int_timer; |
| 156 | 166 | } ps_rtc_regs_t; |
| 157 | 167 | |
| 158 | 168 | static ps_ftlb_regs_t ftlb_regs; |
| r6276 | r6277 | |
| 487 | 497 | } |
| 488 | 498 | } |
| 489 | 499 | |
| 500 | static TIMER_CALLBACK( rtc_int_reset ) |
| 501 | { |
| 502 | ps_intc_set_interrupt_line(machine, PS_INT_RTC, 0); // Probably not right |
| 503 | } |
| 504 | |
| 490 | 505 | static TIMER_CALLBACK( rtc_tick ) |
| 491 | 506 | { |
| 492 | 507 | ps_intc_set_interrupt_line(machine, PS_INT_RTC, 1); |
| 493 | 508 | 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 |
| 494 | 510 | } |
| 495 | 511 | |
| 496 | 512 | static READ32_HANDLER( ps_rtc_r ) |
| r6276 | r6277 | |
| 504 | 520 | verboselog(space->machine, 0, "ps_rtc_r: RTC Control = %08x & %08x\n", rtc_regs.control, mem_mask ); |
| 505 | 521 | return rtc_regs.control; |
| 506 | 522 | 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; |
| 509 | 525 | 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 ); |
| 511 | 527 | return 0x00990101; |
| 512 | 528 | default: |
| 513 | 529 | verboselog(space->machine, 0, "ps_rtc_r: Unknown Register %08x & %08x\n", 0x0b800000 + (offset << 2), mem_mask ); |
| r6276 | r6277 | |
| 550 | 566 | AM_RANGE(0x0a800000, 0x0a80002b) AM_READWRITE(ps_timer_r, ps_timer_w) |
| 551 | 567 | AM_RANGE(0x0b000000, 0x0b000007) AM_READWRITE(ps_clock_r, ps_clock_w) |
| 552 | 568 | AM_RANGE(0x0b800000, 0x0b80000f) AM_READWRITE(ps_rtc_r, ps_rtc_w) |
| 569 | AM_RANGE(0x0d000100, 0x0d00017f) AM_RAM AM_BASE(&lcd_buffer) |
| 553 | 570 | /* AM_RANGE(0x02000000, 0x0201ffff) Flash ROM |
| 554 | 571 | AM_RANGE(0x08000000, 0x0801ffff) Same as 0x02 above. Mirrors every 128KB. |
| 555 | 572 | AM_RANGE(0x0b000000, 0x0b000003) Internal CPU Clock control |
| r6276 | r6277 | |
| 576 | 593 | |
| 577 | 594 | rtc_regs.timer = timer_alloc(machine, rtc_tick, 0); |
| 578 | 595 | 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); |
| 579 | 599 | } |
| 580 | 600 | |
| 581 | 601 | static MACHINE_RESET( pockstat ) |
| r6276 | r6277 | |
| 583 | 603 | cpu_set_reg(cputag_get_cpu(machine, "maincpu"), REG_GENPC, 0x4000000); |
| 584 | 604 | } |
| 585 | 605 | |
| 586 | | static VIDEO_START( pockstat ) |
| 587 | | { |
| 588 | | } |
| 589 | | |
| 590 | 606 | static VIDEO_UPDATE( pockstat ) |
| 591 | 607 | { |
| 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 | } |
| 592 | 625 | return 0; |
| 593 | 626 | } |
| 594 | 627 | |
| r6276 | r6277 | |
| 604 | 637 | MDRV_SCREEN_ADD("screen", LCD) |
| 605 | 638 | MDRV_SCREEN_REFRESH_RATE(50) |
| 606 | 639 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 607 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 640 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 608 | 641 | MDRV_SCREEN_SIZE(32, 32) |
| 609 | 642 | MDRV_SCREEN_VISIBLE_AREA(0, 32-1, 0, 32-1) |
| 610 | 643 | MDRV_PALETTE_LENGTH(2) |
| 611 | 644 | MDRV_PALETTE_INIT(black_and_white) |
| 612 | 645 | |
| 613 | | MDRV_VIDEO_START(pockstat) |
| 646 | MDRV_VIDEO_START(generic_bitmapped) |
| 614 | 647 | MDRV_VIDEO_UPDATE(pockstat) |
| 615 | 648 | MACHINE_DRIVER_END |
| 616 | 649 | |