Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/soc/rtc/rtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ void RTC::Cycle(uint8_t cycles)

const time_t now = std::time(nullptr);
std::tm current_time = {};
#ifdef _WIN32
localtime_s(&current_time, &now);
#else
localtime_r(&now, &current_time);
#endif

RSECDR = BCD(current_time.tm_sec);
RMINDR = BCD(current_time.tm_min);
Expand Down
1 change: 1 addition & 0 deletions core/soc/sci3/sci3.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <memory>
#include <mutex>
#include <queue>

#include "core/soc/memory/regions/io.h"
Expand Down
2 changes: 2 additions & 0 deletions core/utils/h8300h_ptr.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once
#include <bit>
#include <concepts>
#include <cstddef>
#include <cstdint>

// provides an h8/300h big endian byte swap ptr for u16 and u32
// holy moly this is ugly
Expand Down
7 changes: 7 additions & 0 deletions desktop/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <iostream>
#include <QApplication>
#include <QStyleFactory>
#include <QSurfaceFormat>

#include "argparse/argparse.hpp"

Expand All @@ -9,6 +10,12 @@

int main(int argc, char* argv[])
{
QSurfaceFormat fmt;
fmt.setVersion(3, 3);
fmt.setProfile(QSurfaceFormat::CoreProfile);
fmt.setRenderableType(QSurfaceFormat::OpenGL);
QSurfaceFormat::setDefaultFormat(fmt);

argparse::ArgumentParser arguments("pocketwalker");

arguments.add_argument("rom")
Expand Down
6 changes: 6 additions & 0 deletions desktop/src/qt/audio/qt_audio_system.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "qt_audio_system.h"
#include <QMediaDevices>
#include <QThread>

#include "desktop/src/qt/settings/app_settings.h"

Expand All @@ -20,7 +21,12 @@ QtAudioSystem::QtAudioSystem(QObject* parent) : QObject(parent)
QtAudioSystem::~QtAudioSystem()
{
Flush();
sink->disconnect();
sink->stop();
device = nullptr;
QThread::msleep(50);
delete sink;
sink = nullptr;
}

void QtAudioSystem::PushSample(BuzzerInformation info)
Expand Down
11 changes: 11 additions & 0 deletions desktop/src/qt/emulator/emulator_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ EmulatorContext::~EmulatorContext()
if (emulator_thread && emulator_thread->joinable())
emulator_thread->join();

audio.reset();

if (network && network_thread && network_thread->isRunning())
{
QThread* main_thread = QThread::currentThread();
QMetaObject::invokeMethod(
network.get(),
[n = network.get(), main_thread]() { n->moveToThread(main_thread); },
Qt::BlockingQueuedConnection);
}

if (network_thread)
{
network_thread->quit();
Expand Down
Loading