OSDN Git Service

[BUILD][Qt][CMAKE] Add Canon X07.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 20 Dec 2015 16:46:54 +0000 (01:46 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 20 Dec 2015 16:46:54 +0000 (01:46 +0900)
[VM][X07] Fix FTBFS with GCC.

source/build-cmake/x07/CMakeLists.txt [new file with mode: 0644]
source/src/qt/common/qrc/x07.qrc [new file with mode: 0644]
source/src/qt/machines/x07/CMakeLists.txt [new file with mode: 0644]
source/src/qt/machines/x07/MainWindow.cpp [new file with mode: 0644]
source/src/qt/machines/x07/menuclasses.h [new file with mode: 0644]
source/src/vm/x07/CMakeLists.txt [new file with mode: 0644]
source/src/vm/x07/io.cpp

diff --git a/source/build-cmake/x07/CMakeLists.txt b/source/build-cmake/x07/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ff59c04
--- /dev/null
@@ -0,0 +1,46 @@
+# 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,CANON X07, Qt **")
+message("")
+
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
+
+project (emux07)
+
+set(VM_NAME x07)
+set(USE_FMGEN OFF)
+
+set(VMFILES_BASE
+                  z80.cpp
+                  
+                  event.cpp
+                  memory.cpp
+
+                  beep.cpp
+)
+
+
+set(BUILD_SHARED_LIBS OFF)
+set(USE_OPENMP ON CACHE BOOL "Build using OpenMP")
+set(USE_OPENGL ON CACHE BOOL "Build using OpenGL")
+set(WITH_DEBUGGER ON 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_X07)
+set(EXEC_TARGET emux07)
+set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/x07.qrc)
+
+include(config_commonsource)
diff --git a/source/src/qt/common/qrc/x07.qrc b/source/src/qt/common/qrc/x07.qrc
new file mode 100644 (file)
index 0000000..0f6667a
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+    <file alias="default.ico">../../../res/x07.ico</file>
+</qresource>
+</RCC>
diff --git a/source/src/qt/machines/x07/CMakeLists.txt b/source/src/qt/machines/x07/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f393017
--- /dev/null
@@ -0,0 +1,16 @@
+message("* qt/x07")
+
+set(s_qt_x07_headers
+         menuclasses.h
+)
+if(USE_QT_5)
+  QT5_WRAP_CPP(s_qt_x07_headers_MOC ${s_qt_x07_headers})
+else()
+  QT4_WRAP_CPP(s_qt_x07_headers_MOC ${s_qt_x07_headers})
+endif()
+add_library(qt_x07
+         MainWindow.cpp
+         ${s_qt_x07_headers_MOC}
+)
+
+
diff --git a/source/src/qt/machines/x07/MainWindow.cpp b/source/src/qt/machines/x07/MainWindow.cpp
new file mode 100644 (file)
index 0000000..9da9118
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Common Source code Project:
+ * Ui->Qt->MainWindow for Super Casette Vision .
+ * (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 "commonclasses.h"
+#include "menuclasses.h"
+#include "emu.h"
+#include "qt_main.h"
+
+//QT_BEGIN_NAMESPACE
+       
+
+void META_MainWindow::setupUI_Emu(void)
+{
+   int i;
+}
+
+void META_MainWindow::retranslateUi(void)
+{
+  retranslateControlMenu("",  false);
+  retranslateCMTMenu();
+
+   retranslateSoundMenu();
+   retranslateScreenMenu();
+   retranslateUI_Help();
+   
+  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));
+} // 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/machines/x07/menuclasses.h b/source/src/qt/machines/x07/menuclasses.h
new file mode 100644 (file)
index 0000000..d1b243b
--- /dev/null
@@ -0,0 +1,28 @@
+
+#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 Ui_MainWindow;
+//  wrote of X1 Specific menu.
+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/x07/CMakeLists.txt b/source/src/vm/x07/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ee34d5a
--- /dev/null
@@ -0,0 +1,8 @@
+cmake_minimum_required (VERSION 2.6)
+
+message("* vm/x07")
+
+add_library(vm_x07
+       x07.cpp
+       io.cpp
+)
index c999327..2476e27 100644 (file)
@@ -834,7 +834,7 @@ void IO::play_tape(const _TCHAR* file_path)
        close_tape();
        if(cmt_fio->Fopen(file_path, FILEIO_READ_BINARY)) {
                cmt_fio->Fseek(0, FILEIO_SEEK_END);
-               cmt_len = min(cmt_fio->Ftell(), CMT_BUF_SIZE);
+               cmt_len = min((int)cmt_fio->Ftell(), (int)CMT_BUF_SIZE);
                cmt_fio->Fseek(0, FILEIO_SEEK_SET);
                memset(cmt_buf, 0, sizeof(cmt_buf));
                cmt_fio->Fread(cmt_buf, cmt_len, 1);
@@ -1273,7 +1273,7 @@ void IO::save_state(FILEIO* state_fio)
                state_fio->FputInt32(length_tmp);
                while(length_tmp != 0) {
                        uint8 buffer_tmp[1024];
-                       int length_rw = min(length_tmp, sizeof(buffer_tmp));
+                       int length_rw = min((int)length_tmp, (int)sizeof(buffer_tmp));
                        cmt_fio->Fread(buffer_tmp, length_rw, 1);
                        state_fio->Fwrite(buffer_tmp, length_rw, 1);
                        length_tmp -= length_rw;
@@ -1346,7 +1346,7 @@ bool IO::load_state(FILEIO* state_fio)
                cmt_fio->Fopen(rec_file_path, FILEIO_READ_WRITE_NEW_BINARY);
                while(length_tmp != 0) {
                        uint8 buffer_tmp[1024];
-                       int length_rw = min(length_tmp, sizeof(buffer_tmp));
+                       int length_rw = min((int)length_tmp, sizeof(buffer_tmp));
                        state_fio->Fread(buffer_tmp, length_rw, 1);
                        if(cmt_fio->IsOpened()) {
                                cmt_fio->Fwrite(buffer_tmp, length_rw, 1);