diff --git a/src/engine/platform/pcspkr.cpp b/src/engine/platform/pcspkr.cpp index 51353fedf..eb201c1ec 100644 --- a/src/engine/platform/pcspkr.cpp +++ b/src/engine/platform/pcspkr.cpp @@ -21,6 +21,12 @@ #include "../engine.h" #include +#ifdef __linux__ +#include +#include +#include +#endif + #define PCSPKR_DIVIDER 4 #define CHIP_DIVIDER 1 @@ -106,6 +112,19 @@ void DivPlatformPCSpeaker::acquire_piezo(short* bufL, short* bufR, size_t start, } } +void DivPlatformPCSpeaker::acquire_real(short* bufL, short* bufR, size_t start, size_t len) { +#ifdef __linux__ + if (lastOn!=on || lastFreq!=freq) { + lastOn=on; + lastFreq=freq; + ioctl(STDOUT_FILENO,KIOCSOUND,on?freq:0); + } +#endif + for (size_t i=start; i #define _USE_MATH_DEFINES #include "gui.h" #include "util.h" @@ -4894,12 +4893,10 @@ bool FurnaceGUI::loop() { e->setSysFlags(i,(flags&(~3))|2,restart); updateWindowTitle(); } - /* - if (ImGui::RadioButton("Use system beeper",(flags&3)==3)) { + if (ImGui::RadioButton("Use system beeper (Linux only!)",(flags&3)==3)) { e->setSysFlags(i,(flags&(~3))|3,restart); updateWindowTitle(); } - */ break; } case DIV_SYSTEM_QSOUND: {