FIFO: Oops! Fix a bug that snuck in from commit 31851c2.

- In practice, no games seemed to be affected by this bug, but even so, this fix is correct.
- While technically unnecessary, when the index is singly incremented, it's better to hard reset an overrunning index to zero in order to improve the theoretical stability of the code.
This commit is contained in:
rogerman 2021-09-13 10:42:39 -07:00
parent ad64e73bb2
commit fffa7ebb8c
1 changed files with 3 additions and 3 deletions

View File

@ -343,9 +343,9 @@ void DISP_FIFOsend_u32(u32 val)
disp_fifo.buf[disp_fifo.tail] = val;
disp_fifo.tail++;
if (disp_fifo.head >= 0x6000)
if (disp_fifo.tail >= 0x6000)
{
disp_fifo.head -= 0x6000;
disp_fifo.tail = 0;
}
}
@ -357,7 +357,7 @@ u32 DISP_FIFOrecv_u32()
disp_fifo.head++;
if (disp_fifo.head >= 0x6000)
{
disp_fifo.head -= 0x6000;
disp_fifo.head = 0;
}
return val;