OSDN Git Service

[VM][Qt] Add NEC PC-100.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 29 Sep 2015 11:48:20 +0000 (20:48 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 29 Sep 2015 11:48:20 +0000 (20:48 +0900)
source/build-cmake/pc100/CMakeLists.txt [new file with mode: 0644]
source/src/qt/common/qrc/pc100.qrc [new file with mode: 0644]
source/src/qt/pc100/CMakeLists.txt [new file with mode: 0644]
source/src/qt/pc100/MainWindow.cpp [new file with mode: 0644]
source/src/qt/pc100/menuclasses.h [new file with mode: 0644]
source/src/vm/pc100/CMakeLists.txt [new file with mode: 0644]
source/src/vm/pc100/pc100.cpp
source/src/vm/pc100/pc100.h

diff --git a/source/build-cmake/pc100/CMakeLists.txt b/source/build-cmake/pc100/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c93a1b8
--- /dev/null
@@ -0,0 +1,67 @@
+# Build Common Sourcecode Project, Qt.
+# (C) 2014 K.Ohta <whatisthis.sowhat@gmail.com>
+# 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,NEC PC-100, Qt **")
+message("")
+
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
+
+project (pc100)
+
+set(LOCAL_LIBS            vm_pc100
+                  vm_vm
+                  common_common
+                  qt_debugger
+                  qt_pc100
+                  qt_gui
+                   )
+
+set(VMFILES
+                  i286.cpp
+                  
+                  and.cpp
+                  
+                  i8251.cpp
+                  i8255.cpp
+                  i8259.cpp
+                  
+                  msm58321.cpp
+                  upd765a.cpp
+                  
+                  beep.cpp
+                  memory.cpp
+                  pcm1bit.cpp
+                  
+                  disk.cpp
+                  event.cpp
+                  io.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.")
+
+add_definitions(-D_PC100)
+set(EXEC_TARGET emupc100)
+set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc100.qrc)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/vm/pc100)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/qt/pc100)
+
+include(config_commonsource)
+
+add_subdirectory(../../src/vm/pc100 vm/pc100)
+add_subdirectory(../../src/qt/pc100 qt/pc100)
+add_subdirectory(../../src/qt/common qt/common)
+add_subdirectory(../../src/qt/debugger qt/debugger)
diff --git a/source/src/qt/common/qrc/pc100.qrc b/source/src/qt/common/qrc/pc100.qrc
new file mode 100644 (file)
index 0000000..72158f3
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+    <file alias="default.ico">../../../res/pc100.ico</file>
+</qresource>
+</RCC>
\ No newline at end of file
diff --git a/source/src/qt/pc100/CMakeLists.txt b/source/src/qt/pc100/CMakeLists.txt
new file mode 100644 (file)
index 0000000..41fb5ed
--- /dev/null
@@ -0,0 +1,18 @@
+message("* qt/pc100")
+
+set(s_qt_pc100_headers
+         menuclasses.h
+)
+
+if(USE_QT_5)
+  QT5_WRAP_CPP(s_qt_pc100_headers_MOC ${s_qt_pc100_headers})
+else()
+  QT4_WRAP_CPP(s_qt_pc100_headers_MOC ${s_qt_pc100_headers})
+endif()
+
+add_library(qt_pc100
+         MainWindow.cpp
+         ${s_qt_pc100_headers_MOC}
+)
+
+
diff --git a/source/src/qt/pc100/MainWindow.cpp b/source/src/qt/pc100/MainWindow.cpp
new file mode 100644 (file)
index 0000000..551849d
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Common Source code Project:
+ * Ui->Qt->MainWindow for PC-100 .
+ * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
+ *   License : GPLv2
+ *   History :
+ * Jan 14, 2015 : Initial, many of constructors were moved to qt/gui/menu_main.cpp.
+ */
+
+#include <QVariant>
+#include <QtGui>
+#include "emu.h"
+#include "commonclasses.h"
+#include "menuclasses.h"
+#include "qt_main.h"
+
+
+void META_MainWindow::setupUI_Emu(void)
+{
+       int i;
+       QString tmps;
+   
+}
+
+void META_MainWindow::retranslateUi(void)
+{
+       int i;
+   
+       retranslateControlMenu("",  false);
+       retranslateFloppyMenu(0, 1);
+       retranslateFloppyMenu(1, 2);
+       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/pc100/menuclasses.h b/source/src/qt/pc100/menuclasses.h
new file mode 100644 (file)
index 0000000..100d19a
--- /dev/null
@@ -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/pc100/CMakeLists.txt b/source/src/vm/pc100/CMakeLists.txt
new file mode 100644 (file)
index 0000000..eb42b67
--- /dev/null
@@ -0,0 +1,15 @@
+cmake_minimum_required (VERSION 2.6)
+
+message("* vm/pc100")
+
+set(VM_pc100_LIB_SRCS
+       pc100.cpp
+       
+       crtc.cpp
+       ioctrl.cpp
+       kanji.cpp
+)
+
+add_library(vm_pc100
+       ${VM_pc100_LIB_SRCS}
+)
\ No newline at end of file
index b3143b9..897c93f 100644 (file)
@@ -44,7 +44,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
        dummy = new DEVICE(this, emu);  // must be 1st device
        event = new EVENT(this, emu);   // must be 2nd device
        
-       and = new AND(this, emu);
+       g_and = new AND(this, emu);
        beep = new BEEP(this, emu);
        sio = new I8251(this, emu);
        pio0 = new I8255(this, emu);
@@ -66,8 +66,8 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
        event->set_context_sound(beep);
        event->set_context_sound(pcm);
        
-       and->set_context_out(cpu, SIG_CPU_NMI, 1);
-       and->set_mask(SIG_AND_BIT_0 | SIG_AND_BIT_1);
+       g_and->set_context_out(cpu, SIG_CPU_NMI, 1);
+       g_and->set_mask(SIG_AND_BIT_0 | SIG_AND_BIT_1);
        sio->set_context_rxrdy(pic, SIG_I8259_IR1, 1);
        pio0->set_context_port_a(rtc, SIG_MSM58321_READ, 1, 0);
        pio0->set_context_port_a(rtc, SIG_MSM58321_WRITE, 2, 0);
@@ -76,13 +76,13 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
        pio1->set_context_port_a(crtc, SIG_CRTC_BITMASK_LOW, 0xff, 0);
        pio1->set_context_port_b(crtc, SIG_CRTC_BITMASK_HIGH, 0xff, 0);
        pio1->set_context_port_c(crtc, SIG_CRTC_VRAM_PLANE, 0x3f, 0);
-       pio1->set_context_port_c(and, SIG_AND_BIT_0, 0x80, 0);
+       pio1->set_context_port_c(g_and, SIG_AND_BIT_0, 0x80, 0);
        pio1->set_context_port_c(ioctrl, SIG_IOCTRL_RESET, 0x40, 0);
        pic->set_context_cpu(cpu);
        rtc->set_context_data(pio0, SIG_I8255_PORT_C, 0x0f, 0);
        rtc->set_context_busy(pio0, SIG_I8255_PORT_C, 0x10);
        fdc->set_context_irq(cpu, SIG_CPU_NMI, 1);
-       fdc->set_context_drq(and, SIG_AND_BIT_1, 1);
+       fdc->set_context_drq(g_and, SIG_AND_BIT_1, 1);
        
        crtc->set_context_pic(pic);
        ioctrl->set_context_pic(pic);
index a3121c8..f46a889 100644 (file)
@@ -76,7 +76,7 @@ protected:
        // devices
        EVENT* event;
        
-       AND* and;
+       AND* g_and;
        BEEP* beep;
        I8251* sio;
        I8255* pio0;