OSDN Git Service

[VM][GENERAL][EX80BS] Merge upstream 2022-05-07 .
authorK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 12 Dec 2022 06:57:38 +0000 (15:57 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 12 Dec 2022 06:57:38 +0000 (15:57 +0900)
67 files changed:
doc/VMs/ex80.txt [deleted file]
doc/VMs/ex80bs.txt [new file with mode: 0644]
source/cmake/config_singleboards.cmake
source/cmake/config_toshiba.cmake
source/history.txt
source/readme.txt
source/src/qt/common/qrc/ex80.qrc [deleted file]
source/src/qt/common/qrc/ex80bs.qrc [new file with mode: 0644]
source/src/qt/machines/ex80/CMakeLists.txt [deleted file]
source/src/qt/machines/ex80/ex80.ja_JP.ts [deleted file]
source/src/qt/machines/ex80bs/CMakeLists.txt [new file with mode: 0644]
source/src/qt/machines/ex80bs/MainWindow.cpp [moved from source/src/qt/machines/ex80/MainWindow.cpp with 83% similarity]
source/src/qt/machines/ex80bs/ex80bs.ja_JP.ts [new file with mode: 0644]
source/src/qt/machines/ex80bs/menuclasses.h [moved from source/src/qt/machines/ex80/menuclasses.h with 100% similarity]
source/src/res/ex80.ico [deleted file]
source/src/res/ex80bs.rc [moved from source/src/res/ex80.rc with 77% similarity]
source/src/res/ex80bs/board.png [moved from source/src/res/ex80/board.png with 100% similarity]
source/src/res/ex80bs/button00.png [moved from source/src/res/ex80/button00.png with 100% similarity]
source/src/res/ex80bs/button01.png [moved from source/src/res/ex80/button01.png with 100% similarity]
source/src/res/ex80bs/button02.png [moved from source/src/res/ex80/button02.png with 100% similarity]
source/src/res/ex80bs/button03.png [moved from source/src/res/ex80/button03.png with 100% similarity]
source/src/res/ex80bs/button04.png [moved from source/src/res/ex80/button04.png with 100% similarity]
source/src/res/ex80bs/button05.png [moved from source/src/res/ex80/button05.png with 100% similarity]
source/src/res/ex80bs/button06.png [moved from source/src/res/ex80/button06.png with 100% similarity]
source/src/res/ex80bs/button07.png [moved from source/src/res/ex80/button07.png with 100% similarity]
source/src/res/ex80bs/button08.png [moved from source/src/res/ex80/button08.png with 100% similarity]
source/src/res/ex80bs/button09.png [moved from source/src/res/ex80/button09.png with 100% similarity]
source/src/res/ex80bs/button10.png [moved from source/src/res/ex80/button10.png with 100% similarity]
source/src/res/ex80bs/button11.png [moved from source/src/res/ex80/button11.png with 100% similarity]
source/src/res/ex80bs/button12.png [moved from source/src/res/ex80/button12.png with 100% similarity]
source/src/res/ex80bs/button13.png [moved from source/src/res/ex80/button13.png with 100% similarity]
source/src/res/ex80bs/button14.png [moved from source/src/res/ex80/button14.png with 100% similarity]
source/src/res/ex80bs/button15.png [moved from source/src/res/ex80/button15.png with 100% similarity]
source/src/res/ex80bs/button16.png [moved from source/src/res/ex80/button16.png with 100% similarity]
source/src/res/ex80bs/button17.png [moved from source/src/res/ex80/button17.png with 100% similarity]
source/src/res/ex80bs/button18.png [moved from source/src/res/ex80/button18.png with 100% similarity]
source/src/res/ex80bs/button19.png [moved from source/src/res/ex80/button19.png with 100% similarity]
source/src/res/ex80bs/button20.png [moved from source/src/res/ex80/button20.png with 100% similarity]
source/src/res/ex80bs/button21.png [moved from source/src/res/ex80/button21.png with 100% similarity]
source/src/res/ex80bs/button22.png [moved from source/src/res/ex80/button22.png with 100% similarity]
source/src/res/ex80bs/button23.png [moved from source/src/res/ex80/button23.png with 100% similarity]
source/src/res/ex80bs/button24.png [moved from source/src/res/ex80/button24.png with 100% similarity]
source/src/res/i18n/ja/ex80.ja_JP.qm [deleted file]
source/src/res/i18n/ja/ex80bs.ja_JP.qm [new file with mode: 0644]
source/src/vm/ex80/ex80.cpp [deleted file]
source/src/vm/ex80/ex80.h [deleted file]
source/src/vm/ex80/keyboard.cpp [deleted file]
source/src/vm/ex80/keyboard.h [deleted file]
source/src/vm/ex80/memory.cpp [deleted file]
source/src/vm/ex80/memory.h [deleted file]
source/src/vm/ex80bs/CMakeLists.txt [moved from source/src/vm/ex80/CMakeLists.txt with 57% similarity]
source/src/vm/ex80bs/cmt.cpp [moved from source/src/vm/ex80/cmt.cpp with 99% similarity]
source/src/vm/ex80bs/cmt.h [moved from source/src/vm/ex80/cmt.h with 98% similarity]
source/src/vm/ex80bs/display.cpp [moved from source/src/vm/ex80/display.cpp with 77% similarity]
source/src/vm/ex80bs/display.h [moved from source/src/vm/ex80/display.h with 55% similarity]
source/src/vm/ex80bs/font.txt [moved from source/src/vm/ex80/font.txt with 100% similarity]
source/src/vm/ex80bs/memory.cpp [new file with mode: 0644]
source/src/vm/ex80bs/memory.h [new file with mode: 0644]
source/src/vm/i8080.cpp
source/src/vm/i8080_base.cpp
source/src/vm/i8080_base.h
source/src/vm/vm.h
source/vc++2008/build9.bat
source/vc++2008/ex80bs.vcproj [moved from source/vc++2008/ex80.vcproj with 81% similarity]
source/vc++2017/build15.bat
source/vc++2017/ex80bs.vcxproj [moved from source/vc++2017/ex80.vcxproj with 87% similarity]
source/vc++2017/ex80bs.vcxproj.filters [moved from source/vc++2017/ex80.vcxproj.filters with 78% similarity]

diff --git a/doc/VMs/ex80.txt b/doc/VMs/ex80.txt
deleted file mode 100644 (file)
index 892c2e2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-"eEX-80" - TOSHIBA EX-80 Emulator for Win32
-                                                               12/15/2015
-
---- Internal ROM images
-
-       MON.ROM         $0000-$07FF
-       FONT.ROM        T3477A 5x7 font (optional)
-
-
---- Displays
-
-EX-80BS has both CRT and 8 7-segs LEDs.
-CRT is displayed at the left side of window.
-
-
---- Key maps
-
-       Virtual         PC
-       --------------------------------
-       RET             F1
-       RUN             F2
-       SDA             F3
-       LDA             F4
-       ADR             F5
-       RIC             F6 or PgUp
-       RDC             F7 or PgDn
-       WIC             F8 or Enter
-       0-9,A-F         0-9,A-F
-
-----------------------------------------
-TAKEDA, toshiya
-t-takeda@m1.interq.or.jp
-http://takeda-toshiya.my.coocan.jp/
diff --git a/doc/VMs/ex80bs.txt b/doc/VMs/ex80bs.txt
new file mode 100644 (file)
index 0000000..8ea4762
--- /dev/null
@@ -0,0 +1,43 @@
+"eEX-80BS" - TOSHIBA EX-80BS Emulator for Win32
+                                                               5/7/2022
+
+--- Internal ROM images for EX-80
+
+       MON.ROM         $0000-$07FF
+       PROM1.ROM       $0800-$0BFF (optional)
+       PROM2.ROM       $0C00-$0FFF (optional)
+       FONT.ROM        T3477A font (optional)
+
+
+--- Internal ROM images for EX-80BS
+
+       LV1BASIC.ROM    $3000-$3FFF (optional)
+       LV2BASIC.ROM    $1800-$3FFF (optional)
+       FONT1.ROM       TMM334 font (optional)
+       FONT2.ROM       TMM232C user-defined font (optional)
+
+
+--- Displays
+
+EX-80BS has both CRT and 8 7-segs LEDs.
+CRT is displayed at the left side of window.
+
+
+--- Key maps
+
+       Virtual         PC
+       --------------------------------
+       CAN             PageUp
+       DEL             Delete
+       ETX             Escape
+       BS              Back Space
+       LF              Page Down
+       CR              Enter
+       KANA KIGOU      Alt
+       KANA LOCK       Kana
+
+
+----------------------------------------
+TAKEDA, toshiya
+t-takeda@m1.interq.or.jp
+http://takeda-toshiya.my.coocan.jp/
index 18a5990..40267ce 100644 (file)
@@ -1,5 +1,4 @@
 set(BUILD_BABBAGE2ND ON CACHE BOOL "Build Gijutsu-Hyoron-Sha Babbage-2nd")
-set(BUILD_EX80 ON CACHE BOOL "Build TOSHIBA EX-80")
 set(BUILD_MP85 ON CACHE BOOL "Build MITEC MP-85")
 set(BUILD_SMB80TE ON CACHE BOOL "Build SHARP SM-B-80TE")
 set(BUILD_TK80 ON CACHE BOOL "Build NEC TK-80")
@@ -7,15 +6,10 @@ set(BUILD_TK80BS ON CACHE BOOL "Build NEC TK-80BS")
 set(BUILD_TK85 ON CACHE BOOL "Build NEC TK-85")
 set(BUILD_YS6464A ON CACHE BOOL "Build SHINKO SANGYO YS-6464A")
 
-
 if(BUILD_BABBAGE2ND)
        set(RESOURCE ${PROJECT_SOURCE_DIR}/src/qt/common/qrc/babbage2nd.qrc)
        ADD_VM(babbage2nd emubabbage2nd _BABBAGE2ND)
 endif()
-if(BUILD_EX80)
-       set(RESOURCE ${PROJECT_SOURCE_DIR}/src/qt/common/qrc/ex80.qrc)
-       ADD_VM(ex80 emuex80 _EX80)
-endif()
 if(BUILD_MP85)
        set(RESOURCE ${PROJECT_SOURCE_DIR}/src/qt/common/qrc/mp85.qrc)
        ADD_VM(mp85 emump85 _MP85)
index 966dc2d..772a417 100644 (file)
@@ -4,6 +4,7 @@ set(BUILD_PASOPIA7 ON CACHE BOOL "Build for TOSHIBA PASOPIA7")
 set(BUILD_PASOPIA7_LCD ON CACHE BOOL "Build for TOSHIBA PASOPIA7 with LCD")
 set(BUILD_J3100GT ON CACHE BOOL "Build for Toshiba J-3100GT")
 set(BUILD_J3100SL ON CACHE BOOL "Build for Toshiba J-3100SL")
+set(BUILD_EX80BS ON CACHE BOOL "Build TOSHIBA EX-80BS")
 
 if(BUILD_PASOPIA)
        set(RESOURCE ${PROJECT_SOURCE_DIR}/src/qt/common/qrc/pasopia.qrc)
@@ -45,3 +46,7 @@ if(BUILD_J3100SS)
        ADD_VM(j3100 emuj3100ss _J3100SS)
 endif()
 
+if(BUILD_EX80BS)
+       set(RESOURCE ${PROJECT_SOURCE_DIR}/src/qt/common/qrc/ex80bs.qrc)
+       ADD_VM(ex80bs emuex80bs _EX80BS)
+endif()
index 8d4bcbf..fa68a0e 100644 (file)
@@ -1,9 +1,16 @@
+5/7/2022
+
+[VM/I8080] fix issue in the case CALL/RST performed by interrupt while halted
+
+[EX80BS] support TOSHIBA EX-80BS (eEX-80 is renamed to eEX-80BS)
+
+
 4/9/2022
 
 [COMMON] avoid C5208 and C26495 warnings on VC++2019 (thanks Mr.Meister)
 [EMU/DEBUGGER] support mount and unmount image files
 
-[PC8801MA] support changing access lamp of floppy drives
+[PC8801MA/FLOPPY] support changing access lamp of floppy drives
 [SMC777/MEMORY] improve screen renderer for scrolling
 [SMC777/MEMORY] improve joystick port not to keep trigger#2 pressed
 [SMC777/MEMORY] improve for key releasingg
index 8035f6c..420c1a9 100644 (file)
@@ -1,5 +1,5 @@
 Binary archive of retro pc emulator common source code
-                                                               4/5/2021
+                                                               5/7/2022
 
 --- What's this ?
 
@@ -144,7 +144,7 @@ This archive includes the binaries of the emulators listed below:
        TOMY
                ePyuTa          PyuTa/PyuTa Jr.
        TOSHIBA
-               eEX-80          EX-80
+               eEX-80BS        EX-80BS
                yayaHX-20+      HX-20 + FDD (by Mr.umaiboux)
                EmuPIA          PASOPIA/PASOPIA5
                EmuPIA7         PASOPIA7
diff --git a/source/src/qt/common/qrc/ex80.qrc b/source/src/qt/common/qrc/ex80.qrc
deleted file mode 100644 (file)
index e0aaf3f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
-    <file alias="background.png">../../../res/ex80/board.png</file>
-    <file alias="default.ico">../../../res/ex80.ico</file>
-    <file alias="bios_and_keys.txt">../../../../../doc/VMs/ex80.txt</file>
-    <file alias="machine.ja_JP.qm">../../../res/i18n/ja/ex80.ja_JP.qm</file>
-    <file alias="button00.png">../../../res/ex80/button00.png</file>
-    <file alias="button01.png">../../../res/ex80/button01.png</file>
-    <file alias="button02.png">../../../res/ex80/button02.png</file>
-    <file alias="button03.png">../../../res/ex80/button03.png</file>
-    <file alias="button04.png">../../../res/ex80/button04.png</file>
-    <file alias="button05.png">../../../res/ex80/button05.png</file>
-    <file alias="button06.png">../../../res/ex80/button06.png</file>
-    <file alias="button07.png">../../../res/ex80/button07.png</file>
-    <file alias="button08.png">../../../res/ex80/button08.png</file>
-    <file alias="button09.png">../../../res/ex80/button09.png</file>
-    <file alias="button10.png">../../../res/ex80/button10.png</file>
-    <file alias="button11.png">../../../res/ex80/button11.png</file>
-    <file alias="button12.png">../../../res/ex80/button12.png</file>
-    <file alias="button13.png">../../../res/ex80/button13.png</file>
-    <file alias="button14.png">../../../res/ex80/button14.png</file>
-    <file alias="button15.png">../../../res/ex80/button15.png</file>
-    <file alias="button16.png">../../../res/ex80/button16.png</file>
-    <file alias="button17.png">../../../res/ex80/button17.png</file>
-    <file alias="button18.png">../../../res/ex80/button18.png</file>
-    <file alias="button19.png">../../../res/ex80/button19.png</file>
-    <file alias="button20.png">../../../res/ex80/button20.png</file>
-    <file alias="button21.png">../../../res/ex80/button21.png</file>
-    <file alias="button22.png">../../../res/ex80/button22.png</file>
-    <file alias="button23.png">../../../res/ex80/button23.png</file>
-    <file alias="button24.png">../../../res/ex80/button24.png</file>
-</qresource>
-</RCC>
diff --git a/source/src/qt/common/qrc/ex80bs.qrc b/source/src/qt/common/qrc/ex80bs.qrc
new file mode 100644 (file)
index 0000000..8e8b310
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+    <file alias="background.png">../../../res/ex80bs/board.png</file>
+    <file alias="default.ico">../../../res/ex80bs.ico</file>
+    <file alias="bios_and_keys.txt">../../../../../doc/VMs/ex80bs.txt</file>
+    <file alias="machine.ja_JP.qm">../../../res/i18n/ja/ex80bs.ja_JP.qm</file>
+    <file alias="button00.png">../../../res/ex80bs/button00.png</file>
+    <file alias="button01.png">../../../res/ex80bs/button01.png</file>
+    <file alias="button02.png">../../../res/ex80bs/button02.png</file>
+    <file alias="button03.png">../../../res/ex80bs/button03.png</file>
+    <file alias="button04.png">../../../res/ex80bs/button04.png</file>
+    <file alias="button05.png">../../../res/ex80bs/button05.png</file>
+    <file alias="button06.png">../../../res/ex80bs/button06.png</file>
+    <file alias="button07.png">../../../res/ex80bs/button07.png</file>
+    <file alias="button08.png">../../../res/ex80bs/button08.png</file>
+    <file alias="button09.png">../../../res/ex80bs/button09.png</file>
+    <file alias="button10.png">../../../res/ex80bs/button10.png</file>
+    <file alias="button11.png">../../../res/ex80bs/button11.png</file>
+    <file alias="button12.png">../../../res/ex80bs/button12.png</file>
+    <file alias="button13.png">../../../res/ex80bs/button13.png</file>
+    <file alias="button14.png">../../../res/ex80bs/button14.png</file>
+    <file alias="button15.png">../../../res/ex80bs/button15.png</file>
+    <file alias="button16.png">../../../res/ex80bs/button16.png</file>
+    <file alias="button17.png">../../../res/ex80bs/button17.png</file>
+    <file alias="button18.png">../../../res/ex80bs/button18.png</file>
+    <file alias="button19.png">../../../res/ex80bs/button19.png</file>
+    <file alias="button20.png">../../../res/ex80bs/button20.png</file>
+    <file alias="button21.png">../../../res/ex80bs/button21.png</file>
+    <file alias="button22.png">../../../res/ex80bs/button22.png</file>
+    <file alias="button23.png">../../../res/ex80bs/button23.png</file>
+    <file alias="button24.png">../../../res/ex80bs/button24.png</file>
+</qresource>
+</RCC>
diff --git a/source/src/qt/machines/ex80/CMakeLists.txt b/source/src/qt/machines/ex80/CMakeLists.txt
deleted file mode 100644 (file)
index 1bab9ec..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-message("* qt/ex80")
-
-set(s_qt_ex80_headers
-         menuclasses.h
-)
-
-MAKE_WRAP_CPP(s_qt_ex80_headers_MOC ${s_qt_ex80_headers})
-
-add_library(qt_emuex80
-         MainWindow.cpp
-         ${s_qt_ex80_headers_MOC}
-)
-
-
diff --git a/source/src/qt/machines/ex80/ex80.ja_JP.ts b/source/src/qt/machines/ex80/ex80.ja_JP.ts
deleted file mode 100644 (file)
index 809b5a7..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1" language="ja_JP">
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>SW1</source>
-        <translation type="vanished">スイッチ1</translation>
-    </message>
-    <message>
-        <source>SW2</source>
-        <translation type="vanished">スイッチ2</translation>
-    </message>
-    <message>
-        <source>VRAM Address</source>
-        <translation type="vanished">VRAMアドレス</translation>
-    </message>
-</context>
-<context>
-    <name>MenuEX80</name>
-    <message>
-        <location filename="MainWindow.cpp" line="151"/>
-        <source>RAM</source>
-        <translatorcomment>RAM</translatorcomment>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="155"/>
-        <source>SW1</source>
-        <translatorcomment>SW1</translatorcomment>
-        <translation>スイッチ1</translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="156"/>
-        <source>STEP</source>
-        <translatorcomment>STEP</translatorcomment>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="157"/>
-        <source>AUTO</source>
-        <translatorcomment>AUTO</translatorcomment>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="159"/>
-        <source>SW2</source>
-        <translatorcomment>SW2</translatorcomment>
-        <translation>スイッチ2</translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="160"/>
-        <source>CHAR</source>
-        <translatorcomment>CHAR</translatorcomment>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="161"/>
-        <source>BIT</source>
-        <translatorcomment>BIT</translatorcomment>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="163"/>
-        <source>VRAM Address</source>
-        <translation>VRAMアドレス</translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="164"/>
-        <source>$8000-$81FF</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="165"/>
-        <source>$8200-$83FF</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="166"/>
-        <source>$8400-$85FF</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="MainWindow.cpp" line="167"/>
-        <source>$8600-$87FF</source>
-        <translation></translation>
-    </message>
-</context>
-</TS>
diff --git a/source/src/qt/machines/ex80bs/CMakeLists.txt b/source/src/qt/machines/ex80bs/CMakeLists.txt
new file mode 100644 (file)
index 0000000..70814c4
--- /dev/null
@@ -0,0 +1,14 @@
+message("* qt/ex80bs")
+
+set(s_qt_ex80bs_headers
+         menuclasses.h
+)
+
+MAKE_WRAP_CPP(s_qt_ex80bs_headers_MOC ${s_qt_ex80bs_headers})
+
+add_library(qt_emuex80bs
+         MainWindow.cpp
+         ${s_qt_ex80bs_headers_MOC}
+)
+
+
similarity index 83%
rename from source/src/qt/machines/ex80/MainWindow.cpp
rename to source/src/qt/machines/ex80bs/MainWindow.cpp
index b6b7776..7260d40 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Common Source code Project:
- * Ui->Qt->MainWindow for JR100 .
+ * Ui->Qt->MainWindow for EX-80BS .
  * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
  *   License : GPLv2
  *   History :
@@ -12,6 +12,7 @@
 #include <QMenu>
 
 #include "emu.h"
+#include "vm.h"
 #include "commonclasses.h"
 #include "menuclasses.h"
 #include "qt_main.h"
@@ -19,7 +20,9 @@
 
 void META_MainWindow::setupUI_Emu(void)
 {
-   int i; 
+   int i;
+   ConfigCPUBootMode(USE_BOOT_MODE);
+   
    actionGroup_DipSW1 = new QActionGroup(this);
    actionGroup_DipSW1->setExclusive(true);
 
@@ -71,6 +74,12 @@ void META_MainWindow::retranslateUi(void)
        Ui_MainWindowBase::retranslateUi();
        retranslateControlMenu("System Reset",  false);
        
+       menuBootMode->setTitle(QApplication::translate("Machine", "BOOT Mode", 0));
+       menuBootMode->setToolTipsVisible(false);
+       actionBootMode[0]->setText(QApplication::translate("Machine", "EX-80", 0));
+       actionBootMode[1]->setText(QApplication::translate("Machine", "EX-80BS Lv1 BASIC", 0));
+       actionBootMode[2]->setText(QApplication::translate("Machine", "EX-80BS Lv2 BASIC", 0));
+       
        if(menu_BINs[0] != NULL) menu_BINs[0]->setTitle(QApplication::translate("MenuEX80", "RAM", 0));
 #ifdef USE_MOUSE
        actionMouseEnable->setVisible(false);
@@ -88,6 +97,14 @@ void META_MainWindow::retranslateUi(void)
        actionVramAddr[1]->setText(QApplication::translate("MenuEX80", "$8200-$83FF", 0));
        actionVramAddr[2]->setText(QApplication::translate("MenuEX80", "$8400-$85FF", 0));
        actionVramAddr[3]->setText(QApplication::translate("MenuEX80", "$8600-$87FF", 0));
+
+#if defined(USE_MONITOR_TYPE)
+       actionMonitorType[0]->setText(QApplication::translate("MenuEX80", "Show TV Monitor"));
+       actionMonitorType[1]->setText(QApplication::translate("MenuEX80", "Hide TV Monitor"));
+//     actionMonitorType[0]->setToolTipVisible(false);
+//     actionMonitorType[1]->setToolTipVisible(false);
+#endif 
+
 #ifdef USE_DEBUGGER
        actionDebugger[0]->setVisible(true);
        actionDebugger[1]->setVisible(false);
diff --git a/source/src/qt/machines/ex80bs/ex80bs.ja_JP.ts b/source/src/qt/machines/ex80bs/ex80bs.ja_JP.ts
new file mode 100644 (file)
index 0000000..28f126d
--- /dev/null
@@ -0,0 +1,100 @@
+<?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="76"/>
+        <source>BOOT Mode</source>
+        <translation>起動モード</translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="78"/>
+        <source>EX-80</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="79"/>
+        <source>EX-80BS Lv1 BASIC</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="80"/>
+        <source>EX-80BS Lv2 BASIC</source>
+        <translation></translation>
+    </message>
+</context>
+<context>
+    <name>MenuEX80</name>
+    <message>
+        <location filename="MainWindow.cpp" line="82"/>
+        <source>RAM</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="86"/>
+        <source>SW1</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="87"/>
+        <source>STEP</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="88"/>
+        <source>AUTO</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="90"/>
+        <source>SW2</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="91"/>
+        <source>CHAR</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="92"/>
+        <source>BIT</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="94"/>
+        <source>VRAM Address</source>
+        <translation>VRAMアドレス</translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="95"/>
+        <source>$8000-$81FF</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="96"/>
+        <source>$8200-$83FF</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="97"/>
+        <source>$8400-$85FF</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="98"/>
+        <source>$8600-$87FF</source>
+        <translation></translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="101"/>
+        <source>Show TV Monitor</source>
+        <translation>テレビモニタを表示する</translation>
+    </message>
+    <message>
+        <location filename="MainWindow.cpp" line="102"/>
+        <source>Hide TV Monitor</source>
+        <translation>テレビモニタを消す</translation>
+    </message>
+</context>
+</TS>
diff --git a/source/src/res/ex80.ico b/source/src/res/ex80.ico
deleted file mode 100644 (file)
index ce8e827..0000000
Binary files a/source/src/res/ex80.ico and /dev/null differ
similarity index 77%
rename from source/src/res/ex80.rc
rename to source/src/res/ex80bs.rc
index 215cc93..343899b 100644 (file)
@@ -138,6 +138,12 @@ BEGIN
     END\r
     POPUP "Device"\r
     BEGIN\r
+        POPUP "Boot"\r
+        BEGIN\r
+            MENUITEM "EX-80",                   ID_VM_BOOT_MODE0\r
+            MENUITEM "EX-80BS Lv1 BASIC",       ID_VM_BOOT_MODE1\r
+            MENUITEM "EX-80BS Lv2 BASIC",       ID_VM_BOOT_MODE2\r
+        END\r
         POPUP "DIP Switch"\r
         BEGIN\r
             MENUITEM "SW1: STEP/AUTO",          ID_VM_DIPSWITCH0\r
@@ -197,32 +203,32 @@ END
 // Image\r
 //\r
 \r
-IDI_BITMAP_BOARD        IMAGE   DISCARDABLE     "ex80/board.png"\r
-IDI_BITMAP_BUTTON00     IMAGE   DISCARDABLE     "ex80/button00.png"\r
-IDI_BITMAP_BUTTON01     IMAGE   DISCARDABLE     "ex80/button01.png"\r
-IDI_BITMAP_BUTTON02     IMAGE   DISCARDABLE     "ex80/button02.png"\r
-IDI_BITMAP_BUTTON03     IMAGE   DISCARDABLE     "ex80/button03.png"\r
-IDI_BITMAP_BUTTON04     IMAGE   DISCARDABLE     "ex80/button04.png"\r
-IDI_BITMAP_BUTTON05     IMAGE   DISCARDABLE     "ex80/button05.png"\r
-IDI_BITMAP_BUTTON06     IMAGE   DISCARDABLE     "ex80/button06.png"\r
-IDI_BITMAP_BUTTON07     IMAGE   DISCARDABLE     "ex80/button07.png"\r
-IDI_BITMAP_BUTTON08     IMAGE   DISCARDABLE     "ex80/button08.png"\r
-IDI_BITMAP_BUTTON09     IMAGE   DISCARDABLE     "ex80/button09.png"\r
-IDI_BITMAP_BUTTON10     IMAGE   DISCARDABLE     "ex80/button10.png"\r
-IDI_BITMAP_BUTTON11     IMAGE   DISCARDABLE     "ex80/button11.png"\r
-IDI_BITMAP_BUTTON12     IMAGE   DISCARDABLE     "ex80/button12.png"\r
-IDI_BITMAP_BUTTON13     IMAGE   DISCARDABLE     "ex80/button13.png"\r
-IDI_BITMAP_BUTTON14     IMAGE   DISCARDABLE     "ex80/button14.png"\r
-IDI_BITMAP_BUTTON15     IMAGE   DISCARDABLE     "ex80/button15.png"\r
-IDI_BITMAP_BUTTON16     IMAGE   DISCARDABLE     "ex80/button16.png"\r
-IDI_BITMAP_BUTTON17     IMAGE   DISCARDABLE     "ex80/button17.png"\r
-IDI_BITMAP_BUTTON18     IMAGE   DISCARDABLE     "ex80/button18.png"\r
-IDI_BITMAP_BUTTON19     IMAGE   DISCARDABLE     "ex80/button19.png"\r
-IDI_BITMAP_BUTTON20     IMAGE   DISCARDABLE     "ex80/button20.png"\r
-IDI_BITMAP_BUTTON21     IMAGE   DISCARDABLE     "ex80/button21.png"\r
-IDI_BITMAP_BUTTON22     IMAGE   DISCARDABLE     "ex80/button22.png"\r
-IDI_BITMAP_BUTTON23     IMAGE   DISCARDABLE     "ex80/button23.png"\r
-IDI_BITMAP_BUTTON24     IMAGE   DISCARDABLE     "ex80/button24.png"\r
+IDI_BITMAP_BOARD        IMAGE   DISCARDABLE     "ex80bs/board.png"\r
+IDI_BITMAP_BUTTON00     IMAGE   DISCARDABLE     "ex80bs/button00.png"\r
+IDI_BITMAP_BUTTON01     IMAGE   DISCARDABLE     "ex80bs/button01.png"\r
+IDI_BITMAP_BUTTON02     IMAGE   DISCARDABLE     "ex80bs/button02.png"\r
+IDI_BITMAP_BUTTON03     IMAGE   DISCARDABLE     "ex80bs/button03.png"\r
+IDI_BITMAP_BUTTON04     IMAGE   DISCARDABLE     "ex80bs/button04.png"\r
+IDI_BITMAP_BUTTON05     IMAGE   DISCARDABLE     "ex80bs/button05.png"\r
+IDI_BITMAP_BUTTON06     IMAGE   DISCARDABLE     "ex80bs/button06.png"\r
+IDI_BITMAP_BUTTON07     IMAGE   DISCARDABLE     "ex80bs/button07.png"\r
+IDI_BITMAP_BUTTON08     IMAGE   DISCARDABLE     "ex80bs/button08.png"\r
+IDI_BITMAP_BUTTON09     IMAGE   DISCARDABLE     "ex80bs/button09.png"\r
+IDI_BITMAP_BUTTON10     IMAGE   DISCARDABLE     "ex80bs/button10.png"\r
+IDI_BITMAP_BUTTON11     IMAGE   DISCARDABLE     "ex80bs/button11.png"\r
+IDI_BITMAP_BUTTON12     IMAGE   DISCARDABLE     "ex80bs/button12.png"\r
+IDI_BITMAP_BUTTON13     IMAGE   DISCARDABLE     "ex80bs/button13.png"\r
+IDI_BITMAP_BUTTON14     IMAGE   DISCARDABLE     "ex80bs/button14.png"\r
+IDI_BITMAP_BUTTON15     IMAGE   DISCARDABLE     "ex80bs/button15.png"\r
+IDI_BITMAP_BUTTON16     IMAGE   DISCARDABLE     "ex80bs/button16.png"\r
+IDI_BITMAP_BUTTON17     IMAGE   DISCARDABLE     "ex80bs/button17.png"\r
+IDI_BITMAP_BUTTON18     IMAGE   DISCARDABLE     "ex80bs/button18.png"\r
+IDI_BITMAP_BUTTON19     IMAGE   DISCARDABLE     "ex80bs/button19.png"\r
+IDI_BITMAP_BUTTON20     IMAGE   DISCARDABLE     "ex80bs/button20.png"\r
+IDI_BITMAP_BUTTON21     IMAGE   DISCARDABLE     "ex80bs/button21.png"\r
+IDI_BITMAP_BUTTON22     IMAGE   DISCARDABLE     "ex80bs/button22.png"\r
+IDI_BITMAP_BUTTON23     IMAGE   DISCARDABLE     "ex80bs/button23.png"\r
+IDI_BITMAP_BUTTON24     IMAGE   DISCARDABLE     "ex80bs/button24.png"\r
 \r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
@@ -232,7 +238,7 @@ IDI_BITMAP_BUTTON24     IMAGE   DISCARDABLE     "ex80/button24.png"
 \r
 // Icon with lowest ID value placed first to ensure application icon\r
 // remains consistent on all systems.\r
-IDI_ICON1               ICON    DISCARDABLE     "ex80.ico"\r
+IDI_ICON1               ICON    DISCARDABLE     "ex80bs.ico"\r
 #endif    // English (U.S.) resources\r
 /////////////////////////////////////////////////////////////////////////////\r
 \r
diff --git a/source/src/res/i18n/ja/ex80.ja_JP.qm b/source/src/res/i18n/ja/ex80.ja_JP.qm
deleted file mode 100644 (file)
index 17ad041..0000000
Binary files a/source/src/res/i18n/ja/ex80.ja_JP.qm and /dev/null differ
diff --git a/source/src/res/i18n/ja/ex80bs.ja_JP.qm b/source/src/res/i18n/ja/ex80bs.ja_JP.qm
new file mode 100644 (file)
index 0000000..a097b12
Binary files /dev/null and b/source/src/res/i18n/ja/ex80bs.ja_JP.qm differ
diff --git a/source/src/vm/ex80/ex80.cpp b/source/src/vm/ex80/ex80.cpp
deleted file mode 100644 (file)
index 948299a..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-       TOSHIBA EX-80 Emulator 'eEX-80'
-
-       Author : Takeda.Toshiya
-       Date   : 2015.12.10-
-
-       [ virtual machine ]
-*/
-
-#include "ex80.h"
-#include "../../emu.h"
-#include "../device.h"
-#include "../event.h"
-
-#include "../i8080.h"
-#include "../i8251.h"
-#include "../i8255.h"
-#include "../io.h"
-#include "../pcm1bit.h"
-
-#ifdef USE_DEBUGGER
-#include "../debugger.h"
-#endif
-
-#include "./cmt.h"
-#include "./display.h"
-#include "./keyboard.h"
-#include "./memory.h"
-
-using EX80::CMT;
-using EX80::DISPLAY;
-using EX80::KEYBOARD;
-using EX80::MEMORY;
-
-// ----------------------------------------------------------------------------
-// initialize
-// ----------------------------------------------------------------------------
-
-VM::VM(EMU_TEMPLATE* parent_emu) : VM_TEMPLATE(parent_emu)
-{
-       // create devices
-       first_device = last_device = NULL;
-       dummy = new DEVICE(this, emu);  // must be 1st device
-       event = new EVENT(this, emu);   // must be 2nd device
-       
-       sio = new I8251(this, emu);
-       pio = new I8255(this, emu);
-       io = new IO(this, emu);
-       pcm = new PCM1BIT(this, emu);
-#ifdef USE_DEBUGGER
-//     pcm->set_context_debugger(new DEBUGGER(this, emu));
-#endif
-       cpu = new I8080(this, emu);
-       
-       cmt = new CMT(this, emu);
-       display = new DISPLAY(this, emu);
-       keyboard = new KEYBOARD(this, emu);
-       memory = new MEMORY(this, emu);
-       // Set names
-#if defined(_USE_QT)
-       dummy->set_device_name(_T("1st Dummy"));
-       
-       pio->set_device_name(_T("i8255(SOUND/KEY/DISPLAY)"));
-       sio->set_device_name(_T("i8251(CMT)"));
-       pcm->set_device_name(_T("SOUND OUT"));
-#endif
-       
-       // set contexts
-       event->set_context_cpu(cpu);
-       event->set_context_sound(pcm);
-       
-       sio->set_context_out(cmt, SIG_CMT_OUT);
-       pio->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 0x08, 0);
-       pio->set_context_port_c(keyboard, SIG_KEYBOARD_COLUMN, 0x70, 0);
-       pio->set_context_port_c(display, SIG_DISPLAY_DMA, 0x80, 0);
-       // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
-       //pcm->set_realtime_render(true);
-       
-       cmt->set_context_sio(sio);
-       display->set_context_cpu(cpu);
-       display->set_ram_ptr(memory->get_ram());
-       keyboard->set_context_pio(pio);
-       memory->set_context_cpu(cpu);
-       
-       // cpu bus
-       cpu->set_context_mem(memory);
-       cpu->set_context_io(io);
-       cpu->set_context_intr(dummy);
-#ifdef USE_DEBUGGER
-       cpu->set_context_debugger(new DEBUGGER(this, emu));
-#endif
-       
-       // io bus
-       io->set_iomap_range_rw(0xdc, 0xdd, sio);
-       io->set_iomap_range_rw(0xf8, 0xfb, pio);
-       
-       // initialize all devices
-#if defined(__GIT_REPO_VERSION)
-       set_git_repo_version(__GIT_REPO_VERSION);
-#endif
-       initialize_devices();
-}
-
-VM::~VM()
-{
-       // delete all devices
-       for(DEVICE* device = first_device; device;) {
-               DEVICE *next_device = device->next_device;
-               device->release();
-               delete device;
-               device = next_device;
-       }
-}
-
-
-// ----------------------------------------------------------------------------
-// drive virtual machine
-// ----------------------------------------------------------------------------
-
-
-void VM::run()
-{
-       __UNLIKELY_IF(event == nullptr) return;
-       event->drive();
-}
-
-// ----------------------------------------------------------------------------
-// debugger
-// ----------------------------------------------------------------------------
-
-#ifdef USE_DEBUGGER
-DEVICE *VM::get_cpu(int index)
-{
-       if(index == 0) {
-               return cpu;
-       }
-       return NULL;
-}
-#endif
-
-// ----------------------------------------------------------------------------
-// draw screen
-// ----------------------------------------------------------------------------
-
-void VM::draw_screen()
-{
-       __UNLIKELY_IF(display == nullptr) return;
-       display->draw_screen();
-}
-
-int VM::max_draw_ranges()
-{
-       return (config.monitor_type == 0) ? 9 : 8;
-}
-
-// ----------------------------------------------------------------------------
-// soud manager
-// ----------------------------------------------------------------------------
-
-void VM::initialize_sound(int rate, int samples)
-{
-       // init sound manager
-       event->initialize_sound(rate, samples);
-       
-       // init sound gen
-       pcm->initialize_sound(rate, 8000);
-}
-
-uint16_t* VM::create_sound(int* extra_frames)
-{
-       __UNLIKELY_IF(event == nullptr) return nullptr;
-       return event->create_sound(extra_frames);
-}
-
-int VM::get_sound_buffer_ptr()
-{
-       __UNLIKELY_IF(event == nullptr) return 0;
-       return event->get_sound_buffer_ptr();
-}
-
-#ifdef USE_SOUND_VOLUME
-void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
-{
-       if(ch == 0) {
-               pcm->set_volume(0, decibel_l, decibel_r);
-       }
-}
-#endif
-
-// ----------------------------------------------------------------------------
-// user interface
-// ----------------------------------------------------------------------------
-
-void VM::load_binary(int drv, const _TCHAR* file_path)
-{
-       if(drv == 0) {
-               memory->load_binary(file_path);
-       }
-}
-
-void VM::save_binary(int drv, const _TCHAR* file_path)
-{
-       if(drv == 0) {
-               memory->save_binary(file_path);
-       }
-}
-
-void VM::play_tape(int drv, const _TCHAR* file_path)
-{
-       cmt->play_tape(file_path);
-}
-
-void VM::rec_tape(int drv, const _TCHAR* file_path)
-{
-       cmt->rec_tape(file_path);
-}
-
-void VM::close_tape(int drv)
-{
-       cmt->close_tape();
-}
-
-bool VM::is_tape_inserted(int drv)
-{
-       return cmt->is_tape_inserted();
-}
-
-bool VM::is_frame_skippable()
-{
-       __UNLIKELY_IF(event == nullptr) return false;
-       return event->is_frame_skippable();
-}
-
-double VM::get_current_usec()
-{
-       __UNLIKELY_IF(event == nullptr) return 0.0;
-       return event->get_current_usec();
-}
-
-uint64_t VM::get_current_clock_uint64()
-{
-       __UNLIKELY_IF(event == nullptr) return (uint64_t)0;
-       return event->get_current_clock_uint64();
-}
-
-#define STATE_VERSION  2
-
-bool VM::process_state(FILEIO* state_fio, bool loading)
-{
-       if(!(VM_TEMPLATE::process_state_core(state_fio, loading, STATE_VERSION))) {
-               return false;
-       }
-       // Machine specified.
-       return true;
-}
-
diff --git a/source/src/vm/ex80/ex80.h b/source/src/vm/ex80/ex80.h
deleted file mode 100644 (file)
index 172edaf..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
-       TOSHIBA EX-80 Emulator 'eEX-80'
-
-       Author : Takeda.Toshiya
-       Date   : 2015.12.10-
-
-       [ virtual machine ]
-*/
-
-#ifndef _EX80_H_
-#define _EX80_H_
-
-#define DEVICE_NAME            "TOSHIBA EX-80"
-#define CONFIG_NAME            "ex80"
-
-// device informations for virtual machine
-#define FRAMES_PER_SEC         59.94
-#define LINES_PER_FRAME        525
-#define CPU_CLOCKS             2048000
-#define HAS_I8080
-#define SCREEN_WIDTH           960
-#define SCREEN_HEIGHT          670
-#define MEMORY_ADDR_MAX                0x10000
-#define MEMORY_BANK_SIZE       0x400
-#define IO_ADDR_MAX            0x100
-
-// device informations for win32
-#define ONE_BOARD_MICRO_COMPUTER
-#define MAX_BUTTONS            25
-//#define MAX_DRAW_RANGES      9
-/*
-SW1    ON = STEP / OFF = AUTO
-SW2    ON = CHAR / OFF = BIT
-SW3-1/2        ON ,ON  = 8000H-81FFH
-       OFF,ON  = 8200H-83FFH
-       ON ,OFF = 8400H-85FFH
-       OFF,OFF = 8600H-87FFH
-*/
-#define USE_DIPSWITCH
-#define DIPSWITCH_DEFAULT      0x0e
-#define USE_TAPE               1
-#define TAPE_BINARY_ONLY
-#define USE_BINARY_FILE                1
-#define USE_AUTO_KEY           5
-#define USE_AUTO_KEY_RELEASE   6
-#define USE_AUTO_KEY_NO_CAPS
-#define USE_MONITOR_TYPE       2
-#define USE_SOUND_VOLUME       1
-#define USE_DEBUGGER
-#define USE_STATE
-#define USE_CPU_I8080
-
-#include "../../common.h"
-#include "../../fileio.h"
-#include "../vm_template.h"
-
-#ifdef USE_SOUND_VOLUME
-static const _TCHAR *sound_device_caption[] = {
-       _T("Beep"),
-};
-#endif
-
-#define LED_WIDTH      26
-#define LED_HEIGHT     51
-
-const struct {
-       int x, y;
-       int width, height;
-       int code;
-} vm_buttons[] = {
-       // virtual key codes 0x80-0x8f and 0x98-0x9f are not used in pc keyboard
-       {763 + 36 * 0, 478 + 34 * 4, 30, 21, 0x80}, // 0
-       {763 + 36 * 1, 478 + 34 * 4, 30, 21, 0x81}, // 1
-       {763 + 36 * 2, 478 + 34 * 4, 30, 21, 0x82}, // 2
-       {763 + 36 * 3, 478 + 34 * 4, 30, 21, 0x83}, // 3
-       {763 + 36 * 0, 478 + 34 * 3, 30, 21, 0x84}, // 4
-       {763 + 36 * 1, 478 + 34 * 3, 30, 21, 0x85}, // 5
-       {763 + 36 * 2, 478 + 34 * 3, 30, 21, 0x86}, // 6
-       {763 + 36 * 3, 478 + 34 * 3, 30, 21, 0x87}, // 7
-       {763 + 36 * 0, 478 + 34 * 2, 30, 21, 0x88}, // 8
-       {763 + 36 * 1, 478 + 34 * 2, 30, 21, 0x89}, // 9
-       {763 + 36 * 2, 478 + 34 * 2, 30, 21, 0x8a}, // A
-       {763 + 36 * 3, 478 + 34 * 2, 30, 21, 0x8b}, // B
-       {763 + 36 * 0, 478 + 34 * 1, 30, 21, 0x8c}, // C
-       {763 + 36 * 1, 478 + 34 * 1, 30, 21, 0x8d}, // D
-       {763 + 36 * 2, 478 + 34 * 1, 30, 21, 0x8e}, // E
-       {763 + 36 * 3, 478 + 34 * 1, 30, 21, 0x8f}, // F
-       {763 + 36 * 0, 478 + 34 * 0, 30, 21, 0x98}, // RET
-       {763 + 36 * 1, 478 + 34 * 0, 30, 21, 0x99}, // RUN
-       {763 + 36 * 2, 478 + 34 * 0, 30, 21, 0x9a}, // SDA
-       {763 + 36 * 3, 478 + 34 * 0, 30, 21, 0x9b}, // LDA
-       {763 + 36 * 4, 478 + 34 * 0, 30, 21, 0x00}, // RST
-       {763 + 36 * 4, 478 + 34 * 1, 30, 21, 0x9c}, // ADR
-       {763 + 36 * 4, 478 + 34 * 2, 30, 21, 0x9d}, // RIC
-       {763 + 36 * 4, 478 + 34 * 3, 30, 21, 0x9e}, // RDC
-       {763 + 36 * 4, 478 + 34 * 4, 30, 21, 0x9f}, // WIC
-};
-const struct {
-       int x, y;
-       int width, height;
-} vm_ranges[] = {
-       {668 + 33 * 0, 295, LED_WIDTH, LED_HEIGHT}, // 7-seg LEDs
-       {668 + 33 * 1, 295, LED_WIDTH, LED_HEIGHT},
-       {668 + 33 * 2, 295, LED_WIDTH, LED_HEIGHT},
-       {668 + 33 * 3, 295, LED_WIDTH, LED_HEIGHT},
-       {828 + 33 * 0, 295, LED_WIDTH, LED_HEIGHT},
-       {828 + 33 * 1, 295, LED_WIDTH, LED_HEIGHT},
-       {828 + 33 * 2, 295, LED_WIDTH, LED_HEIGHT},
-       {828 + 33 * 3, 295, LED_WIDTH, LED_HEIGHT},
-       {8, 8, 8 * 6 * 12, 8 * 2 * 29}, // CRT
-};
-
-//class csp_state_utils;
-class EMU;
-class DEVICE;
-class EVENT;
-
-class I8251;
-class I8255;
-class IO;
-class PCM1BIT;
-class I8080;
-
-namespace EX80 {
-       class CMT;
-       class DISPLAY;
-       class KEYBOARD;
-       class MEMORY;
-}
-
-class VM : public VM_TEMPLATE
-{
-protected:
-       //EMU* emu;
-       //csp_state_utils *state_entry;
-       // devices
-       //EVENT* event;
-       
-       I8251* sio;
-       I8255* pio;
-       IO* io;
-       PCM1BIT* pcm;
-       I8080* cpu;
-       
-       EX80::CMT* cmt;
-       EX80::DISPLAY* display;
-       EX80::KEYBOARD* keyboard;
-       EX80::MEMORY* memory;
-       
-public:
-       // ----------------------------------------
-       // initialize
-       // ----------------------------------------
-       
-       VM(EMU_TEMPLATE* parent_emu);
-       ~VM();
-       
-       // ----------------------------------------
-       // for emulation class
-       // ----------------------------------------
-       
-       // drive virtual machine
-       //void reset();
-       void run();
-       double get_frame_rate()
-       {
-               return FRAMES_PER_SEC;
-       }
-       
-#ifdef USE_DEBUGGER
-       // debugger
-       DEVICE *get_cpu(int index);
-#endif
-       
-       // draw screen
-       void draw_screen();
-       int max_draw_ranges();
-       
-       // sound generation
-       void initialize_sound(int rate, int samples);
-       uint16_t* create_sound(int* extra_frames);
-       int get_sound_buffer_ptr();
-#ifdef USE_SOUND_VOLUME
-       void set_sound_device_volume(int ch, int decibel_l, int decibel_r);
-#endif
-       
-       // user interface
-       void load_binary(int drv, const _TCHAR* file_path);
-       void save_binary(int drv, const _TCHAR* file_path);
-       void play_tape(int drv, const _TCHAR* file_path);
-       void rec_tape(int drv, const _TCHAR* file_path);
-       void close_tape(int drv);
-       bool is_tape_inserted(int drv);
-       bool is_frame_skippable();
-       
-       double get_current_usec();
-       uint64_t get_current_clock_uint64();
-
-       //void update_config();
-       bool process_state(FILEIO* state_fio, bool loading);
-       
-       // ----------------------------------------
-       // for each device
-       // ----------------------------------------
-       
-       // devices
-       //DEVICE* get_device(int id);
-       //DEVICE* dummy;
-       //DEVICE* first_device;
-       //DEVICE* last_device;
-};
-
-#endif
diff --git a/source/src/vm/ex80/keyboard.cpp b/source/src/vm/ex80/keyboard.cpp
deleted file mode 100644 (file)
index 2146b5b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-       TOSHIBA EX-80 Emulator 'eEX-80'
-
-       Author : Takeda.Toshiya
-       Date   : 2015.12.10-
-
-       [ keyboard ]
-*/
-
-#include "./keyboard.h"
-#include "../i8255.h"
-
-namespace EX80 {
-void KEYBOARD::initialize()
-{
-       column = 0xff;
-       register_frame_event(this);
-}
-
-void KEYBOARD::write_signal(int id, uint32_t data, uint32_t mask)
-{
-       column = data & mask;
-       event_frame();
-}
-
-void KEYBOARD::event_frame()
-{
-       const uint8_t* key_stat = emu->get_key_buffer();
-       uint32_t val = 0xff;
-       
-       if(!(column & 0x10)) {
-               if(key_stat[0x80] || key_stat[0x30] || key_stat[0x60]) val &= ~0x01;    // 0
-               if(key_stat[0x81] || key_stat[0x31] || key_stat[0x61]) val &= ~0x02;    // 1
-               if(key_stat[0x82] || key_stat[0x32] || key_stat[0x62]) val &= ~0x04;    // 2
-               if(key_stat[0x83] || key_stat[0x33] || key_stat[0x63]) val &= ~0x08;    // 3
-               if(key_stat[0x84] || key_stat[0x34] || key_stat[0x64]) val &= ~0x10;    // 4
-               if(key_stat[0x85] || key_stat[0x35] || key_stat[0x65]) val &= ~0x20;    // 5
-               if(key_stat[0x86] || key_stat[0x36] || key_stat[0x66]) val &= ~0x40;    // 6
-               if(key_stat[0x87] || key_stat[0x37] || key_stat[0x67]) val &= ~0x80;    // 7
-       }
-       if(!(column & 0x20)) {
-               if(key_stat[0x88] || key_stat[0x38] || key_stat[0x68]) val &= ~0x01;    // 8
-               if(key_stat[0x89] || key_stat[0x39] || key_stat[0x69]) val &= ~0x02;    // 9
-               if(key_stat[0x8a] || key_stat[0x41]                  ) val &= ~0x04;    // A
-               if(key_stat[0x8b] || key_stat[0x42]                  ) val &= ~0x08;    // B
-               if(key_stat[0x8c] || key_stat[0x43]                  ) val &= ~0x10;    // C
-               if(key_stat[0x8d] || key_stat[0x44]                  ) val &= ~0x20;    // D
-               if(key_stat[0x8e] || key_stat[0x45]                  ) val &= ~0x40;    // E
-               if(key_stat[0x8f] || key_stat[0x46]                  ) val &= ~0x80;    // F
-       }
-       if(!(column & 0x40)) {
-               if(key_stat[0x98] || key_stat[0x70]                  ) val &= ~0x02;    // RET ... F1
-               if(key_stat[0x99] || key_stat[0x71]                  ) val &= ~0x01;    // RUN ... F2
-               if(key_stat[0x9a] || key_stat[0x72]                  ) val &= ~0x40;    // SDA ... F3
-               if(key_stat[0x9b] || key_stat[0x73]                  ) val &= ~0x80;    // LDA ... F4
-               if(key_stat[0x9c] || key_stat[0x74]                  ) val &= ~0x04;    // ADR ... F5
-               if(key_stat[0x9d] || key_stat[0x75] || key_stat[0x21]) val &= ~0x10;    // RIC ... F6 or PgUp
-               if(key_stat[0x9e] || key_stat[0x76] || key_stat[0x22]) val &= ~0x08;    // RDC ... F7 or PgDn
-               if(key_stat[0x9f] || key_stat[0x77] || key_stat[0x0d]) val &= ~0x20;    // WIC ... F8 or Enter
-       }
-       d_pio->write_signal(SIG_I8255_PORT_A, val, 0xff);
-}
-
-#define STATE_VERSION  1
-
-bool KEYBOARD::process_state(FILEIO* state_fio, bool loading)
-{
-       if(!state_fio->StateCheckUint32(STATE_VERSION)) {
-               return false;
-       }
-       if(!state_fio->StateCheckInt32(this_device_id)) {
-               return false;
-       }
-       state_fio->StateValue(column);
-       return true;
-}
-}
diff --git a/source/src/vm/ex80/keyboard.h b/source/src/vm/ex80/keyboard.h
deleted file mode 100644 (file)
index 5606d02..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-       TOSHIBA EX-80 Emulator 'eEX-80'
-
-       Author : Takeda.Toshiya
-       Date   : 2015.12.10-
-
-       [ keyboard ]
-*/
-
-#ifndef _KEYBOARD_H_
-#define _KEYBOARD_H_
-
-#include "../vm.h"
-#include "../../emu.h"
-#include "../device.h"
-
-namespace EX80 {
-#define SIG_KEYBOARD_COLUMN    0
-
-class KEYBOARD : public DEVICE
-{
-private:
-       DEVICE *d_pio;
-       
-       uint32_t column;
-       
-       void update_kb();
-       
-public:
-       KEYBOARD(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu) : DEVICE(parent_vm, parent_emu)
-       {
-               set_device_name(_T("Keyboard"));
-       }
-       ~KEYBOARD() {}
-       
-       // common functions
-       void initialize();
-       void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
-       void event_frame();
-       bool process_state(FILEIO* state_fio, bool loading);
-       
-       // unique function
-       void set_context_pio(DEVICE* device)
-       {
-               d_pio = device;
-       }
-};
-}
-
-#endif
-
diff --git a/source/src/vm/ex80/memory.cpp b/source/src/vm/ex80/memory.cpp
deleted file mode 100644 (file)
index 508fb36..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-       TOSHIBA EX-80 Emulator 'eEX-80'
-
-       Author : Takeda.Toshiya
-       Date   : 2015.12.14-
-
-       [ memory ]
-*/
-
-#include "./memory.h"
-#include "../i8080.h"
-
-namespace EX80 {
-#define SET_BANK(s, e, w, r) { \
-       int sb = (s) >> 10, eb = (e) >> 10; \
-       for(int i = sb; i <= eb; i++) { \
-               if(((uintptr_t)w) == ((uintptr_t)wdmy)) {       \
-                       wbank[i] = wdmy; \
-               } else { \
-                       wbank[i] = (w) + 0x400 * (i - sb); \
-               } \
-               if(((uintptr_t)r) == ((uintptr_t)rdmy)) {       \
-                       rbank[i] = rdmy; \
-               } else { \
-                       rbank[i] = (r) + 0x400 * (i - sb); \
-               } \
-       } \
-}
-
-void MEMORY::initialize()
-{
-       memset(mon, 0xff, sizeof(mon));
-       memset(prom1, 0xff, sizeof(prom1));
-       memset(prom2, 0xff, sizeof(prom2));
-       memset(ram, 0, sizeof(ram));
-       
-       // load rom image
-       FILEIO* fio = new FILEIO();
-       if(fio->Fopen(create_local_path(_T("MON.ROM")), FILEIO_READ_BINARY)) {
-               fio->Fread(mon, sizeof(mon), 1);
-               fio->Fclose();
-       }
-       if(fio->Fopen(create_local_path(_T("PROM1.ROM")), FILEIO_READ_BINARY)) {
-               fio->Fread(prom1, sizeof(prom1), 1);
-               fio->Fclose();
-       }
-       if(fio->Fopen(create_local_path(_T("PROM2.ROM")), FILEIO_READ_BINARY)) {
-               fio->Fread(prom2, sizeof(prom2), 1);
-               fio->Fclose();
-       }
-       delete fio;
-       
-       // set memory map
-       SET_BANK(0x0000, 0x07ff, wdmy, mon );
-       SET_BANK(0x0800, 0x0bff, wdmy, prom1);
-       SET_BANK(0x0c00, 0x0fff, wdmy, prom2);
-       SET_BANK(0x1000, 0x7fff, wdmy, rdmy);
-       SET_BANK(0x8000, 0x87ff, ram,  ram );
-       SET_BANK(0x8800, 0xffff, wdmy, rdmy);
-}
-
-void MEMORY::write_data8(uint32_t addr, uint32_t data)
-{
-       addr &= 0xffff;
-       wbank[addr >> 10][addr & 0x3ff] = data;
-}
-
-uint32_t MEMORY::read_data8(uint32_t addr)
-{
-       addr &= 0xffff;
-       return rbank[addr >> 10][addr & 0x3ff];
-}
-
-uint32_t MEMORY::fetch_op(uint32_t addr, int *wait)
-{
-       if((config.dipswitch & 1) && d_cpu->read_signal(SIG_I8080_INTE)) {
-               d_cpu->write_signal(SIG_I8080_INTR, 1, 1);
-       }
-       *wait = 0;
-       return read_data8(addr);
-}
-
-void MEMORY::load_binary(const _TCHAR* file_path)
-{
-       FILEIO* fio = new FILEIO();
-       if(fio->Fopen(file_path, FILEIO_READ_BINARY)) {
-               fio->Fread(ram, sizeof(ram), 1);
-               fio->Fclose();
-       }
-       delete fio;
-}
-
-void MEMORY::save_binary(const _TCHAR* file_path)
-{
-       FILEIO* fio = new FILEIO();
-       if(fio->Fopen(file_path, FILEIO_WRITE_BINARY)) {
-               fio->Fwrite(ram, sizeof(ram), 1);
-               fio->Fclose();
-       }
-       delete fio;
-}
-
-#define STATE_VERSION  1
-
-bool MEMORY::process_state(FILEIO* state_fio, bool loading)
-{
-       if(!state_fio->StateCheckUint32(STATE_VERSION)) {
-               return false;
-       }
-       if(!state_fio->StateCheckInt32(this_device_id)) {
-               return false;
-       }
-       state_fio->StateArray(ram, sizeof(ram), 1);
-       return true;
-}
-}
diff --git a/source/src/vm/ex80/memory.h b/source/src/vm/ex80/memory.h
deleted file mode 100644 (file)
index 6abb25c..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-       TOSHIBA EX-80 Emulator 'eEX-80'
-
-       Author : Takeda.Toshiya
-       Date   : 2015.12.14-
-
-       [ memory ]
-*/
-
-#ifndef _EX80_MEMORY_H_
-#define _EX80_MEMORY_H_
-
-#include "../vm.h"
-#include "../../emu.h"
-#include "../device.h"
-
-namespace EX80 {
-class MEMORY : public DEVICE
-{
-private:
-       DEVICE *d_cpu;
-       
-       uint8_t mon[0x800];
-       uint8_t prom1[0x400];
-       uint8_t prom2[0x400];
-       uint8_t ram[0x800];
-       
-       uint8_t wdmy[0x400];
-       uint8_t rdmy[0x400];
-       uint8_t* wbank[64];
-       uint8_t* rbank[64];
-       
-public:
-       MEMORY(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu) : DEVICE(parent_vm, parent_emu)
-       {
-               set_device_name(_T("Memory Bus"));
-       }
-       ~MEMORY() {}
-       
-       // common functions
-       void initialize();
-       void __FASTCALL write_data8(uint32_t addr, uint32_t data);
-       uint32_t __FASTCALL read_data8(uint32_t addr);
-       uint32_t __FASTCALL fetch_op(uint32_t addr, int *wait);
-       uint32_t get_intr_ack()
-       {
-               // RST 7
-               return 0xff;
-       }
-       bool process_state(FILEIO* state_fio, bool loading);
-       
-       // unique functions
-       void set_context_cpu(DEVICE* device)
-       {
-               d_cpu = device;
-       }
-       uint8_t* get_ram()
-       {
-               return ram;
-       }
-       void load_binary(const _TCHAR* file_path);
-       void save_binary(const _TCHAR* file_path);
-};
-}
-
-#endif
-
similarity index 57%
rename from source/src/vm/ex80/CMakeLists.txt
rename to source/src/vm/ex80bs/CMakeLists.txt
index 237f131..b29f36b 100644 (file)
@@ -1,13 +1,12 @@
 cmake_minimum_required (VERSION 3.0)
 
