Make effect of I/O delay more consistent as cycles run out. Prevents flickering in NBA Jam Tournament Edition at higher cycles, and also improves automatic speed limiting in Quake.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4215
This commit is contained in:
parent
911cc38865
commit
139456b2d0
1 changed files with 2 additions and 2 deletions
|
@ -208,14 +208,14 @@ inline void IO_USEC_write_delay_old() {
|
|||
|
||||
inline void IO_USEC_read_delay() {
|
||||
Bits delaycyc = CPU_CycleMax/IODELAY_READ_MICROSk;
|
||||
if(GCC_UNLIKELY(CPU_Cycles < 3*delaycyc)) delaycyc = 0; //Else port acces will set cycles to 0. which might trigger problem with games which read 16 bit values
|
||||
if(GCC_UNLIKELY(delaycyc > CPU_Cycles)) delaycyc = CPU_Cycles;
|
||||
CPU_Cycles -= delaycyc;
|
||||
CPU_IODelayRemoved += delaycyc;
|
||||
}
|
||||
|
||||
inline void IO_USEC_write_delay() {
|
||||
Bits delaycyc = CPU_CycleMax/IODELAY_WRITE_MICROSk;
|
||||
if(GCC_UNLIKELY(CPU_Cycles < 3*delaycyc)) delaycyc=0;
|
||||
if(GCC_UNLIKELY(delaycyc > CPU_Cycles)) delaycyc = CPU_Cycles;
|
||||
CPU_Cycles -= delaycyc;
|
||||
CPU_IODelayRemoved += delaycyc;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue