Reply 740 of 742, by superfury
Fixed an issue with an x86 CPU locking the bus for any reason while the BIU is still processing a transfer (usually on it's final tick of the T1-T4 or T1-T2 or T1 ticks). When requesting a bus lock, the main condition is that the bus is idle, which might not be the case (for example a 386 on T2 before having ticked said T2 but having returned it's data result to the EU already, as it's processed first).
In this case, the main CPU execution detects that a bus lock is requested while the bus processing is still active and the BIU isn't requested by the EU to tick more cycles. If this condition is detected, the BIU is forced to tick single cycles anyway to force it to become idle properly before the main loop of the emulation grants the bus lock to the BIU.
When the BIU itself requests the bus lock, this is unaffected. But when the EU requests a bus lock (for a descriptor load or paging lookup from a TLB miss) this case might trigger if the EU leaves the BIU in an unfinished state (not yet having finished it's memory T4(80(1)86/T2([2/3]86)/T1(486+) cycles).
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io