mirror of
https://github.com/libretro/hatari.git
synced 2026-11-07 10:36:00 -10:00
For the Blitter, use a common function to propagate the state of the IRQ line to the MFP
This commit is contained in:
1 parent
28bebefedd
commit
ae138b94b3
3 files changed
+51
-5
No files matched your search
+41
-3
@@ -210,6 +210,8 @@ typedef struct
|
||||
uint16_t CountBusBlitter; /* To count bus accesses made by the blitter */
|
||||
uint16_t CountBusCpu; /* To count bus accesses made by the CPU */
|
||||
uint8_t ContinueLater; /* 0=false / 1=true */
|
||||
|
||||
uint8_t IRQ_Line; /* 0=IRQ set 1=IRQ cleared */
|
||||
} BLITTERSTATE;
|
||||
|
||||
|
||||
@@ -308,6 +310,43 @@ void Blitter_Reset ( void )
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/**
|
||||
* Set or reset the Blitter's IRQ line
|
||||
* IRQ signal is inverted (0/low irq set, 1/high irq cleared)
|
||||
*
|
||||
* The IRQ signal is connected to GPIP5 on the MFP on ST/STE
|
||||
*/
|
||||
static void Blitter_Set_Line_IRQ_MFP ( uint8_t bit )
|
||||
{
|
||||
uint8_t Line_State;
|
||||
|
||||
LOG_TRACE ( TRACE_BLITTER, "blitter set irq line val=%d (%s) VBL=%d HBL=%d\n" , bit , bit==BLITTER_IRQ_ON ? "on" : "off" , nVBLs , nHBL );
|
||||
|
||||
if ( bit == BLITTER_IRQ_ON )
|
||||
Line_State = MFP_GPIP_STATE_LOW;
|
||||
else
|
||||
Line_State = MFP_GPIP_STATE_HIGH;
|
||||
|
||||
BlitterState.IRQ_Line = Line_State;
|
||||
|
||||
MFP_GPIP_Set_Line_Input ( pMFP_Main , MFP_GPIP_LINE_GPU_DONE , Line_State );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/**
|
||||
* Return the value of the Blitter's IRQ line
|
||||
* IRQ signal is inverted (0/low irq set, 1/high irq cleared)
|
||||
*/
|
||||
uint8_t Blitter_Get_Line_IRQ_MFP ( void )
|
||||
{
|
||||
return BlitterState.IRQ_Line;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/**
|
||||
* Compute some stats for the blitter's usage during a period (eg one VBL)
|
||||
@@ -892,7 +931,7 @@ Video_GetPosition ( &FrameCycles , &HblCounterVideo , &LineCycles );
|
||||
BlitterPhase = BLITTER_PHASE_RUN_TRANSFER;
|
||||
|
||||
/* Busy=1, set line to high/1 and clear interrupt */
|
||||
MFP_GPIP_Set_Line_Input ( pMFP_Main , MFP_GPIP_LINE_GPU_DONE , MFP_GPIP_STATE_HIGH );
|
||||
Blitter_Set_Line_IRQ_MFP ( BLITTER_IRQ_OFF );
|
||||
|
||||
/* Now we enter the main blitting loop */
|
||||
do
|
||||
@@ -913,8 +952,7 @@ Video_GetPosition ( &FrameCycles , &HblCounterVideo , &LineCycles );
|
||||
BlitterRegs.ctrl &= ~(0x80|0x40);
|
||||
|
||||
/* Busy=0, set line to low/0 and request interrupt */
|
||||
MFP_GPIP_Set_Line_Input ( pMFP_Main , MFP_GPIP_LINE_GPU_DONE , MFP_GPIP_STATE_LOW );
|
||||
|
||||
Blitter_Set_Line_IRQ_MFP ( BLITTER_IRQ_ON );
|
||||
BlitterPhase = BLITTER_PHASE_STOP;
|
||||
|
||||
if ( BLITTER_RUN_CE )
|
||||
|
||||
@@ -11,9 +11,17 @@
|
||||
#define BLITTER_H
|
||||
|
||||
|
||||
#define BLITTER_IRQ_ON 0 /* O/low sets IRQ line */
|
||||
#define BLITTER_IRQ_OFF 1 /* 1/high clears IRQ line */
|
||||
|
||||
|
||||
extern uint16_t BlitterPhase;
|
||||
|
||||
extern void Blitter_Reset ( void );
|
||||
|
||||
|
||||
extern void Blitter_Reset ( void );
|
||||
extern uint8_t Blitter_Get_Line_IRQ_MFP ( void );
|
||||
|
||||
|
||||
extern void Blitter_StatsUpdateRate ( int period_cycles );
|
||||
extern int Blitter_StatsGetRate ( void );
|
||||
|
||||
@@ -327,7 +327,7 @@ Input -----/ | ------------------------ |
|
||||
0 : parallel port, busy signal (0=not busy, 1=busy)
|
||||
1 : rs232 port, data carrier detect (DCD) signal
|
||||
2 : rs232 port, clear to send (CTS) signal
|
||||
3 : STF/STE/TT : blitter, active low (0=IRQ set, 1=IRQ not set)
|
||||
3 : STF/STE : blitter, active low (0=IRQ set, 1=IRQ not set)
|
||||
Falcon : DSP, active low (0=HREQ set, 1=HREQ not set)
|
||||
4 : ACIAs 6850 (ikbd and midi), active low (0=IRQ set for ACIA 1 and/or 2, 1=IRQ not set for neither ACIA 1 nor 2)
|
||||
5 : FDC/HD, active low (0=IRQ set, 1=IRQ not set)
|
||||
|
||||
Reference in new issue
Block a user