diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-03-28 14:12:35 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-03-28 14:12:35 +0100 |
commit | eff2a40c163933b65f016c1a154aa77dacaaef09 (patch) | |
tree | 3e5043a97a1184a76b5b6309ec0dd499a6332bc1 | |
parent | feb92fedb1eb041465a4185a114b3441e70cc132 (diff) | |
parent | 5a34ad16cd040d163b50dcf7c070968dbd55ac43 (diff) | |
download | plan9front-eff2a40c163933b65f016c1a154aa77dacaaef09.tar.xz |
merge
-rw-r--r-- | sys/src/games/gba/apu.c | 2 | ||||
-rw-r--r-- | sys/src/games/gba/ev.c | 6 | ||||
-rw-r--r-- | sys/src/games/gba/ppu.c | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/sys/src/games/gba/apu.c b/sys/src/games/gba/apu.c index 0e0c01548..3b99a4614 100644 --- a/sys/src/games/gba/apu.c +++ b/sys/src/games/gba/apu.c @@ -209,7 +209,7 @@ sampletick(void *) s16int s[2]; int i; - addevent(&evsamp, sratediv + evsamp.time); + addevent(&evsamp, sratediv); if(--envctr == 0){ envctr = envrel; diff --git a/sys/src/games/gba/ev.c b/sys/src/games/gba/ev.c index e4612114c..fb75129ad 100644 --- a/sys/src/games/gba/ev.c +++ b/sys/src/games/gba/ev.c @@ -185,9 +185,11 @@ timertick(void *aux) Timer *t; u32int v; int to; + ulong clock0; t = aux; - t->clock = clock + t->time & -(1 << t->sh); + clock0 = clock + t->time; + t->clock = clock0 & -(1 << t->sh); t->val = -t->time >> t->sh; do{ to = 0; @@ -196,7 +198,7 @@ timertick(void *aux) to++; }while(v >= 0x10000); if(t == aux) - addevent(t, (0x10000 - t->val << t->sh) + (-clock & (1 << t->sh) - 1)); + addevent(t, (0x10000 - t->val << t->sh) + (-clock0 & (1 << t->sh) - 1)); if((*t->cnt & TIMERIRQ) != 0) setif(IRQTIM0 << t->i); if(t->snd) diff --git a/sys/src/games/gba/ppu.c b/sys/src/games/gba/ppu.c index 43d334d6c..85d1d0652 100644 --- a/sys/src/games/gba/ppu.c +++ b/sys/src/games/gba/ppu.c @@ -733,7 +733,7 @@ hblanktick(void *) stat = reg[DISPSTAT]; if(hblank){ hblclock = clock + evhblank.time; - addevent(&evhblank, 240*4 + evhblank.time); + addevent(&evhblank, 240*4); hblank = 0; ppux0 = 0; memset(pixpri, VACANT, sizeof(pixpri)); @@ -755,7 +755,7 @@ hblanktick(void *) }else{ syncppu(240); linecopy(); - addevent(&evhblank, 68*4 + evhblank.time); + addevent(&evhblank, 68*4); hblank = 1; if((stat & IRQHBLEN) != 0) setif(IRQHBL); |