mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
PC speaker: fix timer issue
This commit is contained in:
parent
521b311692
commit
f99ba810fe
1 changed files with 3 additions and 0 deletions
|
@ -53,6 +53,7 @@ void DivPlatformPCSpeaker::acquire_unfilt(short* bufL, short* bufR, size_t start
|
||||||
for (size_t i=start; i<start+len; i++) {
|
for (size_t i=start; i<start+len; i++) {
|
||||||
if (on) {
|
if (on) {
|
||||||
pos-=PCSPKR_DIVIDER;
|
pos-=PCSPKR_DIVIDER;
|
||||||
|
if (pos>freq) pos=freq;
|
||||||
while (pos<0) {
|
while (pos<0) {
|
||||||
if (freq<1) {
|
if (freq<1) {
|
||||||
pos=1;
|
pos=1;
|
||||||
|
@ -71,6 +72,7 @@ void DivPlatformPCSpeaker::acquire_cone(short* bufL, short* bufR, size_t start,
|
||||||
for (size_t i=start; i<start+len; i++) {
|
for (size_t i=start; i<start+len; i++) {
|
||||||
if (on) {
|
if (on) {
|
||||||
pos-=PCSPKR_DIVIDER;
|
pos-=PCSPKR_DIVIDER;
|
||||||
|
if (pos>freq) pos=freq;
|
||||||
while (pos<0) {
|
while (pos<0) {
|
||||||
if (freq<1) {
|
if (freq<1) {
|
||||||
pos=1;
|
pos=1;
|
||||||
|
@ -95,6 +97,7 @@ void DivPlatformPCSpeaker::acquire_piezo(short* bufL, short* bufR, size_t start,
|
||||||
for (size_t i=start; i<start+len; i++) {
|
for (size_t i=start; i<start+len; i++) {
|
||||||
if (on) {
|
if (on) {
|
||||||
pos-=PCSPKR_DIVIDER;
|
pos-=PCSPKR_DIVIDER;
|
||||||
|
if (pos>freq) pos=freq;
|
||||||
while (pos<0) {
|
while (pos<0) {
|
||||||
if (freq<1) {
|
if (freq<1) {
|
||||||
pos=1;
|
pos=1;
|
||||||
|
|
Loading…
Reference in a new issue