Skip to content

Instantly share code, notes, and snippets.

@punesemu
Last active June 2, 2019 13:38
Show Gist options
  • Save punesemu/2bab4349dd3e2d3141e560248b0a29a6 to your computer and use it in GitHub Desktop.
Save punesemu/2bab4349dd3e2d3141e560248b0a29a6 to your computer and use it in GitHub Desktop.
tests to study the issue #78
diff --git a/src/core/emu_thread.c b/src/core/emu_thread.c
index 680a082..14e4f2b 100644
--- a/src/core/emu_thread.c
+++ b/src/core/emu_thread.c
@@ -54,4 +54,10 @@
memset(&emu_thread, 0x00, sizeof(emu_thread));
+
+
+ return (EXIT_OK);
+
+
+
#if defined (__unix__)
emu_thread.thread = malloc(sizeof(pthread_t));
@@ -77,4 +83,11 @@
void emu_thread_pause(void) {
+
+
+
+ return;
+
+
+
if (emu_thread.in_run == ET_UNINITIALIZED) {
return;
@@ -88,4 +101,11 @@
}
void emu_thread_continue(void) {
+
+
+
+ return;
+
+
+
if (emu_thread.in_run == ET_UNINITIALIZED) {
return;
@@ -104,12 +124,33 @@
void emu_thread_pause_with_count(int *count) {
+
+
+
+ return;
+
+
+
emu_thread_pause();
(*count)++;
}
void emu_thread_continue_with_count(int *count) {
+
+
+
+ return;
+
+
+
emu_thread_continue();
(*count)--;
}
void emu_thread_continue_ctrl_count(int *count) {
+
+
+
+ return;
+
+
+
for (; (*count) > 0; (*count)--) {
emu_thread_continue();
diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp
index f240a36..d94fa51 100644
--- a/src/gui/mainWindow.cpp
+++ b/src/gui/mainWindow.cpp
@@ -146,4 +146,13 @@
set_language(cfg->language);
+
+
+
+
+ tloop = new QTimer(this);
+ connect(tloop, SIGNAL(timeout()), this, SLOT(s_loop()));
+
+
+
}
mainWindow::~mainWindow() {}
@@ -219,4 +228,10 @@
shcjoy_stop();
+
+
+ tloop->stop();
+
+
+
// in linux non posso spostare tramite le qt una finestra da un monitor
// ad un'altro, quindi salvo la posizione solo se sono sul monitor 0;
@@ -1429,2 +1444,9 @@
gui_external_control_windows_show();
}
+
+
+
+
+void mainWindow::s_loop(void) {
+ emu_frame();
+}
diff --git a/src/gui/mainWindow.hpp b/src/gui/mainWindow.hpp
index 0a4081c..9b40285 100644
--- a/src/gui/mainWindow.hpp
+++ b/src/gui/mainWindow.hpp
@@ -67,4 +67,10 @@
wdgStatusBar *statusbar;
+
+
+ QTimer *tloop;
+
+
+
private:
QShortcut *shortcut[SET_MAX_NUM_SC];
@@ -172,4 +178,8 @@
void s_et_vs_reset(void);
void s_et_external_control_windows_show(void);
+
+
+
+ void s_loop(void);
};
diff --git a/src/gui/qt.cpp b/src/gui/qt.cpp
index f4fa4fb..6bcaee2 100644
--- a/src/gui/qt.cpp
+++ b/src/gui/qt.cpp
@@ -166,4 +166,10 @@
}
void gui_start(void) {
+ qt.mwin->tloop->start();
+
+
+
+
+
gui.start = TRUE;
fps.frame.expected_end = gui_get_ms() + machine.ms_frame;
diff --git a/src/video/gfx_thread.c b/src/video/gfx_thread.c
index f575930..b59a17e 100644
--- a/src/video/gfx_thread.c
+++ b/src/video/gfx_thread.c
@@ -59,4 +59,12 @@
memset(&gfx_thread, 0x00, sizeof(gfx_thread));
+
+
+
+ return (EXIT_OK);
+
+
+
+
#if defined (__unix__)
if (pthread_mutex_init(&gfx_thread.lock, NULL) != 0) {
@@ -94,4 +102,9 @@
void gfx_thread_lock(void) {
+
+
+ return;
+
+
#if defined (__unix__)
pthread_mutex_lock(&gfx_thread.lock);
@@ -101,4 +114,12 @@
}
void gfx_thread_unlock(void) {
+
+
+
+ return;
+
+
+
+
#if defined (__unix__)
pthread_mutex_unlock(&gfx_thread.lock);
@@ -109,4 +130,11 @@
void gfx_thread_pause(void) {
+
+
+
+ return;
+
+
+
if (gfx_thread.in_run == GT_UNINITIALIZED) {
return;
@@ -120,4 +148,10 @@
}
void gfx_thread_continue(void) {
+
+
+ return;
+
+
+
if (gfx_thread.in_run == GT_UNINITIALIZED) {
return;
diff --git a/src/video/opengl/gfx.c b/src/video/opengl/gfx.c
index 78fc60a..b4dd7e9 100644
--- a/src/video/opengl/gfx.c
+++ b/src/video/opengl/gfx.c
@@ -465,7 +465,18 @@
}
+ /*
if (screen.rd->ready == FALSE) {
screen.rd->ready = TRUE;
}
+ */
+
+
+
+ gfx_apply_filter();
+
+
+
+
+
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment