apu sortof working.
This commit is contained in:
15
lib/timer.c
15
lib/timer.c
@ -13,18 +13,15 @@ long long now;
|
||||
|
||||
void timer_init() {
|
||||
ctx.div = 0XAC00;
|
||||
LARGE_INTEGER freq;
|
||||
QueryPerformanceFrequency(&freq);
|
||||
counts_per_cycle = freq.QuadPart / (1 << 22);
|
||||
}
|
||||
|
||||
void timer_tick() {
|
||||
while(now - last < counts_per_cycle){
|
||||
LARGE_INTEGER current;
|
||||
QueryPerformanceCounter(¤t);
|
||||
now = current.QuadPart;
|
||||
//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;
|
||||
ctx.div++;
|
||||
@ -60,7 +57,7 @@ void timer_tick() {
|
||||
}
|
||||
|
||||
if((prev_div & (1 << 1)) && (!(ctx.div & (1 << 1)))){
|
||||
audio_period_tick();
|
||||
//audio_period_tick();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user