2 Skelton for retropc emulator
4 Author : Takeda.Toshiya
12 #include "emu_thread.h"
17 //BOOL WINAPI ctrl_c_handler(DWORD type)
22 void OSD::do_write_inputdata(QString s)
25 emit sig_console_input_string(s);
28 void OSD::do_set_input_string(QString s)
30 memset(console_string, 0x00, sizeof(console_string));
31 strncpy(console_string, s.toLocal8Bit().constData(), sizeof(console_string) - 1);
34 _TCHAR *OSD::console_input_string(void)
36 if(strlen(console_string) <= 0) return NULL;
37 return console_string;
40 void OSD::clear_console_input_string(void)
42 memset(console_string, 0x00, sizeof(console_string));
45 void OSD::open_console(_TCHAR* title)
47 if(osd_console_opened) return;
48 memset(console_string, 0x00, sizeof(console_string));
49 osd_console_opened = true;
53 void OSD::close_console()
55 memset(console_string, 0x00, sizeof(console_string));
56 osd_console_opened = false;
59 unsigned int OSD::get_console_code_page()
61 //return GetConsoleCP();
65 bool OSD::is_console_active()
67 return osd_console_opened;
70 void OSD::set_console_text_attribute(unsigned short attr)
72 //SetConsoleTextAttribute(hStdOut, attr);
75 void OSD::write_console(_TCHAR* buffer, unsigned int length)
77 QString s = QString::fromLocal8Bit(buffer, length);
78 emit sig_put_string_debugger(s);
81 int OSD::read_console_input(_TCHAR* buffer)
88 void OSD::do_close_debugger_console()
90 emit sig_debugger_finished(); // It's dirty...
93 void OSD::do_close_debugger_thread()
95 #if defined(USE_DEBUGGER)
96 //if(emu->debugger_thread_param.request_terminate == true) {
97 emit sig_debugger_finished();
99 //emu->close_debugger();