Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

DOS fixed game speed cpu independent

$
0
0

Hi folks,

This is a question specific for you Dos game programmers:

I programmed a game and want it to run with a fixed speed weather it runs on a 286,386,486 cpu.

This is the code I used to maintain a fixed speed:

// set timer rate to default 
Change_Timer(TIMER_18HZ);
    
Old_Isr = _dos_getvect(TIME_KEEPER_INT);
_dos_setvect(TIME_KEEPER_INT, GameLoop);
 // GameLoop is the game loop function
    
while(!done);
	
// replace old ISR
_dos_setvect(TIME_KEEPER_INT, Old_Isr);

Under DosBox emulator and also under DosBox Magic for android phones it works pretty good with the same fixed

speed even when I changed cpu speeds.

The problem …


Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>