summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqwx <qwx@sciops.net>2023-01-21 18:13:10 +0000
committerqwx <qwx@sciops.net>2023-01-21 18:13:10 +0000
commitd65589c29941b16a5239f6f2e9c8f6fea5c863a2 (patch)
tree6e42b556856003a04039a311d3c03a7bf29e65c8
parent080a7b01bfa0fb89951cf4e30070dc7665992c90 (diff)
games/dmid: update for opl3 streaming
-rw-r--r--sys/src/games/dmid.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/sys/src/games/dmid.c b/sys/src/games/dmid.c
index a0bdc79a4..b007a7580 100644
--- a/sys/src/games/dmid.c
+++ b/sys/src/games/dmid.c
@@ -450,24 +450,6 @@ ev(Trk *x, vlong t)
}
void
-tproc(void *)
-{
- uvlong t, Δt;
- uchar u[4];
- Trk x;
-
- x.e = u + sizeof u;
- t = nsec();
- for(;;){
- putcmd(0, 0, 1);
- t += 10000000 / (Rate / 100);
- Δt = (t - nsec()) / 1000000;
- if(Δt > 0)
- sleep(Δt);
- }
-}
-
-void
readinst(char *file)
{
int n;
@@ -581,14 +563,11 @@ threadmain(int argc, char **argv)
putcmd(Rop3, 1, 0);
trace = debug;
if(stream){
- if(proccreate(tproc, nil, mainstacksize) < 0)
- sysfatal("proccreate: %r");
for(;;){
getvar(nil);
if(ev(nil, 0) < 0)
- break;
+ threadexits(nil);
}
- threadexitsall(n < 0 ? "read: %r" : nil);
}
for(end=0; !end;){
end = 1;