dont understand audio :(

This commit is contained in:
2025-02-02 22:56:07 -07:00
parent 8493ff5fea
commit d4c6f05fb8
5 changed files with 89 additions and 45 deletions

View File

@ -15,16 +15,16 @@ void timer_init() {
ctx.div = 0XAC00;
LARGE_INTEGER freq;
QueryPerformanceFrequency(&freq);
counts_per_cycle = freq.QuadPart / (1 << 19);
counts_per_cycle = freq.QuadPart / (1 << 22);
}
void timer_tick() {
//while(now - last < counts_per_cycle){
// LARGE_INTEGER current;
// QueryPerformanceCounter(&current);
// now = current.QuadPart;
// //printf("Last-now: %lld, counts: %lld\n", now - last, counts_per_cycle);
//}
while(now - last < counts_per_cycle){
LARGE_INTEGER current;
QueryPerformanceCounter(&current);
now = current.QuadPart;
//printf("Last-now: %lld, counts: %lld\n", now - last, counts_per_cycle);
}
last = now;
u16 prev_div = ctx.div;
ctx.div++;