From e77c1f2971703e2943d6592a73d1ce3ba3eac466 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Fri, 23 Aug 2013 23:33:12 +0000 Subject: [PATCH] Corrected refresh rate --- src/mame/drivers/naomi.c | 2 +- src/mame/video/powervr2.c | 7 ++++++- src/mess/drivers/dccons.c | 25 ++++++++++++++++++++++--- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index 23b525e1dbd..458ebc5d376 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -2499,7 +2499,7 @@ static MACHINE_CONFIG_START( naomi_aw_base, naomi_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(CPU_CLOCK/2/4, 820, 0, 640, 532, 0, 480) /* TODO: PVR is clocked at 100 MHz, pixel clock is guessed to be /4 so ~57 fps. */ + MCFG_SCREEN_RAW_PARAMS(13458568*2, 820, 0, 640, 532, 0, 480) /* TODO: where pclk actually comes? */ MCFG_SCREEN_UPDATE_DEVICE("powervr2", powervr2_device, screen_update) MCFG_PALETTE_LENGTH(0x1000) MCFG_POWERVR2_ADD("powervr2", WRITE8(dc_state, pvr_irq)) diff --git a/src/mame/video/powervr2.c b/src/mame/video/powervr2.c index 55ffde7e14c..db2dcfd889f 100644 --- a/src/mame/video/powervr2.c +++ b/src/mame/video/powervr2.c @@ -1450,6 +1450,8 @@ WRITE32_MEMBER( powervr2_device::palette_w ) void powervr2_device::update_screen_format() { + INT32 spg_hsize = spg_load & 0x3ff; + INT32 spg_vsize = (spg_load >> 16) & 0x3ff; INT32 spg_hbstart = spg_hblank & 0x3ff; INT32 spg_hbend = (spg_hblank >> 16) & 0x3ff; INT32 spg_vbstart = spg_vblank & 0x3ff; @@ -1457,6 +1459,8 @@ void powervr2_device::update_screen_format() INT32 vo_horz_start_pos = vo_startx & 0x3ff; INT32 vo_vert_start_pos_f1 = vo_starty & 0x3ff; + attoseconds_t refresh = HZ_TO_ATTOSECONDS(13458568*2) * spg_hsize * spg_vsize; + rectangle visarea = m_screen->visible_area(); /* FIXME: right visible area calculations aren't known yet*/ visarea.min_x = 0; @@ -1464,7 +1468,7 @@ void powervr2_device::update_screen_format() visarea.min_y = 0; visarea.max_y = ((spg_vbstart - spg_vbend - vo_vert_start_pos_f1) <= 0x100 ? 240 : 480) - 1; - m_screen->configure(spg_hbstart, spg_vbstart, visarea, m_screen->frame_period().attoseconds ); + m_screen->configure(spg_hsize, spg_vsize, visarea, refresh ); } @@ -2572,6 +2576,7 @@ void powervr2_device::pvr_drawframebuffer(bitmap_rgb32 &bitmap,const rectangle & break; case 0x02: ; // 888 RGB 24-bit - suchie3 - HACKED, see pvr_accumulationbuffer_to_framebuffer! + popmessage("888RGB 24-bit mode used, contact MAME/MESSdev"); for (y=0;y <= dy;y++) { addrp = fb_r_sof1+y*xi*2; diff --git a/src/mess/drivers/dccons.c b/src/mess/drivers/dccons.c index 63d872308c7..f9b0584f207 100644 --- a/src/mess/drivers/dccons.c +++ b/src/mess/drivers/dccons.c @@ -1,7 +1,7 @@ /* dc.c - Sega Dreamcast driver - by R. Belmont + by R. Belmont & Angelo Salese SH-4 @ 200 MHz ARM7DI @ 2.8223 MHz (no T or M extensions) @@ -17,6 +17,18 @@ PCLKs = 26917135 (NTSC 480 @ 59.94), 26944080 (VGA 480 @ 60.0), 13458568 (NTSC 240 @ 59.94), 25925600 (PAL 480 @ 50.00), 13462800 (PAL 240 @ 50.00) + TODO: + - DC splash logo: video and audio are off-sync + - RTC error always pops up at start-up, tied to the aforementioned? + - Only JP games boots so far; + - Inputs doesn't work most of the time; + - Capcom vs. SNK Pro: asserts after VMU message + - F355 Challenge: asserts after Sega logo; + - Idol Janshi wo Tsukucchaou: pixel aspect is way wrong (stretched and offsetted horizontally) + - Power Stone: hangs at Capcom logo; + - Sega GT: hangs at "produced by Sega" screen; + - Tetris 4D: has color bugs, hangs at FMV anyway + */ #include "emu.h" @@ -95,7 +107,7 @@ READ64_MEMBER(dc_cons_state::dc_pdtra_r ) cable setting, (0-1) VGA, (2) TV RGB (3) TV VBS/Y + S/C. Note: several games doesn't like VGA setting (i.e. Idol Janshi wo Tsukucchaou, Airforce Delta), so hard-wire it to most common setting for now. */ - out |= 0x02 << 8; + out |= ioport("SCREEN_TYPE")->read() << 8; return out; } @@ -221,7 +233,7 @@ static MACHINE_CONFIG_START( dc, dc_cons_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(CPU_CLOCK/2/4, 820, 0, 640, 532, 0, 480) /* TODO: PVR is clocked at 100 MHz, pixel clock is guessed to be /4 so ~57 fps. */ + MCFG_SCREEN_RAW_PARAMS(13458568*2, 857, 0, 640, 524, 0, 480) /* TODO: where pclk actually comes? */ MCFG_SCREEN_UPDATE_DEVICE("powervr2", powervr2_device, screen_update) MCFG_PALETTE_LENGTH(0x1000) MCFG_POWERVR2_ADD("powervr2", WRITE8(dc_state, pvr_irq)) @@ -420,6 +432,13 @@ static INPUT_PORTS_START( dc ) PORT_DIPNAME( 0x01, 0x00, "Bilinear Filtering" ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + + PORT_START("SCREEN_TYPE") + PORT_CONFNAME( 0x03, 0x00, "Connection Type" ) + PORT_CONFSETTING( 0x00, "NTSC" ) + PORT_CONFSETTING( 0x01, "PAL" ) + PORT_CONFSETTING( 0x02, "VGA (0)" ) + PORT_CONFSETTING( 0x03, "VGA (1)" ) INPUT_PORTS_END