- Also rename name of slot around romaji kana conversioning.
{
}
-
-int EmuThreadClass::get_interval(void)
-{
- static int64_t accum = 0;
- accum += (p_emu->get_frame_interval() / 2);
- int interval = accum >> 10;
- accum -= interval << 10;
- return interval;
-}
-
#include <QStringList>
#include <QFileInfo>
-void EmuThreadClass::resetEmu()
-{
- clear_key_queue();
- p_emu->reset();
-}
-
-void EmuThreadClass::specialResetEmu(int num)
-{
- if(p_emu == nullptr) return;
- std::shared_ptr<USING_FLAGS> p = using_flags;
- if(p.get() == nullptr) return;
-
- if(p->is_use_special_reset()) {
- p_emu->special_reset(num);
- }
-}
-
-void EmuThreadClass::loadState()
-{
- if(p_emu == nullptr) return;
- std::shared_ptr<USING_FLAGS> p = using_flags;
- if(p.get() == nullptr) return;
-
- if(!(p->is_use_state())) return;
-
- if(!lStateFile.isEmpty()) {
- p_emu->load_state(lStateFile.toLocal8Bit().constData());
- lStateFile.clear();
- }
-}
-
-void EmuThreadClass::saveState()
-{
- if(p_emu == nullptr) return;
- std::shared_ptr<USING_FLAGS> p = using_flags;
- if(p.get() == nullptr) return;
-
- if(!(p->is_use_state())) return;
-
- if(!sStateFile.isEmpty()) {
- p_emu->save_state(sStateFile.toLocal8Bit().constData());
- sStateFile.clear();
- }
-
-}
void EmuThreadClass::doWork(const QString ¶ms)
{
class EmuThreadClass : public EmuThreadClassBase {
Q_OBJECT
protected:
- const _TCHAR *get_device_name(void);
-
- void resetEmu();
- void specialResetEmu(int num);
- void loadState();
- void saveState();
+ const _TCHAR *get_device_name(void) override;
public:
EmuThreadClass(Ui_MainWindowBase *rootWindow, std::shared_ptr<USING_FLAGS> p, QObject *parent = 0);
~EmuThreadClass();
- void run() { doWork("");}
- int get_interval(void);
+ void run() override { doWork("");}
public slots:
void doWork(const QString ¶m);
-
};
QT_END_NAMESPACE
#ifdef USE_AUTO_KEY
connect(this, SIGNAL(sig_start_auto_key(QString)), hRunEmu, SLOT(do_start_auto_key(QString)), Qt::QueuedConnection);
connect(this, SIGNAL(sig_stop_auto_key()), hRunEmu, SLOT(do_stop_auto_key()), Qt::QueuedConnection);
- connect(this, SIGNAL(sig_set_roma_kana(bool)), hRunEmu, SLOT(set_romakana(bool)), Qt::QueuedConnection);
+ connect(this, SIGNAL(sig_set_roma_kana(bool)), hRunEmu, SLOT(do_set_roma_kana(bool)), Qt::QueuedConnection);
#endif
csp_logger->debug_log(CSP_LOG_INFO, CSP_LOG_TYPE_GENERAL, "EmuThread : Start.");
}
}
-void EmuThreadClassBase::set_romakana(bool flag)
-{
- if(p_emu == nullptr) return;
- std::shared_ptr<USING_FLAGS> p = using_flags;
- if(p.get() == nullptr) return;
-
- if(p->is_use_auto_key()) {
- p_emu->set_auto_key_char(flag ? 1 : 0);
- }
-}
void EmuThreadClassBase::do_notify_power_off()
{
#include "virtualfileslist.h"
#include "menu_metaclass.h"
-//#include "../../romakana.h"
-
-//#include "csp_logger.h"
#include "menu_flags.h"
EmuThreadClassBase::EmuThreadClassBase(Ui_MainWindowBase *rootWindow, std::shared_ptr<USING_FLAGS> p, QObject *parent) : QThread(parent)
int get_message_count(void);
void dec_message_count(void);
+ int get_interval(void);
+
virtual const _TCHAR *get_device_name(void);
- virtual void resetEmu() { }
- virtual void specialResetEmu(int num) { }
- virtual void loadState() { }
- virtual void saveState() { }
+ void resetEmu();
+ void specialResetEmu(int num);
+ void loadState();
+ void saveState();
void enqueue_key_up(key_queue_t s) {
QMutexLocker n(&keyMutex);
bool is_bubble_casette_protected(int drive);
void set_bubble_casette_protected(int drive, bool flag);
QString get_b77_file_path(int drive);
-
public slots:
void doExit(void);
void do_start_auto_key(QString text);
void do_stop_auto_key(void);
- void set_romakana(bool flag);
+ void do_set_roma_kana(bool flag);
void do_close_debugger(void);
#include <QTextCodec>
#include "config.h"
+#include "emu_template.h"
#include "emu_thread_tmpl.h"
#include "mainwidget_base.h"
#include "common.h"
p_emu->stop_auto_key();
}
}
+
+void EmuThreadClassBase::do_set_roma_kana(bool flag)
+{
+ if(p_emu == nullptr) return;
+ std::shared_ptr<USING_FLAGS> p = using_flags;
+ if(p.get() == nullptr) return;
+
+ if(p->is_use_auto_key()) {
+ p_emu->set_auto_key_char(flag ? 1 : 0);
+ }
+}
--- /dev/null
+/*
+ Skelton for retropc emulator
+ Author : Takeda.Toshiya
+ Port to Qt : K.Ohta <whatisthis.sowhat _at_ gmail.com>
+ Date : 2015.11.10
+ History: 2023.02.24 Split from emu_thread_tmpl.cpp
+ Note: This class must be compiled per VM, must not integrate shared units.
+ [ win32 main ] -> [ Qt main ] -> [Emu Thread] -> [Sequences around emulation]
+*/
+
+#include <QWidget>
+
+#include "config.h"
+#include "emu_template.h"
+#include "emu_thread_tmpl.h"
+#include "mainwidget_base.h"
+#include "common.h"
+#include "../../osdcall_types.h"
+
+#include "virtualfileslist.h"
+#include "menu_metaclass.h"
+
+#include "menu_flags.h"
+
+int EmuThreadClassBase::get_interval(void)
+{
+ static int64_t accum = 0;
+ if(p_emu == nullptr) return 0;
+ accum += (p_emu->get_frame_interval() / 2);
+ int interval = accum >> 10;
+ accum -= interval << 10;
+ return interval;
+}
+
+void EmuThreadClassBase::resetEmu()
+{
+ clear_key_queue();
+ if(p_emu == nullptr) return;
+ p_emu->reset();
+}
+
+void EmuThreadClassBase::specialResetEmu(int num)
+{
+ if(p_emu == nullptr) return;
+ std::shared_ptr<USING_FLAGS> p = using_flags;
+ if(p.get() == nullptr) return;
+
+ if(p->is_use_special_reset()) {
+ p_emu->special_reset(num);
+ }
+}
+
+void EmuThreadClassBase::loadState()
+{
+ if(p_emu == nullptr) return;
+ std::shared_ptr<USING_FLAGS> p = using_flags;
+ if(p.get() == nullptr) return;
+
+ if(!(p->is_use_state())) return;
+
+ if(!lStateFile.isEmpty()) {
+ p_emu->load_state(lStateFile.toLocal8Bit().constData());
+ lStateFile.clear();
+ }
+}
+
+void EmuThreadClassBase::saveState()
+{
+ if(p_emu == nullptr) return;
+ std::shared_ptr<USING_FLAGS> p = using_flags;
+ if(p.get() == nullptr) return;
+ if(!(p->is_use_state())) return;
+
+ if(!sStateFile.isEmpty()) {
+ p_emu->save_state(sStateFile.toLocal8Bit().constData());
+ sStateFile.clear();
+ }
+}
#include <QWidget>
#include "config.h"
+#include "emu_template.h"
#include "emu_thread_tmpl.h"
#include "mainwidget_base.h"
#include "common.h"
return (const _TCHAR *)_T("TEST");
}
+
#if defined(Q_OS_LINUX)
//#define _GNU_SOURCE
#include <unistd.h>
../emu_thread/emu_thread_tmpl.cpp
../emu_thread/utils.cpp
../emu_thread/inputs.cpp
+ ../emu_thread/sequences.cpp
../emu_thread/emu_thread_slots.cpp
)
add_definitions(-D__GUI_LIBRARY_NAME=\"libCSPgui.${THIS_LIB_VERSION}\")