-message("* vm/ex80")
+message("* vm/ex80bs")
 
-add_library(vm_emuex80
+add_library(vm_emuex80bs
        ../i8080.cpp
        
        cmt.cpp
        display.cpp
-       keyboard.cpp
        ./memory.cpp
-       ex80.cpp
+       ex80bs.cpp
 )
similarity index 99%
rename from source/src/vm/ex80/cmt.cpp
rename to source/src/vm/ex80bs/cmt.cpp
index f1cc94c..2682043 100644 (file)
@@ -10,7 +10,7 @@
 #include "./cmt.h"
 #include "../i8251.h"
 
-namespace EX80 {
+namespace EX80BS {
 void CMT::initialize()
 {
        fio = new FILEIO();
similarity index 98%
rename from source/src/vm/ex80/cmt.h
rename to source/src/vm/ex80bs/cmt.h
index 33f0254..fe172a4 100644 (file)
@@ -19,7 +19,7 @@
 // max 256kbytes
 #define BUFFER_SIZE    0x40000
 
-namespace EX80 {
+namespace EX80BS {
 class CMT : public DEVICE
 {
 private:
similarity index 77%
rename from source/src/vm/ex80/display.cpp
rename to source/src/vm/ex80bs/display.cpp
index 70b54e9..87b927c 100644 (file)
@@ -10,7 +10,7 @@
 #include "display.h"
 #include "../f9368.h"
 
-namespace EX80 {
+namespace EX80BS {
 #define EVENT_HBLANK 0
 
 /*
@@ -212,18 +212,27 @@ static const int led_pattern[LED_HEIGHT][LED_WIDTH] = {
 void DISPLAY::initialize()
 {
        // load rom image
+       memcpy(font,  font_pattern, sizeof(font ));
+       memcpy(font1, font_pattern, sizeof(font1));
+       memcpy(font2, font_pattern, sizeof(font2));
+       
        FILEIO* fio = new FILEIO();
        if(fio->Fopen(create_local_path(_T("FONT.ROM")), FILEIO_READ_BINARY)) {
                fio->Fread(font, sizeof(font), 1);
                fio->Fclose();
-       } else {
-               memcpy(font, font_pattern, sizeof(font));
+       }
+       if(fio->Fopen(create_local_path(_T("FONT1.ROM")), FILEIO_READ_BINARY)) {
+               fio->Fread(font1, sizeof(font1), 1);
+               fio->Fclose();
+       }
+       if(fio->Fopen(create_local_path(_T("FONT2.ROM")), FILEIO_READ_BINARY)) {
+               fio->Fread(font2, sizeof(font2), 1);
+               fio->Fclose();
        }
        delete fio;
        
-       memset(screen, 0, sizeof(screen));
        odd_even = 0;
-       dma = true;
+       pc = 0x80;
        
        register_frame_event(this);
        register_vline_event(this);
@@ -231,8 +240,8 @@ void DISPLAY::initialize()
 
 void DISPLAY::write_signal(int id, uint32_t data, uint32_t mask)
 {
-       if(id == SIG_DISPLAY_DMA) {
-               dma = ((data & mask) != 0);
+       if(id == SIG_DISPLAY_PC) {
+               pc = data & mask;
        }
 }
 
@@ -244,39 +253,10 @@ void DISPLAY::event_frame()
 void DISPLAY::event_vline(int v, int clock)
 {
        if((v & 1) == odd_even && v < 8 * 29 * 2) {
-               uint8_t* dest = screen[v];
-               if(dma) {
-/*
-                       SW2     ON = CHAR / OFF = BIT
-                       SW3-1/2 ON ,ON  = 8000H-81FFH
-                               OFF,ON  = 8200H-83FFH
-                               ON ,OFF = 8400H-85FFH
-                               OFF,OFF = 8600H-87FFH
-*/
-                       int line = v >> 4;
-                       int raster = (v >> 1) & 7;
-                       uint8_t* base = ram + (~(config.dipswitch >> 2) & 3) * 0x200 + (line + 1) * 16;
-                       
-                       for(int x = 0; x < 12; x++) {
-                               uint8_t pat = base[x];
-                               if(config.dipswitch & 2) {
-                                       pat = (font[(pat & 0x7f) * 8 + raster] & 0x1f) << 2;
-                               }
-                               dest[0] = (pat & 0x01) >> 0;
-                               dest[1] = (pat & 0x02) >> 1;
-                               dest[2] = (pat & 0x04) >> 2;
-                               dest[3] = (pat & 0x08) >> 3;
-                               dest[4] = (pat & 0x10) >> 4;
-                               dest[5] = (pat & 0x20) >> 5;
-                               dest[6] = (pat & 0x40) >> 6;
-                               dest[7] = (pat & 0x80) >> 7;
-                               dest += 8;
-                       }
+               if(pc & 0x80) {
                        d_cpu->write_signal(SIG_CPU_BUSREQ, 1, 1);
                        // wait 8clk/byte
                        register_event_by_clock(this, EVENT_HBLANK, 8 * 12, false, NULL);
-               } else {
-                       memset(dest, 0, 8 * 12);
                }
        }
 }
@@ -291,14 +271,20 @@ void DISPLAY::event_callback(int event_id, int err)
 void DISPLAY::draw_screen()
 {
        // draw screen
-       scrntype_t color_crt[2] = {RGB_COLOR(255, 255, 255), 0};
-       for(int y = 0; y < 8 * 29 * 2; y++) {
+       scrntype_t color_tv[2] = {0, RGB_COLOR(255, 255, 255)};
+
+       if(pc & 0x80) {
+               draw_tv();
+       } else {
+               draw_bs();
+       }
+       for(int y = 0; y < TV_HEIGHT; y++) {
                scrntype_t* dest = emu->get_screen_buffer(y + vm_ranges[8].y) + vm_ranges[8].x;
                uint8_t* src = screen[y];
-               for(int x = 0; x < 8 * 12; x++) {
-                       dest[0] = dest[1] = dest[2] = dest[3] = dest[4] = dest[5] = color_crt[src[x] & 1];
-                       dest += 6;
-               }
+               
+               for(int x = 0; x < TV_WIDTH; x++) {
+                       dest[x] = color_tv[src[x]];
+               }
        }
        
        // draw 7-seg LEDs
@@ -312,7 +298,7 @@ void DISPLAY::draw_screen()
                uint8_t val = (base[i >> 1] >> ((i & 1) ? 0 : 4)) & 0x0f;
                
                for(int b = 0; b < 8; b++) {
-                       color_led[b + 1] = (dma && f9368[val][b]) ? color_on : color_off;
+                       color_led[b + 1] = ((pc & 0x80) && f9368[val][b]) ? color_on : color_off;
                }
                for(int y = 0; y < LED_HEIGHT; y++) {
                        scrntype_t* dest = emu->get_screen_buffer(vm_ranges[i].y + y) + vm_ranges[i].x;
@@ -323,7 +309,85 @@ void DISPLAY::draw_screen()
        }
 }
 
-#define STATE_VERSION  1
+void DISPLAY::draw_tv()
+{
+/*
+       SW2     ON = CHAR / OFF = BIT
+       SW3-1/2 ON ,ON  = 8000H-81FFH
+               OFF,ON  = 8200H-83FFH
+               ON ,OFF = 8400H-85FFH
+               OFF,OFF = 8600H-87FFH
+*/
+       const uint8_t color_wb[2] = {1, 0};
+       uint8_t *base = ram + (~(config.dipswitch >> 2) & 3) * 0x200 + 0x31;
+       
+       memset(screen, 1, sizeof(screen));
+       
+       if(pc & 0x80) {
+               for(int y = 0; y < 26; y++) {
+                       for(int l = 0; l < 8; l++) {
+                               uint8_t *dest = &screen[(y * 8 + l) * 2 + 4][20];
+                               
+                               for(int x = 0; x < 10; x++) {
+                                       uint8_t pat = base[x];
+                                       if(config.dipswitch & 2) {
+                                               pat = (font[(pat & 0x7f) * 8 + l] & 0x1f) << 2;
+                                       }
+                                       dest[ 0] = dest[ 1] = dest[ 2] = dest[ 3] = dest[ 4] = dest[ 5] = color_wb[(pat >> 0) & 1];
+                                       dest[ 6] = dest[ 7] = dest[ 8] = dest[ 9] = dest[10] = dest[11] = color_wb[(pat >> 1) & 1];
+                                       dest[12] = dest[13] = dest[14] = dest[15] = dest[16] = dest[17] = color_wb[(pat >> 2) & 1];
+                                       dest[18] = dest[19] = dest[20] = dest[21] = dest[22] = dest[23] = color_wb[(pat >> 3) & 1];
+                                       dest[24] = dest[25] = dest[26] = dest[27] = dest[28] = dest[29] = color_wb[(pat >> 4) & 1];
+                                       dest[30] = dest[31] = dest[32] = dest[33] = dest[34] = dest[35] = color_wb[(pat >> 5) & 1];
+                                       dest[36] = dest[37] = dest[38] = dest[39] = dest[40] = dest[41] = color_wb[(pat >> 6) & 1];
+                                       dest[42] = dest[43] = dest[44] = dest[45] = dest[46] = dest[47] = color_wb[(pat >> 7) & 1];
+                                       dest += 48;
+                               }
+                       }
+                       base += 16;
+               }
+               for(int y = 0; y < TV_HEIGHT; y += 2) {
+                       memcpy(screen[y + 1], screen[y], TV_WIDTH);
+               }
+       }
+}
+
+void DISPLAY::draw_bs()
+{
+       const uint8_t color_bw[2] = {0, 1};
+       const uint8_t color_wb[2] = {1, 0};
+       const uint8_t *color = (pc & 2) ? color_wb : color_bw;
+       uint8_t *base = vram + 0x80;
+       
+       memset(screen, color[0], sizeof(screen));
+       
+       if(pc & 4) {
+               for(int y = 0; y < 25; y++) {
+                       for(int x = 0; x < 32; x++) {
+                               uint8_t code = *base++;
+                               
+                               for(int l = 0; l < 8; l++) {
+                                       uint8_t *dest = &screen[(y * 8 + l) * 2 + 12][x * 16 + 4];
+                                       uint8_t pat = ((pc & 1) ? font1 : font2)[code * 8 + l];
+                                       
+                                       dest[ 0] = dest[ 1] = color[(pat >> 0) & 1];
+                                       dest[ 2] = dest[ 3] = color[(pat >> 1) & 1];
+                                       dest[ 4] = dest[ 5] = color[(pat >> 2) & 1];
+                                       dest[ 6] = dest[ 7] = color[(pat >> 3) & 1];
+                                       dest[ 8] = dest[ 9] = color[(pat >> 4) & 1];
+                                       dest[10] = dest[11] = color[(pat >> 5) & 1];
+                                       dest[12] = dest[13] = color[(pat >> 6) & 1];
+                                       dest[14] = dest[15] = color[(pat >> 7) & 1];
+                               }
+                       }
+               }
+               for(int y = 0; y < TV_HEIGHT; y += 2) {
+                       memcpy(screen[y + 1], screen[y], TV_WIDTH);
+               }
+       }
+}
+
+#define STATE_VERSION  2
 
 bool DISPLAY::process_state(FILEIO* state_fio, bool loading)
 {
@@ -334,7 +398,7 @@ bool DISPLAY::process_state(FILEIO* state_fio, bool loading)
                return false;
        }
        state_fio->StateValue(odd_even);
-       state_fio->StateValue(dma);
+       state_fio->StateValue(pc);
        return true;
 }
 }
similarity index 55%
rename from source/src/vm/ex80/display.h
rename to source/src/vm/ex80bs/display.h
index 721626c..dec4d27 100644 (file)
 #include "../../emu.h"
 #include "../device.h"
 
-#define SIG_DISPLAY_DMA                0
+#define SIG_DISPLAY_PC         0
 
-namespace EX80 {
+namespace EX80BS {
 class DISPLAY : public DEVICE
 {
 private:
        DEVICE *d_cpu;
-       
-       uint8_t font[0x400];
-       uint8_t screen[8 * 29 * 2][8 * 12];
+       uint8_t font[0x400];    // EX-80
+       uint8_t font1[0x800];   // EX-80BS
+       uint8_t font2[0x800];   // EX-80BS (user defined)
+       uint8_t screen[TV_HEIGHT][TV_WIDTH];
        
        uint8_t *ram;
+       uint8_t *vram;
        int odd_even;
-       bool dma;
+       uint8_t pc;
        
+       void draw_tv();
+       void draw_bs();
+
 public:
        DISPLAY(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu) : DEVICE(parent_vm, parent_emu)
        {
@@ -37,12 +42,12 @@ public:
        ~DISPLAY() {}
        
        // common functions
-       void initialize();
-       void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
-       void event_frame();
-       void event_vline(int v, int clock);
-       void __FASTCALL event_callback(int event_id, int err);
-       bool process_state(FILEIO* state_fio, bool loading);
+       void initialize() override;
+       void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask) override;
+       void event_frame() override;
+       void event_vline(int v, int clock) override;
+       void __FASTCALL event_callback(int event_id, int err) override;
+       bool process_state(FILEIO* state_fio, bool loading) override;
        
        // unique functions
        void set_context_cpu(DEVICE* device)
@@ -53,6 +58,10 @@ public:
        {
                ram = ptr;
        }
+       void set_vram_ptr(uint8_t* ptr)
+       {
+               vram = ptr;
+       }
        void draw_screen();
 };
 }
diff --git a/source/src/vm/ex80bs/memory.cpp b/source/src/vm/ex80bs/memory.cpp
new file mode 100644 (file)
index 0000000..dda853d
--- /dev/null
@@ -0,0 +1,1321 @@
+/*
+       TOSHIBA EX-80 Emulator 'eEX-80'
+
+       Author : Takeda.Toshiya
+       Date   : 2015.12.14-
+
+       [ memory ]
+*/
+
+#include "./memory.h"
+#include "../i8080.h"
+#include "../i8255.h"
+
+namespace EX80BS {
+#define SET_BANK(s, e, w, r) { \
+       int sb = (s) >> 10, eb = (e) >> 10; \
+       for(int i = sb; i <= eb; i++) { \
+               if((w) == wdmy) { \
+                       wbank[i] = wdmy; \
+               } else { \
+                       wbank[i] = (w) + 0x400 * (i - sb); \
+               } \
+               if((r) == rdmy) { \
+                       rbank[i] = rdmy; \
+               } else { \
+                       rbank[i] = (r) + 0x400 * (i - sb); \
+               } \
+       } \
+}
+
+static const int table[256] = {
+         -1,   // 00 
+         -1,   // 01 
+         -1,   // 02 
+         -1,   // 03 
+         -1,   // 04 
+         -1,   // 05 
+         -1,   // 06 
+         -1,   // 07 
+       0x08,   // 08 Back      BS
+         -1,   // 09 Tab
+         -1,   // 0A 
+         -1,   // 0B 
+         -1,   // 0C 
+       0x0d,   // 0D Enter     CR
+         -1,   // 0E 
+         -1,   // 0F 
+         -1,   // 10 Shift
+         -1,   // 11 Ctrl
+         -1,   // 12 Alt
+         -1,   // 13 Pause
+         -1,   // 14 Caps
+         -1,   // 15 Kana
+         -1,   // 16 
+         -1,   // 17 
+         -1,   // 18 
+         -1,   // 19 Kanji
+         -1,   // 1A 
+       0x03,   // 1B Escape    ETX
+         -1,   // 1C Convert
+         -1,   // 1D NonConv
+         -1,   // 1E 
+         -1,   // 1F 
+       0x20,   // 20 Space     SPACE
+       0x18,   // 21 PgUp      CAN
+       0x0a,   // 22 PgDwn     LF
+         -1,   // 23 End
+         -1,   // 24 Home
+         -1,   // 25 Left
+         -1,   // 26 Up
+         -1,   // 27 Right
+         -1,   // 28 Down
+         -1,   // 29 
+         -1,   // 2A 
+         -1,   // 2B 
+         -1,   // 2C 
+         -1,   // 2D Ins
+       0x7f,   // 2E Del       DEL
+         -1,   // 2F 
+       0x30,   // 30 0         0
+       0x31,   // 31 1         1
+       0x32,   // 32 2         2
+       0x33,   // 33 3         3
+       0x34,   // 34 4         4
+       0x35,   // 35 5         5
+       0x36,   // 36 6         6
+       0x37,   // 37 7         7
+       0x38,   // 38 8         8
+       0x39,   // 39 9         9
+         -1,   // 3A 
+         -1,   // 3B 
+         -1,   // 3C 
+         -1,   // 3D 
+         -1,   // 3E 
+         -1,   // 3F 
+         -1,   // 40 
+       0x41,   // 41 A         A
+       0x42,   // 42 B         B
+       0x43,   // 43 C         C
+       0x44,   // 44 D         D
+       0x45,   // 45 E         E
+       0x46,   // 46 F         F
+       0x47,   // 47 G         G
+       0x48,   // 48 H         H
+       0x49,   // 49 I         I
+       0x4a,   // 4A J         J
+       0x4b,   // 4B K         K
+       0x4c,   // 4C L         L
+       0x4d,   // 4D M         M
+       0x4e,   // 4E N         N
+       0x4f,   // 4F O         O
+       0x50,   // 50 P         P
+       0x51,   // 51 Q         Q
+       0x52,   // 52 R         R
+       0x53,   // 53 S         S
+       0x54,   // 54 T         T
+       0x55,   // 55 U         U
+       0x56,   // 56 V         V
+       0x57,   // 57 W         W
+       0x58,   // 58 X         X
+       0x59,   // 59 Y         Y
+       0x5a,   // 5A Z         Z
+         -1,   // 5B 
+         -1,   // 5C 
+         -1,   // 5D 
+         -1,   // 5E 
+         -1,   // 5F 
+       0x30,   // 60 NUM 0     0
+       0x31,   // 61 NUM 1     1
+       0x32,   // 62 NUM 2     2
+       0x33,   // 63 NUM 3     3
+       0x34,   // 64 NUM 4     4
+       0x35,   // 65 NUM 5     5
+       0x36,   // 66 NUM 6     6
+       0x37,   // 67 NUM 7     7
+       0x38,   // 68 NUM 8     8
+       0x39,   // 69 NUM 9     9
+       0x2a,   // 6A NUM *     *
+       0x2b,   // 6B NUM +     +
+       0x0d,   // 6C NUM Ent   CR
+       0x2d,   // 6D NUM -     -
+       0x2e,   // 6E NUM .     .
+       0x2f,   // 6F NUM /     /
+         -1,   // 70 F1
+         -1,   // 71 F2
+         -1,   // 72 F3
+         -1,   // 73 F4
+         -1,   // 74 F5
+         -1,   // 75 F6
+         -1,   // 76 F7
+         -1,   // 77 F8
+         -1,   // 78 F9
+         -1,   // 79 F10
+         -1,   // 7A F11
+         -1,   // 7B F12
+         -1,   // 7C F13
+         -1,   // 7D F14
+         -1,   // 7E F15
+         -1,   // 7F F16
+         -1,   // 80 F17
+         -1,   // 81 F18
+         -1,   // 82 F19
+         -1,   // 83 F20
+         -1,   // 84 F21
+         -1,   // 85 F22
+         -1,   // 86 F23
+         -1,   // 87 F24
+         -1,   // 88 
+         -1,   // 89 
+         -1,   // 8A 
+         -1,   // 8B 
+         -1,   // 8C 
+         -1,   // 8D 
+         -1,   // 8E 
+         -1,   // 8F 
+         -1,   // 90 
+         -1,   // 91 ScrLk
+         -1,   // 92 
+         -1,   // 93 
+         -1,   // 94 
+         -1,   // 95 
+         -1,   // 96 
+         -1,   // 97 
+         -1,   // 98 
+         -1,   // 99 
+         -1,   // 9A 
+         -1,   // 9B 
+         -1,   // 9C 
+         -1,   // 9D 
+         -1,   // 9E 
+         -1,   // 9F 
+         -1,   // A0 L Shift
+         -1,   // A1 R Shift
+         -1,   // A2 L Ctrl
+         -1,   // A3 R Ctrl
+         -1,   // A4 L Alt
+         -1,   // A5 R Alt
+         -1,   // A6 
+         -1,   // A7 
+         -1,   // A8 
+         -1,   // A9 
+         -1,   // AA 
+         -1,   // AB 
+         -1,   // AC 
+         -1,   // AD 
+         -1,   // AE 
+         -1,   // AF 
+         -1,   // B0 
+         -1,   // B1 
+         -1,   // B2 
+         -1,   // B3 
+         -1,   // B4 
+         -1,   // B5 
+         -1,   // B6 
+         -1,   // B7 
+         -1,   // B8 
+         -1,   // B9 
+       0x3a,   // BA :         :
+       0x3b,   // BB ;         ;
+       0x2c,   // BC ,         ,
+       0x2d,   // BD -         -
+       0x2e,   // BE .         .
+       0x2f,   // BF /         /
+       0x40,   // C0 @         @
+         -1,   // C1 
+         -1,   // C2 
+         -1,   // C3 
+         -1,   // C4 
+         -1,   // C5 
+         -1,   // C6 
+         -1,   // C7 
+         -1,   // C8 
+         -1,   // C9 
+         -1,   // CA 
+         -1,   // CB 
+         -1,   // CC 
+         -1,   // CD 
+         -1,   // CE 
+         -1,   // CF 
+         -1,   // D0 
+         -1,   // D1 
+         -1,   // D2 
+         -1,   // D3 
+         -1,   // D4 
+         -1,   // D5 
+         -1,   // D6 
+         -1,   // D7 
+         -1,   // D8 
+         -1,   // D9 
+         -1,   // DA 
+       0x5b,   // DB [         [
+       0x5c,   // DC Yen       Yen
+       0x5d,   // DD ]         ]
+       0x5e,   // DE ^         ^
+         -1,   // DF 
+         -1,   // E0 
+         -1,   // E1 
+         -1,   // E2 _
+         -1,   // E3 
+         -1,   // E4 
+         -1,   // E5 
+         -1,   // E6 
+         -1,   // E7 
+         -1,   // E8 
+         -1,   // E9 
+         -1,   // EA 
+         -1,   // EB 
+         -1,   // EC 
+         -1,   // ED 
+         -1,   // EE 
+         -1,   // EF 
+         -1,   // F0 
+         -1,   // F1 
+         -1,   // F2 
+         -1,   // F3 
+         -1,   // F4 
+         -1,   // F5 
+         -1,   // F6 
+         -1,   // F7 
+         -1,   // F8 
+         -1,   // F9 
+         -1,   // FA 
+         -1,   // FB 
+         -1,   // FC 
+         -1,   // FD 
+         -1,   // FE 
+         -1,   // FF 
+};
+
+static const int table_shift[256] = {
+         -1,   // 00 
+         -1,   // 01 
+         -1,   // 02 
+         -1,   // 03 
+         -1,   // 04 
+         -1,   // 05 
+         -1,   // 06 
+         -1,   // 07 
+       0x08,   // 08 Back      BS
+         -1,   // 09 Tab
+         -1,   // 0A 
+         -1,   // 0B 
+         -1,   // 0C 
+       0x0d,   // 0D Enter     CR
+         -1,   // 0E 
+         -1,   // 0F 
+         -1,   // 10 Shift
+         -1,   // 11 Ctrl
+         -1,   // 12 Alt
+         -1,   // 13 Pause
+         -1,   // 14 Caps
+         -1,   // 15 Kana
+         -1,   // 16 
+         -1,   // 17 
+         -1,   // 18 
+         -1,   // 19 Kanji
+         -1,   // 1A 
+       0x03,   // 1B Escape    ETX
+         -1,   // 1C Convert
+         -1,   // 1D NonConv
+         -1,   // 1E 
+         -1,   // 1F 
+       0x20,   // 20 Space     SPACE
+       0x18,   // 21 PgUp      CAN
+       0x0a,   // 22 PgDwn     LF
+         -1,   // 23 End
+         -1,   // 24 Home
+         -1,   // 25 Left
+         -1,   // 26 Up
+         -1,   // 27 Right
+         -1,   // 28 Down
+         -1,   // 29 
+         -1,   // 2A 
+         -1,   // 2B 
+         -1,   // 2C 
+         -1,   // 2D Ins
+       0x7f,   // 2E Del       DEL
+         -1,   // 2F 
+         -1,   // 30 0
+       0x21,   // 31 1         !
+       0x22,   // 32 2         "
+       0x23,   // 33 3         #
+       0x24,   // 34 4         $
+       0x25,   // 35 5         %
+       0x26,   // 36 6         &
+       0x27,   // 37 7         '
+       0x28,   // 38 8         (
+       0x29,   // 39 9         )
+         -1,   // 3A 
+         -1,   // 3B 
+         -1,   // 3C 
+         -1,   // 3D 
+         -1,   // 3E 
+         -1,   // 3F 
+         -1,   // 40 
+         -1,   // 41 A
+         -1,   // 42 B
+         -1,   // 43 C
+         -1,   // 44 D
+         -1,   // 45 E
+         -1,   // 46 F
+         -1,   // 47 G
+         -1,   // 48 H
+         -1,   // 49 I
+         -1,   // 4A J
+         -1,   // 4B K
+         -1,   // 4C L
+         -1,   // 4D M
+         -1,   // 4E N
+         -1,   // 4F O
+         -1,   // 50 P
+         -1,   // 51 Q
+         -1,   // 52 R
+         -1,   // 53 S
+         -1,   // 54 T
+         -1,   // 55 U
+         -1,   // 56 V
+         -1,   // 57 W
+         -1,   // 58 X
+         -1,   // 59 Y
+         -1,   // 5A Z
+         -1,   // 5B 
+         -1,   // 5C 
+         -1,   // 5D 
+         -1,   // 5E 
+         -1,   // 5F 
+       0x30,   // 60 NUM 0     0
+       0x31,   // 61 NUM 1     1
+       0x32,   // 62 NUM 2     2
+       0x33,   // 63 NUM 3     3
+       0x34,   // 64 NUM 4     4
+       0x35,   // 65 NUM 5     5
+       0x36,   // 66 NUM 6     6
+       0x37,   // 67 NUM 7     7
+       0x38,   // 68 NUM 8     8
+       0x39,   // 69 NUM 9     9
+       0x2a,   // 6A NUM *     *
+       0x2b,   // 6B NUM +     +
+       0x0d,   // 6C NUM Ent   CR
+       0x2d,   // 6D NUM -     -
+       0x2e,   // 6E NUM .     .
+       0x2f,   // 6F NUM /     /
+         -1,   // 70 F1
+         -1,   // 71 F2
+         -1,   // 72 F3
+         -1,   // 73 F4
+         -1,   // 74 F5
+         -1,   // 75 F6
+         -1,   // 76 F7
+         -1,   // 77 F8
+         -1,   // 78 F9
+         -1,   // 79 F10
+         -1,   // 7A F11
+         -1,   // 7B F12
+         -1,   // 7C F13
+         -1,   // 7D F14
+         -1,   // 7E F15
+         -1,   // 7F F16
+         -1,   // 80 F17
+         -1,   // 81 F18
+         -1,   // 82 F19
+         -1,   // 83 F20
+         -1,   // 84 F21
+         -1,   // 85 F22
+         -1,   // 86 F23
+         -1,   // 87 F24
+         -1,   // 88 
+         -1,   // 89 
+         -1,   // 8A 
+         -1,   // 8B 
+         -1,   // 8C 
+         -1,   // 8D 
+         -1,   // 8E 
+         -1,   // 8F 
+         -1,   // 90 
+         -1,   // 91 ScrLk
+         -1,   // 92 
+         -1,   // 93 
+         -1,   // 94 
+         -1,   // 95 
+         -1,   // 96 
+         -1,   // 97 
+         -1,   // 98 
+         -1,   // 99 
+         -1,   // 9A 
+         -1,   // 9B 
+         -1,   // 9C 
+         -1,   // 9D 
+         -1,   // 9E 
+         -1,   // 9F 
+         -1,   // A0 L Shift
+         -1,   // A1 R Shift
+         -1,   // A2 L Ctrl
+         -1,   // A3 R Ctrl
+         -1,   // A4 L Alt
+         -1,   // A5 R Alt
+         -1,   // A6 
+         -1,   // A7 
+         -1,   // A8 
+         -1,   // A9 
+         -1,   // AA 
+         -1,   // AB 
+         -1,   // AC 
+         -1,   // AD 
+         -1,   // AE 
+         -1,   // AF 
+         -1,   // B0 
+         -1,   // B1 
+         -1,   // B2 
+         -1,   // B3 
+         -1,   // B4 
+         -1,   // B5 
+         -1,   // B6 
+         -1,   // B7 
+         -1,   // B8 
+         -1,   // B9 
+       0x2a,   // BA :         *
+       0x2b,   // BB ;         +
+       0x3c,   // BC ,         <
+       0x3d,   // BD -         =
+       0x3e,   // BE .         >
+       0x3f,   // BF /         ?
+       0x60,   // C0 @         `
+         -1,   // C1 
+         -1,   // C2 
+         -1,   // C3 
+         -1,   // C4 
+         -1,   // C5 
+         -1,   // C6 
+         -1,   // C7 
+         -1,   // C8 
+         -1,   // C9 
+         -1,   // CA 
+         -1,   // CB 
+         -1,   // CC 
+         -1,   // CD 
+         -1,   // CE 
+         -1,   // CF 
+         -1,   // D0 
+         -1,   // D1 
+         -1,   // D2 
+         -1,   // D3 
+         -1,   // D4 
+         -1,   // D5 
+         -1,   // D6 
+         -1,   // D7 
+         -1,   // D8 
+         -1,   // D9 
+         -1,   // DA 
+       0x7b,   // DB [         {
+       0x7c,   // DC Yen       |
+       0x7d,   // DD ]         }
+       0x7e,   // DE ^         ~
+         -1,   // DF 
+         -1,   // E0 
+         -1,   // E1 
+         -1,   // E2 _
+         -1,   // E3 
+         -1,   // E4 
+         -1,   // E5 
+         -1,   // E6 
+         -1,   // E7 
+         -1,   // E8 
+         -1,   // E9 
+         -1,   // EA 
+         -1,   // EB 
+         -1,   // EC 
+         -1,   // ED 
+         -1,   // EE 
+         -1,   // EF 
+         -1,   // F0 
+         -1,   // F1 
+         -1,   // F2 
+         -1,   // F3 
+         -1,   // F4 
+         -1,   // F5 
+         -1,   // F6 
+         -1,   // F7 
+         -1,   // F8 
+         -1,   // F9 
+         -1,   // FA 
+         -1,   // FB 
+         -1,   // FC 
+         -1,   // FD 
+         -1,   // FE 
+         -1,   // FF 
+};
+
+static const int table_symbol[256] = {
+         -1,   // 00 
+         -1,   // 01 
+         -1,   // 02 
+         -1,   // 03 
+         -1,   // 04 
+         -1,   // 05 
+         -1,   // 06 
+         -1,   // 07 
+       0x08,   // 08 Back      BS
+         -1,   // 09 Tab
+         -1,   // 0A 
+         -1,   // 0B 
+         -1,   // 0C 
+       0x0d,   // 0D Enter     CR
+         -1,   // 0E 
+         -1,   // 0F 
+         -1,   // 10 Shift
+         -1,   // 11 Ctrl
+         -1,   // 12 Alt
+         -1,   // 13 Pause
+         -1,   // 14 Caps
+         -1,   // 15 Kana
+         -1,   // 16 
+         -1,   // 17 
+         -1,   // 18 
+         -1,   // 19 Kanji
+         -1,   // 1A 
+       0x03,   // 1B Escape    ETX
+         -1,   // 1C Convert
+         -1,   // 1D NonConv
+         -1,   // 1E 
+         -1,   // 1F 
+       0x20,   // 20 Space     SPACE
+       0x18,   // 21 PgUp      CAN
+       0x0a,   // 22 PgDwn     LF
+         -1,   // 23 End
+         -1,   // 24 Home
+         -1,   // 25 Left
+         -1,   // 26 Up
+         -1,   // 27 Right
+         -1,   // 28 Down
+         -1,   // 29 
+         -1,   // 2A 
+         -1,   // 2B 
+         -1,   // 2C 
+         -1,   // 2D Ins
+       0x7f,   // 2E Del       DEL
+         -1,   // 2F 
+       0xa6,   // 30 0         WO
+         -1,   // 31 1
+         -1,   // 32 2
+       0xa7,   // 33 3         XA
+       0xa9,   // 34 4         XU
+       0xaa,   // 35 5         XE
+       0xab,   // 36 6         XO
+       0xac,   // 37 7         XYA
+       0xad,   // 38 8         XYU
+       0xae,   // 39 9         XYO
+         -1,   // 3A 
+         -1,   // 3B 
+         -1,   // 3C 
+         -1,   // 3D 
+         -1,   // 3E 
+         -1,   // 3F 
+         -1,   // 40 
+         -1,   // 41 A
+         -1,   // 42 B
+         -1,   // 43 C
+         -1,   // 44 D
+       0xa8,   // 45 E         XI
+         -1,   // 46 F
+         -1,   // 47 G
+         -1,   // 48 H
+         -1,   // 49 I
+         -1,   // 4A J
+         -1,   // 4B K
+         -1,   // 4C L
+         -1,   // 4D M
+         -1,   // 4E N
+         -1,   // 4F O
+         -1,   // 50 P
+         -1,   // 51 Q
+         -1,   // 52 R
+         -1,   // 53 S
+         -1,   // 54 T
+         -1,   // 55 U
+         -1,   // 56 V
+         -1,   // 57 W
+         -1,   // 58 X
+         -1,   // 59 Y
+       0xaf,   // 5A Z         XTSU
+         -1,   // 5B 
+         -1,   // 5C 
+         -1,   // 5D 
+         -1,   // 5E 
+         -1,   // 5F 
+       0x30,   // 60 NUM 0     0
+       0x31,   // 61 NUM 1     1
+       0x32,   // 62 NUM 2     2
+       0x33,   // 63 NUM 3     3
+       0x34,   // 64 NUM 4     4
+       0x35,   // 65 NUM 5     5
+       0x36,   // 66 NUM 6     6
+       0x37,   // 67 NUM 7     7
+       0x38,   // 68 NUM 8     8
+       0x39,   // 69 NUM 9     9
+       0x2a,   // 6A NUM *     *
+       0x2b,   // 6B NUM +     +
+       0x0d,   // 6C NUM Ent   CR
+       0x2d,   // 6D NUM -     -
+       0x2e,   // 6E NUM .     .
+       0x2f,   // 6F NUM /     /
+         -1,   // 70 F1
+         -1,   // 71 F2
+         -1,   // 72 F3
+         -1,   // 73 F4
+         -1,   // 74 F5
+         -1,   // 75 F6
+         -1,   // 76 F7
+         -1,   // 77 F8
+         -1,   // 78 F9
+         -1,   // 79 F10
+         -1,   // 7A F11
+         -1,   // 7B F12
+         -1,   // 7C F13
+         -1,   // 7D F14
+         -1,   // 7E F15
+         -1,   // 7F F16
+         -1,   // 80 F17
+         -1,   // 81 F18
+         -1,   // 82 F19
+         -1,   // 83 F20
+         -1,   // 84 F21
+         -1,   // 85 F22
+         -1,   // 86 F23
+         -1,   // 87 F24
+         -1,   // 88 
+         -1,   // 89 
+         -1,   // 8A 
+         -1,   // 8B 
+         -1,   // 8C 
+         -1,   // 8D 
+         -1,   // 8E 
+         -1,   // 8F 
+         -1,   // 90 
+         -1,   // 91 ScrLk
+         -1,   // 92 
+         -1,   // 93 
+         -1,   // 94 
+         -1,   // 95 
+         -1,   // 96 
+         -1,   // 97 
+         -1,   // 98 
+         -1,   // 99 
+         -1,   // 9A 
+         -1,   // 9B 
+         -1,   // 9C 
+         -1,   // 9D 
+         -1,   // 9E 
+         -1,   // 9F 
+         -1,   // A0 L Shift
+         -1,   // A1 R Shift
+         -1,   // A2 L Ctrl
+         -1,   // A3 R Ctrl
+         -1,   // A4 L Alt
+         -1,   // A5 R Alt
+         -1,   // A6 
+         -1,   // A7 
+         -1,   // A8 
+         -1,   // A9 
+         -1,   // AA 
+         -1,   // AB 
+         -1,   // AC 
+         -1,   // AD 
+         -1,   // AE 
+         -1,   // AF 
+         -1,   // B0 
+         -1,   // B1 
+         -1,   // B2 
+         -1,   // B3 
+         -1,   // B4 
+         -1,   // B5 
+         -1,   // B6 
+         -1,   // B7 
+         -1,   // B8 
+         -1,   // B9 
+         -1,   // BA :
+         -1,   // BB ;
+       0xa4,   // BC ,         TOUTEN
+         -1,   // BD -
+       0xa1,   // BE .         KUTEN
+       0xa5,   // BF /         CHUUTEN
+         -1,   // C0 @
+         -1,   // C1 
+         -1,   // C2 
+         -1,   // C3 
+         -1,   // C4 
+         -1,   // C5 
+         -1,   // C6 
+         -1,   // C7 
+         -1,   // C8 
+         -1,   // C9 
+         -1,   // CA 
+         -1,   // CB 
+         -1,   // CC 
+         -1,   // CD 
+         -1,   // CE 
+         -1,   // CF 
+         -1,   // D0 
+         -1,   // D1 
+         -1,   // D2 
+         -1,   // D3 
+         -1,   // D4 
+         -1,   // D5 
+         -1,   // D6 
+         -1,   // D7 
+         -1,   // D8 
+         -1,   // D9 
+         -1,   // DA 
+       0xa2,   // DB [         KAGIKAKKO
+         -1,   // DC Yen
+       0xa3,   // DD ]         KAGIKAKKO TOJI
+         -1,   // DE ^
+         -1,   // DF 
+         -1,   // E0 
+         -1,   // E1 
+         -1,   // E2 _
+         -1,   // E3 
+         -1,   // E4 
+         -1,   // E5 
+         -1,   // E6 
+         -1,   // E7 
+         -1,   // E8 
+         -1,   // E9 
+         -1,   // EA 
+         -1,   // EB 
+         -1,   // EC 
+         -1,   // ED 
+         -1,   // EE 
+         -1,   // EF 
+         -1,   // F0 
+         -1,   // F1 
+         -1,   // F2 
+         -1,   // F3 
+         -1,   // F4 
+         -1,   // F5 
+         -1,   // F6 
+         -1,   // F7 
+         -1,   // F8 
+         -1,   // F9 
+         -1,   // FA 
+         -1,   // FB 
+         -1,   // FC 
+         -1,   // FD 
+         -1,   // FE 
+         -1,   // FF 
+};
+
+static const int table_kana[256] = {
+         -1,   // 00 
+         -1,   // 01 
+         -1,   // 02 
+         -1,   // 03 
+         -1,   // 04 
+         -1,   // 05 
+         -1,   // 06 
+         -1,   // 07 
+       0x08,   // 08 Back      BS
+         -1,   // 09 Tab
+         -1,   // 0A 
+         -1,   // 0B 
+         -1,   // 0C 
+       0x0d,   // 0D Enter     CR
+         -1,   // 0E 
+         -1,   // 0F 
+         -1,   // 10 Shift
+         -1,   // 11 Ctrl
+         -1,   // 12 Alt
+         -1,   // 13 Pause
+         -1,   // 14 Caps
+         -1,   // 15 Kana
+         -1,   // 16 
+         -1,   // 17 
+         -1,   // 18 
+         -1,   // 19 Kanji
+         -1,   // 1A 
+       0x03,   // 1B Escape    ETX
+         -1,   // 1C Convert
+         -1,   // 1D NonConv
+         -1,   // 1E 
+         -1,   // 1F 
+       0x20,   // 20 Space     SPACE
+       0x18,   // 21 PgUp      CAN
+       0x0a,   // 22 PgDwn     LF
+         -1,   // 23 End
+         -1,   // 24 Home
+         -1,   // 25 Left
+         -1,   // 26 Up
+         -1,   // 27 Right
+         -1,   // 28 Down
+         -1,   // 29 
+         -1,   // 2A 
+         -1,   // 2B 
+         -1,   // 2C 
+         -1,   // 2D Ins
+       0x7f,   // 2E Del       DEL
+         -1,   // 2F 
+       0xdc,   // 30 0         WA
+       0xc7,   // 31 1         NU
+       0xcc,   // 32 2         FU
+       0xb1,   // 33 3         A
+       0xb3,   // 34 4         U
+       0xb4,   // 35 5         E
+       0xb5,   // 36 6         O
+       0xd4,   // 37 7         YA
+       0xd5,   // 38 8         YU
+       0xd6,   // 39 9         YO
+         -1,   // 3A 
+         -1,   // 3B 
+         -1,   // 3C 
+         -1,   // 3D 
+         -1,   // 3E 
+         -1,   // 3F 
+         -1,   // 40 
+       0xc1,   // 41 A         CHI
+       0xba,   // 42 B         KO
+       0xbf,   // 43 C         SO
+       0xbc,   // 44 D         SHI
+       0xb2,   // 45 E         I
+       0xca,   // 46 F         HA
+       0xb7,   // 47 G         KI
+       0xb8,   // 48 H         KU
+       0xc6,   // 49 I         NI
+       0xcf,   // 4A J         MA
+       0xc9,   // 4B K         NO
+       0xd8,   // 4C L         RI
+       0xd3,   // 4D M         MO
+       0xd0,   // 4E N         MI
+       0xd7,   // 4F O         RA
+       0xbe,   // 50 P         SE
+       0xc0,   // 51 Q         TA
+       0xbd,   // 52 R         SU
+       0xc4,   // 53 S         TO
+       0xb6,   // 54 T         KA
+       0xc5,   // 55 U         NA
+       0xcb,   // 56 V         HI
+       0xc3,   // 57 W         TE
+       0xbb,   // 58 X         SA
+       0xdd,   // 59 Y         N
+       0xc2,   // 5A Z         TSU
+         -1,   // 5B 
+         -1,   // 5C 
+         -1,   // 5D 
+         -1,   // 5E 
+         -1,   // 5F 
+       0x30,   // 60 NUM 0     0
+       0x31,   // 61 NUM 1     1
+       0x32,   // 62 NUM 2     2
+       0x33,   // 63 NUM 3     3
+       0x34,   // 64 NUM 4     4
+       0x35,   // 65 NUM 5     5
+       0x36,   // 66 NUM 6     6
+       0x37,   // 67 NUM 7     7
+       0x38,   // 68 NUM 8     8
+       0x39,   // 69 NUM 9     9
+       0x2a,   // 6A NUM *     *
+       0x2b,   // 6B NUM +     +
+       0x0d,   // 6C NUM Ent   CR
+       0x2d,   // 6D NUM -     -
+       0x2e,   // 6E NUM .     .
+       0x2f,   // 6F NUM /     /
+         -1,   // 70 F1
+         -1,   // 71 F2
+         -1,   // 72 F3
+         -1,   // 73 F4
+         -1,   // 74 F5
+         -1,   // 75 F6
+         -1,   // 76 F7
+         -1,   // 77 F8
+         -1,   // 78 F9
+         -1,   // 79 F10
+         -1,   // 7A F11
+         -1,   // 7B F12
+         -1,   // 7C F13
+         -1,   // 7D F14
+         -1,   // 7E F15
+         -1,   // 7F F16
+         -1,   // 80 F17
+         -1,   // 81 F18
+         -1,   // 82 F19
+         -1,   // 83 F20
+         -1,   // 84 F21
+         -1,   // 85 F22
+         -1,   // 86 F23
+         -1,   // 87 F24
+         -1,   // 88 
+         -1,   // 89 
+         -1,   // 8A 
+         -1,   // 8B 
+         -1,   // 8C 
+         -1,   // 8D 
+         -1,   // 8E 
+         -1,   // 8F 
+         -1,   // 90 
+         -1,   // 91 ScrLk
+         -1,   // 92 
+         -1,   // 93 
+         -1,   // 94 
+         -1,   // 95 
+         -1,   // 96 
+         -1,   // 97 
+         -1,   // 98 
+         -1,   // 99 
+         -1,   // 9A 
+         -1,   // 9B 
+         -1,   // 9C 
+         -1,   // 9D 
+         -1,   // 9E 
+         -1,   // 9F 
+         -1,   // A0 L Shift
+         -1,   // A1 R Shift
+         -1,   // A2 L Ctrl
+         -1,   // A3 R Ctrl
+         -1,   // A4 L Alt
+         -1,   // A5 R Alt
+         -1,   // A6 
+         -1,   // A7 
+         -1,   // A8 
+         -1,   // A9 
+         -1,   // AA 
+         -1,   // AB 
+         -1,   // AC 
+         -1,   // AD 
+         -1,   // AE 
+         -1,   // AF 
+         -1,   // B0 
+         -1,   // B1 
+         -1,   // B2 
+         -1,   // B3 
+         -1,   // B4 
+         -1,   // B5 
+         -1,   // B6 
+         -1,   // B7 
+         -1,   // B8 
+         -1,   // B9 
+       0xb9,   // BA :         KE
+       0xda,   // BB ;         RE
+       0xc8,   // BC ,         NE
+       0xce,   // BD -         HO
+       0xd9,   // BE .         RU
+       0xd2,   // BF /         ME
+       0xde,   // C0 @         DAKUON
+         -1,   // C1 
+         -1,   // C2 
+         -1,   // C3 
+         -1,   // C4 
+         -1,   // C5 
+         -1,   // C6 
+         -1,   // C7 
+         -1,   // C8 
+         -1,   // C9 
+         -1,   // CA 
+         -1,   // CB 
+         -1,   // CC 
+         -1,   // CD 
+         -1,   // CE 
+         -1,   // CF 
+         -1,   // D0 
+         -1,   // D1 
+         -1,   // D2 
+         -1,   // D3 
+         -1,   // D4 
+         -1,   // D5 
+         -1,   // D6 
+         -1,   // D7 
+         -1,   // D8 
+         -1,   // D9 
+         -1,   // DA 
+       0xdf,   // DB [         HAN DAKUON
+       0xb0,   // DC Yen       CHOUON
+       0xd1,   // DD ]         MU
+       0xcd,   // DE ^         HE
+         -1,   // DF 
+         -1,   // E0 
+         -1,   // E1 
+       0xdb,   // E2 _         RO
+         -1,   // E3 
+         -1,   // E4 
+         -1,   // E5 
+         -1,   // E6 
+         -1,   // E7 
+         -1,   // E8 
+         -1,   // E9 
+         -1,   // EA 
+         -1,   // EB 
+         -1,   // EC 
+         -1,   // ED 
+         -1,   // EE 
+         -1,   // EF 
+         -1,   // F0 
+         -1,   // F1 
+         -1,   // F2 
+         -1,   // F3 
+         -1,   // F4 
+         -1,   // F5 
+         -1,   // F6 
+         -1,   // F7 
+         -1,   // F8 
+         -1,   // F9 
+         -1,   // FA 
+         -1,   // FB 
+         -1,   // FC 
+         -1,   // FD 
+         -1,   // FE 
+         -1,   // FF 
+};
+
+void MEMORY::initialize()
+{
+       column = 0xff;
+       kana = false;
+       pressed = 0;
+       register_frame_event(this);
+       
+       memset(rdmy, 0xff, sizeof(rdmy));
+       memset(mon, 0xff, sizeof(mon));
+       memset(prom1, 0xff, sizeof(prom1));
+       memset(prom2, 0xff, sizeof(prom2));
+       memset(bas1, 0xff, sizeof(bas1));
+       memset(bas2, 0xff, sizeof(bas2));
+       memset(ram, 0x00, sizeof(ram));
+       memset(vram, 0x00, sizeof(vram));
+       
+       // load rom image
+       FILEIO* fio = new FILEIO();
+       if(fio->Fopen(create_local_path(_T("MON.ROM")), FILEIO_READ_BINARY)) {
+               fio->Fread(mon, sizeof(mon), 1);
+               fio->Fclose();
+       }
+       if(fio->Fopen(create_local_path(_T("PROM1.ROM")), FILEIO_READ_BINARY)) {
+               fio->Fread(prom1, sizeof(prom1), 1);
+               fio->Fclose();
+       }
+       if(fio->Fopen(create_local_path(_T("PROM2.ROM")), FILEIO_READ_BINARY)) {
+               fio->Fread(prom2, sizeof(prom2), 1);
+               fio->Fclose();
+       }
+       if(fio->Fopen(create_local_path(_T("LV1BASIC.ROM")), FILEIO_READ_BINARY)) {
+               fio->Fread(bas1, sizeof(bas1), 1);
+               fio->Fclose();
+       }
+       if(fio->Fopen(create_local_path(_T("LV2BASIC.ROM")), FILEIO_READ_BINARY)) {
+               fio->Fread(bas2, sizeof(bas2), 1);
+               fio->Fclose();
+       }
+       delete fio;
+       
+       // set memory map
+       SET_BANK(0x0000, 0x07ff, wdmy, mon  );
+       SET_BANK(0x0800, 0x0bff, wdmy, prom1);
+       SET_BANK(0x0c00, 0x0fff, wdmy, prom2);
+       SET_BANK(0x1000, 0xffff, wdmy, rdmy );
+       
+       boot_mode = -1;
+}
+
+void MEMORY::reset()
+{
+       if(boot_mode != config.boot_mode) {
+               SET_BANK(0x1000, 0xffff, wdmy, rdmy);
+               
+               if(config.boot_mode == 2) {
+                       // EX-80BS LV2 BASIC
+                       SET_BANK(0x1800, 0x3fff, wdmy, bas2);
+                       SET_BANK(0x8000, 0xbfff, ram , ram );
+                       SET_BANK(0xfc00, 0xffff, vram, vram);
+               } else if(config.boot_mode == 1) {
+                       // EX-80BS LV1 BASIC
+                       SET_BANK(0x3000, 0x3fff, wdmy, bas1);
+                       SET_BANK(0x8000, 0xbfff, ram , ram );
+                       SET_BANK(0xfc00, 0xffff, vram, vram);
+               } else {
+                       // EX-80
+                       SET_BANK(0x8000, 0x87ff, ram , ram );
+               }
+               boot_mode = config.boot_mode;
+       }
+       irq_bits = 0;
+}
+
+void MEMORY::event_frame()
+{
+       const uint8_t* key_stat = emu->get_key_buffer();
+       uint32_t val = 0xff;
+       
+       if(!(column & 0x10)) {
+               if(key_stat[0x80]) val &= ~0x01;        // 0
+               if(key_stat[0x81]) val &= ~0x02;        // 1
+               if(key_stat[0x82]) val &= ~0x04;        // 2
+               if(key_stat[0x83]) val &= ~0x08;        // 3
+               if(key_stat[0x84]) val &= ~0x10;        // 4
+               if(key_stat[0x85]) val &= ~0x20;        // 5
+               if(key_stat[0x86]) val &= ~0x40;        // 6
+               if(key_stat[0x87]) val &= ~0x80;        // 7
+       }
+       if(!(column & 0x20)) {
+               if(key_stat[0x88]) val &= ~0x01;        // 8
+               if(key_stat[0x89]) val &= ~0x02;        // 9
+               if(key_stat[0x8a]) val &= ~0x04;        // A
+               if(key_stat[0x8b]) val &= ~0x08;        // B
+               if(key_stat[0x8c]) val &= ~0x10;        // C
+               if(key_stat[0x8d]) val &= ~0x20;        // D
+               if(key_stat[0x8e]) val &= ~0x40;        // E
+               if(key_stat[0x8f]) val &= ~0x80;        // F
+       }
+       if(!(column & 0x40)) {
+               if(key_stat[0x98]) val &= ~0x02;        // RET
+               if(key_stat[0x99]) val &= ~0x01;        // RUN
+               if(key_stat[0x9a]) val &= ~0x40;        // SDA
+               if(key_stat[0x9b]) val &= ~0x80;        // LDA
+               if(key_stat[0x9c]) val &= ~0x04;        // ADR
+               if(key_stat[0x9d]) val &= ~0x10;        // RIC
+               if(key_stat[0x9e]) val &= ~0x08;        // RDC
+               if(key_stat[0x9f]) val &= ~0x20;        // WIC
+       }
+       d_pio->write_signal(SIG_I8255_PORT_A, val, 0xff);
+}
+
+void MEMORY::write_signal(int id, uint32_t data, uint32_t mask)
+{
+       column = data & mask;
+       event_frame();
+}
+
+void MEMORY::write_data8(uint32_t addr, uint32_t data)
+{
+       addr &= 0xffff;
+       wbank[addr >> 10][addr & 0x3ff] = data;
+}
+
+uint32_t MEMORY::read_data8(uint32_t addr)
+{
+       addr &= 0xffff;
+       return rbank[addr >> 10][addr & 0x3ff];
+}
+
+uint32_t MEMORY::fetch_op(uint32_t addr, int *wait)
+{
+       if((config.dipswitch & 1) && d_cpu->read_signal(SIG_I8080_INTE)) {
+               irq_bits |= 1;
+               d_cpu->write_signal(SIG_I8080_INTR, 1, 1);
+       }
+       *wait = 0;
+       return read_data8(addr);
+}
+
+void MEMORY::write_io8(uint32_t addr, uint32_t data)
+{
+       switch(addr & 0xff) {
+       case 0xaf:
+               if((irq_bits &= ~(data & 0xfa)) == 0) {
+                       d_cpu->write_signal(SIG_I8080_INTR, 0, 1);
+               }
+               break;
+       }
+}
+
+uint32_t MEMORY::read_io8(uint32_t addr)
+{
+       switch(addr & 0xff) {
+       case 0xef:
+               return pressed;
+       }
+       return 0xff;
+}
+
+uint32_t MEMORY::get_intr_ack()
+{
+       if(irq_bits & 0x80) {
+               return 0xc7; // RST 0
+       }
+       if(irq_bits & 0x40) {
+               return 0xcf; // RST 1
+       }
+       if(irq_bits & 0x20) {
+               return 0xd7; // RST 2
+       }
+       if(irq_bits & 0x10) {
+               return 0xdf; // RST 3
+       }
+       if(irq_bits & 0x08) {
+               return 0xe7; // RST 4
+       }
+       if(irq_bits & 0x04) {
+               irq_bits &= ~0x04;
+               return 0xef; // RST 5
+       }
+       if(irq_bits & 0x02) {
+               return 0xf7; // RST 6
+       }
+       if(irq_bits & 0x01) {
+               irq_bits &= ~0x01;
+               return 0xff; // RST 7
+       }
+       return 0x00; // NOP
+}
+
+void MEMORY::key_down(int code)
+{
+       if(code == 0x15) {
+               kana = !kana;
+               return;
+       }
+       bool shift  = (emu->get_key_buffer()[0x10] != 0);
+       bool symbol = (emu->get_key_buffer()[0x12] != 0);
+       
+       if(shift) {
+               code = table_shift[code & 0xff];
+       } else if(symbol) {
+               code = table_symbol[code & 0xff];
+       } else if(kana) {
+               code = table_kana[code & 0xff];
+       } else {
+               code = table[code & 0xff];
+       }
+       if(code != -1) {
+               pressed = code;
+               irq_bits |= 4;
+               d_cpu->write_signal(SIG_I8080_INTR, 1, 1);
+       }
+}
+
+void MEMORY::load_binary(const _TCHAR* file_path)
+{
+       FILEIO* fio = new FILEIO();
+       if(fio->Fopen(file_path, FILEIO_READ_BINARY)) {
+               fio->Fread(ram, sizeof(ram), 1);
+               fio->Fclose();
+       }
+       delete fio;
+}
+
+void MEMORY::save_binary(const _TCHAR* file_path)
+{
+       FILEIO* fio = new FILEIO();
+       if(fio->Fopen(file_path, FILEIO_WRITE_BINARY)) {
+               fio->Fwrite(ram, sizeof(ram), 1);
+               fio->Fclose();
+       }
+       delete fio;
+}
+
+#define STATE_VERSION  2
+
+bool MEMORY::process_state(FILEIO* state_fio, bool loading)
+{
+       if(!state_fio->StateCheckUint32(STATE_VERSION)) {
+               return false;
+       }
+       if(!state_fio->StateCheckInt32(this_device_id)) {
+               return false;
+       }
+       state_fio->StateValue(column);
+       state_fio->StateValue(kana);
+       state_fio->StateValue(pressed);
+       state_fio->StateValue(irq_bits);
+       state_fio->StateArray(ram, sizeof(ram), 1);
+       state_fio->StateArray(vram, sizeof(vram), 1);
+       state_fio->StateValue(boot_mode);
+       return true;
+}
+}
diff --git a/source/src/vm/ex80bs/memory.h b/source/src/vm/ex80bs/memory.h
new file mode 100644 (file)
index 0000000..a7e7c14
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+       TOSHIBA EX-80 Emulator 'eEX-80'
+
+       Author : Takeda.Toshiya
+       Date   : 2015.12.14-
+
+       [ memory ]
+*/
+
+#ifndef _EX80BS_MEMORY_H_
+#define _EX80BS_MEMORY_H_
+
+#include "../vm.h"
+#include "../../emu.h"
+#include "../device.h"
+
+#define SIG_KEYBOARD_COLUMN    0
+
+namespace EX80BS {
+class MEMORY : public DEVICE
+{
+private:
+       DEVICE *d_cpu;
+       DEVICE *d_pio;
+       
+       uint32_t column;
+       bool kana;
+       uint8_t pressed;
+       uint8_t irq_bits;
+       
+       void update_kb();
+       uint8_t mon[0x800];
+       uint8_t prom1[0x400];
+       uint8_t prom2[0x400];
+       uint8_t bas1[0x1000];
+       uint8_t bas2[0x2800];
+       uint8_t ram[0x4000];
+       uint8_t vram[0x400];
+       
+       uint8_t wdmy[0x400];
+       uint8_t rdmy[0x400];
+       uint8_t* wbank[64];
+       uint8_t* rbank[64];
+       
+       int boot_mode;
+       
+public:
+       MEMORY(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu) : DEVICE(parent_vm, parent_emu)
+       {
+               set_device_name(_T("Memory Bus"));
+       }
+       ~MEMORY() {}
+       
+       // common functions
+       void initialize() override;
+       void reset() override;
+       void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask) override;
+       void event_frame() override;
+       
+       void __FASTCALL write_data8(uint32_t addr, uint32_t data) override;
+       uint32_t __FASTCALL read_data8(uint32_t addr) override;
+       uint32_t __FASTCALL fetch_op(uint32_t addr, int *wait) override;
+       uint32_t get_intr_ack() override;
+       void __FASTCALL write_io8(uint32_t addr, uint32_t data) override;
+       uint32_t __FASTCALL read_io8(uint32_t addr) override;
+       bool process_state(FILEIO* state_fio, bool loading) override;
+       
+       // unique functions
+       void set_context_cpu(DEVICE* device)
+       {
+               d_cpu = device;
+       }
+       void set_context_pio(DEVICE* device)
+       {
+               d_pio = device;
+       }
+       uint8_t* get_ram()
+       {
+               return ram;
+       }
+       uint8_t* get_vram()
+       {
+               return vram;
+       }
+       void key_down(int code);
+       void load_binary(const _TCHAR* file_path);
+       void save_binary(const _TCHAR* file_path);
+};
+}
+
+#endif
+
index 9ed4da1..3d3a91b 100644 (file)
@@ -485,6 +485,10 @@ void I8080::check_interrupt()
        // check interrupt
        if(IM & IM_REQ) {
                if(IM & IM_NMI) {
+                       if(afterHALT) {
+                               PC++;
+                               afterHALT = false;
+                       }
                        INT(0x24);
                        count -= 5;     // unknown
                        RIM_IEN = IM & IM_IEN;
@@ -496,16 +500,28 @@ void I8080::check_interrupt()
 #else
                        if(!(IM & IM_M7) && (IM & IM_I7)) {
 #endif
+                               if(afterHALT) {
+                                       PC++;
+                                       afterHALT = false;
+                               }
                                INT(0x3c);
                                count -= 7;     // unknown
                                RIM_IEN = 0;
                                IM &= ~(IM_IEN | IM_I7);
                        } else if(!(IM & IM_M6) && (IM & IM_I6)) {
+                               if(afterHALT) {
+                                       PC++;
+                                       afterHALT = false;
+                               }
                                INT(0x34);
                                count -= 7;     // unknown
                                RIM_IEN = 0;
                                IM &= ~(IM_IEN | IM_I6);
                        } else if(!(IM & IM_M5) && (IM & IM_I5)) {
+                               if(afterHALT) {
+                                       PC++;
+                                       afterHALT = false;
+                               }
                                INT(0x2c);
                                count -= 7;     // unknown
                                RIM_IEN = 0;
@@ -513,10 +529,14 @@ void I8080::check_interrupt()
                        } else
 #endif
                        if(IM & IM_INT) {
+                               if(afterHALT) {
+                                       PC++;
+                                       afterHALT = false;
+                               }
                                uint32_t vector = ACK_INTR();
                                uint8_t v0 = vector;
                                uint16_t v12 = vector >> 8;
-                               // support JMP/CALL/RST only
+                               // support JMP/CALL/RST/NOP only
                                //count -= cc_op[v0];
 #ifdef HAS_I8085
                                count -= cc_op_8085[v0];
index 812324a..dd3c964 100644 (file)
@@ -793,7 +793,7 @@ void I8080_BASE::OP(uint8_t code)
                break;
        case 0x76: // HLT
                PC--;
-               afterHALT = 1;
+               afterHALT = true;
                break;
        case 0x77: // MOV M,A
                WM8(HL, _A);
index 8e7436a..a837574 100644 (file)
@@ -192,11 +192,9 @@ public:
 };
 
 inline void I8080_BASE::INT(uint16_t v)
-{                                                                                              \
-       if(afterHALT) {
-               PC++; afterHALT = 0;
-       }
-       PUSH16(PC); PC = (v);
+{                                                                                              
+       PUSH16(PC);
+       PC = (v);
 }
 
 inline void I8080_BASE::RST(uint16_t n)
index b3e10d8..dcbf4f7 100644 (file)
@@ -40,9 +40,9 @@
 #include "colecovision/colecovision.h"
 #endif
 
-// TOSHIBA EX-80
-#ifdef _EX80
-#include "ex80/ex80.h"
+// TOSHIBA EX-80BS
+#ifdef _EX80BS
+#include "ex80bs/ex80bs.h"
 #endif
 
 // Nintendo Family BASIC
index 2b0235d..7f100e9 100644 (file)
@@ -35,9 +35,9 @@ devenv.com colecovision.vcproj /Rebuild Release
 mkdir build_xp\colecovision\r
 copy Release\colecovision.exe build_xp\colecovision\.\r
 \r
-devenv.com ex80.vcproj /Rebuild Release\r
-mkdir build_xp\ex80\r
-copy Release\ex80.exe build_xp\ex80\.\r
+devenv.com ex80bs.vcproj /Rebuild Release\r
+mkdir build_xp\ex80bs\r
+copy Release\ex80bs.exe build_xp\ex80bs\.\r
 \r
 devenv.com familybasic.vcproj /Rebuild Release\r
 mkdir build_xp\familybasic\r
similarity index 81%
rename from source/vc++2008/ex80.vcproj
rename to source/vc++2008/ex80bs.vcproj
index 3fcac82..458e9ff 100644 (file)
@@ -2,9 +2,9 @@
 <VisualStudioProject\r
        ProjectType="Visual C++"\r
        Version="9.00"\r
-       Name="ex80"\r
+       Name="ex80bs"\r
        ProjectGUID="{F62D036D-7569-431B-9C55-C056A4D3145A}"\r
-       RootNamespace="ex80"\r
+       RootNamespace="ex80bs"\r
        TargetFrameworkVersion="131072"\r
        >\r
        <Platforms>\r
                                MkTypLibCompatible="true"\r
                                SuppressStartupBanner="true"\r
                                TargetEnvironment="1"\r
-                               TypeLibraryName=".\Debug/ex80.tlb"\r
+                               TypeLibraryName=".\Debug/ex80bs.tlb"\r
                                HeaderFileName=""\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_EX80"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_EX80BS"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="1"\r
-                               PrecompiledHeaderFile=".\Debug/ex80.pch"\r
+                               PrecompiledHeaderFile=".\Debug/ex80bs.pch"\r
                                AssemblerListingLocation=".\Debug/"\r
                                ObjectFile=".\Debug/"\r
                                ProgramDataBaseFileName=".\Debug/"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib imm32.lib"\r
-                               OutputFile=".\Debug/ex80.exe"\r
+                               OutputFile=".\Debug/ex80bs.exe"\r
                                LinkIncremental="2"\r
                                SuppressStartupBanner="true"\r
                                GenerateManifest="false"\r
                                GenerateDebugInformation="true"\r
-                               ProgramDatabaseFile=".\Debug/ex80.pdb"\r
+                               ProgramDatabaseFile=".\Debug/ex80bs.pdb"\r
                                SubSystem="2"\r
                                RandomizedBaseAddress="1"\r
                                DataExecutionPrevention="0"\r
@@ -99,7 +99,7 @@
                        <Tool\r
                                Name="VCBscMakeTool"\r
                                SuppressStartupBanner="true"\r
-                               OutputFile=".\Debug/ex80.bsc"\r
+                               OutputFile=".\Debug/ex80bs.bsc"\r
                        />\r
                        <Tool\r
                                Name="VCFxCopTool"\r
                                MkTypLibCompatible="true"\r
                                SuppressStartupBanner="true"\r
                                TargetEnvironment="1"\r
-                               TypeLibraryName=".\Release/ex80.tlb"\r
+                               TypeLibraryName=".\Release/ex80bs.tlb"\r
                                HeaderFileName=""\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                InlineFunctionExpansion="2"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_EX80"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_EX80BS"\r
                                StringPooling="true"\r
                                RuntimeLibrary="0"\r
                                EnableFunctionLevelLinking="true"\r
                                EnableEnhancedInstructionSet="2"\r
-                               PrecompiledHeaderFile=".\Release/ex80.pch"\r
+                               PrecompiledHeaderFile=".\Release/ex80bs.pch"\r
                                AssemblerListingLocation=".\Release/"\r
                                ObjectFile=".\Release/"\r
                                ProgramDataBaseFileName=".\Release/"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib imm32.lib"\r
-                               OutputFile=".\Release/ex80.exe"\r
+                               OutputFile=".\Release/ex80bs.exe"\r
                                LinkIncremental="1"\r
                                SuppressStartupBanner="true"\r
                                GenerateManifest="false"\r
-                               ProgramDatabaseFile=".\Release/ex80.pdb"\r
+                               ProgramDatabaseFile=".\Release/ex80bs.pdb"\r
                                SubSystem="2"\r
                                RandomizedBaseAddress="1"\r
                                DataExecutionPrevention="0"\r
                        <Tool\r
                                Name="VCBscMakeTool"\r
                                SuppressStartupBanner="true"\r
-                               OutputFile=".\Release/ex80.bsc"\r
+                               OutputFile=".\Release/ex80bs.bsc"\r
                        />\r
                        <Tool\r
                                Name="VCFxCopTool"\r
                                Filter="cpp"\r
                                >\r
                                <File\r
-                                       RelativePath="..\src\vm\ex80\cmt.cpp"\r
+                                       RelativePath="..\src\vm\ex80bs\cmt.cpp"\r
                                        >\r
                                        <FileConfiguration\r
                                                Name="Debug|Win32"\r
                                        </FileConfiguration>\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\src\vm\ex80\display.cpp"\r
+                                       RelativePath="..\src\vm\ex80bs\display.cpp"\r
                                        >\r
                                        <FileConfiguration\r
                                                Name="Debug|Win32"\r
                                        </FileConfiguration>\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\src\vm\ex80\ex80.cpp"\r
+                                       RelativePath="..\src\vm\ex80bs\ex80bs.cpp"\r
                                        >\r
                                        <FileConfiguration\r
                                                Name="Debug|Win32"\r
                                        </FileConfiguration>\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\src\vm\ex80\keyboard.cpp"\r
-                                       >\r
-                                       <FileConfiguration\r
-                                               Name="Debug|Win32"\r
-                                               >\r
-                                               <Tool\r
-                                                       Name="VCCLCompilerTool"\r
-                                                       PreprocessorDefinitions=""\r
-                                               />\r
-                                       </FileConfiguration>\r
-                                       <FileConfiguration\r
-                                               Name="Release|Win32"\r
-                                               >\r
-                                               <Tool\r
-                                                       Name="VCCLCompilerTool"\r
-                                                       PreprocessorDefinitions=""\r
-                                               />\r
-                                       </FileConfiguration>\r
-                               </File>\r
-                               <File\r
-                                       RelativePath="..\src\vm\ex80\memory.cpp"\r
+                                       RelativePath="..\src\vm\ex80bs\memory.cpp"\r
                                        >\r
                                        <FileConfiguration\r
                                                Name="Debug|Win32"\r
                                Filter="h"\r
                                >\r
                                <File\r
-                                       RelativePath="..\src\vm\ex80\cmt.h"\r
-                                       >\r
-                               </File>\r
-                               <File\r
-                                       RelativePath="..\src\vm\ex80\display.h"\r
+                                       RelativePath="..\src\vm\ex80bs\cmt.h"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\src\vm\ex80\ex80.h"\r
+                                       RelativePath="..\src\vm\ex80bs\display.h"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\src\vm\ex80\keyboard.h"\r
+                                       RelativePath="..\src\vm\ex80bs\ex80bs.h"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\src\vm\ex80\memory.h"\r
+                                       RelativePath="..\src\vm\ex80bs\memory.h"\r
                                        >\r
                                </File>\r
                        </Filter>\r
                        Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
                        >\r
                        <File\r
-                               RelativePath="..\src\res\ex80.ico"\r
+                               RelativePath="..\src\res\ex80bs.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80.rc"\r
+                               RelativePath="..\src\res\ex80bs.rc"\r
                                >\r
                                <FileConfiguration\r
                                        Name="Debug|Win32"\r
                                </FileConfiguration>\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\board.png"\r
+                               RelativePath="..\src\res\ex80bs\board.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button00.png"\r
+                               RelativePath="..\src\res\ex80bs\button00.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button01.png"\r
+                               RelativePath="..\src\res\ex80bs\button01.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button02.png"\r
+                               RelativePath="..\src\res\ex80bs\button02.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button03.png"\r
+                               RelativePath="..\src\res\ex80bs\button03.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button04.png"\r
+                               RelativePath="..\src\res\ex80bs\button04.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button05.png"\r
+                               RelativePath="..\src\res\ex80bs\button05.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button06.png"\r
+                               RelativePath="..\src\res\ex80bs\button06.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button07.png"\r
+                               RelativePath="..\src\res\ex80bs\button07.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button08.png"\r
+                               RelativePath="..\src\res\ex80bs\button08.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button09.png"\r
+                               RelativePath="..\src\res\ex80bs\button09.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button10.png"\r
+                               RelativePath="..\src\res\ex80bs\button10.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button11.png"\r
+                               RelativePath="..\src\res\ex80bs\button11.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button12.png"\r
+                               RelativePath="..\src\res\ex80bs\button12.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button13.png"\r
+                               RelativePath="..\src\res\ex80bs\button13.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button14.png"\r
+                               RelativePath="..\src\res\ex80bs\button14.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button15.png"\r
+                               RelativePath="..\src\res\ex80bs\button15.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button16.png"\r
+                               RelativePath="..\src\res\ex80bs\button16.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button17.png"\r
+                               RelativePath="..\src\res\ex80bs\button17.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button18.png"\r
+                               RelativePath="..\src\res\ex80bs\button18.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button19.png"\r
+                               RelativePath="..\src\res\ex80bs\button19.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button20.png"\r
+                               RelativePath="..\src\res\ex80bs\button20.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button21.png"\r
+                               RelativePath="..\src\res\ex80bs\button21.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button22.png"\r
+                               RelativePath="..\src\res\ex80bs\button22.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button23.png"\r
+                               RelativePath="..\src\res\ex80bs\button23.png"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\src\res\ex80\button24.png"\r
+                               RelativePath="..\src\res\ex80bs\button24.png"\r
                                >\r
                        </File>\r
                        <File\r
index a964453..14c4b5a 100644 (file)
@@ -31,9 +31,9 @@ msbuild.exe colecovision.vcxproj /t:clean;rebuild /p:Configuration=Release;Platf
 mkdir build_vc15\colecovision\r
 copy bin\x86\Release\colecovision.exe build_vc15\colecovision\.\r
 \r
-msbuild.exe ex80.vcxproj /t:clean;rebuild /p:Configuration=Release;Platform="Win32"\r
-mkdir build_vc15\ex80\r
-copy bin\x86\Release\ex80.exe build_vc15\ex80\.\r
+msbuild.exe ex80bs.vcxproj /t:clean;rebuild /p:Configuration=Release;Platform="Win32"\r
+mkdir build_vc15\ex80bs\r
+copy bin\x86\Release\ex80bs.exe build_vc15\ex80bs\.\r
 \r
 msbuild.exe familybasic.vcxproj /t:clean;rebuild /p:Configuration=Release;Platform="Win32"\r
 mkdir build_vc15\familybasic\r
similarity index 87%
rename from source/vc++2017/ex80.vcxproj
rename to source/vc++2017/ex80bs.vcxproj
index 0fd89d2..da251bc 100644 (file)
@@ -20,7 +20,7 @@
   </ItemGroup>\r
   <PropertyGroup Label="Globals">\r
     <ProjectGuid>{F62D036D-7569-431B-9C55-C056A4D3145A}</ProjectGuid>\r
-    <RootNamespace>ex80</RootNamespace>\r
+    <RootNamespace>ex80bs</RootNamespace>\r
     <Keyword>Win32Proj</Keyword>\r
     <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
   </PropertyGroup>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_EX80;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_EX80BS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
       <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_EX80;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_EX80BS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
       <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>\r
     <ClCompile>\r
       <Optimization>MaxSpeed</Optimization>\r
       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_EX80;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_EX80BS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <StringPooling>true</StringPooling>\r
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
     <ClCompile>\r
       <Optimization>MaxSpeed</Optimization>\r
       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_EX80;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_EX80BS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <StringPooling>true</StringPooling>\r
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
     <ClCompile Include="..\src\fifo.cpp" />\r
     <ClCompile Include="..\src\fileio.cpp" />\r
     <ClCompile Include="..\src\vm\event.cpp" />\r
-    <ClCompile Include="..\src\vm\ex80\cmt.cpp" />\r
-    <ClCompile Include="..\src\vm\ex80\display.cpp" />\r
-    <ClCompile Include="..\src\vm\ex80\ex80.cpp" />\r
-    <ClCompile Include="..\src\vm\ex80\keyboard.cpp" />\r
-    <ClCompile Include="..\src\vm\ex80\memory.cpp" />\r
+    <ClCompile Include="..\src\vm\ex80bs\cmt.cpp" />\r
+    <ClCompile Include="..\src\vm\ex80bs\display.cpp" />\r
+    <ClCompile Include="..\src\vm\ex80bs\ex80bs.cpp" />\r
+    <ClCompile Include="..\src\vm\ex80bs\memory.cpp" />\r
     <ClCompile Include="..\src\vm\i8080.cpp" />\r
     <ClCompile Include="..\src\vm\i8251.cpp" />\r
     <ClCompile Include="..\src\vm\i8255.cpp" />\r
     <ClInclude Include="..\src\vm\debugger.h" />\r
     <ClInclude Include="..\src\vm\device.h" />\r
     <ClInclude Include="..\src\vm\event.h" />\r
-    <ClInclude Include="..\src\vm\ex80\cmt.h" />\r
-    <ClInclude Include="..\src\vm\ex80\display.h" />\r
-    <ClInclude Include="..\src\vm\ex80\ex80.h" />\r
-    <ClInclude Include="..\src\vm\ex80\keyboard.h" />\r
-    <ClInclude Include="..\src\vm\ex80\memory.h" />\r
+    <ClInclude Include="..\src\vm\ex80bs\cmt.h" />\r
+    <ClInclude Include="..\src\vm\ex80bs\display.h" />\r
+    <ClInclude Include="..\src\vm\ex80bs\ex80bs.h" />\r
+    <ClInclude Include="..\src\vm\ex80bs\memory.h" />\r
     <ClInclude Include="..\src\vm\f9368.h" />\r
     <ClInclude Include="..\src\vm\i8080.h" />\r
     <ClInclude Include="..\src\vm\i8251.h" />\r
     <ClInclude Include="..\src\win32\osd.h" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <Image Include="..\src\res\ex80.ico" />\r
-    <Image Include="..\src\res\ex80\board.png" />\r
-    <Image Include="..\src\res\ex80\button00.png" />\r
-    <Image Include="..\src\res\ex80\button01.png" />\r
-    <Image Include="..\src\res\ex80\button02.png" />\r
-    <Image Include="..\src\res\ex80\button03.png" />\r
-    <Image Include="..\src\res\ex80\button04.png" />\r
-    <Image Include="..\src\res\ex80\button05.png" />\r
-    <Image Include="..\src\res\ex80\button06.png" />\r
-    <Image Include="..\src\res\ex80\button07.png" />\r
-    <Image Include="..\src\res\ex80\button08.png" />\r
-    <Image Include="..\src\res\ex80\button09.png" />\r
-    <Image Include="..\src\res\ex80\button10.png" />\r
-    <Image Include="..\src\res\ex80\button11.png" />\r
-    <Image Include="..\src\res\ex80\button12.png" />\r
-    <Image Include="..\src\res\ex80\button13.png" />\r
-    <Image Include="..\src\res\ex80\button14.png" />\r
-    <Image Include="..\src\res\ex80\button15.png" />\r
-    <Image Include="..\src\res\ex80\button16.png" />\r
-    <Image Include="..\src\res\ex80\button17.png" />\r
-    <Image Include="..\src\res\ex80\button18.png" />\r
-    <Image Include="..\src\res\ex80\button19.png" />\r
-    <Image Include="..\src\res\ex80\button20.png" />\r
-    <Image Include="..\src\res\ex80\button21.png" />\r
-    <Image Include="..\src\res\ex80\button22.png" />\r
-    <Image Include="..\src\res\ex80\button23.png" />\r
-    <Image Include="..\src\res\ex80\button24.png" />\r
+    <Image Include="..\src\res\ex80bs.ico" />\r
+    <Image Include="..\src\res\ex80bs\board.png" />\r
+    <Image Include="..\src\res\ex80bs\button00.png" />\r
+    <Image Include="..\src\res\ex80bs\button01.png" />\r
+    <Image Include="..\src\res\ex80bs\button02.png" />\r
+    <Image Include="..\src\res\ex80bs\button03.png" />\r
+    <Image Include="..\src\res\ex80bs\button04.png" />\r
+    <Image Include="..\src\res\ex80bs\button05.png" />\r
+    <Image Include="..\src\res\ex80bs\button06.png" />\r
+    <Image Include="..\src\res\ex80bs\button07.png" />\r
+    <Image Include="..\src\res\ex80bs\button08.png" />\r
+    <Image Include="..\src\res\ex80bs\button09.png" />\r
+    <Image Include="..\src\res\ex80bs\button10.png" />\r
+    <Image Include="..\src\res\ex80bs\button11.png" />\r
+    <Image Include="..\src\res\ex80bs\button12.png" />\r
+    <Image Include="..\src\res\ex80bs\button13.png" />\r
+    <Image Include="..\src\res\ex80bs\button14.png" />\r
+    <Image Include="..\src\res\ex80bs\button15.png" />\r
+    <Image Include="..\src\res\ex80bs\button16.png" />\r
+    <Image Include="..\src\res\ex80bs\button17.png" />\r
+    <Image Include="..\src\res\ex80bs\button18.png" />\r
+    <Image Include="..\src\res\ex80bs\button19.png" />\r
+    <Image Include="..\src\res\ex80bs\button20.png" />\r
+    <Image Include="..\src\res\ex80bs\button21.png" />\r
+    <Image Include="..\src\res\ex80bs\button22.png" />\r
+    <Image Include="..\src\res\ex80bs\button23.png" />\r
+    <Image Include="..\src\res\ex80bs\button24.png" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ResourceCompile Include="..\src\res\ex80.rc">\r
+    <ResourceCompile Include="..\src\res\ex80bs.rc">\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\src\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\src\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\src\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
similarity index 78%
rename from source/vc++2017/ex80.vcxproj.filters
rename to source/vc++2017/ex80bs.vcxproj.filters
index 77e30c4..b14e1f1 100644 (file)
     <ClCompile Include="..\src\vm\pcm1bit.cpp">\r
       <Filter>Source Files\VM Common Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\src\vm\ex80\cmt.cpp">\r
+    <ClCompile Include="..\src\vm\ex80bs\cmt.cpp">\r
       <Filter>Source Files\VM Driver Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\src\vm\ex80\display.cpp">\r
+    <ClCompile Include="..\src\vm\ex80bs\display.cpp">\r
       <Filter>Source Files\VM Driver Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\src\vm\ex80\ex80.cpp">\r
+    <ClCompile Include="..\src\vm\ex80bs\ex80bs.cpp">\r
       <Filter>Source Files\VM Driver Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\src\vm\ex80\keyboard.cpp">\r
-      <Filter>Source Files\VM Driver Source Files</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\src\vm\ex80\memory.cpp">\r
+    <ClCompile Include="..\src\vm\ex80bs\memory.cpp">\r
       <Filter>Source Files\VM Driver Source Files</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
     <ClInclude Include="..\src\vm\vm_template.h">\r
       <Filter>Header Files\VM Common Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\src\vm\ex80\cmt.h">\r
-      <Filter>Header Files\VM Driver Header Files</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="..\src\vm\ex80\display.h">\r
+    <ClInclude Include="..\src\vm\ex80bs\cmt.h">\r
       <Filter>Header Files\VM Driver Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\src\vm\ex80\ex80.h">\r
+    <ClInclude Include="..\src\vm\ex80bs\display.h">\r
       <Filter>Header Files\VM Driver Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\src\vm\ex80\keyboard.h">\r
+    <ClInclude Include="..\src\vm\ex80bs\ex80bs.h">\r
       <Filter>Header Files\VM Driver Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\src\vm\ex80\memory.h">\r
+    <ClInclude Include="..\src\vm\ex80bs\memory.h">\r
       <Filter>Header Files\VM Driver Header Files</Filter>\r
     </ClInclude>\r
     <ClInclude Include="..\src\res\resource.h">\r
     </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <Image Include="..\src\res\ex80.ico">\r
+    <Image Include="..\src\res\ex80bs.ico">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\board.png">\r
+    <Image Include="..\src\res\ex80bs\board.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button00.png">\r
+    <Image Include="..\src\res\ex80bs\button00.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button01.png">\r
+    <Image Include="..\src\res\ex80bs\button01.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button02.png">\r
+    <Image Include="..\src\res\ex80bs\button02.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button03.png">\r
+    <Image Include="..\src\res\ex80bs\button03.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button04.png">\r
+    <Image Include="..\src\res\ex80bs\button04.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button05.png">\r
+    <Image Include="..\src\res\ex80bs\button05.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button06.png">\r
+    <Image Include="..\src\res\ex80bs\button06.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button07.png">\r
+    <Image Include="..\src\res\ex80bs\button07.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button08.png">\r
+    <Image Include="..\src\res\ex80bs\button08.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button09.png">\r
+    <Image Include="..\src\res\ex80bs\button09.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button10.png">\r
+    <Image Include="..\src\res\ex80bs\button10.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button11.png">\r
+    <Image Include="..\src\res\ex80bs\button11.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button12.png">\r
+    <Image Include="..\src\res\ex80bs\button12.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button13.png">\r
+    <Image Include="..\src\res\ex80bs\button13.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button14.png">\r
+    <Image Include="..\src\res\ex80bs\button14.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button15.png">\r
+    <Image Include="..\src\res\ex80bs\button15.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button16.png">\r
+    <Image Include="..\src\res\ex80bs\button16.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button17.png">\r
+    <Image Include="..\src\res\ex80bs\button17.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button18.png">\r
+    <Image Include="..\src\res\ex80bs\button18.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button19.png">\r
+    <Image Include="..\src\res\ex80bs\button19.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button20.png">\r
+    <Image Include="..\src\res\ex80bs\button20.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button21.png">\r
+    <Image Include="..\src\res\ex80bs\button21.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button22.png">\r
+    <Image Include="..\src\res\ex80bs\button22.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button23.png">\r
+    <Image Include="..\src\res\ex80bs\button23.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
-    <Image Include="..\src\res\ex80\button24.png">\r
+    <Image Include="..\src\res\ex80bs\button24.png">\r
       <Filter>Resource Files</Filter>\r
     </Image>\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ResourceCompile Include="..\src\res\ex80.rc">\r
+    <ResourceCompile Include="..\src\res\ex80bs.rc">\r
       <Filter>Resource Files</Filter>\r
     </ResourceCompile>\r
   </ItemGroup>\r