mirror of
https://github.com/holub/mame
synced 2025-07-03 17:08:39 +03:00
Implemented uPD7801 timers.
This commit is contained in:
parent
e66fe1dad7
commit
22c5856130
@ -9457,3 +9457,14 @@ static void STM(upd7810_state *cpustate)
|
|||||||
{
|
{
|
||||||
cpustate->ovc0 = ( ( TMM & 0x04 ) ? 16 * 8 : 8 ) * TM0;
|
cpustate->ovc0 = ( ( TMM & 0x04 ) ? 16 * 8 : 8 ) * TM0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void STM_7801(upd7810_state *cpustate)
|
||||||
|
{
|
||||||
|
/* Set the timer flip/fliop */
|
||||||
|
TO = 1;
|
||||||
|
if ( cpustate->config.io_callback)
|
||||||
|
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
|
||||||
|
|
||||||
|
/* Reload the timer */
|
||||||
|
cpustate->ovc0 = 16 * ( TM0 + ( ( TM1 & 0x0f ) << 8 ) );
|
||||||
|
}
|
||||||
|
@ -1043,6 +1043,7 @@ static void INR_A_7801(upd7810_state *cpustate);
|
|||||||
static void INR_B_7801(upd7810_state *cpustate);
|
static void INR_B_7801(upd7810_state *cpustate);
|
||||||
static void INR_C_7801(upd7810_state *cpustate);
|
static void INR_C_7801(upd7810_state *cpustate);
|
||||||
static void INRW_wa_7801(upd7810_state *cpustate);
|
static void INRW_wa_7801(upd7810_state *cpustate);
|
||||||
|
static void STM_7801(upd7810_state *cpustate);
|
||||||
|
|
||||||
|
|
||||||
static const struct opcode_s op48[256] =
|
static const struct opcode_s op48[256] =
|
||||||
@ -4645,7 +4646,7 @@ static const struct opcode_s opXX_7801[256] =
|
|||||||
{INX_BC, 1, 7, 7,L0|L1}, {DCX_BC, 1, 7, 7,L0|L1},
|
{INX_BC, 1, 7, 7,L0|L1}, {DCX_BC, 1, 7, 7,L0|L1},
|
||||||
{LXI_B_w, 3,10,10,L0|L1}, {ORIW_wa_xx, 3,16,16,L0|L1},
|
{LXI_B_w, 3,10,10,L0|L1}, {ORIW_wa_xx, 3,16,16,L0|L1},
|
||||||
{XRI_A_xx, 2, 7, 7,L0|L1}, {ORI_A_xx, 2, 7, 7,L0|L1},
|
{XRI_A_xx, 2, 7, 7,L0|L1}, {ORI_A_xx, 2, 7, 7,L0|L1},
|
||||||
{RETS, 1,11,11,L0|L1}, {STM, 1, 4, 4,L0|L1},
|
{RETS, 1,11,11,L0|L1}, {STM_7801, 1, 4, 4,L0|L1},
|
||||||
{MOV_B_A, 1, 4, 4,L0|L1}, {MOV_C_A, 1, 4, 4,L0|L1},
|
{MOV_B_A, 1, 4, 4,L0|L1}, {MOV_C_A, 1, 4, 4,L0|L1},
|
||||||
{MOV_D_A, 1, 4, 4,L0|L1}, {MOV_E_A, 1, 4, 4,L0|L1},
|
{MOV_D_A, 1, 4, 4,L0|L1}, {MOV_E_A, 1, 4, 4,L0|L1},
|
||||||
{MOV_H_A, 1, 4, 4,L0|L1}, {MOV_L_A, 1, 4, 4,L0|L1},
|
{MOV_H_A, 1, 4, 4,L0|L1}, {MOV_L_A, 1, 4, 4,L0|L1},
|
||||||
|
@ -1654,9 +1654,27 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//static void upd7801_timers(upd7810_state *cpustate, int cycles)
|
static void upd7801_timers(upd7810_state *cpustate, int cycles)
|
||||||
//{
|
{
|
||||||
//}
|
if ( cpustate->ovc0 )
|
||||||
|
{
|
||||||
|
cpustate->ovc0 -= cycles;
|
||||||
|
|
||||||
|
/* Check if timer expired */
|
||||||
|
if ( cpustate->ovc0 <= 0 )
|
||||||
|
{
|
||||||
|
IRR |= INTFT0;
|
||||||
|
|
||||||
|
/* Reset the timer flip/fliop */
|
||||||
|
TO = 0;
|
||||||
|
if ( cpustate->config.io_callback)
|
||||||
|
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
|
||||||
|
|
||||||
|
/* Reload the timer */
|
||||||
|
cpustate->ovc0 = 16 * ( TM0 + ( ( TM1 & 0x0f ) << 8 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void upd78c05_timers(upd7810_state *cpustate, int cycles)
|
static void upd78c05_timers(upd7810_state *cpustate, int cycles)
|
||||||
{
|
{
|
||||||
@ -1821,6 +1839,8 @@ static CPU_RESET( upd7801 )
|
|||||||
cpustate->op70 = op70_7801;
|
cpustate->op70 = op70_7801;
|
||||||
cpustate->op74 = op74_7801;
|
cpustate->op74 = op74_7801;
|
||||||
cpustate->opXX = opXX_7801;
|
cpustate->opXX = opXX_7801;
|
||||||
|
cpustate->handle_timers = upd7801_timers;
|
||||||
|
cpustate->ovc0 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CPU_RESET( upd78c05 )
|
static CPU_RESET( upd78c05 )
|
||||||
|
Loading…
Reference in New Issue
Block a user