System C2 didn't entirely like those last changes. 3834/2612 difference? (nw)

This commit is contained in:
R. Belmont 2014-04-20 00:56:47 +00:00
parent 48015e84ca
commit aa69cf772a

View File

@ -908,16 +908,40 @@ INLINE void set_timers( FM_OPN *OPN, FM_ST *ST, void *n, int v )
/* External timer handler */ /* External timer handler */
if (ST->timer_handler) (ST->timer_handler)(n,0,ST->TAC * ST->timer_prescaler,ST->clock); if (ST->timer_handler) (ST->timer_handler)(n,0,ST->TAC * ST->timer_prescaler,ST->clock);
} }
else if (!(v & 1))
{
if( ST->TAC != 0 )
{
ST->TAC = 0;
if (ST->timer_handler) (ST->timer_handler)(n,0,0,ST->clock);
}
}
if ((v&2) && !(ST->mode&2)) if ((v&2) && !(ST->mode&2))
{ {
ST->TBC = ( 256-ST->TB)<<4; ST->TBC = ( 256-ST->TB)<<4;
/* External timer handler */ /* External timer handler */
if (ST->timer_handler) (ST->timer_handler)(n,1,ST->TBC * ST->timer_prescaler,ST->clock); if (ST->timer_handler) (ST->timer_handler)(n,1,ST->TBC * ST->timer_prescaler,ST->clock);
} }
else if (!(v & 2))
{
if( ST->TBC != 0 )
{
ST->TBC = 0;
if (ST->timer_handler) (ST->timer_handler)(n,1,0,ST->clock);
}
}
/* reset Timers flags */ /* reset Timers flags */
ST->status &= (~v >> 4); ST->status &= (~v >> 4);
/* if IRQ should be lowered now, do so */
if ( (ST->irq) && !(ST->status & ST->irqmask) )
{
ST->irq = 0;
/* callback user interrupt handler (IRQ is ON to OFF) */
if(ST->IRQ_Handler) (ST->IRQ_Handler)(ST->param, 0);
}
ST->mode = v; ST->mode = v;
} }