mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-16 17:45:10 +00:00
fix Ubuntu build
This commit is contained in:
parent
3aef4b2ede
commit
94dae570e0
1 changed files with 21 additions and 7 deletions
|
@ -107,25 +107,39 @@ void DivPlatformPCSpeaker::pcSpeakerThread() {
|
||||||
bOut=0;
|
bOut=0;
|
||||||
if (r.val==0) {
|
if (r.val==0) {
|
||||||
lseek(beepFD,0x61,SEEK_SET);
|
lseek(beepFD,0x61,SEEK_SET);
|
||||||
read(beepFD,&bOut,1);
|
if (read(beepFD,&bOut,1)<1) {
|
||||||
|
perror("read from 0x61");
|
||||||
|
}
|
||||||
bOut&=(~3);
|
bOut&=(~3);
|
||||||
lseek(beepFD,0x61,SEEK_SET);
|
lseek(beepFD,0x61,SEEK_SET);
|
||||||
write(beepFD,&bOut,1);
|
if (write(beepFD,&bOut,1)<1) {
|
||||||
|
perror("write to 0x61");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
lseek(beepFD,0x43,SEEK_SET);
|
lseek(beepFD,0x43,SEEK_SET);
|
||||||
bOut=0xb6;
|
bOut=0xb6;
|
||||||
write(beepFD,&bOut,1);
|
if (write(beepFD,&bOut,1)<1) {
|
||||||
|
perror("write to 0x43");
|
||||||
|
}
|
||||||
lseek(beepFD,0x42,SEEK_SET);
|
lseek(beepFD,0x42,SEEK_SET);
|
||||||
bOut=r.val&0xff;
|
bOut=r.val&0xff;
|
||||||
write(beepFD,&bOut,1);
|
if (write(beepFD,&bOut,1)<1) {
|
||||||
|
perror("write to 0x42");
|
||||||
|
}
|
||||||
lseek(beepFD,0x42,SEEK_SET);
|
lseek(beepFD,0x42,SEEK_SET);
|
||||||
bOut=r.val>>8;
|
bOut=r.val>>8;
|
||||||
write(beepFD,&bOut,1);
|
if (write(beepFD,&bOut,1)<1) {
|
||||||
|
perror("write to 0x42");
|
||||||
|
}
|
||||||
lseek(beepFD,0x61,SEEK_SET);
|
lseek(beepFD,0x61,SEEK_SET);
|
||||||
read(beepFD,&bOut,1);
|
if (read(beepFD,&bOut,1)<1) {
|
||||||
|
perror("read from 0x61");
|
||||||
|
}
|
||||||
bOut|=3;
|
bOut|=3;
|
||||||
lseek(beepFD,0x61,SEEK_SET);
|
lseek(beepFD,0x61,SEEK_SET);
|
||||||
write(beepFD,&bOut,1);
|
if (write(beepFD,&bOut,1)<1) {
|
||||||
|
perror("write to 0x61");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue