mirror of
https://github.com/holub/mame
synced 2025-05-13 17:38:21 +03:00
Attempt to add proper H/V latch settings
This commit is contained in:
parent
1758617657
commit
ac39e1dfd5
@ -5962,11 +5962,10 @@ READ16_MEMBER ( saturn_state::saturn_vdp2_regs_r )
|
|||||||
/* latch h/v signals through HV latch*/
|
/* latch h/v signals through HV latch*/
|
||||||
if(!STV_VDP2_EXLTEN)
|
if(!STV_VDP2_EXLTEN)
|
||||||
{
|
{
|
||||||
/* TODO: handle various h/v settings. */
|
|
||||||
if(!space.debugger_access())
|
if(!space.debugger_access())
|
||||||
{
|
{
|
||||||
m_vdp2.h_count = space.machine().primary_screen->hpos() & 0x3ff;
|
m_vdp2.h_count = get_hcounter();
|
||||||
m_vdp2.v_count = space.machine().primary_screen->vpos() & (STV_VDP2_LSMD == 3 ? 0x7ff : 0x3ff);
|
m_vdp2.v_count = get_vcounter();
|
||||||
/* latch flag */
|
/* latch flag */
|
||||||
m_vdp2.exltfg |= 1;
|
m_vdp2.exltfg |= 1;
|
||||||
}
|
}
|
||||||
@ -6253,6 +6252,55 @@ UINT8 saturn_state::get_odd_bit( void )
|
|||||||
return machine().primary_screen->frame_number() & 1;
|
return machine().primary_screen->frame_number() & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: these needs to be checked via HW tests! */
|
||||||
|
int saturn_state::get_hcounter( void )
|
||||||
|
{
|
||||||
|
int hcount;
|
||||||
|
|
||||||
|
hcount = machine().primary_screen->hpos();
|
||||||
|
|
||||||
|
switch(STV_VDP2_HRES & 6)
|
||||||
|
{
|
||||||
|
/* Normal */
|
||||||
|
case 0:
|
||||||
|
hcount &= 0x1ff;
|
||||||
|
hcount <<= 1;
|
||||||
|
break;
|
||||||
|
/* Hi-Res */
|
||||||
|
case 2:
|
||||||
|
hcount &= 0x3ff;
|
||||||
|
break;
|
||||||
|
/* Exclusive Normal*/
|
||||||
|
case 4:
|
||||||
|
hcount &= 0x1ff;
|
||||||
|
break;
|
||||||
|
/* Exclusive Hi-Res */
|
||||||
|
case 6:
|
||||||
|
hcount >>= 1;
|
||||||
|
hcount &= 0x1ff;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hcount;
|
||||||
|
}
|
||||||
|
|
||||||
|
int saturn_state::get_vcounter( void )
|
||||||
|
{
|
||||||
|
int vcount;
|
||||||
|
|
||||||
|
vcount = machine().primary_screen->vpos();
|
||||||
|
|
||||||
|
/* Exclusive Monitor */
|
||||||
|
if(STV_VDP2_HRES & 4)
|
||||||
|
return vcount & 0x3ff;
|
||||||
|
|
||||||
|
/* Double Density Interlace */
|
||||||
|
if((STV_VDP2_LSMD & 3) == 3)
|
||||||
|
return (vcount & ~1) | (machine().primary_screen->frame_number() & 1);
|
||||||
|
|
||||||
|
return (vcount << 1); // Non-interlace
|
||||||
|
}
|
||||||
|
|
||||||
void saturn_state::stv_vdp2_state_save_postload( void )
|
void saturn_state::stv_vdp2_state_save_postload( void )
|
||||||
{
|
{
|
||||||
UINT8 *gfxdata = m_vdp2.gfx_decode;
|
UINT8 *gfxdata = m_vdp2.gfx_decode;
|
||||||
|
@ -1532,7 +1532,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(saturn_state::saturn_scanline)
|
|||||||
|
|
||||||
//popmessage("%08x %d T0 %d T1 %d %08x",m_scu.ism ^ 0xffffffff,max_y,m_scu_regs[36],m_scu_regs[37],m_scu_regs[38]);
|
//popmessage("%08x %d T0 %d T1 %d %08x",m_scu.ism ^ 0xffffffff,max_y,m_scu_regs[36],m_scu_regs[37],m_scu_regs[38]);
|
||||||
|
|
||||||
if(scanline == (0)*y_step)
|
if(scanline == (vblank_line)*y_step)
|
||||||
{
|
{
|
||||||
video_update_vdp1();
|
video_update_vdp1();
|
||||||
|
|
||||||
|
@ -374,6 +374,8 @@ public:
|
|||||||
|
|
||||||
UINT8 get_vblank( void );
|
UINT8 get_vblank( void );
|
||||||
UINT8 get_hblank( void );
|
UINT8 get_hblank( void );
|
||||||
|
int get_hcounter( void );
|
||||||
|
int get_vcounter( void );
|
||||||
int get_vblank_duration( void );
|
int get_vblank_duration( void );
|
||||||
int get_hblank_duration( void );
|
int get_hblank_duration( void );
|
||||||
int get_pixel_clock( void );
|
int get_pixel_clock( void );
|
||||||
|
Loading…
Reference in New Issue
Block a user