From 8d0a5aa34a1e2b6256247f4a584fb6706c362ce3 Mon Sep 17 00:00:00 2001 From: "K.Ohta" Date: Wed, 30 Sep 2015 22:37:33 +0900 Subject: [PATCH] [VM][Qt] Add SANYOPHC-20, PHC-25 and SEIKO MAP-1010 . --- source/build-cmake/map1010/CMakeLists.txt | 69 +++++++++++++++++++++++++++++++ source/build-cmake/phc20/CMakeLists.txt | 54 ++++++++++++++++++++++++ source/build-cmake/phc25/CMakeLists.txt | 69 +++++++++++++++++++++++++++++++ source/src/qt/common/qrc/map1010.qrc | 5 +++ source/src/qt/common/qrc/phc20.qrc | 5 +++ source/src/qt/common/qrc/phc25.qrc | 5 +++ source/src/qt/phc20/CMakeLists.txt | 18 ++++++++ source/src/qt/phc20/MainWindow.cpp | 60 +++++++++++++++++++++++++++ source/src/qt/phc20/menuclasses.h | 30 ++++++++++++++ source/src/qt/phc25/CMakeLists.txt | 18 ++++++++ source/src/qt/phc25/MainWindow.cpp | 60 +++++++++++++++++++++++++++ source/src/qt/phc25/menuclasses.h | 30 ++++++++++++++ source/src/vm/phc25/phc25.cpp | 6 +-- source/src/vm/phc25/phc25.h | 2 +- 14 files changed, 427 insertions(+), 4 deletions(-) create mode 100644 source/build-cmake/map1010/CMakeLists.txt create mode 100644 source/build-cmake/phc20/CMakeLists.txt create mode 100644 source/build-cmake/phc25/CMakeLists.txt create mode 100644 source/src/qt/common/qrc/map1010.qrc create mode 100644 source/src/qt/common/qrc/phc20.qrc create mode 100644 source/src/qt/common/qrc/phc25.qrc create mode 100644 source/src/qt/phc20/CMakeLists.txt create mode 100644 source/src/qt/phc20/MainWindow.cpp create mode 100644 source/src/qt/phc20/menuclasses.h create mode 100644 source/src/qt/phc25/CMakeLists.txt create mode 100644 source/src/qt/phc25/MainWindow.cpp create mode 100644 source/src/qt/phc25/menuclasses.h diff --git a/source/build-cmake/map1010/CMakeLists.txt b/source/build-cmake/map1010/CMakeLists.txt new file mode 100644 index 000000000..29b0bfc4b --- /dev/null +++ b/source/build-cmake/map1010/CMakeLists.txt @@ -0,0 +1,69 @@ +# Build Common Sourcecode Project, Qt. +# (C) 2014 K.Ohta +# This is part of XM7/SDL, but license is apache 2.2, +# this part was written only me. + +cmake_minimum_required (VERSION 2.8) +cmake_policy(SET CMP0011 NEW) + +message("") +message("** Start of configure CommonSourceProject,SEIKO MAP1010, Qt **") +message("") + +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake") + +project (map1010) + +set(LOCAL_LIBS vm_phc25 + vm_vm + vm_fmgen + common_common + qt_debugger + qt_phc25 + qt_gui + ) + +set(VMFILES + z80.cpp + not.cpp + mc6847.cpp + ym2203.cpp + + datarec.cpp + io.cpp + + event.cpp +) + +set(BUILD_SHARED_LIBS OFF) +set(USE_OPENMP ON CACHE BOOL "Build using OpenMP") +set(USE_OPENGL ON CACHE BOOL "Build using OpenGL") + +include(detect_target_cpu) +#include(windows-mingw-cross) +# set entry +set(CMAKE_SYSTEM_PROCESSOR ${ARCHITECTURE} CACHE STRING "Set processor to build.") + +set(BUILD_PHC25 OFF CACHE BOOL "Build ePHC25") +set(BUILD_MAP1010 ON CACHE BOOL "Build eMAP1010") + +if(BUILD_PHC25) + add_definitions(-D_PHC25) + set(EXEC_TARGET emuphc25) + set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/phc25.qrc) +elseif(BUILD_MAP1010) + add_definitions(-D_MAP1010) + set(EXEC_TARGET emumap1010) + set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/map1010.qrc) +endif() + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/phc25) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/phc25) + +include(config_commonsource) + +add_subdirectory(../../src/vm/phc25 vm/phc25) +add_subdirectory(../../src/vm/fmgen vm/fmgen) +add_subdirectory(../../src/qt/phc25 qt/phc25) +add_subdirectory(../../src/qt/common qt/common) +add_subdirectory(../../src/qt/debugger qt/debugger) diff --git a/source/build-cmake/phc20/CMakeLists.txt b/source/build-cmake/phc20/CMakeLists.txt new file mode 100644 index 000000000..f271047ce --- /dev/null +++ b/source/build-cmake/phc20/CMakeLists.txt @@ -0,0 +1,54 @@ +# Build Common Sourcecode Project, Qt. +# (C) 2014 K.Ohta +# This is part of XM7/SDL, but license is apache 2.2, +# this part was written only me. + +cmake_minimum_required (VERSION 2.8) +cmake_policy(SET CMP0011 NEW) + +message("") +message("** Start of configure CommonSourceProject,SANYO PHC-20, Qt **") +message("") + +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake") + +project (phc20) + +set(LOCAL_LIBS vm_phc20 + vm_vm + common_common +# qt_debugger + qt_phc20 + qt_gui + ) + +set(VMFILES + z80.cpp + + mc6847.cpp + + datarec.cpp + event.cpp +) + +set(BUILD_SHARED_LIBS OFF) +set(USE_OPENMP ON CACHE BOOL "Build using OpenMP") +set(USE_OPENGL ON CACHE BOOL "Build using OpenGL") + +include(detect_target_cpu) +# set entry +set(CMAKE_SYSTEM_PROCESSOR ${ARCHITECTURE} CACHE STRING "Set processor to build.") + +add_definitions(-D_PHC20) +set(EXEC_TARGET emuphc20) +set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/phc20.qrc) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/phc20) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/phc20) + +include(config_commonsource) + +add_subdirectory(../../src/vm/phc20 vm/phc20) +add_subdirectory(../../src/qt/phc20 qt/phc20) +add_subdirectory(../../src/qt/common qt/common) +#add_subdirectory(../../src/qt/debugger qt/debugger) diff --git a/source/build-cmake/phc25/CMakeLists.txt b/source/build-cmake/phc25/CMakeLists.txt new file mode 100644 index 000000000..412b3014e --- /dev/null +++ b/source/build-cmake/phc25/CMakeLists.txt @@ -0,0 +1,69 @@ +# Build Common Sourcecode Project, Qt. +# (C) 2014 K.Ohta +# This is part of XM7/SDL, but license is apache 2.2, +# this part was written only me. + +cmake_minimum_required (VERSION 2.8) +cmake_policy(SET CMP0011 NEW) + +message("") +message("** Start of configure CommonSourceProject,SEIKO MAP1010, Qt **") +message("") + +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake") + +project (map1010) + +set(LOCAL_LIBS vm_phc25 + vm_vm + vm_fmgen + common_common + qt_debugger + qt_phc25 + qt_gui + ) + +set(VMFILES + z80.cpp + not.cpp + mc6847.cpp + ym2203.cpp + + datarec.cpp + io.cpp + + event.cpp +) + +set(BUILD_SHARED_LIBS OFF) +set(USE_OPENMP ON CACHE BOOL "Build using OpenMP") +set(USE_OPENGL ON CACHE BOOL "Build using OpenGL") + +include(detect_target_cpu) +#include(windows-mingw-cross) +# set entry +set(CMAKE_SYSTEM_PROCESSOR ${ARCHITECTURE} CACHE STRING "Set processor to build.") + +set(BUILD_PHC25 ON CACHE BOOL "Build ePHC25") +set(BUILD_MAP1010 OFF CACHE BOOL "Build eMAP1010") + +if(BUILD_PHC25) + add_definitions(-D_PHC25) + set(EXEC_TARGET emuphc25) + set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/phc25.qrc) +elseif(BUILD_MAP1010) + add_definitions(-D_MAP1010) + set(EXEC_TARGET emumap1010) + set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/map1010.qrc) +endif() + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/phc25) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/phc25) + +include(config_commonsource) + +add_subdirectory(../../src/vm/phc25 vm/phc25) +add_subdirectory(../../src/vm/fmgen vm/fmgen) +add_subdirectory(../../src/qt/phc25 qt/phc25) +add_subdirectory(../../src/qt/common qt/common) +add_subdirectory(../../src/qt/debugger qt/debugger) diff --git a/source/src/qt/common/qrc/map1010.qrc b/source/src/qt/common/qrc/map1010.qrc new file mode 100644 index 000000000..13457a3d8 --- /dev/null +++ b/source/src/qt/common/qrc/map1010.qrc @@ -0,0 +1,5 @@ + + + ../../../res/map1010.ico + + \ No newline at end of file diff --git a/source/src/qt/common/qrc/phc20.qrc b/source/src/qt/common/qrc/phc20.qrc new file mode 100644 index 000000000..623c1b2ee --- /dev/null +++ b/source/src/qt/common/qrc/phc20.qrc @@ -0,0 +1,5 @@ + + + ../../../res/phc20.ico + + \ No newline at end of file diff --git a/source/src/qt/common/qrc/phc25.qrc b/source/src/qt/common/qrc/phc25.qrc new file mode 100644 index 000000000..b7a6fff4f --- /dev/null +++ b/source/src/qt/common/qrc/phc25.qrc @@ -0,0 +1,5 @@ + + + ../../../res/phc25.ico + + \ No newline at end of file diff --git a/source/src/qt/phc20/CMakeLists.txt b/source/src/qt/phc20/CMakeLists.txt new file mode 100644 index 000000000..9a18d1abb --- /dev/null +++ b/source/src/qt/phc20/CMakeLists.txt @@ -0,0 +1,18 @@ +message("* qt/phc20") + +set(s_qt_phc20_headers + menuclasses.h +) + +if(USE_QT_5) + QT5_WRAP_CPP(s_qt_phc20_headers_MOC ${s_qt_phc20_headers}) +else() + QT4_WRAP_CPP(s_qt_phc20_headers_MOC ${s_qt_phc20_headers}) +endif() + +add_library(qt_phc20 + MainWindow.cpp + ${s_qt_phc20_headers_MOC} +) + + diff --git a/source/src/qt/phc20/MainWindow.cpp b/source/src/qt/phc20/MainWindow.cpp new file mode 100644 index 000000000..d12207de4 --- /dev/null +++ b/source/src/qt/phc20/MainWindow.cpp @@ -0,0 +1,60 @@ +/* + * Common Source code Project: + * Ui->Qt->MainWindow for JR100 . + * (C) 2015 K.Ohta + * License : GPLv2 + * History : + * Jan 14, 2015 : Initial, many of constructors were moved to qt/gui/menu_main.cpp. + */ + +#include +#include +#include "emu.h" +#include "commonclasses.h" +#include "menuclasses.h" +#include "qt_main.h" + + +void META_MainWindow::setupUI_Emu(void) +{ + +} + +void META_MainWindow::retranslateUi(void) +{ + int i; + retranslateControlMenu("System Reset", false); + + retranslateCMTMenu(); + retranslateSoundMenu(); + retranslateScreenMenu(); + + this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0)); + + actionAbout->setText(QApplication::translate("MainWindow", "About...", 0)); + + menuEmulator->setTitle(QApplication::translate("MainWindow", "Emulator", 0)); + menuMachine->setTitle(QApplication::translate("MainWindow", "Machine", 0)); + + menuHELP->setTitle(QApplication::translate("MainWindow", "HELP", 0)); + actionHelp_AboutQt->setText(QApplication::translate("MainWindow", "About Qt", 0)); + // Set Labels +} // retranslateUi + + + +META_MainWindow::META_MainWindow(QWidget *parent) : Ui_MainWindow(parent) +{ + setupUI_Emu(); + retranslateUi(); +} + + +META_MainWindow::~META_MainWindow() +{ +} + +//QT_END_NAMESPACE + + + diff --git a/source/src/qt/phc20/menuclasses.h b/source/src/qt/phc20/menuclasses.h new file mode 100644 index 000000000..abe8b56bd --- /dev/null +++ b/source/src/qt/phc20/menuclasses.h @@ -0,0 +1,30 @@ + + + +#ifndef _CSP_QT_MENUCLASSES_H +#define _CSP_QT_MENUCLASSES_H + +#include "emu.h" +#include "mainwidget.h" +// This extends class CSP_MainWindow as Ui_MainWindow. +// You may use this as +QT_BEGIN_NAMESPACE + +class Ui_MainWindow; + +class META_MainWindow : public Ui_MainWindow { + Q_OBJECT + protected: + void setupUI_Emu(void); + void retranslateUi(void); + + public: + META_MainWindow(QWidget *parent = 0); + ~META_MainWindow(); +public slots: + +}; + +QT_END_NAMESPACE + +#endif // END diff --git a/source/src/qt/phc25/CMakeLists.txt b/source/src/qt/phc25/CMakeLists.txt new file mode 100644 index 000000000..d0adf86b5 --- /dev/null +++ b/source/src/qt/phc25/CMakeLists.txt @@ -0,0 +1,18 @@ +message("* qt/phc25") + +set(s_qt_phc25_headers + menuclasses.h +) + +if(USE_QT_5) + QT5_WRAP_CPP(s_qt_phc25_headers_MOC ${s_qt_phc25_headers}) +else() + QT4_WRAP_CPP(s_qt_phc25_headers_MOC ${s_qt_phc25_headers}) +endif() + +add_library(qt_phc25 + MainWindow.cpp + ${s_qt_phc25_headers_MOC} +) + + diff --git a/source/src/qt/phc25/MainWindow.cpp b/source/src/qt/phc25/MainWindow.cpp new file mode 100644 index 000000000..831350bc0 --- /dev/null +++ b/source/src/qt/phc25/MainWindow.cpp @@ -0,0 +1,60 @@ +/* + * Common Source code Project: + * Ui->Qt->MainWindow for PHC-25 / MAP1010 . + * (C) 2015 K.Ohta + * License : GPLv2 + * History : + * Jan 14, 2015 : Initial, many of constructors were moved to qt/gui/menu_main.cpp. + */ + +#include +#include +#include "emu.h" +#include "commonclasses.h" +#include "menuclasses.h" +#include "qt_main.h" + + +void META_MainWindow::setupUI_Emu(void) +{ + +} + +void META_MainWindow::retranslateUi(void) +{ + int i; + retranslateControlMenu("", false); + + retranslateCMTMenu(); + retranslateSoundMenu(); + retranslateScreenMenu(); + + this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0)); + + actionAbout->setText(QApplication::translate("MainWindow", "About...", 0)); + + menuEmulator->setTitle(QApplication::translate("MainWindow", "Emulator", 0)); + menuMachine->setTitle(QApplication::translate("MainWindow", "Machine", 0)); + + menuHELP->setTitle(QApplication::translate("MainWindow", "HELP", 0)); + actionHelp_AboutQt->setText(QApplication::translate("MainWindow", "About Qt", 0)); + // Set Labels +} // retranslateUi + + + +META_MainWindow::META_MainWindow(QWidget *parent) : Ui_MainWindow(parent) +{ + setupUI_Emu(); + retranslateUi(); +} + + +META_MainWindow::~META_MainWindow() +{ +} + +//QT_END_NAMESPACE + + + diff --git a/source/src/qt/phc25/menuclasses.h b/source/src/qt/phc25/menuclasses.h new file mode 100644 index 000000000..abe8b56bd --- /dev/null +++ b/source/src/qt/phc25/menuclasses.h @@ -0,0 +1,30 @@ + + + +#ifndef _CSP_QT_MENUCLASSES_H +#define _CSP_QT_MENUCLASSES_H + +#include "emu.h" +#include "mainwidget.h" +// This extends class CSP_MainWindow as Ui_MainWindow. +// You may use this as +QT_BEGIN_NAMESPACE + +class Ui_MainWindow; + +class META_MainWindow : public Ui_MainWindow { + Q_OBJECT + protected: + void setupUI_Emu(void); + void retranslateUi(void); + + public: + META_MainWindow(QWidget *parent = 0); + ~META_MainWindow(); +public slots: + +}; + +QT_END_NAMESPACE + +#endif // END diff --git a/source/src/vm/phc25/phc25.cpp b/source/src/vm/phc25/phc25.cpp index c7d10c3ea..97ed3f680 100644 --- a/source/src/vm/phc25/phc25.cpp +++ b/source/src/vm/phc25/phc25.cpp @@ -43,7 +43,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) drec = new DATAREC(this, emu); io = new IO(this, emu); vdp = new MC6847(this, emu); - not = new NOT(this, emu); + g_not = new NOT(this, emu); psg = new YM2203(this, emu); cpu = new Z80(this, emu); @@ -60,8 +60,8 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) vdp->load_font_image(emu->bios_path(_T("FONT.ROM"))); vdp->set_vram_ptr(memory->get_vram(), 0x1800); // vdp->set_context_cpu(cpu); - vdp->set_context_vsync(not, SIG_NOT_INPUT, 1); - not->set_context_out(cpu, SIG_CPU_IRQ, 1); + vdp->set_context_vsync(g_not, SIG_NOT_INPUT, 1); + g_not->set_context_out(cpu, SIG_CPU_IRQ, 1); vdp->set_context_vsync(system, SIG_SYSTEM_PORT, 0x10); drec->set_context_ear(system, SIG_SYSTEM_PORT, 0x20); diff --git a/source/src/vm/phc25/phc25.h b/source/src/vm/phc25/phc25.h index c22825236..061d6a4b3 100644 --- a/source/src/vm/phc25/phc25.h +++ b/source/src/vm/phc25/phc25.h @@ -71,7 +71,7 @@ protected: DATAREC* drec; IO* io; MC6847* vdp; - NOT* not; + NOT* g_not; YM2203* psg; Z80* cpu; -- 2.11.0