After debugging rom, i think it comes from the interrupt management on vdp side, in particular the way interrupt are masked/unmasked.
At start my code was :
Code: Select all
When 68k write into vdp register :
case 0x00: /* CTRL #1 */
if (hint_pending && !(d & 0x10))
{
hint_pending = 0;
updateIRQLine();
}
if (!(d & 0x02)) hc_latch = -1;
break;
case 0x01: /* CTRL #2 */
if (vint_pending && !(d & 0x20))
{
vint_pending = 0;
updateIRQLine();
}
void Vdp::updateIRQLine()
{
if (vint_pending && (reg[1] & 0x20))
{
controller->vdpInterrupt(VDP_V_INT_LEVEL);
status |= 0x0080; /* V interrupt happened*/
return;
}
if (hint_pending && (reg[0] & 0x10))
{
controller->vdpInterrupt(VDP_H_INT_LEVEL);
return;
}
return;
}

-> The first line of sega top logo wasn't displayed

-> The top of the sky was wrong in 2 screen
The IRQ Line was updated only when interrupt was masked by 68k.
So i correct and change the code (temporary code not optimized).
Code: Select all
case 0x00: /* CTRL #1 */
if ((d & 0x10) != (reg[0] & 0x10))
{
if(d & 0x10) reg[0] |= 0x10;
else reg[0] &= 0xEF;
updateIRQLine();
}
if (!(d & 0x02)) hc_latch = -1;
break;
case 0x01: /* CTRL #2 */
if ((d & 0x20) != (reg[1] & 0x20))
{
if(d & 0x20) reg[1] |= 0x20;
else reg[1] &= 0xDF;
updateIRQLine();
}
But the bug in top of the sky isn't gone. The only difference is that it flashes (some frame present and other frames not present).
Are they something specifics for this games to take in account?
How long does an interrupt remains active when it's masked vdp side?
When an interrupt is masked is the interrupt pending cleared?
Thank you for all informations
