/*
	Timer speed setting routines
	Made by Ismo Horppu on 1996 - 1997
*/

#include <dos.h>
#include "types.h"

// 1193180 / timer per second
void set_timer_speed (WORD Speed)
{
	outportb (0x43, 0x36);
	outportb (0x40, Speed & 0xFF);
	outportb (0x40, Speed >> 8);
}

// sets ticks per second
void set_timer_TPS (WORD tps)
{
	if (tps != 0){
		set_timer_speed ((WORD) (1193180 / tps));
	}
}