OSDN Git Service

[VM][Qt] Add BUBCOM80.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 13 Jul 2018 03:44:43 +0000 (12:44 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 13 Jul 2018 03:44:43 +0000 (12:44 +0900)
source/build-cmake/bubcom80/CMakeLists.txt [new file with mode: 0644]
source/src/qt/common/qrc/bubcom80.qrc [new file with mode: 0644]
source/src/qt/machines/bubcom80/CMakeLists.txt [new file with mode: 0644]
source/src/qt/machines/bubcom80/MainWindow.cpp [new file with mode: 0644]
source/src/qt/machines/bubcom80/bubcom80.ts [new file with mode: 0644]
source/src/qt/machines/bubcom80/menuclasses.h [new file with mode: 0644]
source/src/vm/bubcom80/CMakeLists.txt [new file with mode: 0644]
source/src/vm/bubcom80/cmt.cpp

diff --git a/source/build-cmake/bubcom80/CMakeLists.txt b/source/build-cmake/bubcom80/CMakeLists.txt
new file mode 100644 (file)
index 0000000..899e692
--- /dev/null
@@ -0,0 +1,51 @@
+# 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,BUBCOM 80, Qt **")
+message("")
+
+project (emububcom80)
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
+
+set(EXEC_TARGET emububcom80)
+set(VM_NAME bubcom80)
+set(USE_FMGEN OFF)
+set(WITH_JOYSTICK OFF)
+set(WITH_MOUSE ON)
+
+set(FLAG_USE_Z80 ON)
+set(VMFILES_BASE
+       io.cpp
+       memory.cpp
+       event.cpp
+)
+
+set(VMFILES_LIB
+       ls393.cpp
+       mb8877.cpp
+       mc6850.cpp
+       pcm1bit.cpp
+       z80ctc.cpp
+)
+
+set(USE_OPENMP ON CACHE BOOL "Build using OpenMP")
+set(USE_OPENGL ON CACHE BOOL "Build using OpenGL")
+set(WITH_DEBUGGER OFF CACHE BOOL "Build with debugger.")
+
+include(detect_target_cpu)
+#include(windows-mingw-cross)
+# set entry
+set(CMAKE_SYSTEM_PROCESSOR ${ARCHITECTURE} CACHE STRING "Set processor to build.")
+
+set(VMFILES ${VMFILES_BASE})
+add_definitions(-D_BUBCOM80)
+set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/bubcom80.qrc)
+
+include(config_commonsource)
diff --git a/source/src/qt/common/qrc/bubcom80.qrc b/source/src/qt/common/qrc/bubcom80.qrc
new file mode 100644 (file)
index 0000000..a2ac83e
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+    <file alias="default.ico">../../../res/bubcom80.ico</file>
+    <file alias="bios_and_keys.txt">../../../../../doc/VMs/bubcom80.txt</file>
+       <file alias="csp_qt_machine_ja.qm">../../../res/i18n/ja/bubcom80.qm</file>
+</qresource>
+</RCC>
diff --git a/source/src/qt/machines/bubcom80/CMakeLists.txt b/source/src/qt/machines/bubcom80/CMakeLists.txt
new file mode 100644 (file)
index 0000000..558f556
--- /dev/null
@@ -0,0 +1,19 @@
+message("* qt/bubcom80")
+
+set(s_qt_bubcom80_headers
+         menuclasses.h
+)
+
+if(USE_QT_5)
+  QT5_WRAP_CPP(s_qt_bubcom80_headers_MOC ${s_qt_bubcom80_headers})
+#  QT5_ADD_RESOURCES(s_qt_bubcom80_headers_RCC ${RESOURCE})
+else()
+  QT4_WRAP_CPP(s_qt_bubcom80_headers_MOC ${s_qt_bubcom80_headers})
+endif()
+
+add_library(qt_bubcom80
+         MainWindow.cpp
+         ${s_qt_bubcom80_headers_MOC}
+)
+
+
diff --git a/source/src/qt/machines/bubcom80/MainWindow.cpp b/source/src/qt/machines/bubcom80/MainWindow.cpp
new file mode 100644 (file)
index 0000000..7a1f06c
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Common Source code Project:
+ * Ui->Qt->MainWindow for Buncom80 .
+ * (C) 2018 K.Ohta <whatisthis.sowhat _at_ gmail.com>
+ *   License : GPLv2
+ *   History :
+ * July 13, 2018 : Initial, split from FM-7.
+ */
+
+#include <QApplication>
+#include <QtCore/QVariant>
+#include <QtGui>
+#include <QMenu>
+
+#include "commonclasses.h"
+#include "menuclasses.h"
+#include "emu.h"
+#include "qt_main.h"
+#include "sound_dialog.h"
+
+#include "menu_disk.h"
+//QT_BEGIN_NAMESPACE
+
+extern config_t config;
+
+void META_MainWindow::retranslateUi(void)
+{
+
+       Ui_MainWindowBase::retranslateUi();
+       
+       retranslateControlMenu("", false);
+
+       retranslateFloppyMenu(0, 1, QString::fromUtf8("FD"));
+       retranslateFloppyMenu(1, 2, QString::fromUtf8("FD"));
+       retranslateFloppyMenu(2, 3, QString::fromUtf8("FD"));
+       retranslateFloppyMenu(3, 4, QString::fromUtf8("FD"));
+
+       retranslateCMTMenu(0);
+
+       for(int _drv = 0; _drv < USE_BUBBLE; _drv++) {
+               retranslateBubbleMenu(_drv, _drv + 1);
+       }               
+
+       actionPrintDevice[1]->setText(QApplication::translate("Machine", "BC-861/862/863", 0));
+       actionPrintDevice[1]->setToolTip(QApplication::translate("Machine", "Use printer BC-861/862/863.", 0));
+       actionPrintDevice[1]->setEnabled(false);
+       
+#ifdef USE_DEBUGGER
+       actionDebugger[0]->setText(QApplication::translate("Machine", "Main CPU", 0));
+       actionDebugger[0]->setVisible(true);
+       actionDebugger[1]->setVisible(false);
+#endif 
+       //      actionStart_Record_Movie->setText(QApplication::translate("Machine", "Start Record Movie", 0));
+       //      actionStop_Record_Movie->setText(QApplication::translate("Machine", "Stop Record Movie", 0));
+       // 
+       // FM-7 Specified
+
+#if defined(USE_MONITOR_TYPE) && defined(USE_GREEN_DISPLAY)
+       actionMonitorType[0]->setText(QApplication::translate("Machine", "Color Display (need reset)", 0));
+       actionMonitorType[0]->setToolTip(QApplication::translate("Machine", "Using color display.\nChanges will be applied at reset, not immediately.", 0));
+       actionMonitorType[1]->setText(QApplication::translate("Machine", "Green Display (need reset)", 0));
+       actionMonitorType[1]->setToolTip(QApplication::translate("Machine", "Using ancient \"Green Display\" to display.\nChanges will be applied at reset, not immediately.", 0));
+#endif 
+} // retranslateUi
+
+void META_MainWindow::setupUI_Emu(void)
+{
+//     int i;
+//     uint32_t skip;
+//     ConfigCPUTypes(1);
+//     ConfigCPUBootMode(USE_BOOT_MODE);
+}
+
+
+META_MainWindow::META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent) : Ui_MainWindow(p, logger, parent)
+{
+       setupUI_Emu();
+       retranslateUi();
+}
+
+
+META_MainWindow::~META_MainWindow()
+{
+}
+
+//QT_END_NAMESPACE
+
+
+
diff --git a/source/src/qt/machines/bubcom80/bubcom80.ts b/source/src/qt/machines/bubcom80/bubcom80.ts
new file mode 100644 (file)
index 0000000..029fc65
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="ja_JP">
+<context>
+    <name>Machine</name>
+    <message>
+        <location filename="MainWindow.cpp" line="47"/>
+        <source>BC-861/862/863</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="48"/>
+        <source>Use printer BC-861/862/863.</source>
+        <translation>BC-861/862/863をプリンタとして使います。</translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="52"/>
+        <source>Main CPU</source>
+        <translation>メインCPU</translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="62"/>
+        <source>Color Display (need reset)</source>
+        <translation>カラーディスプレィ(リセットが必要)</translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="63"/>
+        <source>Using color display.
+Changes will be applied at reset, not immediately.</source>
+        <translation>カラーディスプレィを使います。
+変更を反映するにはリセットして下さい。</translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="64"/>
+        <source>Green Display (need reset)</source>
+        <translation>グリーンディスプレィ(リセットが必要)</translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="65"/>
+        <source>Using ancient &quot;Green Display&quot; to display.
+Changes will be applied at reset, not immediately.</source>
+        <translation>古のグリーンディスプレィを使います。
+変更を反映するにはリセットして下さい。</translation>
+    </message>
+</context>
+</TS>
diff --git a/source/src/qt/machines/bubcom80/menuclasses.h b/source/src/qt/machines/bubcom80/menuclasses.h
new file mode 100644 (file)
index 0000000..c9c1696
--- /dev/null
@@ -0,0 +1,27 @@
+
+#ifndef _CSP_QT_MENUCLASSES_H
+#define _CSP_QT_MENUCLASSES_H
+
+#include "commonclasses.h"
+#include "mainwidget.h"
+// This extends class CSP_MainWindow as Ui_MainWindow.
+// You may use this as 
+QT_BEGIN_NAMESPACE
+class CSP_Logger;
+class Ui_MainWindow;
+//  wrote of Specific menu.
+class META_MainWindow : public Ui_MainWindow {
+       Q_OBJECT
+protected:
+       
+       void setupUI_Emu(void);
+       void retranslateUi(void);
+public:
+       META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent = 0);
+       ~META_MainWindow();
+public slots:
+};
+
+QT_END_NAMESPACE
+
+#endif // END
diff --git a/source/src/vm/bubcom80/CMakeLists.txt b/source/src/vm/bubcom80/CMakeLists.txt
new file mode 100644 (file)
index 0000000..037a355
--- /dev/null
@@ -0,0 +1,14 @@
+cmake_minimum_required (VERSION 2.6)
+
+message("* vm/bubcom80")
+
+add_library(vm_bubcom80
+    bubblecasette.cpp
+       cmt.cpp
+       display.cpp
+       floppy.cpp
+       keyboard.cpp
+       membus.cpp
+       rtc.cpp
+       bubcom80.cpp
+)
index ffcc5b4..76250db 100644 (file)
@@ -112,7 +112,7 @@ void CMT::decl_state()
        DECL_STATE_ENTRY_CMT_RECORDING(fio, rec, rec_file_path);
        
        DECL_STATE_ENTRY_INT32(bufcnt);
-       DECL_STATE_ENTRY_1D_ARRAY(buffer, sizeof(buffer), 1);
+       DECL_STATE_ENTRY_1D_ARRAY(buffer, sizeof(buffer));
 
        leave_decl_state();
 }