diff options
-rw-r--r-- | src/main.cpp | 4 | ||||
-rw-r--r-- | src/platform.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 7e7d90a..b3e9dc0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,8 @@ #include "chip8.hpp" #include "platform.hpp" +#define WINDOW_TITLE "chip8emu" + int main(int argc, char** argv) { if (argc != 4) { std::cerr << "Usage: " << argv[0] << " <Scale> <Delay> <ROM>\n"; @@ -16,7 +18,7 @@ int main(int argc, char** argv) { char const* filename = argv[3]; Platform platform( - "chip8emu", + WINDOW_TITLE, VIDEO_WIDTH * videoScale, VIDEO_HEIGHT * videoScale, VIDEO_WIDTH, VIDEO_HEIGHT diff --git a/src/platform.cpp b/src/platform.cpp index f2d5984..93e574b 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -117,11 +117,10 @@ void Platform::AudioCallback(void* userdata, uint8_t* stream, int len) { Platform* platform = static_cast<Platform*>(userdata); if (platform->beepRequested) { static double time = 0.0; - double freq = 440.0; int16_t* sample = reinterpret_cast<int16_t*>(stream); for (int i = 0; i < len / 2; i++) { - int16_t value = static_cast<int16_t>(32767.0 * sin(2.0 * PI * freq * time)); + int16_t value = static_cast<int16_t>(32767.0 * sin(2.0 * PI * FREQUENCY * time)); sample[i] = value; time += 1.0 / SAMPLE_RATE; } |