void EMU::release_debugger()
{
- close_debugger();
+ for(int i = 0; i < 8; i++) { // ToDo 20230110 K.O
+ close_debugger(i);
+ }
}
void EMU::open_debugger(int cpu_index)
{
if(!(now_debugging && debugger_thread_param.cpu_index == cpu_index)) {
- close_debugger();
+ close_debugger(cpu_index);
if(vm->get_cpu(cpu_index) != NULL && vm->get_cpu(cpu_index)->get_debugger() != NULL) {
debugger_thread_param.emu = this;
debugger_thread_param.osd = (OSD_BASE*)osd;
}
}
-void EMU::close_debugger()
+void EMU::close_debugger(int cpu_index)
{
+
if(now_debugging) {
if(debugger_thread_param.running) {
debugger_thread_param.request_terminate = true;
//#elif !defined(_USE_QT)
#else
pthread_join(debugger_thread_id, NULL);
-//#else
-// volatile debugger_thread_t *p = (debugger_thread_t *)(&debugger_thread_param);
-// p->running = false;
-
- //if(logfile != NULL && logfile->IsOpened()) {
- // logfile->Fclose();
- //}
- // initialize logfile
- //logfile = NULL;
#endif
now_debugging = false;
+ DEVICE *cpu = vm->get_cpu(cpu_index);
+ DEBUGGER *cpu_debugger = nullptr;
+ if(cpu != nullptr) {
+ cpu_debugger = (DEBUGGER*)cpu->get_debugger();
+ }
+ if((cpu != nullptr) && (cpu_debugger != nullptr)) {
+ cpu_debugger->now_debugging = false;
+ cpu_debugger->now_going = true;
+ // ToDo: Support multiple CPUs
+ debugger_thread_param.cpu_index = -1;
+ }
}
}
// Some functions move to emu.cpp . 20190221 K.O.
load_state(state_file_path(request_load_state));
}
// NOTE: vm instance may be reinitialized in load_state
+ // ToDo: Support multiple debuggers. 20230110 K.O
if(!is_debugger_enabled(debugger_cpu_index)) {
for(int i = 0; i < 8; i++) {
if(is_debugger_enabled(i)) {
cpu_debugger->now_debugging = true;
debugger_thread_param.vm = vm;
} else {
- close_debugger();
+ close_debugger(debugger_cpu_index);
}
request_save_state = request_load_state = -1;
}
#ifdef USE_DEBUGGER
osd->finish_waiting_in_debugger();
now_waiting_in_debugger = false;
+ osd->unmute_sound();
#endif
}
// debugger
#ifdef USE_DEBUGGER
void open_debugger(int cpu_index) override;
- void close_debugger() override;
+ void close_debugger(int cpu_index) override;
bool is_debugger_enabled(int cpu_index) override;
#endif
void start_waiting_in_debugger() override;
virtual void release_debugger() { }
virtual void open_debugger(int cpu_index) {}
- virtual void close_debugger() {}
+ virtual void close_debugger(int cpu_index) {}
virtual bool is_debugger_enabled(int cpu_index) { return false; }
bool now_debugging;
message("* qt/osd")
-SET(THIS_LIB_VERSION 8.9.1)
+SET(THIS_LIB_VERSION 8.10.0)
set(s_qt_osd_headers
osd_base.h
message("* qt/avio")
-SET(THIS_LIB_VERSION 7.4.1)
+SET(THIS_LIB_VERSION 7.4.2)
set(s_qt_avio_headers
csp_avio_basic.h
movie_saver.h
message("* qt/emuutils")
-SET(THIS_LIB_VERSION 7.5.0)
+SET(THIS_LIB_VERSION 7.5.1)
set(s_qt_emuutils_headers
../gui/csp_logger.h
message("* qt/gui")
-set(THIS_LIB_VERSION 7.4.1)
+set(THIS_LIB_VERSION 7.5.0)
set(s_qt_gui_headers
qt_dialogs.h
if(emu != nullptr) {
VM_TEMPLATE* p_vm = debugger_thread_param.vm;
if(p_vm != nullptr) {
+ // ToDo: Support multiple debuggers. 20230110 K.O
uint32_t cpu_index = debugger_thread_param.cpu_index;
if(emu->is_debugger_enabled(cpu_index)) {
- emu->close_debugger();
+ emu->close_debugger(cpu_index);
}
}
}
if(emu != nullptr) {
uint32_t cpu_index = debugger_thread_param.cpu_index;
if(emu->is_debugger_enabled(cpu_index)) {
- emu->close_debugger();
+ emu->close_debugger(cpu_index);
}
}
//emu.reset(); // Deallocate
play_movie();
}
}
+ unmute_sound();
}
// common sound
void update_sound(int* extra_frames);
void mute_sound();
+ void unmute_sound();
void stop_sound();
void start_record_sound();
void stop_record_sound();
}
}
}
+
+void OSD_BASE::unmute_sound()
+{
+ if(now_mute && sound_ok) {
+ std::shared_ptr<SOUND_MODULE::OUTPUT::M_BASE>sound_drv = m_sound_driver;
+ if(sound_drv.get() != nullptr) {
+ sound_drv->unmute_sound();
+ }
+ now_mute = false;
+ }
+}
void OSD_BASE::mute_sound()
{
if(!now_mute && sound_ok) {
{
}
+void M_BASE::unmute_sound()
+{
+}
+
void M_BASE::stop_sound()
{
}
virtual void initialize_sound(int rate, int samples, int* presented_rate, int* presented_samples);
virtual void release_sound();
virtual void mute_sound();
+ virtual void unmute_sound();
virtual void stop_sound();
virtual void update_config() {}
void M_QT_MULTIMEDIA::mute_sound()
{
if(!(m_mute.load()) && (m_config_ok.load())) {
- #if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
+ #if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
std::shared_ptr<QAudioSink> p = m_audioOutputSink;
- #elif QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ #elif QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
std::shared_ptr<QAudioOutput> p = m_audioOutputSink;
- #endif
-
+ #endif
if(p.get() != nullptr) {
switch(p->state()) {
case QAudio::ActiveState:
m_mute = true;
}
+void M_QT_MULTIMEDIA::unmute_sound()
+{
+ if((m_mute.load()) && (m_config_ok.load())) {
+ #if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
+ std::shared_ptr<QAudioSink> p = m_audioOutputSink;
+ #elif QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ std::shared_ptr<QAudioOutput> p = m_audioOutputSink;
+ #endif
+ if(p.get() != nullptr) {
+ switch(p->state()) {
+ case QAudio::SuspendedState:
+ emit sig_discard_audio();
+ emit sig_resume_audio();
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ m_mute = false;
+}
+
+
void M_QT_MULTIMEDIA::do_discard_sound()
{
std::shared_ptr<SOUND_BUFFER_QT> q = m_driver_fileio;
virtual void release_sound() override;
virtual void mute_sound() override;
+ virtual void unmute_sound() override;
virtual void stop_sound() override;
virtual void driver_state_changed(QAudio::State newState);
message("* vm/common_vm")
-SET(THIS_LIB_VERSION 7.1.0)
+SET(THIS_LIB_VERSION 7.2.0)
#include(cotire)
set(s_vm_common_vm_srcs
cmake_minimum_required (VERSION 3.0)
message("* vm/fmgen")
-SET(THIS_LIB_VERSION 5.4.1)
+SET(THIS_LIB_VERSION 5.4.2)
add_definitions(-D__LIBFMGEN_VERSION=\"libCSPfmgen.${THIS_LIB_VERSION}\")
SET(s_vm_fmgen_srcs