Fix rirq_sort when called from within interrupt
This commit is contained in:
parent
c12bca7b4e
commit
907452d918
|
@ -591,7 +591,7 @@ void rirq_wait(void)
|
||||||
npos++;
|
npos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rirq_sort(void)
|
void rirq_sort(bool inirq)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
byte maxr = rasterIRQRows[rasterIRQIndex[1]];
|
byte maxr = rasterIRQRows[rasterIRQIndex[1]];
|
||||||
|
@ -641,11 +641,16 @@ void rirq_sort(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
npos++;
|
npos++;
|
||||||
|
if (inirq)
|
||||||
|
nextIRQ = NUM_IRQS - 1;
|
||||||
|
else
|
||||||
|
{
|
||||||
nextIRQ = 0;
|
nextIRQ = 0;
|
||||||
byte yp = rasterIRQNext[nextIRQ];
|
byte yp = rasterIRQNext[nextIRQ];
|
||||||
if (yp != 0xff)
|
if (yp != 0xff)
|
||||||
vic.raster = yp - 1;
|
vic.raster = yp - 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void rirq_start(void)
|
void rirq_start(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -180,7 +180,8 @@ void rirq_stop(void);
|
||||||
|
|
||||||
// Sort the raster IRQ, must be performed at the end of the frame after changing
|
// Sort the raster IRQ, must be performed at the end of the frame after changing
|
||||||
// the vertical position of one of the interrupt operatins.
|
// the vertical position of one of the interrupt operatins.
|
||||||
void rirq_sort(void);
|
// Set the inirq flag to true when calling this from an interrupt
|
||||||
|
void rirq_sort(bool inirq = false);
|
||||||
|
|
||||||
// Wait for the last raster IRQ op to have completed. Must be called before a
|
// Wait for the last raster IRQ op to have completed. Must be called before a
|
||||||
// sort if the raster IRQ system is active
|
// sort if the raster IRQ system is active
|
||||||
|
|
Loading…
Reference in New Issue