Latest changes (please port this to MESS, tia)

This commit is contained in:
Angelo Salese 2011-06-11 19:25:53 +00:00
parent 17e86ecdf7
commit 5d2798215c
3 changed files with 17 additions and 6 deletions

View File

@ -2578,6 +2578,9 @@ VBLANK-IN is used at the end of the vblank period.
SCU register[36] is the timer zero compare register.
SCU register[40] is for IRQ masking.
TODO:
- VDP1 timing and CEF emulation isn't accurate at all.
*/
@ -2598,9 +2601,17 @@ static TIMER_DEVICE_CALLBACK( saturn_scanline )
//popmessage("%08x %d %08x %08x",state->m_scu_regs[40] ^ 0xffffffff,max_y,state->m_scu_regs[36],state->m_scu_regs[38]);
if(scanline == 0*y_step)
{
device_set_input_line_and_vector(state->m_maincpu, 0xe, (stv_irq.vblank_out) ? HOLD_LINE : CLEAR_LINE , 0x41);
//CEF_0; //TODO
}
else if(scanline == vblank_line*y_step)
{
device_set_input_line_and_vector(state->m_maincpu, 0xf, (stv_irq.vblank_in) ? HOLD_LINE : CLEAR_LINE , 0x40);
if(stv_irq.vdp1_end)
device_set_input_line_and_vector(state->m_maincpu, 0x2, HOLD_LINE, 0x4d);
CEF_1;
}
else if((scanline % y_step) == 0 && scanline < vblank_line*y_step)
device_set_input_line_and_vector(state->m_maincpu, 0xd, (stv_irq.hblank_in) ? HOLD_LINE : CLEAR_LINE, 0x42);
@ -2611,8 +2622,6 @@ static TIMER_DEVICE_CALLBACK( saturn_scanline )
if(scanline == (state->m_scu_regs[36] & 0x3ff)*y_step)
device_set_input_line_and_vector(state->m_maincpu, 0xc, (stv_irq.timer_0) ? HOLD_LINE : CLEAR_LINE, 0x43 );
if(scanline == 64) //TODO: emulate the timing of this
device_set_input_line_and_vector(state->m_maincpu, 0x2, (stv_irq.vdp1_end) ? HOLD_LINE : CLEAR_LINE, 0x4d);
}
static READ32_HANDLER( saturn_cart_dram0_r )

View File

@ -96,6 +96,8 @@ public:
#define MASTER_CLOCK_352 57272800
#define MASTER_CLOCK_320 53748200
#define CEF_1 state->m_vdp1_regs[0x010/4]|=0x00020000
#define CEF_0 state->m_vdp1_regs[0x010/4]&=~0x00020000
DRIVER_INIT ( stv );

View File

@ -154,8 +154,6 @@ struct shaded_point
#define STV_VDP1_EDSR ((state->m_vdp1_regs[0x010/4] >> 16)&0x0000ffff)
#define STV_VDP1_CEF (STV_VDP1_EDSR & 2)
#define STV_VDP1_BEF (STV_VDP1_EDSR & 1)
#define CEF_1 state->m_vdp1_regs[0x010/4]|=0x00020000
#define CEF_0 state->m_vdp1_regs[0x010/4]&=~0x00020000
/**/
@ -347,6 +345,7 @@ WRITE32_HANDLER ( saturn_vdp1_framebuffer0_w )
if ( STV_VDP1_TVM & 1 )
{
/* 8-bit mode */
printf("%08x %02x\n",offset,data);
}
else
{
@ -370,6 +369,7 @@ READ32_HANDLER ( saturn_vdp1_framebuffer0_r )
if ( STV_VDP1_TVM & 1 )
{
/* 8-bit mode */
printf("%08x\n",offset);
}
else
{
@ -1768,7 +1768,7 @@ static void stv_vdp1_process_list(running_machine &machine)
stv_clear_gouraud_shading();
/*Set CEF bit to 0*/
CEF_0;
//CEF_0;
while (spritecount<10000) // if its drawn this many sprites something is probably wrong or sega were crazy ;-)
{
@ -1978,7 +1978,7 @@ static void stv_vdp1_process_list(running_machine &machine)
end:
/*set CEF to 1*/
CEF_1;
//CEF_1;
/* not here! this is done every frame drawn even if the cpu isn't running eg in the debugger */
// if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/