To Gulikoza: My modifications to your timesync need to be improved. I am trying to get dosbox running at max without bothering with cycles.
In your timesync patch it is needed to set cycles to high value. But if cycles value is very high dosbox becomes overloaded and slow. Therefore manual cycles adjustment is needed and I am trying to avoid this.
Also host CPU load must be not 100% because if it is 100% the keys start to stick at my old K6-2.
Currently I dynamically set cycles to 4/3 of the last actual cycles executed. But it doesnt work well in all cases...
Here is my current code:
- Code: Select all
static Bitu Normal_Loop(void) {
Bits ret,NewTicks;
while (1) {
if (PIC_RunQueue()) {
// code start
if((CPU_TimeSynched) || (showcycles)) {
NewTicks=GetTicks();
if ((CPU_TimeSynched) && (NewTicks!=LastTicks))
CPU_Cycles=0;
if (NewTicks >= Ticks) {
Ticks=NewTicks + 512; // next update in 512ms
CPU_CyclesCur=(cycle_count-CPU_CyclesCur) >> 9;
if (CPU_TimeSynched && CPU_CyclesCur > 500)
CPU_CycleMax=CPU_CyclesCur*4/3;
if (showcycles) {
frames*=1.95; // compensate for 512ms interval
GFX_SetTitle(CPU_CycleMax,-1,false);
frames=0;
}
CPU_CyclesCur=cycle_count;
}
}
// code end
ret=(*cpudecoder)();
Any suggestions?