void create_date_file_path(_TCHAR *file_path, int length, const _TCHAR *extension);
bool check_file_extension(const _TCHAR* file_path, const _TCHAR* ext);
const _TCHAR *get_file_path_without_extensiton(const _TCHAR* file_path);
+const _TCHAR *create_string(const _TCHAR* format, ...);
-uint32 getcrc32(uint8 data[], int size);
+uint32 get_crc32(uint8 data[], int size);
uint16 jis_to_sjis(uint16 jis);
p->osd->sleep(10);
}
- uint32 prog_addr_mask = cpu->get_debug_prog_addr_mask();
- uint32 data_addr_mask = cpu->get_debug_data_addr_mask();
+ uint32 prog_addr_mask = cpu->debug_prog_addr_mask();
+ uint32 data_addr_mask = cpu->debug_data_addr_mask();
uint32 dump_addr = 0;
uint32 dasm_addr = cpu->get_next_pc();
p->osd->open_console(create_string(_T("Debugger - %s"), _T(DEVICE_NAME)));
p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
- cpu->get_debug_regs_info(buffer, 1024);
+ cpu->debug_regs_info(buffer, 1024);
my_printf(p->osd, _T("%s\n"), buffer);
p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_INTENSITY);
bool cp932 = (p->osd->get_console_code_page() == 932);
p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
- cpu->get_debug_regs_info(buffer, 1024);
+ cpu->debug_regs_info(buffer, 1024);
my_printf(p->osd, _T("%s\n"), buffer);
p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_INTENSITY);
void enable_mouse();
void disenable_mouse();
void toggle_mouse();
- bool get_mouse_enabled();
bool is_mouse_enabled();
#ifdef USE_AUTO_KEY
void start_auto_key();
// sound
void mute_sound();
- void start_recording_sound();
- void stop_recording_sound();
+ void start_record_sound();
+ void stop_record_sound();
bool is_sound_recording();
// video device
int EmuThreadClass::get_interval(void)
{
static int accum = 0;
- accum += p_emu->frame_interval();
+ accum += p_emu->get_frame_interval();
int interval = accum >> 10;
accum -= interval << 10;
return interval;
void EmuThreadClass::button_pressed_mouse(Qt::MouseButton button)
{
int stat = p_emu->get_mouse_button();
- bool flag = p_emu->get_mouse_enabled();
+ bool flag = p_emu->is_mouse_enabled();
switch(button) {
case Qt::LeftButton:
stat |= 0x01;
defined(USE_FD5) || defined(USE_FD6) || defined(USE_FD7) || defined(USE_FD8)
void EmuThreadClass::do_write_protect_disk(int drv, bool flag)
{
- p_emu->set_disk_protected(drv, flag);
+ p_emu->is_floppy_disk_protected(drv, flag);
}
void EmuThreadClass::do_close_disk(int drv)
{
- p_emu->close_disk(drv);
+ p_emu->close_floppy_disk(drv);
p_emu->d88_file[drv].bank_num = 0;
p_emu->d88_file[drv].cur_bank = -1;
}
} else {
bank = 0;
}
- p_emu->open_disk(drv, localPath.constData(), bank);
+ p_emu->open_floppy_disk(drv, localPath.constData(), bank);
emit sig_update_recent_disk(drv);
}
void EmuThreadClass::do_close_quickdisk(int drv)
{
- p_emu->close_quickdisk(drv);
+ p_emu->close_quick_disk(drv);
}
void EmuThreadClass::do_open_quickdisk(int drv, QString path)
{
- p_emu->open_quickdisk(drv, path.toLocal8Bit().constData());
+ p_emu->open_quick_disk(drv, path.toLocal8Bit().constData());
}
#endif
int i;
#if defined(USE_QD1)
# if defined(USE_ACCESS_LAMP)
- access_drv = p_emu->get_vm()->access_lamp();
+ access_drv = p_emu->get_access_lamp();
# endif
for(i = 0; i < MAX_QD ; i++) {
- if(p_emu->quickdisk_inserted(i)) {
+ if(p_emu->is_quick_disk_inserted(i)) {
// printf("%d\n", access_drv);
# if defined(USE_ACCESS_LAMP)
if(i == (access_drv - 1)) {
#if defined(USE_FD1)
# if defined(USE_ACCESS_LAMP)
- access_drv = p_emu->get_vm()->access_lamp();
+ access_drv = p_emu->get_access_lamp();
# endif
for(i = 0; i < MAX_FD; i++) {
- if(p_emu->disk_inserted(i)) {
+ if(p_emu->is_floppy_disk_inserted(i)) {
# if defined(USE_ACCESS_LAMP)
if(i == (access_drv - 1)) {
alamp = QString::fromUtf8("<FONT COLOR=RED>●</FONT> ");
}
#endif
#if defined(USE_TAPE) && !defined(TAPE_BINARY_ONLY)
- if(p_emu->tape_inserted()) {
- int tape_counter = p_emu->tape_position();
+ if(p_emu->is_tape_inserted()) {
+ int tape_counter = p_emu->get_tape_position();
tmpstr = QString::fromUtf8("");
- if(p_emu->tape_playing()) {
+ if(p_emu->is_tape_playing()) {
tmpstr = QString::fromUtf8("<FONT COLOR=BLUE>▶ </FONT>");
- } else if(p_emu->tape_recording()) {
+ } else if(p_emu->is_tape_recording()) {
tmpstr = QString::fromUtf8("<FONT COLOR=RED>● </FONT>");
} else {
tmpstr = QString::fromUtf8("<FONT COLOR=BLACK>■ </FONT>");
opengl_filter_num_bak = config.opengl_filter_num;
#endif
if(bStartRecordSoundReq != false) {
- p_emu->start_rec_sound();
+ p_emu->start_record_sound();
bStartRecordSoundReq = false;
req_draw = true;
}
if(bStopRecordSoundReq != false) {
- p_emu->stop_rec_sound();
+ p_emu->stop_record_sound();
bStopRecordSoundReq = false;
req_draw = true;
}
run_frames = p_emu->run();
total_frames += run_frames;
#if defined(USE_MINIMUM_RENDERING)
- req_draw |= p_emu->screen_changed();
+ req_draw |= p_emu->is_screen_changed();
#else
req_draw = true;
#endif
sample_access_drv();
interval += get_interval();
- now_skip = p_emu->now_skip() && !p_emu->now_rec_video();
+ now_skip = p_emu->is_frame_skippable() && !p_emu->is_video_recording();
if((prev_skip && !now_skip) || next_time == 0) {
next_time = tick_timer.elapsed();
{
p_emu->suspend();
//p_emu->set_vm_screen_size(w, h, -1, -1, ww, wh);
- p_emu->set_window_size(w, h, true);
+ p_emu->set_host_window_size(w, h, true);
}
void EmuThreadClass::doUpdateVolumeLevel(int num, int level)
emu->hDebugger->debugger_thread_param.osd = emu->get_osd();
emu->hDebugger->debugger_thread_param.vm = vm;
emu->hDebugger->debugger_thread_param.cpu_index = no;
- emu->stop_rec_sound();
- emu->stop_rec_video();
+ emu->stop_record_sound();
+ emu->stop_record_video();
emu->now_debugging = true;
connect(this, SIGNAL(quit_debugger_thread()), emu->hDebugger, SLOT(doExit()));
//connect(this, SIGNAL(quit_debugger_thread()), emu->hDebugger, SLOT(close()));
const int fps[3] = {60, 30, 15};
if((num < 0) || (num > 2)) return;
if(emu) {
- //emit sig_emu_start_rec_screen();
- emu->start_rec_sound();
- if(!emu->start_rec_video(fps[num])) {
- emu->stop_rec_sound();
+ //emit sig_emu_start_record_screen();
+ emu->start_record_sound();
+ if(!emu->start_record_video(fps[num])) {
+ emu->stop_record_sound();
}
}
}
void OnStopRecordScreen(void)
{
if(emu) {
- //emit sig_emu_stop_rec_screen();
- emu->stop_rec_video();
- emu->stop_rec_sound();
+ //emit sig_emu_stop_record_screen();
+ emu->stop_record_video();
+ emu->stop_record_sound();
}
}
if(p_emu == NULL) return;
if((index < 0) || (index >= 2)) return;
p_emu->lock_vm();
- uint32_t *joy_status = p_emu->joy_buffer();
+ uint32_t *joy_status = p_emu->get_joy_buffer();
if(joy_status != NULL) {
if(value < -8192) { // left
if(p_emu == NULL) return;
if((index < 0) || (index >= 2)) return;
p_emu->lock_vm();
- uint32_t *joy_status = p_emu->joy_buffer();
+ uint32_t *joy_status = p_emu->get_joy_buffer();
if(joy_status != NULL) {
if(value < -8192) {// up
if(p_emu == NULL) return;
if((index < 0) || (index >= 2)) return;
p_emu->lock_vm();
- uint32_t *joy_status = p_emu->joy_buffer();
+ uint32_t *joy_status = p_emu->get_joy_buffer();
if(joy_status != NULL) {
joy_status[index] |= (1 << (button + 4));
}
if(p_emu == NULL) return;
if((index < 0) || (index >= 2)) return;
p_emu->lock_vm();
- uint32_t *joy_status = p_emu->joy_buffer();
+ uint32_t *joy_status = p_emu->get_joy_buffer();
if(joy_status != NULL) {
joy_status[index] &= ~(1 << (button + 4));
}
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="credits.html">../../../res/credits.html</file>
- <file alias="readme.txt">../../../../../readme.txt</file>
- <file alias="readme.qt.txt">../../../../../readme.qt.txt</file>
- <file alias="readme_by_mr_tanam.txt">../../../../../readme_by_mr_tanam.txt</file>
- <file alias="readme_by_artane.txt">../../../../../readme_by_artane.txt</file>
- <file alias="readme_fm7.txt">../../../../../readme_fm7.txt</file>
- <file alias="readme_fm7.jp.txt">../../../../../readme_fm7.jp.txt</file>
- <file alias="RELEASENOTE.txt">../../../../../RELEASENOTE.txt</file>
- <file alias="ChangeLog.txt">../../../../../ChangeLog</file>
+ <file alias="readme.txt">../../../../readme.txt</file>
+ <file alias="readme.qt.txt">../../../../readme.qt.txt</file>
+ <file alias="readme_by_mr_tanam.txt">../../../../readme_by_mr_tanam.txt</file>
+ <file alias="readme_by_artane.txt">../../../../readme_by_artane.txt</file>
+ <file alias="readme_fm7.txt">../../../../readme_fm7.txt</file>
+ <file alias="readme_fm7.jp.txt">../../../../readme_fm7.jp.txt</file>
+ <file alias="RELEASENOTE.txt">../../../../RELEASENOTE.txt</file>
+ <file alias="ChangeLog.txt">../../../../ChangeLog</file>
- <file alias="history.txt">../../../../../history.txt</file>
- <file alias="history_by_mr_tanam.txt">../../../../../history_by_mr_tanam.txt</file>
- <file alias="revision.txt">../../../../../revision.txt</file>
+ <file alias="history.txt">../../../../history.txt</file>
+ <file alias="history_by_mr_tanam.txt">../../../../history_by_mr_tanam.txt</file>
+ <file alias="revision.txt">../../../../revision.txt</file>
- <file alias="LICENSE.txt">../../../../../LICENSE</file>
- <file alias="LICENSE.ja.txt">../../../../../LICENSE.ja.txt</file>
+ <file alias="LICENSE.txt">../../../../LICENSE</file>
+ <file alias="LICENSE.ja.txt">../../../../LICENSE.ja.txt</file>
</qresource>
</RCC>
}
if(QApplication::overrideCursor() == NULL) {
if(p_emu != NULL) {
- if(p_emu->get_mouse_enabled()) {
+ if(p_emu->is_mouse_enabled()) {
QApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
}
}
tmps = tmps + QString::fromUtf8("_");
tmps = tmps + nowTime.toString(QString::fromUtf8("yyyy-MM-dd_hh-mm-ss.zzz"));
tmps = tmps + QString::fromUtf8(".png");
- filename_screen_pixmap = QString::fromLocal8Bit(application_path()) + tmps;
+ filename_screen_pixmap = QString::fromLocal8Bit(get_application_path()) + tmps;
}
}
if(uTmpDepthBuffer == 0) {
extfunc_3_0->glGenRenderbuffers(1, &uTmpDepthBuffer);
extfunc_3_0->glBindRenderbuffer(GL_RENDERBUFFER, uTmpDepthBuffer);
- extfunc_3_0->glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, SCREEN_WIDTH_ASPECT, SCREEN_HEIGHT_ASPECT);
+ extfunc_3_0->glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, SCREEN_WIDTH, SCREEN_HEIGHT);
extfunc_3_0->glBindRenderbuffer(GL_RENDERBUFFER, 0);
}
{
if(emu == NULL) return;
emu->lock_vm();
- bool flag = emu->get_mouse_enabled();
+ bool flag = emu->is_mouse_enabled();
if(!flag) {
graphicsView->grabMouse();
emu->enable_mouse();
hRunEmu->start();
AGAR_DebugLog(AGAR_LOG_DEBUG, "EmuThread : Launch done.");
- this->set_screen_aspect(config.stretch_type);
+ this->set_screen_aspect(config.window_stretch_type);
}
// So, does need below action?
// Maybe, needs Agar's changing action.
- config.stretch_type = num;
+ config.window_stretch_type = num;
if(emu) {
int w, h, n;
w = (int)(nd * (double)SCREEN_WIDTH);
h = (int)(nd * (double)SCREEN_HEIGHT);
#if defined(USE_CRT_MONITOR_4_3)
- if(config.stretch_type == 1) {
+ if(config.window_stretch_type == 1) {
h = (int)((double)h * ((double)SCREEN_WIDTH / (double)SCREEN_HEIGHT * 3.0 / 4.0));
- } else if(config.stretch_type == 2) {
+ } else if(config.window_stretch_type == 2) {
w = (int)((double)w * (4.0 / (3.0 * (double)SCREEN_WIDTH / (double)SCREEN_HEIGHT)));
}
//printf("%d x %d\n", w, h);
}
}
this->set_screen_size(w, h);
- this->set_screen_aspect(config.stretch_type);
+ this->set_screen_aspect(config.window_stretch_type);
if(actionScreenSize[config.window_mode] != NULL) {
double nd = actionScreenSize[config.window_mode]->binds->getDoubleValue();
graphicsView->do_set_screen_multiply(nd);
w = (int)(nd * (double)SCREEN_WIDTH);
h = (int)(nd * (double)SCREEN_HEIGHT);
#if defined(USE_CRT_MONITOR_4_3)
- if(config.stretch_type == 1) {
+ if(config.window_stretch_type == 1) {
h = (int)((double)h * ((double)SCREEN_WIDTH / (double)SCREEN_HEIGHT * 3.0 / 4.0));
- } else if(config.stretch_type == 2) {
+ } else if(config.window_stretch_type == 2) {
w = (int)((double)w * (4.0 / (3.0 * (double)SCREEN_WIDTH / (double)SCREEN_HEIGHT)));
}
#endif
actionDot_by_Dot = new Action_Control(this);
actionDot_by_Dot->setObjectName(QString::fromUtf8("actionDot_by_Dot"));
actionDot_by_Dot->setCheckable(true);
- if(config.stretch_type == 0) actionDot_by_Dot->setChecked(true);
+ if(config.window_stretch_type == 0) actionDot_by_Dot->setChecked(true);
actionDot_by_Dot->binds->setValue1(0);
actionKeep_Aspect = new Action_Control(this);
actionKeep_Aspect->setObjectName(QString::fromUtf8("actionKeep_Aspect"));
actionKeep_Aspect->setCheckable(true);
actionKeep_Aspect->binds->setValue1(1);
- if(config.stretch_type == 1) actionKeep_Aspect->setChecked(true);
+ if(config.window_stretch_type == 1) actionKeep_Aspect->setChecked(true);
actionFill_Display = new Action_Control(this);
actionFill_Display->setObjectName(QString::fromUtf8("actionFill_Display"));
actionFill_Display->setCheckable(true);
actionFill_Display->binds->setValue1(2);
- if(config.stretch_type == 2) actionFill_Display->setChecked(true);
+ if(config.window_stretch_type == 2) actionFill_Display->setChecked(true);
actionGroup_Stretch = new QActionGroup(this);
actionGroup_Stretch->setExclusive(true);
connect(sliderDeviceVolume[ij], SIGNAL(sig_emu_update_volume_level(int, int)),
parent_widget, SLOT(do_emu_update_volume_level(int, int)));
- if(!sound_device_monophonic[ii]) {
- sliderDeviceVolume[ij + 1] = new Ui_SndSliderObject(_emu, Qt::Vertical, this, ii + 1);
- sliderDeviceVolume[ij + 1]->setMinimum(-20);
- sliderDeviceVolume[ij + 1]->setMaximum(20);
- sliderDeviceVolume[ij + 1]->setSingleStep(1);
- sliderDeviceVolume[ij + 1]->setPageStep(4);
-
- sliderDeviceVolume[ij + 1]->setValue((config.sound_volume_r[ii] - config.sound_volume_l[ii]) / 2);
- sliderDeviceVolume[ij + 1]->connect(sliderDeviceVolume[ij + 1], SIGNAL(valueChanged(int)),
+ sliderDeviceVolume[ij + 1] = new Ui_SndSliderObject(_emu, Qt::Vertical, this, ii + 1);
+ sliderDeviceVolume[ij + 1]->setMinimum(-20);
+ sliderDeviceVolume[ij + 1]->setMaximum(20);
+ sliderDeviceVolume[ij + 1]->setSingleStep(1);
+ sliderDeviceVolume[ij + 1]->setPageStep(4);
+
+ sliderDeviceVolume[ij + 1]->setValue((config.sound_volume_r[ii] - config.sound_volume_l[ii]) / 2);
+ sliderDeviceVolume[ij + 1]->connect(sliderDeviceVolume[ij + 1], SIGNAL(valueChanged(int)),
sliderDeviceVolume[ij + 1], SLOT(setBalanceValue(int)));
- connect(sliderDeviceVolume[ij + 1], SIGNAL(sig_emu_update_volume_balance(int, int)),
- parent_widget, SLOT(do_emu_update_volume_balance(int, int)));
- }
+ connect(sliderDeviceVolume[ij + 1], SIGNAL(sig_emu_update_volume_balance(int, int)),
+ parent_widget, SLOT(do_emu_update_volume_balance(int, int)));
+
boxDeviceVolume[ii] = new QGroupBox(lbl);
HBoxDeviceVolume[ii] = new QHBoxLayout;
HBoxDeviceVolume[ii]->addWidget(sliderDeviceVolume[ij]);
- if(!sound_device_monophonic[ii]) {
- HBoxDeviceVolume[ii]->addWidget(sliderDeviceVolume[ij + 1]);
- }
+ HBoxDeviceVolume[ii]->addWidget(sliderDeviceVolume[ij + 1]);
+
boxDeviceVolume[ii]->setLayout(HBoxDeviceVolume[ii]);
HBoxWindow->addWidget(boxDeviceVolume[ii]);
ij += 2;
if(emu && emu->d88_file[drive].cur_bank != num) {
emit sig_open_disk(drive, path, num);
- if(emu->get_disk_protected(drive)) {
+ if(emu->is_floppy_disk_protected(drive)) {
menu_fds[drive]->do_set_write_protect(true);
} else {
menu_fds[drive]->do_set_write_protect(false);
int i;
if(emu == NULL) return;
menu_fds[drv]->do_update_histories(listFDs[drv]);
- menu_fds[drv]->do_set_initialize_directory(config.initial_disk_dir);
- if(emu->get_disk_protected(drv)) {
+ menu_fds[drv]->do_set_initialize_directory(config.initial_floppy_disk_dir);
+ if(emu->is_floppy_disk_protected(drv)) {
menu_fds[drv]->do_write_protect_media();
} else {
menu_fds[drv]->do_write_unprotect_media();
char path_shadow[PATH_MAX];
int i;
if((num < 0) || (num >= MAX_HISTORY)) return -1;
- s_path = QString::fromUtf8(config.recent_disk_path[drv][num]);
+ s_path = QString::fromUtf8(config.recent_floppy_disk_path[drv][num]);
strncpy(path_shadow, s_path.toUtf8().constData(), PATH_MAX);
- UPDATE_HISTORY(path_shadow, config.recent_disk_path[drv], listFDs[drv]);
+ UPDATE_HISTORY(path_shadow, config.recent_floppy_disk_path[drv], listFDs[drv]);
strncpy(path_shadow, s_path.toUtf8().constData(), PATH_MAX);
get_parent_dir(path_shadow);
- strcpy(config.initial_disk_dir, path_shadow);
+ strcpy(config.initial_floppy_disk_dir, path_shadow);
strncpy(path_shadow, s_path.toUtf8().constData(), PATH_MAX);
if(emu) {
emit sig_close_disk(drv);
emit sig_open_disk(drv, s_path, 0);
menu_fds[drv]->do_update_histories(listFDs[drv]);
- menu_fds[drv]->do_set_initialize_directory(config.initial_disk_dir);
+ menu_fds[drv]->do_set_initialize_directory(config.initial_floppy_disk_dir);
if(check_file_extension(path_shadow, ".d88") || check_file_extension(path_shadow, ".d77")) {
UPDATE_D88_LIST(drv, listD88[drv]);
menu_fds[drv]->do_update_inner_media(listD88[drv], 0);
emit sig_close_disk(drv2);
emit sig_open_disk(drv2, s_path, 1);
menu_fds[drv2]->do_update_histories(listFDs[drv2]);
- menu_fds[drv2]->do_set_initialize_directory(config.initial_disk_dir);
+ menu_fds[drv2]->do_set_initialize_directory(config.initial_floppy_disk_dir);
UPDATE_D88_LIST(drv2, listD88[drv2]);
menu_fds[drv2]->do_update_inner_media(listD88[drv2], 1);
}
if(fname.length() <= 0) return;
drv = drv & 7;
strncpy(path_shadow, fname.toUtf8().constData(), PATH_MAX);
- UPDATE_HISTORY(path_shadow, config.recent_disk_path[drv], listFDs[drv]);
+ UPDATE_HISTORY(path_shadow, config.recent_floppy_disk_path[drv], listFDs[drv]);
get_parent_dir(path_shadow);
- strcpy(config.initial_disk_dir, path_shadow);
+ strcpy(config.initial_floppy_disk_dir, path_shadow);
// Update List
strncpy(path_shadow, fname.toUtf8().constData(), PATH_MAX);
if(emu) {
//emu->LockVM();
emit sig_open_disk(drv, fname, 0);
menu_fds[drv]->do_update_histories(listFDs[drv]);
- menu_fds[drv]->do_set_initialize_directory(config.initial_disk_dir);
+ menu_fds[drv]->do_set_initialize_directory(config.initial_floppy_disk_dir);
if(check_file_extension(path_shadow, ".d88") || check_file_extension(path_shadow, ".d77")) {
UPDATE_D88_LIST(drv, listD88[drv]);
menu_fds[drv]->do_update_inner_media(listD88[drv], 0);
strncpy(path_shadow, fname.toUtf8().constData(), PATH_MAX);
emit sig_open_disk(drv2, fname, 1);
menu_fds[drv2]->do_update_histories(listFDs[drv2]);
- menu_fds[drv2]->do_set_initialize_directory(config.initial_disk_dir);
+ menu_fds[drv2]->do_set_initialize_directory(config.initial_floppy_disk_dir);
UPDATE_D88_LIST(drv2, listD88[drv2]);
menu_fds[drv2]->do_update_inner_media(listD88[drv2], 1);
}
menu_fds[drv]->do_clear_inner_media();
menu_fds[drv]->do_add_media_extension(ext, desc1);
- SETUP_HISTORY(config.recent_disk_path[drv], listFDs[drv]);
+ SETUP_HISTORY(config.recent_floppy_disk_path[drv], listFDs[drv]);
menu_fds[drv]->do_update_histories(listFDs[drv]);
- menu_fds[drv]->do_set_initialize_directory(config.initial_disk_dir);
+ menu_fds[drv]->do_set_initialize_directory(config.initial_floppy_disk_dir);
listD88[drv].clear();
QString name = QString::fromUtf8("FD");
OSD::OSD() : QThread(0)
{
VMSemaphore = new QSemaphore(1);
+ locked_vm = false;
}
OSD::~OSD()
void OSD::lock_vm(void)
{
+ locked_vm = true;
if(parent_thread != NULL) {
if(!parent_thread->now_debugging()) VMSemaphore->acquire(1);
} else {
void OSD::unlock_vm(void)
{
+ locked_vm = false;
if(parent_thread != NULL) {
if(!parent_thread->now_debugging()) VMSemaphore->release(1);
} else {
}
}
+bool OSD::is_vm_locked(void)
+{
+ return locked_vm;
+}
+
void OSD::force_unlock_vm(void)
{
if(parent_thread == NULL) {
private:
_TCHAR app_path[_MAX_PATH];
QElapsedTimer osd_timer;
+ bool locked_vm;
// console
FILE *hStdIn, *hStdOut;
bitmap_t vm_screen_buffer;
bitmap_t video_screen_buffer;
bitmap_t* draw_screen_buffer;
+ int vm_window_width, vm_window_height;
+ int vm_window_width_aspect, vm_window_height_aspect;
int host_window_width, host_window_height;
bool host_window_mode;
int base_window_width, base_window_height;
- int vm_screen_width, vm_screen_height, vm_screen_width_aspect, vm_screen_height_aspect;
+ int vm_screen_width, vm_screen_height;
int draw_screen_width, draw_screen_height;
void update_input();
void key_down(int code, bool repeat);
void key_up(int code);
+ void key_down_native(int code, bool repeat);
+ void key_up_native(int code);
void key_lost_focus()
{
lost_focus = true;
void enable_mouse();
void disenable_mouse();
void toggle_mouse();
- bool get_mouse_enabled()
+ bool is_mouse_enabled()
{
return mouse_enabled;
}
- //QImage *getPseudoVramClass(void) { return pPseudoVram;}
+ //QImage *getPseudoVramClass(void) { return pPseudoVram;}
void set_mouse_pointer(int x, int y) {
mouse_ptrx = x;
mouse_ptry = y;
#ifdef USE_AUTO_KEY
void start_auto_key();
void stop_auto_key();
- bool now_auto_key()
- {
- return (autokey_phase != 0);
- }
+ bool now_auto_key;
#endif
void modify_key_buffer(int code, uint8 val)
{
key_status[code] = val;
}
- uint8* key_buffer()
+ uint8* get_key_buffer()
{
return key_status;
}
- uint32* joy_buffer()
+ uint32* get_joy_buffer()
{
return joy_status;
}
- int* mouse_buffer()
+ int* get_mouse_buffer()
{
return mouse_status;
}
// common screen
int get_window_width(int mode);
int get_window_height(int mode);
- void set_window_size(int window_width, int window_height, bool window_mode);
+ void set_host_window_size(int window_width, int window_height, bool window_mode);
void set_vm_screen_size(int width, int height, int width_aspect, int height_aspect, int window_width, int window_height);
+ int get_vm_window_width()
+ {
+ return vm_window_width;
+ }
+ int get_vm_window_height()
+ {
+ return vm_window_height;
+ }
+ int get_vm_window_width_aspect()
+ {
+ return vm_window_width_aspect;
+ }
+ int get_vm_window_height_aspect()
+ {
+ return vm_window_height_aspect;
+ }
scrntype* get_vm_screen_buffer(int y);
int draw_screen();
#ifdef ONE_BOARD_MICRO_COMPUTER
}
#endif
void capture_screen();
- bool start_rec_video(int fps);
- void stop_rec_video();
- void restart_rec_video();
+ bool start_record_video(int fps);
+ void stop_record_video();
+ void restart_record_video();
void add_extra_frames(int extra_frames);
- bool now_rec_video;
+ bool now_record_video;
#ifdef USE_CRT_FILTER
bool screen_skip_line;
#endif
void update_sound(int* extra_frames);
void mute_sound();
void stop_sound();
- void start_rec_sound();
- void stop_rec_sound();
- void restart_rec_sound();
- bool now_rec_sound;
+ void start_record_sound();
+ void stop_record_sound();
+ void restart_record_sound();
+ bool now_record_sound;
#if defined(USE_MOVIE_PLAYER) || defined(USE_VIDEO_CAPTURE)
// common video device
void lock_vm(void);
void unlock_vm(void);
void force_unlock_vm(void);
+ bool is_vm_locked(void);
public slots:
#ifdef USE_AUTO_KEY
#endif
}
+void OSD::key_down_native(int code, bool repeat)
+{
+ bool keep_frames = false;
+
+ if(code == 0xf0) {
+ code = VK_CAPITAL;
+ keep_frames = true;
+ } else if(code == 0xf2) {
+ code = VK_KANA;
+ keep_frames = true;
+ } else if(code == 0xf3 || code == 0xf4) {
+ code = VK_KANJI;
+ keep_frames = true;
+ }
+ if(!(code == VK_LSHIFT || code == VK_RSHIFT || code == VK_LCONTROL || code == VK_RCONTROL || code == VK_LMENU || code == VK_RMENU)) {
+ code = keycode_conv[code];
+ }
+
+#ifdef DONT_KEEEP_KEY_PRESSED
+ if(!(code == VK_LSHIFT || code == VK_RSHIFT || code == VK_LCONTROL || code == VK_RCONTROL || code == VK_LMENU || code == VK_RMENU)) {
+ key_status[code] = KEY_KEEP_FRAMES;
+ } else
+#endif
+ key_status[code] = keep_frames ? KEY_KEEP_FRAMES : 0x80;
+
+#ifdef NOTIFY_KEY_DOWN
+#ifndef NOTIFY_KEY_DOWN_LR_SHIFT
+ uint8 prev_shift = key_status[VK_SHIFT];
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_CONTROL
+ uint8 prev_control = key_status[VK_CONTROL];
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_MENU
+ uint8 prev_menu = key_status[VK_MENU];
+#endif
+#endif
+ key_status[VK_SHIFT] = key_status[VK_LSHIFT] | key_status[VK_RSHIFT];
+ key_status[VK_CONTROL] = key_status[VK_LCONTROL] | key_status[VK_RCONTROL];
+ key_status[VK_MENU] = key_status[VK_LMENU] | key_status[VK_RMENU];
+
+#ifdef NOTIFY_KEY_DOWN
+ if(keep_frames) {
+ repeat = false;
+ }
+#ifndef NOTIFY_KEY_DOWN_LR_SHIFT
+ if(code == VK_LSHIFT || code == VK_RSHIFT) {
+ if(prev_shift == 0 && key_status[VK_SHIFT] != 0) {
+ vm->key_down(VK_SHIFT, repeat);
+ }
+ return;
+ }
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_CONTROL
+ if(code == VK_LCONTROL|| code == VK_RCONTROL) {
+ if(prev_control == 0 && key_status[VK_CONTROL] != 0) {
+ vm->key_down(VK_CONTROL, repeat);
+ }
+ return;
+ }
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_MENU
+ if(code == VK_LMENU|| code == VK_RMENU) {
+ if(prev_menu == 0 && key_status[VK_MENU] != 0) {
+ vm->key_down(VK_MENU, repeat);
+ }
+ return;
+ }
+#endif
+ vm->key_down(code, repeat);
+#endif
+}
+
+void OSD::key_up_native(int code)
+{
+ if(!(code == VK_LSHIFT || code == VK_RSHIFT || code == VK_LCONTROL || code == VK_RCONTROL || code == VK_LMENU || code == VK_RMENU)) {
+ code = keycode_conv[code];
+ }
+ if(key_status[code] == 0) {
+ return;
+ }
+ if((key_status[code] &= 0x7f) != 0) {
+ return;
+ }
+
+#ifdef NOTIFY_KEY_DOWN
+#ifndef NOTIFY_KEY_DOWN_LR_SHIFT
+ uint8 prev_shift = key_status[VK_SHIFT];
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_CONTROL
+ uint8 prev_control = key_status[VK_CONTROL];
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_MENU
+ uint8 prev_menu = key_status[VK_MENU];
+#endif
+#endif
+ key_status[VK_SHIFT] = key_status[VK_LSHIFT] | key_status[VK_RSHIFT];
+ key_status[VK_CONTROL] = key_status[VK_LCONTROL] | key_status[VK_RCONTROL];
+ key_status[VK_MENU] = key_status[VK_LMENU] | key_status[VK_RMENU];
+
+#ifdef NOTIFY_KEY_DOWN
+#ifndef NOTIFY_KEY_DOWN_LR_SHIFT
+ if(code == VK_LSHIFT || code == VK_RSHIFT) {
+ if(prev_shift != 0 && key_status[VK_SHIFT] == 0) {
+ vm->key_up(VK_SHIFT);
+ }
+ return;
+ }
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_CONTROL
+ if(code == VK_LCONTROL|| code == VK_RCONTROL) {
+ if(prev_control != 0 && key_status[VK_CONTROL] == 0) {
+ vm->key_up(VK_CONTROL);
+ }
+ return;
+ }
+#endif
+#ifndef NOTIFY_KEY_DOWN_LR_MENU
+ if(code == VK_LMENU || code == VK_RMENU) {
+ if(prev_menu != 0 && key_status[VK_MENU] == 0) {
+ vm->key_up(VK_MENU);
+ }
+ return;
+ }
+#endif
+ vm->key_up(code);
+#endif
+}
+
void OSD::key_down_sub(int code, bool repeat)
{
bool keep_frames = false;
vm_screen_width = SCREEN_WIDTH;
vm_screen_height = SCREEN_HEIGHT;
- vm_screen_width_aspect = SCREEN_WIDTH_ASPECT;
- vm_screen_height_aspect = SCREEN_HEIGHT_ASPECT;
+ vm_window_width = WINDOW_WIDTH;
+ vm_window_height = WINDOW_HEIGHT;
+ vm_window_width_aspect = WINDOW_WIDTH_ASPECT;
+ vm_window_height_aspect = WINDOW_HEIGHT_ASPECT;
QColor col(0, 0, 0, 255);
//memset(&vm_screen_buffer, 0, sizeof(bitmap_t));
vm_screen_buffer.height = SCREEN_HEIGHT;
vm_screen_buffer.pImage = QImage(SCREEN_WIDTH, SCREEN_HEIGHT, QImage::Format_ARGB32);
vm_screen_buffer.pImage.fill(col);
- now_rec_video = false;
+ now_record_video = false;
//pAVIStream = NULL;
//pAVICompressed = NULL;
//pAVIFile = NULL;
void OSD::release_screen()
{
- stop_rec_video();
+ stop_record_video();
//release_d3d9();
//if(vm_screen_buffer.pImage != NULL) delete vm_screen_buffer.pImage;
int OSD::get_window_width(int mode)
{
#ifdef USE_SCREEN_ROTATE
- if(config.rotate_type) {
- return base_window_height + vm_screen_height_aspect * mode;
+ if(config.rotate_type == 1 || config.rotate_type == 3) {
+ return (config.window_stretch_type == 0 ? vm_window_height : vm_window_height_aspect) * (mode + WINDOW_MODE_BASE);
}
#endif
- return base_window_width + vm_screen_width_aspect * mode;
+ return (config.window_stretch_type == 0 ? vm_window_width : vm_window_width_aspect) * (mode + WINDOW_MODE_BASE);
}
int OSD::get_window_height(int mode)
{
#ifdef USE_SCREEN_ROTATE
- if(config.rotate_type) {
- return base_window_width + vm_screen_width_aspect * mode;
+ if(config.rotate_type == 1 || config.rotate_type == 3) {
+ return (config.window_stretch_type == 0 ? vm_window_width : vm_window_width_aspect) * (mode + WINDOW_MODE_BASE);
}
#endif
- return base_window_height + vm_screen_height_aspect * mode;
+ return (config.window_stretch_type == 0 ? vm_window_height : vm_window_height_aspect) * (mode + WINDOW_MODE_BASE);
}
-void OSD::set_window_size(int window_width, int window_height, bool window_mode)
+void OSD::set_host_window_size(int window_width, int window_height, bool window_mode)
{
if(window_width != -1) {
host_window_width = window_width;
first_invalidate = true;
}
-void OSD::set_vm_screen_size(int width, int height, int width_aspect, int height_aspect, int window_width, int window_height)
+void OSD::set_vm_screen_size(int screen_width, int screen_height, int window_width, int window_height, int window_width_aspect, int window_height_aspect)
{
- if(vm_screen_width != width || vm_screen_height != height) {
- if(width_aspect == -1) {
- width_aspect = width;
+ if(vm_screen_width != screen_width || vm_screen_height != screen_height) {
+ if(window_width == -1) {
+ window_width = screen_width;
}
- if(height_aspect == -1) {
- height_aspect = height;
+ if(window_height == -1) {
+ window_height = screen_height;
}
- int wold = vm_screen_width;
- int hold = vm_screen_height;
- vm_screen_width = width;
- vm_screen_height = height;
- vm_screen_width_aspect = width_aspect;
- vm_screen_height_aspect = height_aspect;
- base_window_width = window_width;
- base_window_height = window_height;
+ if(window_width_aspect == -1) {
+ window_width_aspect = window_width;
+ }
+ if(window_height_aspect == -1) {
+ window_height_aspect = window_height;
+ }
+ vm_screen_width = screen_width;
+ vm_screen_height = screen_height;
+ vm_window_width = window_width;
+ vm_window_height = window_height;
+ vm_window_width_aspect = window_width_aspect;
+ vm_window_height_aspect = window_height_aspect;
+
// change the window size
- //emit sig_resize_vm_screen(vm_screen_width, vm_screen_height);
+ emit sig_resize_vm_screen(&(vm_screen_buffer.pImage), vm_window_width, vm_window_height);
}
+// if(vm_screen_buffer.width != vm_screen_width || vm_screen_buffer.height != vm_screen_height) {
+// if(now_record_video) {
+// stop_record_video();
+//// stop_record_sound();
+// }
+// //initialize_screen_buffer(&vm_screen_buffer, vm_screen_width, vm_screen_height, COLORONCOLOR);
+// initialize_screen_buffer(&vm_screen_buffer, vm_screen_width, vm_screen_height, 0);
+// emit sig_resize_vm_screen(&(vm_screen_buffer.pImage), vm_window_width, vm_window_height);
+// }
}
+
scrntype* OSD::get_vm_screen_buffer(int y)
{
return get_buffer(&vm_screen_buffer, y);
int OSD::draw_screen()
{
// check avi file recording timing
- if(now_rec_video && rec_video_run_frames <= 0) {
+ if(now_record_video && rec_video_run_frames <= 0) {
return 0;
}
// draw screen
lock_vm();
if(vm_screen_buffer.width != vm_screen_width || vm_screen_buffer.height != vm_screen_height) {
- if(now_rec_video) {
- stop_rec_video();
-// stop_rec_sound();
+ if(now_record_video) {
+ stop_record_video();
+// stop_record_sound();
}
initialize_screen_buffer(&vm_screen_buffer, vm_screen_width, vm_screen_height, 0);
}
first_draw_screen = self_invalidate = true;
// record avi file
- if(now_rec_video) {
+ if(now_record_video) {
return add_video_frames();
} else {
return 1;
// create bitmap
}
-bool OSD::start_rec_video(int fps)
+bool OSD::start_record_video(int fps)
{
if(fps > 0) {
rec_video_fps = fps;
strhdr.dwSuggestedBufferSize = video_screen_buffer.lpDib->bmiHeader.biSizeImage;
SetRect(&strhdr.rcFrame, 0, 0, video_screen_buffer.width, video_screen_buffer.height);
if(AVIFileCreateStream(pAVIFile, &pAVIStream, &strhdr) != AVIERR_OK) {
- stop_rec_video();
+ stop_record_video();
return false;
}
pOpts[0] = &AVIOpts;
if(show_dialog && !AVISaveOptions(main_window_handle, ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE, 1, &pAVIStream, (LPAVICOMPRESSOPTIONS FAR *)&pOpts)) {
AVISaveOptionsFree(1, (LPAVICOMPRESSOPTIONS FAR *)&pOpts);
- stop_rec_video();
+ stop_record_video();
return false;
}
if(AVIMakeCompressedStream(&pAVICompressed, pAVIStream, &AVIOpts, NULL) != AVIERR_OK) {
- stop_rec_video();
+ stop_record_video();
return false;
}
if(AVIStreamSetFormat(pAVICompressed, 0, &video_screen_buffer.lpDib->bmiHeader, video_screen_buffer.lpDib->bmiHeader.biSize + video_screen_buffer.lpDib->bmiHeader.biClrUsed * sizeof(RGBQUAD)) != AVIERR_OK) {
- stop_rec_video();
+ stop_record_video();
return false;
}
dwAVIFileSize = 0;
rec_video_thread_param.frames = 0;
rec_video_thread_param.result = 0;
#endif
- now_rec_video = true;
+ now_record_video = true;
return true;
}
-void OSD::stop_rec_video()
+void OSD::stop_record_video()
{
#if 0
// release thread
pAVIFile = NULL;
// repair header
- if(now_rec_video) {
+ if(now_record_video) {
FILE* fp = NULL;
if((fp = _tfopen(bios_path(video_file_name), _T("r+b"))) != NULL) {
// copy fccHandler
}
}
#endif
- now_rec_video = false;
+ now_record_video = false;
}
-void OSD::restart_rec_video()
+void OSD::restart_record_video()
{
- bool tmp = now_rec_video;
- stop_rec_video();
+ bool tmp = now_record_video;
+ stop_record_video();
if(tmp) {
- start_rec_video(-1);
+ start_record_video(-1);
}
}
hVideoThread = (HANDLE)0;
if(rec_video_thread_param.result == REC_VIDEO_FULL) {
- stop_rec_video();
- if(!start_rec_video(-1)) {
+ stop_record_video();
+ if(!start_record_video(-1)) {
return 0;
}
} else if(rec_video_thread_param.result == REC_VIDEO_ERROR) {
- stop_rec_video();
+ stop_record_video();
return 0;
}
}
rec_video_thread_param.frames += counter;
rec_video_thread_param.result = 0;
if((hVideoThread = (HANDLE)_beginthreadex(NULL, 0, rec_video_thread, &rec_video_thread_param, 0, NULL)) == (HANDLE)0) {
- stop_rec_video();
+ stop_record_video();
return 0;
}
}
sound_rate = rate;
sound_samples = samples;
- sound_ok = sound_started = now_mute = now_rec_sound = false;
+ sound_ok = sound_started = now_mute = now_record_sound = false;
rec_sound_buffer_ptr = 0;
- sound_ok = sound_started = now_mute = now_rec_sound = false;
+ sound_ok = sound_started = now_mute = now_record_sound = false;
sound_write_pos = 0;
sound_data_len = 0;
sound_buffer_size = 0;
}
if(sound_buf_ptr != NULL) free(sound_buf_ptr);
// stop recording
- stop_rec_sound();
+ stop_record_sound();
}
void OSD::update_sound(int* extra_frames)
//SDL_UnlockAudio();
// sound buffer must be updated
Sint16* sound_buffer = (Sint16 *)vm->create_sound(extra_frames);
- if(now_rec_sound) {
+ if(now_record_sound) {
// record sound
if(sound_samples > rec_sound_buffer_ptr) {
int samples = sound_samples - rec_sound_buffer_ptr;
int length = samples * sizeof(uint16) * 2; // stereo
rec_sound_fio->Fwrite(sound_buffer + rec_sound_buffer_ptr * 2, length, 1);
rec_sound_bytes += length;
- if(now_rec_video) {
+ if(now_record_video) {
// sync video recording
static double frames = 0;
static int prev_samples = -1;
}
}
-void OSD::start_rec_sound()
+void OSD::start_record_sound()
{
- if(!now_rec_sound) {
+ if(!now_record_sound) {
//LockVM();
QDateTime nowTime = QDateTime::currentDateTime();
QString tmps = QString::fromUtf8("Sound_Save_emu");
rec_sound_bytes = 0;
rec_sound_buffer_ptr = 0;
- now_rec_sound = true;
+ now_record_sound = true;
} else {
// failed to open the wave file
delete rec_sound_fio;
}
}
-void OSD::stop_rec_sound()
+void OSD::stop_record_sound()
{
- if(now_rec_sound) {
+ if(now_record_sound) {
//LockVM();
if(rec_sound_bytes == 0) {
rec_sound_fio->Fclose();
rec_sound_fio->Fclose();
}
delete rec_sound_fio;
- now_rec_sound = false;
+ now_record_sound = false;
//UnlockVM();
}
}
-void OSD::restart_rec_sound()
+void OSD::restart_record_sound()
{
- bool tmp = now_rec_sound;
- stop_rec_sound();
+ bool tmp = now_record_sound;
+ stop_record_sound();
if(tmp) {
- start_rec_sound();
+ start_record_sound();
}
}
{
return NULL;
}
- virtual uint32 get_debug_prog_addr_mask()
+ virtual uint32 debug_prog_addr_mask()
{
return 0;
}
- virtual uint32 get_debug_data_addr_mask()
+ virtual uint32 debug_data_addr_mask()
{
return 0;
}
{
return false;
}
- virtual void get_debug_regs_info(_TCHAR *buffer, size_t buffer_len) {}
+ virtual void debug_regs_info(_TCHAR *buffer, size_t buffer_len) {}
virtual int debug_dasm(uint32 pc, _TCHAR *buffer, size_t buffer_len)
{
return 0;
#else
is_cyclesteal = false;
#endif
+// emu->set_vm_screen_size(640, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
emu->set_vm_screen_size(640, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
enter_display();
nmi_event_id = -1;
firq_mask = false;
key_firq_req = false; //firq_mask = true;
frame_skip_count = 3;
+ emu->set_vm_screen_size(640, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
}
void DISPLAY::release()
dmac = NULL;
#endif
memset(io_w_latch, 0xff, 0x100);
- init_output_signals(&clock_status);
- init_output_signals(&printer_reset_bus);
- init_output_signals(&printer_strobe_bus);
- init_output_signals(&printer_select_bus);
+ initialize_output_signals(&clock_status);
+ initialize_output_signals(&printer_reset_bus);
+ initialize_output_signals(&printer_strobe_bus);
+ initialize_output_signals(&printer_select_bus);
}
FM7_MAINIO::~FM7_MAINIO()
release_screen_buffer(&video_screen_buffer);
}
-int OSD::get_window_width(int mode)
+int OSD::get_vm_window_width(int mode)
{
#ifdef USE_SCREEN_ROTATE
if(config.rotate_type == 1 || config.rotate_type == 3) {
return (config.window_stretch_type == 0 ? vm_window_width : vm_window_width_aspect) * (mode + WINDOW_MODE_BASE);
}
-int OSD::get_window_height(int mode)
+int OSD::get_vm_window_height(int mode)
{
#ifdef USE_SCREEN_ROTATE
if(config.rotate_type == 1 || config.rotate_type == 3) {