Fixed UNIX compilation
This commit is contained in:
17
lib/timer.c
17
lib/timer.c
@ -1,29 +1,16 @@
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
#include <timer.h>
|
||||
#include <interrupts.h>
|
||||
#include <audio.h>
|
||||
#include <profileapi.h>
|
||||
|
||||
static timer_context ctx = {0};
|
||||
long long counts_per_cycle;
|
||||
long long last;
|
||||
long long now;
|
||||
|
||||
void timer_init() {
|
||||
ctx.div = 0XAC00;
|
||||
}
|
||||
|
||||
void timer_tick() {
|
||||
//while(now - last < counts_per_cycle){
|
||||
// LARGE_INTEGER current;
|
||||
// QueryPerformanceCounter(¤t);
|
||||
// now = current.QuadPart;
|
||||
//printf("Last-now: %lld, counts: %lld\n", now - last, counts_per_cycle);
|
||||
//}
|
||||
last = now;
|
||||
u16 prev_div = ctx.div;
|
||||
u16 prev_div = ctx.div;
|
||||
ctx.div++;
|
||||
bool timer_update = false;
|
||||
switch(ctx.tac & 0b11) {
|
||||
@ -107,4 +94,4 @@ u8 timer_read(u16 address) {
|
||||
|
||||
timer_context *timer_get_context() {
|
||||
return &ctx;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user