Corrected refresh rate

This commit is contained in:
Angelo Salese 2013-08-23 23:33:12 +00:00
parent 4f3f6d191e
commit e77c1f2971
3 changed files with 29 additions and 5 deletions

View File

@ -2499,7 +2499,7 @@ static MACHINE_CONFIG_START( naomi_aw_base, naomi_state )
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) 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_SCREEN_UPDATE_DEVICE("powervr2", powervr2_device, screen_update)
MCFG_PALETTE_LENGTH(0x1000) MCFG_PALETTE_LENGTH(0x1000)
MCFG_POWERVR2_ADD("powervr2", WRITE8(dc_state, pvr_irq)) MCFG_POWERVR2_ADD("powervr2", WRITE8(dc_state, pvr_irq))

View File

@ -1450,6 +1450,8 @@ WRITE32_MEMBER( powervr2_device::palette_w )
void powervr2_device::update_screen_format() 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_hbstart = spg_hblank & 0x3ff;
INT32 spg_hbend = (spg_hblank >> 16) & 0x3ff; INT32 spg_hbend = (spg_hblank >> 16) & 0x3ff;
INT32 spg_vbstart = spg_vblank & 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_horz_start_pos = vo_startx & 0x3ff;
INT32 vo_vert_start_pos_f1 = vo_starty & 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(); rectangle visarea = m_screen->visible_area();
/* FIXME: right visible area calculations aren't known yet*/ /* FIXME: right visible area calculations aren't known yet*/
visarea.min_x = 0; visarea.min_x = 0;
@ -1464,7 +1468,7 @@ void powervr2_device::update_screen_format()
visarea.min_y = 0; visarea.min_y = 0;
visarea.max_y = ((spg_vbstart - spg_vbend - vo_vert_start_pos_f1) <= 0x100 ? 240 : 480) - 1; 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; break;
case 0x02: ; // 888 RGB 24-bit - suchie3 - HACKED, see pvr_accumulationbuffer_to_framebuffer! 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++) for (y=0;y <= dy;y++)
{ {
addrp = fb_r_sof1+y*xi*2; addrp = fb_r_sof1+y*xi*2;

View File

@ -1,7 +1,7 @@
/* /*
dc.c - Sega Dreamcast driver dc.c - Sega Dreamcast driver
by R. Belmont by R. Belmont & Angelo Salese
SH-4 @ 200 MHz SH-4 @ 200 MHz
ARM7DI @ 2.8223 MHz (no T or M extensions) 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), 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) 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" #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. 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. 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; return out;
} }
@ -221,7 +233,7 @@ static MACHINE_CONFIG_START( dc, dc_cons_state )
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) 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_SCREEN_UPDATE_DEVICE("powervr2", powervr2_device, screen_update)
MCFG_PALETTE_LENGTH(0x1000) MCFG_PALETTE_LENGTH(0x1000)
MCFG_POWERVR2_ADD("powervr2", WRITE8(dc_state, pvr_irq)) 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_DIPNAME( 0x01, 0x00, "Bilinear Filtering" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) ) 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 INPUT_PORTS_END