OSDN Git Service

[UI][Qt] Update to upstream 2017-06-22.Some parts are temporally.
[csp-qt/common_source_project-fm7.git] / source / src / qt / common / emu_thread.h
1 /*
2         Skelton for retropc emulator
3         Author : Takeda.Toshiya
4         Port to Qt : K.Ohta <whatisthis.sowhat _at_ gmail.com>
5         Date   : 2006.08.18 -
6         License : GPLv2
7         History : 2015.11.10 Split from qt_main.h
8         [ win32 main ] -> [ Qt main ] -> [Emu Thread]
9 */
10 #ifndef _CSP_QT_EMU_THREAD_H
11 #define _CSP_QT_EMU_THREAD_H
12
13 #include <QThread>
14 #include <QQueue>
15 #include <QString>
16 #include <QElapsedTimer>
17
18 #include "common.h"
19 #include "commonclasses.h"
20 #include "fileio.h"
21 #include "emu.h"
22 #include "vm.h"
23 #include "menuclasses.h"
24 #include "mainwidget.h"
25 #include "commonclasses.h"
26 #include "config.h"
27 #include "../gui/emu_thread_tmpl.h"
28
29 #ifndef MAX_HISTORY
30 #define MAX_HISTORY 8
31 #endif
32 #define MAX_COMMAND_LEN 64
33
34
35 class META_MainWindow;
36 class EMU;
37 class QWaitCondition;
38 class USING_FLAGS;
39
40 QT_BEGIN_NAMESPACE
41
42 class EmuThreadClass : public EmuThreadClassBase {
43         Q_OBJECT
44 protected:
45         char dbg_prev_command[MAX_COMMAND_LEN];
46         bool now_skip;
47   
48         void button_pressed_mouse_sub(Qt::MouseButton button);
49         void button_released_mouse_sub(Qt::MouseButton button);
50         void get_qd_string(void);
51         void get_fd_string(void);
52         void get_tape_string(void);
53         void get_cd_string(void);
54         void get_bubble_string(void);
55
56         void set_romakana(void) override;
57 public:
58         EmuThreadClass(META_MainWindow *rootWindow, USING_FLAGS *p, QObject *parent = 0);
59         ~EmuThreadClass();
60         void run() { doWork("");}
61         bool now_debugging();
62         int get_interval(void);
63
64 public slots:
65         void doWork(const QString &param);
66         void print_framerate(int frames);
67         
68         void do_set_display_size(int w, int h, int ww, int wh);
69         void moved_mouse(int, int);
70
71         void do_write_protect_disk(int drv, bool flag);
72         void do_close_disk(int);
73         void do_open_disk(int, QString, int);
74         void do_play_tape(int drv, QString name);
75         void do_rec_tape(int drv, QString name);
76         void do_close_tape(int drv);
77         void do_cmt_push_play(int drv);
78         void do_cmt_push_stop(int drv);
79         void do_cmt_push_fast_forward(int drv);
80         void do_cmt_push_fast_rewind(int drv);
81         void do_cmt_push_apss_forward(int drv);
82         void do_cmt_push_apss_rewind(int drv);
83         void do_write_protect_quickdisk(int drv, bool flag);
84         void do_close_quickdisk(int drv);
85         void do_open_quickdisk(int drv, QString path);
86         void do_close_cart(int drv);
87         void do_open_cart(int drv, QString path);
88         void do_close_laser_disc(void);
89         void do_open_laser_disc(QString path);
90         void do_eject_cdrom(void);
91         void do_open_cdrom(QString path);
92         void do_load_binary(int drv, QString path);
93         void do_save_binary(int drv, QString path);
94         void do_write_protect_bubble_casette(int drv, bool flag);
95         void do_close_bubble_casette(int);
96         void do_open_bubble_casette(int, QString, int);
97         void do_start_auto_key(QString text);
98         void do_stop_auto_key(void);
99
100         void do_close_debugger(void);
101 };
102
103 QT_END_NAMESPACE
104
105 #endif