• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revision2ca526938a8e8b3b9690f304961b024d521e4c93 (tree)
Time2019-01-13 00:48:36
AuthorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[VM] Add PC-8001/mk2/8801/mk2.
[General] Merge upstream 2019-01-11.

Change Summary

Incremental Difference

--- a/source/build-cmake/cmake/config_pc8801.cmake
+++ b/source/build-cmake/cmake/config_pc8801.cmake
@@ -23,7 +23,6 @@ set(VMFILES_LIB
2323 pcm1bit.cpp
2424 upd1990a.cpp
2525 upd765a.cpp
26- ym2203.cpp
2726 z80ctc.cpp
2827 z80dma.cpp
2928 z80pio.cpp
@@ -36,10 +35,13 @@ set(FLAG_USE_Z80 ON)
3635
3736 set(BUILD_SHARED_LIBS OFF)
3837
38+set(BUILD_PC8001 OFF CACHE BOOL "Build for PC8001")
39+set(BUILD_PC8001MK2 OFF CACHE BOOL "Build for PC8001 mk2")
3940 set(BUILD_PC8001SR OFF CACHE BOOL "Build for PC8001SR")
41+set(BUILD_PC8801 OFF CACHE BOOL "Build with PC8801")
42+set(BUILD_PC8801MK2 OFF CACHE BOOL "Build with PC8801 mk2")
4043 set(BUILD_PC8801MA OFF CACHE BOOL "Build with PC8801MA")
41-set(USE_OPNA ON CACHE BOOL "Use OPNA sound with PC8801MA")
42-set(USE_SOUNDBOARD2 ON CACHE BOOL "Use Sound Board sound with PC8801MA")
44+
4345 set(USE_PCG ON CACHE BOOL "Use PCG8100")
4446 set(PC88_EXTRAM_PAGES "4" CACHE STRING "Set banks of EXTRAM of PC8801, bank = 32Kbytes")
4547 set(USE_OPENMP ON CACHE BOOL "Build using OpenMP")
@@ -53,19 +55,47 @@ set(CMAKE_SYSTEM_PROCESSOR ${ARCHITECTURE} CACHE STRING "Set processor to build.
5355
5456 add_definitions(-D_CONFIGURE_WITH_CMAKE)
5557
56-
57-
58-if(BUILD_PC8001SR)
58+if(BUILD_PC8001)
59+ set(EXEC_TARGET emupc8001)
60+ add_definitions(-D_PC8001)
61+ set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc8001.qrc)
62+
63+elseif(BUILD_PC8001MK2)
64+ set(EXEC_TARGET emupc8001mk2)
65+ add_definitions(-D_PC8001MK2)
66+ set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc8001mk2.qrc)
67+ set(VMFILES_LIB ${VMFILES_LIB}
68+ ym2203.cpp
69+ )
70+
71+elseif(BUILD_PC8001SR)
5972 set(EXEC_TARGET emupc8001sr)
6073 add_definitions(-D_PC8001SR)
6174 set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc8001mk2sr.qrc)
75+ set(VMFILES_LIB ${VMFILES_LIB}
76+ ym2203.cpp
77+ )
78+
79+elseif(BUILD_PC8801)
80+ set(EXEC_TARGET emupc8801)
81+ add_definitions(-D_PC8801)
82+ set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc8801.qrc)
83+
84+elseif(BUILD_PC8801MK2)
85+ set(EXEC_TARGET emupc8801mk2)
86+ add_definitions(-D_PC8801MK2)
87+ set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc8801mk2.qrc)
88+ set(VMFILES_LIB ${VMFILES_LIB}
89+ ym2203.cpp
90+ )
6291
6392 elseif(BUILD_PC8801MA)
6493 set(EXEC_TARGET emupc8801ma)
6594 add_definitions(-D_PC8801MA)
6695 set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc8801ma.qrc)
6796 set(VMFILES_LIB ${VMFILES_LIB}
68- ym2151.cpp
97+ ym2203.cpp
98+ ym2151.cpp
6999 )
70100 set(VMFILES ${VMFILES}
71101 scsi_dev.cpp scsi_cdrom.cpp scsi_host.cpp
@@ -81,13 +111,4 @@ if(USE_PCG)
81111 add_definitions(-DSUPPORT_PC88_PCG8100)
82112 endif()
83113
84-if(USE_SOUNDBOARD2)
85- add_definitions(-DSUPPORT_PC88_SB2)
86- add_definitions(-DSUPPORT_PC88_OPNA)
87-else()
88- if(USE_OPNA)
89- add_definitions(-DSUPPORT_PC88_OPNA)
90- endif()
91-endif()
92-
93114 include(config_commonsource)
--- a/source/build-cmake/cmake/toolchain_mingw_cross_linux.cmake
+++ b/source/build-cmake/cmake/toolchain_mingw_cross_linux.cmake
@@ -9,14 +9,14 @@ SET(CMAKE_AR i686-w64-mingw32-gcc-ar)
99
1010 #set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
1111 #set(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++")
12-set(CMAKE_EXE_LINKER_FLAGS "-flto=6 -fwhole-program")
12+#set(CMAKE_EXE_LINKER_FLAGS "-flto=12 -fwhole-program")
1313
1414 #SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> --plugin==$(i686-w64-mingw32-gcc --print-file-name=liblto_plugin.so) <LINK_FLAGS> <OBJECTS>")
1515 #SET(CMAKE_C_ARCHIVE_FINISH true)
1616 #SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> --plugin==$(i686-w64-mingw32-gcc --print-file-name=liblto_plugin.so) <LINK_FLAGS> <OBJECTS>")
1717 #SET(CMAKE_CXX_ARCHIVE_FINISH true)
1818
19-set(LIBAV_ROOT_DIR "/usr/local/i586-mingw-msvc/ffmpeg-4.0")
19+set(LIBAV_ROOT_DIR "/usr/local/i586-mingw-msvc/ffmpeg-4.1")
2020
2121 # here is the target environment located
2222 set(USE_SDL2 ON)
@@ -24,15 +24,13 @@ if(USE_SDL2)
2424 SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32
2525 /usr/local/i586-mingw-msvc
2626 /usr/local/i586-mingw-msvc/SDL/i686-w64-mingw32
27- /usr/local/i586-mingw-msvc/5.10.1/mingw_73x
28-# /usr/local/i586-mingw-msvc/devel-libs/usr/i686-w64-mingw32/sys-root/mingw
27+ /usr/local/i586-mingw-msvc/5.12/mingw_82x
2928 )
3029 else()
3130 SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32
3231 /usr/local/i586-mingw-msvc
3332 /usr/local/i586-mingw-msvc/SDL1/
34- /usr/local/i586-mingw-msvc/5.10.1/mingw_73x
35-# /usr/local/i586-mingw-msvc/devel-libs/usr/i686-w64-mingw32/sys-root/mingw
33+ /usr/local/i586-mingw-msvc/5.12/mingw_82x
3634 )
3735 endif()
3836 SET(CSP_CROSS_BUILD 1)
@@ -44,8 +42,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
4442 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
4543 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
4644
47-#set(LIBAV_INCLUDE_DIRS /usr/local/i586-mingw-msvc/ffmpeg-3.0/include)
48-
4945 set(SDL2_LIBRARIES
5046 /usr/local/i586-mingw-msvc/SDL/i686-w64-mingw32/lib/libSDL2.dll.a
5147 /usr/local/i586-mingw-msvc/SDL/i686-w64-mingw32/lib/libSDL2main.a)
--- /dev/null
+++ b/source/build-cmake/pc8001/CMakeLists.txt
@@ -0,0 +1,18 @@
1+# Build Common Sourcecode Project, Agar.
2+# (C) 2014 K.Ohta <whatisthis.sowhat@gmail.com>
3+# This is part of , but license is apache 2.2,
4+# this part was written only me.
5+
6+cmake_minimum_required (VERSION 2.8)
7+cmake_policy(SET CMP0011 NEW)
8+
9+message("")
10+message("** Start of configure CommonSourceProject,PC8001, Qt **")
11+message("")
12+
13+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
14+
15+project (emupc8001)
16+set(BUILD_PC8001 ON CACHE BOOL "Build for PC8001")
17+
18+include(config_pc8801)
--- /dev/null
+++ b/source/build-cmake/pc8001mk2/CMakeLists.txt
@@ -0,0 +1,18 @@
1+# Build Common Sourcecode Project, Agar.
2+# (C) 2014 K.Ohta <whatisthis.sowhat@gmail.com>
3+# This is part of , but license is apache 2.2,
4+# this part was written only me.
5+
6+cmake_minimum_required (VERSION 2.8)
7+cmake_policy(SET CMP0011 NEW)
8+
9+message("")
10+message("** Start of configure CommonSourceProject,PC8001mk2, Qt **")
11+message("")
12+
13+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
14+
15+project (emupc8001mk2)
16+set(BUILD_PC8001MK2 ON CACHE BOOL "Build for PC8001mk2")
17+
18+include(config_pc8801)
--- a/source/build-cmake/pc8001sr/CMakeLists.txt
+++ b/source/build-cmake/pc8001sr/CMakeLists.txt
@@ -7,7 +7,7 @@ cmake_minimum_required (VERSION 2.8)
77 cmake_policy(SET CMP0011 NEW)
88
99 message("")
10-message("** Start of configure CommonSourceProject,PC8801MA, Qt **")
10+message("** Start of configure CommonSourceProject,PC8001mk2 SR, Qt **")
1111 message("")
1212
1313 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
--- /dev/null
+++ b/source/build-cmake/pc8801/CMakeLists.txt
@@ -0,0 +1,18 @@
1+# Build Common Sourcecode Project, Agar.
2+# (C) 2014 K.Ohta <whatisthis.sowhat@gmail.com>
3+# This is part of , but license is apache 2.2,
4+# this part was written only me.
5+
6+cmake_minimum_required (VERSION 2.8)
7+cmake_policy(SET CMP0011 NEW)
8+
9+message("")
10+message("** Start of configure CommonSourceProject,PC8801, Qt **")
11+message("")
12+
13+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
14+project (emupc8801)
15+
16+set(BUILD_PC8801 ON CACHE BOOL "Build with PC8801")
17+
18+include(config_pc8801)
\ No newline at end of file
--- /dev/null
+++ b/source/build-cmake/pc8801mk2/CMakeLists.txt
@@ -0,0 +1,18 @@
1+# Build Common Sourcecode Project, Agar.
2+# (C) 2014 K.Ohta <whatisthis.sowhat@gmail.com>
3+# This is part of , but license is apache 2.2,
4+# this part was written only me.
5+
6+cmake_minimum_required (VERSION 2.8)
7+cmake_policy(SET CMP0011 NEW)
8+
9+message("")
10+message("** Start of configure CommonSourceProject,PC8801mk2, Qt **")
11+message("")
12+
13+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
14+project (emupc8801mk2)
15+
16+set(BUILD_PC8801MK2 ON CACHE BOOL "Build with PC8801mk2")
17+
18+include(config_pc8801)
\ No newline at end of file
--- a/source/src/res/fm7.rc
+++ b/source/src/res/fm7.rc
@@ -128,7 +128,7 @@ BEGIN
128128 MENUITEM SEPARATOR
129129 MENUITEM "Exit", ID_EXIT
130130 END
131- POPUP "FD0"
131+ POPUP "FD1"
132132 BEGIN
133133 MENUITEM "Insert", ID_OPEN_FD1
134134 MENUITEM "Eject", ID_CLOSE_FD1
@@ -140,7 +140,7 @@ BEGIN
140140 MENUITEM SEPARATOR
141141 MENUITEM "Recent", ID_RECENT_FD1
142142 END
143- POPUP "FD1"
143+ POPUP "FD2"
144144 BEGIN
145145 MENUITEM "Insert", ID_OPEN_FD2
146146 MENUITEM "Eject", ID_CLOSE_FD2
--- a/source/src/res/fm77.rc
+++ b/source/src/res/fm77.rc
@@ -128,7 +128,7 @@ BEGIN
128128 MENUITEM SEPARATOR
129129 MENUITEM "Exit", ID_EXIT
130130 END
131- POPUP "FD0"
131+ POPUP "FD1"
132132 BEGIN
133133 MENUITEM "Insert", ID_OPEN_FD1
134134 MENUITEM "Eject", ID_CLOSE_FD1
@@ -141,7 +141,7 @@ BEGIN
141141 MENUITEM SEPARATOR
142142 MENUITEM "Recent", ID_RECENT_FD1
143143 END
144- POPUP "FD1"
144+ POPUP "FD2"
145145 BEGIN
146146 MENUITEM "Insert", ID_OPEN_FD2
147147 MENUITEM "Eject", ID_CLOSE_FD2
--- a/source/src/res/fm77av.rc
+++ b/source/src/res/fm77av.rc
@@ -128,7 +128,7 @@ BEGIN
128128 MENUITEM SEPARATOR
129129 MENUITEM "Exit", ID_EXIT
130130 END
131- POPUP "FD0"
131+ POPUP "FD1"
132132 BEGIN
133133 MENUITEM "Insert", ID_OPEN_FD1
134134 MENUITEM "Eject", ID_CLOSE_FD1
@@ -140,7 +140,7 @@ BEGIN
140140 MENUITEM SEPARATOR
141141 MENUITEM "Recent", ID_RECENT_FD1
142142 END
143- POPUP "FD1"
143+ POPUP "FD2"
144144 BEGIN
145145 MENUITEM "Insert", ID_OPEN_FD2
146146 MENUITEM "Eject", ID_CLOSE_FD2
--- a/source/src/res/fm77av40.rc
+++ b/source/src/res/fm77av40.rc
@@ -128,7 +128,7 @@ BEGIN
128128 MENUITEM SEPARATOR
129129 MENUITEM "Exit", ID_EXIT
130130 END
131- POPUP "FD0"
131+ POPUP "FD1"
132132 BEGIN
133133 MENUITEM "Insert", ID_OPEN_FD1
134134 MENUITEM "Eject", ID_CLOSE_FD1
@@ -141,7 +141,7 @@ BEGIN
141141 MENUITEM SEPARATOR
142142 MENUITEM "Recent", ID_RECENT_FD1
143143 END
144- POPUP "FD1"
144+ POPUP "FD2"
145145 BEGIN
146146 MENUITEM "Insert", ID_OPEN_FD2
147147 MENUITEM "Eject", ID_CLOSE_FD2
--- a/source/src/res/fm77av40ex.rc
+++ b/source/src/res/fm77av40ex.rc
@@ -128,7 +128,7 @@ BEGIN
128128 MENUITEM SEPARATOR
129129 MENUITEM "Exit", ID_EXIT
130130 END
131- POPUP "FD0"
131+ POPUP "FD1"
132132 BEGIN
133133 MENUITEM "Insert", ID_OPEN_FD1
134134 MENUITEM "Eject", ID_CLOSE_FD1
@@ -141,7 +141,7 @@ BEGIN
141141 MENUITEM SEPARATOR
142142 MENUITEM "Recent", ID_RECENT_FD1
143143 END
144- POPUP "FD1"
144+ POPUP "FD2"
145145 BEGIN
146146 MENUITEM "Insert", ID_OPEN_FD2
147147 MENUITEM "Eject", ID_CLOSE_FD2
--- a/source/src/res/fm8.rc
+++ b/source/src/res/fm8.rc
@@ -128,7 +128,7 @@ BEGIN
128128 MENUITEM SEPARATOR
129129 MENUITEM "Exit", ID_EXIT
130130 END
131- POPUP "FD0"
131+ POPUP "FD1"
132132 BEGIN
133133 MENUITEM "Insert", ID_OPEN_FD1
134134 MENUITEM "Eject", ID_CLOSE_FD1
@@ -140,7 +140,7 @@ BEGIN
140140 MENUITEM SEPARATOR
141141 MENUITEM "Recent", ID_RECENT_FD1
142142 END
143- POPUP "FD1"
143+ POPUP "FD2"
144144 BEGIN
145145 MENUITEM "Insert", ID_OPEN_FD2
146146 MENUITEM "Eject", ID_CLOSE_FD2
--- a/source/src/res/icon.txt
+++ b/source/src/res/icon.txt
@@ -44,8 +44,11 @@ PC6001MK2SR
4444 PC6601
4545 PC6601SR
4646 PC8001
47+PC8001MK2
48+PC8001MK2SR
4749 PC8201
4850 PC8801
51+PC8801MK2
4952 PC8801MA (PC8801FH)
5053 PC9801 (PC9801)
5154 PC9801E (PC98E)
--- /dev/null
+++ b/source/src/res/pc8001.rc
@@ -0,0 +1,358 @@
1+// Microsoft Visual C++ generated resource script.
2+//
3+#include "resource.h"
4+
5+#define APSTUDIO_READONLY_SYMBOLS
6+/////////////////////////////////////////////////////////////////////////////
7+//
8+// Generated from the TEXTINCLUDE 2 resource.
9+//
10+#include "afxres.h"
11+
12+/////////////////////////////////////////////////////////////////////////////
13+#undef APSTUDIO_READONLY_SYMBOLS
14+
15+/////////////////////////////////////////////////////////////////////////////
16+// Japanese resources
17+
18+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
19+#ifdef _WIN32
20+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
21+#pragma code_page(932)
22+#endif //_WIN32
23+
24+#ifdef APSTUDIO_INVOKED
25+/////////////////////////////////////////////////////////////////////////////
26+//
27+// TEXTINCLUDE
28+//
29+
30+1 TEXTINCLUDE DISCARDABLE
31+BEGIN
32+ "resource.h\0"
33+END
34+
35+2 TEXTINCLUDE DISCARDABLE
36+BEGIN
37+ "#include ""afxres.h""\r\n"
38+ "\0"
39+END
40+
41+3 TEXTINCLUDE DISCARDABLE
42+BEGIN
43+ "\r\n"
44+ "\0"
45+END
46+
47+#endif // APSTUDIO_INVOKED
48+
49+#endif // Japanese resources
50+/////////////////////////////////////////////////////////////////////////////
51+
52+
53+/////////////////////////////////////////////////////////////////////////////
54+// English (U.S.) resources
55+
56+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
57+#ifdef _WIN32
58+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
59+#pragma code_page(1252)
60+#endif //_WIN32
61+
62+/////////////////////////////////////////////////////////////////////////////
63+//
64+// Accelerator
65+//
66+
67+IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE
68+BEGIN
69+ VK_RETURN, ID_ACCEL_MOUSE, VIRTKEY, CONTROL, NOINVERT
70+ VK_RETURN, ID_ACCEL_SCREEN, VIRTKEY, ALT, NOINVERT
71+ VK_APPS, ID_ACCEL_SPEED, VIRTKEY, NOINVERT
72+ VK_APPS, ID_ACCEL_ROMAJI, VIRTKEY, CONTROL, NOINVERT
73+END
74+
75+
76+/////////////////////////////////////////////////////////////////////////////
77+//
78+// Menu
79+//
80+
81+IDR_MENU1 MENU DISCARDABLE
82+BEGIN
83+ POPUP "Control"
84+ BEGIN
85+ MENUITEM "Reset", ID_RESET
86+ MENUITEM SEPARATOR
87+ MENUITEM "CPU x1", ID_CPU_POWER0
88+ MENUITEM "CPU x2", ID_CPU_POWER1
89+ MENUITEM "CPU x4", ID_CPU_POWER2
90+ MENUITEM "CPU x8", ID_CPU_POWER3
91+ MENUITEM "CPU x16", ID_CPU_POWER4
92+ MENUITEM "Full Speed", ID_FULL_SPEED
93+ MENUITEM SEPARATOR
94+ MENUITEM "Paste", ID_AUTOKEY_START
95+ MENUITEM "Stop", ID_AUTOKEY_STOP
96+ MENUITEM "Romaji to Kana", ID_ROMAJI_TO_KANA
97+ MENUITEM SEPARATOR
98+ POPUP "Save State"
99+ BEGIN
100+ MENUITEM "State 0", ID_SAVE_STATE0
101+ MENUITEM "State 1", ID_SAVE_STATE1
102+ MENUITEM "State 2", ID_SAVE_STATE2
103+ MENUITEM "State 3", ID_SAVE_STATE3
104+ MENUITEM "State 4", ID_SAVE_STATE4
105+ MENUITEM "State 5", ID_SAVE_STATE5
106+ MENUITEM "State 6", ID_SAVE_STATE6
107+ MENUITEM "State 7", ID_SAVE_STATE7
108+ MENUITEM "State 8", ID_SAVE_STATE8
109+ MENUITEM "State 9", ID_SAVE_STATE9
110+ END
111+ POPUP "Load State"
112+ BEGIN
113+ MENUITEM "State 0", ID_LOAD_STATE0
114+ MENUITEM "State 1", ID_LOAD_STATE1
115+ MENUITEM "State 2", ID_LOAD_STATE2
116+ MENUITEM "State 3", ID_LOAD_STATE3
117+ MENUITEM "State 4", ID_LOAD_STATE4
118+ MENUITEM "State 5", ID_LOAD_STATE5
119+ MENUITEM "State 6", ID_LOAD_STATE6
120+ MENUITEM "State 7", ID_LOAD_STATE7
121+ MENUITEM "State 8", ID_LOAD_STATE8
122+ MENUITEM "State 9", ID_LOAD_STATE9
123+ END
124+ MENUITEM SEPARATOR
125+ MENUITEM "Debug Main CPU", ID_OPEN_DEBUGGER0
126+ MENUITEM "Debug PC-80S31K CPU", ID_OPEN_DEBUGGER1
127+ MENUITEM "Close Debugger", ID_CLOSE_DEBUGGER
128+ MENUITEM SEPARATOR
129+ MENUITEM "Exit", ID_EXIT
130+ END
131+ POPUP "FD1"
132+ BEGIN
133+ MENUITEM "Insert", ID_OPEN_FD1
134+ MENUITEM "Eject", ID_CLOSE_FD1
135+ MENUITEM "Insert Blank 2D Disk", ID_OPEN_BLANK_2D_FD1
136+ MENUITEM SEPARATOR
137+ MENUITEM "Write Protected", ID_WRITE_PROTECT_FD1
138+ MENUITEM "Correct Timing", ID_CORRECT_TIMING_FD1
139+ MENUITEM "Ignore CRC Errors", ID_IGNORE_CRC_FD1
140+ MENUITEM SEPARATOR
141+ MENUITEM "Recent", ID_RECENT_FD1
142+ END
143+ POPUP "FD2"
144+ BEGIN
145+ MENUITEM "Insert", ID_OPEN_FD2
146+ MENUITEM "Eject", ID_CLOSE_FD2
147+ MENUITEM "Insert Blank 2D Disk", ID_OPEN_BLANK_2D_FD2
148+ MENUITEM SEPARATOR
149+ MENUITEM "Write Protected", ID_WRITE_PROTECT_FD2
150+ MENUITEM "Correct Timing", ID_CORRECT_TIMING_FD2
151+ MENUITEM "Ignore CRC Errors", ID_IGNORE_CRC_FD2
152+ MENUITEM SEPARATOR
153+ MENUITEM "Recent", ID_RECENT_FD2
154+ END
155+ POPUP "CMT"
156+ BEGIN
157+ MENUITEM "Play", ID_PLAY_TAPE1
158+ MENUITEM "Rec", ID_REC_TAPE1
159+ MENUITEM "Eject", ID_CLOSE_TAPE1
160+ MENUITEM SEPARATOR
161+ MENUITEM "Recent", ID_RECENT_TAPE1
162+ END
163+ POPUP "Device"
164+ BEGIN
165+ POPUP "Sound"
166+ BEGIN
167+ MENUITEM "Play FDD Noise", ID_VM_SOUND_NOISE_FDD
168+ MENUITEM "Play CMT Noise", ID_VM_SOUND_NOISE_CMT, GRAYED
169+ MENUITEM "Play CMT Sound", ID_VM_SOUND_PLAY_TAPE, GRAYED
170+ END
171+ POPUP "Display"
172+ BEGIN
173+ MENUITEM "Scanline", ID_VM_MONITOR_SCANLINE
174+ END
175+ POPUP "Printer"
176+ BEGIN
177+ MENUITEM "Write Printer to File", ID_VM_PRINTER_TYPE0
178+ MENUITEM "PC-PR201", ID_VM_PRINTER_TYPE1, GRAYED
179+ MENUITEM "None", ID_VM_PRINTER_TYPE2
180+ END
181+ END
182+ POPUP "Host"
183+ BEGIN
184+ MENUITEM "Rec Movie 60fps", ID_HOST_REC_MOVIE_60FPS
185+ MENUITEM "Rec Movie 30fps", ID_HOST_REC_MOVIE_30FPS
186+ MENUITEM "Rec Movie 15fps", ID_HOST_REC_MOVIE_15FPS
187+ MENUITEM "Rec Sound", ID_HOST_REC_SOUND
188+ MENUITEM "Stop", ID_HOST_REC_STOP
189+ MENUITEM "Capture Screen", ID_HOST_CAPTURE_SCREEN
190+ MENUITEM SEPARATOR
191+ POPUP "Screen"
192+ BEGIN
193+ MENUITEM "Window x1", ID_SCREEN_WINDOW
194+ MENUITEM "Fullscreen 640x400", ID_SCREEN_FULLSCREEN
195+ MENUITEM SEPARATOR
196+ MENUITEM "Window Stretch 1", ID_SCREEN_WINDOW_STRETCH
197+ MENUITEM "Window Stretch 2", ID_SCREEN_WINDOW_ASPECT
198+ MENUITEM SEPARATOR
199+ MENUITEM "Fullscreen Stretch 1", ID_SCREEN_FULLSCREEN_DOTBYDOT
200+ MENUITEM "Fullscreen Stretch 2", ID_SCREEN_FULLSCREEN_STRETCH
201+ MENUITEM "Fullscreen Stretch 3", ID_SCREEN_FULLSCREEN_ASPECT
202+ MENUITEM "Fullscreen Stretch 4", ID_SCREEN_FULLSCREEN_FILL
203+ MENUITEM SEPARATOR
204+ MENUITEM "Rotate 0deg", ID_SCREEN_ROTATE_0
205+ MENUITEM "Rotate +90deg", ID_SCREEN_ROTATE_90
206+ MENUITEM "Rotate 180deg", ID_SCREEN_ROTATE_180
207+ MENUITEM "Rotate -90deg", ID_SCREEN_ROTATE_270
208+ END
209+ POPUP "Filter"
210+ BEGIN
211+ MENUITEM "RGB Filter", ID_FILTER_RGB
212+ MENUITEM "None", ID_FILTER_NONE
213+ END
214+ POPUP "Sound"
215+ BEGIN
216+ MENUITEM "2000Hz", ID_SOUND_FREQ0
217+ MENUITEM "4000Hz", ID_SOUND_FREQ1
218+ MENUITEM "8000Hz", ID_SOUND_FREQ2
219+ MENUITEM "11025Hz", ID_SOUND_FREQ3
220+ MENUITEM "22050Hz", ID_SOUND_FREQ4
221+ MENUITEM "44100Hz", ID_SOUND_FREQ5
222+ MENUITEM "55467Hz", ID_SOUND_FREQ6
223+ MENUITEM "96000Hz", ID_SOUND_FREQ7
224+ MENUITEM SEPARATOR
225+ MENUITEM "50msec", ID_SOUND_LATE0
226+ MENUITEM "100msec", ID_SOUND_LATE1
227+ MENUITEM "200msec", ID_SOUND_LATE2
228+ MENUITEM "300msec", ID_SOUND_LATE3
229+ MENUITEM "400msec", ID_SOUND_LATE4
230+ MENUITEM SEPARATOR
231+ MENUITEM "Realtime Mix", ID_SOUND_STRICT_RENDER
232+ MENUITEM "Light Weight Mix", ID_SOUND_LIGHT_RENDER
233+ MENUITEM SEPARATOR
234+ MENUITEM "Volume", ID_SOUND_VOLUME
235+ END
236+ POPUP "Input"
237+ BEGIN
238+ MENUITEM "Joystick #1", ID_INPUT_JOYSTICK0
239+ MENUITEM "Joystick #2", ID_INPUT_JOYSTICK1
240+ MENUITEM "Joystick To Keyboard", ID_INPUT_JOYTOKEY
241+ END
242+ MENUITEM SEPARATOR
243+ MENUITEM "Use Direct3D9", ID_HOST_USE_D3D9
244+ MENUITEM "Wait Vsync", ID_HOST_WAIT_VSYNC
245+ MENUITEM "Use DirectInput", ID_HOST_USE_DINPUT
246+ MENUITEM "Disable Windows 8 DWM", ID_HOST_DISABLE_DWM
247+ MENUITEM "Show Status Bar", ID_HOST_SHOW_STATUS_BAR
248+ END
249+END
250+
251+
252+/////////////////////////////////////////////////////////////////////////////
253+//
254+// Image
255+//
256+
257+IDI_BITMAP_ACCESS_OFF BITMAP DISCARDABLE "indicator/access_off.bmp"
258+IDI_BITMAP_ACCESS_ON BITMAP DISCARDABLE "indicator/access_on.bmp"
259+
260+
261+/////////////////////////////////////////////////////////////////////////////
262+//
263+// Icon
264+//
265+
266+// Icon with lowest ID value placed first to ensure application icon
267+// remains consistent on all systems.
268+IDI_ICON1 ICON DISCARDABLE "pc8001.ico"
269+#endif // English (U.S.) resources
270+/////////////////////////////////////////////////////////////////////////////
271+
272+
273+/////////////////////////////////////////////////////////////////////////////
274+//
275+// Dialog
276+//
277+
278+IDD_VOLUME DIALOG DISCARDABLE 0, 0, 250, 120
279+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
280+CAPTION "Volume"
281+FONT 9, "MS PGothic"
282+BEGIN
283+ LTEXT "Sound Device #1",IDC_VOLUME_CAPTION0,6,6,60,8
284+ CONTROL "",IDC_VOLUME_PARAM_L0,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,6,175,12
285+ CONTROL "",IDC_VOLUME_PARAM_R0,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,21,175,12
286+ LTEXT "Sound Device #2",IDC_VOLUME_CAPTION1,6,36,60,8
287+ CONTROL "",IDC_VOLUME_PARAM_L1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,36,175,12
288+ CONTROL "",IDC_VOLUME_PARAM_R1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,51,175,12
289+ LTEXT "Sound Device #3",IDC_VOLUME_CAPTION2,6,66,60,8
290+ CONTROL "",IDC_VOLUME_PARAM_L2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,66,175,12
291+ CONTROL "",IDC_VOLUME_PARAM_R2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,81,175,12
292+ DEFPUSHBUTTON "OK",IDOK,70,100,50,14
293+ DEFPUSHBUTTON "Reset",IDC_VOLUME_RESET,130,100,50,14
294+END
295+
296+IDD_JOYSTICK DIALOG DISCARDABLE 0, 0, 175, 120
297+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
298+CAPTION "Joystick #1"
299+FONT 9, "MS PGothic"
300+BEGIN
301+ LTEXT "Button #1",IDC_JOYSTICK_CAPTION0,6,6,40,8
302+ EDITTEXT IDC_JOYSTICK_PARAM0,50,4,120,14,ES_MULTILINE
303+ LTEXT "Button #2",IDC_JOYSTICK_CAPTION1,6,21,40,8
304+ EDITTEXT IDC_JOYSTICK_PARAM1,50,19,120,14,ES_MULTILINE
305+ LTEXT "Button #3",IDC_JOYSTICK_CAPTION2,6,36,40,8
306+ EDITTEXT IDC_JOYSTICK_PARAM2,50,34,120,14,ES_MULTILINE
307+ LTEXT "Button #4",IDC_JOYSTICK_CAPTION3,6,51,40,8
308+ EDITTEXT IDC_JOYSTICK_PARAM3,50,49,120,14,ES_MULTILINE
309+ LTEXT "Button #5",IDC_JOYSTICK_CAPTION4,6,66,40,8
310+ EDITTEXT IDC_JOYSTICK_PARAM4,50,64,120,14,ES_MULTILINE
311+ LTEXT "Button #6",IDC_JOYSTICK_CAPTION5,6,81,40,8
312+ EDITTEXT IDC_JOYSTICK_PARAM5,50,79,120,14,ES_MULTILINE
313+ DEFPUSHBUTTON "OK",IDOK,35,100,50,14
314+ DEFPUSHBUTTON "Reset",IDC_JOYSTICK_RESET,90,100,50,14
315+END
316+
317+IDD_JOYTOKEY DIALOG DISCARDABLE 0, 0, 175, 235
318+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
319+CAPTION "Joystick To Keyboard"
320+FONT 9, "MS PGothic"
321+BEGIN
322+ CONTROL "Enable Joystick To Keyboard",IDC_JOYTOKEY_CHECK0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,164,8
323+ CONTROL "Cursor Key",IDC_JOYTOKEY_RADIO0,"Button",BS_AUTORADIOBUTTON,6,26,164,7
324+ CONTROL "NumPad Key (4-Directions)",IDC_JOYTOKEY_RADIO1,"Button",BS_AUTORADIOBUTTON,6,41,164,7
325+ CONTROL "NumPad Key (8-Directions)",IDC_JOYTOKEY_RADIO2,"Button",BS_AUTORADIOBUTTON,6,56,164,7
326+ CONTROL "Press NumPad 5 To Release Stick",IDC_JOYTOKEY_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,71,164,8
327+ LTEXT "Button #1",IDC_JOYSTICK_CAPTION0,6,91,40,8
328+ EDITTEXT IDC_JOYSTICK_PARAM0,50,89,120,14,ES_MULTILINE
329+ LTEXT "Button #2",IDC_JOYSTICK_CAPTION1,6,106,40,8
330+ EDITTEXT IDC_JOYSTICK_PARAM1,50,104,120,14,ES_MULTILINE
331+ LTEXT "Button #3",IDC_JOYSTICK_CAPTION2,6,121,40,8
332+ EDITTEXT IDC_JOYSTICK_PARAM2,50,119,120,14,ES_MULTILINE
333+ LTEXT "Button #4",IDC_JOYSTICK_CAPTION3,6,136,40,8
334+ EDITTEXT IDC_JOYSTICK_PARAM3,50,134,120,14,ES_MULTILINE
335+ LTEXT "Button #5",IDC_JOYSTICK_CAPTION4,6,151,40,8
336+ EDITTEXT IDC_JOYSTICK_PARAM4,50,149,120,14,ES_MULTILINE
337+ LTEXT "Button #6",IDC_JOYSTICK_CAPTION5,6,166,40,8
338+ EDITTEXT IDC_JOYSTICK_PARAM5,50,164,120,14,ES_MULTILINE
339+ LTEXT "Button #7",IDC_JOYSTICK_CAPTION6,6,181,40,8
340+ EDITTEXT IDC_JOYSTICK_PARAM6,50,179,120,14,ES_MULTILINE
341+ LTEXT "Button #8",IDC_JOYSTICK_CAPTION7,6,196,40,8
342+ EDITTEXT IDC_JOYSTICK_PARAM7,50,194,120,14,ES_MULTILINE
343+ DEFPUSHBUTTON "OK",IDOK,35,215,50,14
344+ DEFPUSHBUTTON "Reset",IDC_JOYSTICK_RESET,90,215,50,14
345+END
346+
347+
348+
349+#ifndef APSTUDIO_INVOKED
350+/////////////////////////////////////////////////////////////////////////////
351+//
352+// Generated from the TEXTINCLUDE 3 resource.
353+//
354+
355+
356+/////////////////////////////////////////////////////////////////////////////
357+#endif // not APSTUDIO_INVOKED
358+
Binary files /dev/null and b/source/src/res/pc8001mk2.ico differ
--- /dev/null
+++ b/source/src/res/pc8001mk2.rc
@@ -0,0 +1,378 @@
1+// Microsoft Visual C++ generated resource script.
2+//
3+#include "resource.h"
4+
5+#define APSTUDIO_READONLY_SYMBOLS
6+/////////////////////////////////////////////////////////////////////////////
7+//
8+// Generated from the TEXTINCLUDE 2 resource.
9+//
10+#include "afxres.h"
11+
12+/////////////////////////////////////////////////////////////////////////////
13+#undef APSTUDIO_READONLY_SYMBOLS
14+
15+/////////////////////////////////////////////////////////////////////////////
16+// Japanese resources
17+
18+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
19+#ifdef _WIN32
20+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
21+#pragma code_page(932)
22+#endif //_WIN32
23+
24+#ifdef APSTUDIO_INVOKED
25+/////////////////////////////////////////////////////////////////////////////
26+//
27+// TEXTINCLUDE
28+//
29+
30+1 TEXTINCLUDE DISCARDABLE
31+BEGIN
32+ "resource.h\0"
33+END
34+
35+2 TEXTINCLUDE DISCARDABLE
36+BEGIN
37+ "#include ""afxres.h""\r\n"
38+ "\0"
39+END
40+
41+3 TEXTINCLUDE DISCARDABLE
42+BEGIN
43+ "\r\n"
44+ "\0"
45+END
46+
47+#endif // APSTUDIO_INVOKED
48+
49+#endif // Japanese resources
50+/////////////////////////////////////////////////////////////////////////////
51+
52+
53+/////////////////////////////////////////////////////////////////////////////
54+// English (U.S.) resources
55+
56+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
57+#ifdef _WIN32
58+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
59+#pragma code_page(1252)
60+#endif //_WIN32
61+
62+/////////////////////////////////////////////////////////////////////////////
63+//
64+// Accelerator
65+//
66+
67+IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE
68+BEGIN
69+ VK_RETURN, ID_ACCEL_MOUSE, VIRTKEY, CONTROL, NOINVERT
70+ VK_RETURN, ID_ACCEL_SCREEN, VIRTKEY, ALT, NOINVERT
71+ VK_APPS, ID_ACCEL_SPEED, VIRTKEY, NOINVERT
72+ VK_APPS, ID_ACCEL_ROMAJI, VIRTKEY, CONTROL, NOINVERT
73+END
74+
75+
76+/////////////////////////////////////////////////////////////////////////////
77+//
78+// Menu
79+//
80+
81+IDR_MENU1 MENU DISCARDABLE
82+BEGIN
83+ POPUP "Control"
84+ BEGIN
85+ MENUITEM "Reset", ID_RESET
86+ MENUITEM SEPARATOR
87+ MENUITEM "CPU x1", ID_CPU_POWER0
88+ MENUITEM "CPU x2", ID_CPU_POWER1
89+ MENUITEM "CPU x4", ID_CPU_POWER2
90+ MENUITEM "CPU x8", ID_CPU_POWER3
91+ MENUITEM "CPU x16", ID_CPU_POWER4
92+ MENUITEM "Full Speed", ID_FULL_SPEED
93+ MENUITEM SEPARATOR
94+ MENUITEM "Paste", ID_AUTOKEY_START
95+ MENUITEM "Stop", ID_AUTOKEY_STOP
96+ MENUITEM "Romaji to Kana", ID_ROMAJI_TO_KANA
97+ MENUITEM SEPARATOR
98+ POPUP "Save State"
99+ BEGIN
100+ MENUITEM "State 0", ID_SAVE_STATE0
101+ MENUITEM "State 1", ID_SAVE_STATE1
102+ MENUITEM "State 2", ID_SAVE_STATE2
103+ MENUITEM "State 3", ID_SAVE_STATE3
104+ MENUITEM "State 4", ID_SAVE_STATE4
105+ MENUITEM "State 5", ID_SAVE_STATE5
106+ MENUITEM "State 6", ID_SAVE_STATE6
107+ MENUITEM "State 7", ID_SAVE_STATE7
108+ MENUITEM "State 8", ID_SAVE_STATE8
109+ MENUITEM "State 9", ID_SAVE_STATE9
110+ END
111+ POPUP "Load State"
112+ BEGIN
113+ MENUITEM "State 0", ID_LOAD_STATE0
114+ MENUITEM "State 1", ID_LOAD_STATE1
115+ MENUITEM "State 2", ID_LOAD_STATE2
116+ MENUITEM "State 3", ID_LOAD_STATE3
117+ MENUITEM "State 4", ID_LOAD_STATE4
118+ MENUITEM "State 5", ID_LOAD_STATE5
119+ MENUITEM "State 6", ID_LOAD_STATE6
120+ MENUITEM "State 7", ID_LOAD_STATE7
121+ MENUITEM "State 8", ID_LOAD_STATE8
122+ MENUITEM "State 9", ID_LOAD_STATE9
123+ END
124+ MENUITEM SEPARATOR
125+ MENUITEM "Debug Main CPU", ID_OPEN_DEBUGGER0
126+ MENUITEM "Debug PC-80S31K CPU", ID_OPEN_DEBUGGER1
127+ MENUITEM "Close Debugger", ID_CLOSE_DEBUGGER
128+ MENUITEM SEPARATOR
129+ MENUITEM "Exit", ID_EXIT
130+ END
131+ POPUP "FD1"
132+ BEGIN
133+ MENUITEM "Insert", ID_OPEN_FD1
134+ MENUITEM "Eject", ID_CLOSE_FD1
135+ MENUITEM "Insert Blank 2D Disk", ID_OPEN_BLANK_2D_FD1
136+ MENUITEM SEPARATOR
137+ MENUITEM "Write Protected", ID_WRITE_PROTECT_FD1
138+ MENUITEM "Correct Timing", ID_CORRECT_TIMING_FD1
139+ MENUITEM "Ignore CRC Errors", ID_IGNORE_CRC_FD1
140+ MENUITEM SEPARATOR
141+ MENUITEM "Recent", ID_RECENT_FD1
142+ END
143+ POPUP "FD2"
144+ BEGIN
145+ MENUITEM "Insert", ID_OPEN_FD2
146+ MENUITEM "Eject", ID_CLOSE_FD2
147+ MENUITEM "Insert Blank 2D Disk", ID_OPEN_BLANK_2D_FD2
148+ MENUITEM SEPARATOR
149+ MENUITEM "Write Protected", ID_WRITE_PROTECT_FD2
150+ MENUITEM "Correct Timing", ID_CORRECT_TIMING_FD2
151+ MENUITEM "Ignore CRC Errors", ID_IGNORE_CRC_FD2
152+ MENUITEM SEPARATOR
153+ MENUITEM "Recent", ID_RECENT_FD2
154+ END
155+ POPUP "CMT"
156+ BEGIN
157+ MENUITEM "Play", ID_PLAY_TAPE1
158+ MENUITEM "Rec", ID_REC_TAPE1
159+ MENUITEM "Eject", ID_CLOSE_TAPE1
160+ MENUITEM SEPARATOR
161+ MENUITEM "Recent", ID_RECENT_TAPE1
162+ END
163+ POPUP "Device"
164+ BEGIN
165+ POPUP "Boot"
166+ BEGIN
167+ MENUITEM "N80 mode" ID_VM_BOOT_MODE0
168+ MENUITEM "N mode" ID_VM_BOOT_MODE2
169+ END
170+ POPUP "Sound"
171+ BEGIN
172+ MENUITEM "OPN", ID_VM_SOUND_TYPE0
173+ MENUITEM "OPNA", ID_VM_SOUND_TYPE1
174+ MENUITEM SEPARATOR
175+ MENUITEM "Play FDD Noise", ID_VM_SOUND_NOISE_FDD
176+ MENUITEM "Play CMT Noise", ID_VM_SOUND_NOISE_CMT, GRAYED
177+ MENUITEM "Play CMT Sound", ID_VM_SOUND_PLAY_TAPE, GRAYED
178+ END
179+ POPUP "Display"
180+ BEGIN
181+ MENUITEM "Scanline", ID_VM_MONITOR_SCANLINE
182+ END
183+ POPUP "Printer"
184+ BEGIN
185+ MENUITEM "Write Printer to File", ID_VM_PRINTER_TYPE0
186+ MENUITEM "PC-PR201", ID_VM_PRINTER_TYPE1, GRAYED
187+ MENUITEM "None", ID_VM_PRINTER_TYPE2
188+ END
189+ END
190+ POPUP "Host"
191+ BEGIN
192+ MENUITEM "Rec Movie 60fps", ID_HOST_REC_MOVIE_60FPS
193+ MENUITEM "Rec Movie 30fps", ID_HOST_REC_MOVIE_30FPS
194+ MENUITEM "Rec Movie 15fps", ID_HOST_REC_MOVIE_15FPS
195+ MENUITEM "Rec Sound", ID_HOST_REC_SOUND
196+ MENUITEM "Stop", ID_HOST_REC_STOP
197+ MENUITEM "Capture Screen", ID_HOST_CAPTURE_SCREEN
198+ MENUITEM SEPARATOR
199+ POPUP "Screen"
200+ BEGIN
201+ MENUITEM "Window x1", ID_SCREEN_WINDOW
202+ MENUITEM "Fullscreen 640x400", ID_SCREEN_FULLSCREEN
203+ MENUITEM SEPARATOR
204+ MENUITEM "Window Stretch 1", ID_SCREEN_WINDOW_STRETCH
205+ MENUITEM "Window Stretch 2", ID_SCREEN_WINDOW_ASPECT
206+ MENUITEM SEPARATOR
207+ MENUITEM "Fullscreen Stretch 1", ID_SCREEN_FULLSCREEN_DOTBYDOT
208+ MENUITEM "Fullscreen Stretch 2", ID_SCREEN_FULLSCREEN_STRETCH
209+ MENUITEM "Fullscreen Stretch 3", ID_SCREEN_FULLSCREEN_ASPECT
210+ MENUITEM "Fullscreen Stretch 4", ID_SCREEN_FULLSCREEN_FILL
211+ MENUITEM SEPARATOR
212+ MENUITEM "Rotate 0deg", ID_SCREEN_ROTATE_0
213+ MENUITEM "Rotate +90deg", ID_SCREEN_ROTATE_90
214+ MENUITEM "Rotate 180deg", ID_SCREEN_ROTATE_180
215+ MENUITEM "Rotate -90deg", ID_SCREEN_ROTATE_270
216+ END
217+ POPUP "Filter"
218+ BEGIN
219+ MENUITEM "RGB Filter", ID_FILTER_RGB
220+ MENUITEM "None", ID_FILTER_NONE
221+ END
222+ POPUP "Sound"
223+ BEGIN
224+ MENUITEM "2000Hz", ID_SOUND_FREQ0
225+ MENUITEM "4000Hz", ID_SOUND_FREQ1
226+ MENUITEM "8000Hz", ID_SOUND_FREQ2
227+ MENUITEM "11025Hz", ID_SOUND_FREQ3
228+ MENUITEM "22050Hz", ID_SOUND_FREQ4
229+ MENUITEM "44100Hz", ID_SOUND_FREQ5
230+ MENUITEM "55467Hz", ID_SOUND_FREQ6
231+ MENUITEM "96000Hz", ID_SOUND_FREQ7
232+ MENUITEM SEPARATOR
233+ MENUITEM "50msec", ID_SOUND_LATE0
234+ MENUITEM "100msec", ID_SOUND_LATE1
235+ MENUITEM "200msec", ID_SOUND_LATE2
236+ MENUITEM "300msec", ID_SOUND_LATE3
237+ MENUITEM "400msec", ID_SOUND_LATE4
238+ MENUITEM SEPARATOR
239+ MENUITEM "Realtime Mix", ID_SOUND_STRICT_RENDER
240+ MENUITEM "Light Weight Mix", ID_SOUND_LIGHT_RENDER
241+ MENUITEM SEPARATOR
242+ MENUITEM "Volume", ID_SOUND_VOLUME
243+ END
244+ POPUP "Input"
245+ BEGIN
246+ MENUITEM "Joystick #1", ID_INPUT_JOYSTICK0
247+ MENUITEM "Joystick #2", ID_INPUT_JOYSTICK1
248+ MENUITEM "Joystick To Keyboard", ID_INPUT_JOYTOKEY
249+ END
250+ MENUITEM SEPARATOR
251+ MENUITEM "Use Direct3D9", ID_HOST_USE_D3D9
252+ MENUITEM "Wait Vsync", ID_HOST_WAIT_VSYNC
253+ MENUITEM "Use DirectInput", ID_HOST_USE_DINPUT
254+ MENUITEM "Disable Windows 8 DWM", ID_HOST_DISABLE_DWM
255+ MENUITEM "Show Status Bar", ID_HOST_SHOW_STATUS_BAR
256+ END
257+END
258+
259+
260+/////////////////////////////////////////////////////////////////////////////
261+//
262+// Image
263+//
264+
265+IDI_BITMAP_ACCESS_OFF BITMAP DISCARDABLE "indicator/access_off.bmp"
266+IDI_BITMAP_ACCESS_ON BITMAP DISCARDABLE "indicator/access_on.bmp"
267+
268+
269+/////////////////////////////////////////////////////////////////////////////
270+//
271+// Icon
272+//
273+
274+// Icon with lowest ID value placed first to ensure application icon
275+// remains consistent on all systems.
276+IDI_ICON1 ICON DISCARDABLE "pc8001mk2.ico"
277+#endif // English (U.S.) resources
278+/////////////////////////////////////////////////////////////////////////////
279+
280+
281+/////////////////////////////////////////////////////////////////////////////
282+//
283+// Dialog
284+//
285+
286+IDD_VOLUME DIALOG DISCARDABLE 0, 0, 250, 240
287+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
288+CAPTION "Volume"
289+FONT 9, "MS PGothic"
290+BEGIN
291+ LTEXT "Sound Device #1",IDC_VOLUME_CAPTION0,6,6,60,8
292+ CONTROL "",IDC_VOLUME_PARAM_L0,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,6,175,12
293+ CONTROL "",IDC_VOLUME_PARAM_R0,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,21,175,12
294+ LTEXT "Sound Device #2",IDC_VOLUME_CAPTION1,6,36,60,8
295+ CONTROL "",IDC_VOLUME_PARAM_L1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,36,175,12
296+ CONTROL "",IDC_VOLUME_PARAM_R1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,51,175,12
297+ LTEXT "Sound Device #3",IDC_VOLUME_CAPTION2,6,66,60,8
298+ CONTROL "",IDC_VOLUME_PARAM_L2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,66,175,12
299+ CONTROL "",IDC_VOLUME_PARAM_R2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,81,175,12
300+ LTEXT "Sound Device #4",IDC_VOLUME_CAPTION3,6,96,60,8
301+ CONTROL "",IDC_VOLUME_PARAM_L3,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,96,175,12
302+ CONTROL "",IDC_VOLUME_PARAM_R3,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,111,175,12
303+ LTEXT "Sound Device #5",IDC_VOLUME_CAPTION4,6,126,60,8
304+ CONTROL "",IDC_VOLUME_PARAM_L4,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,126,175,12
305+ CONTROL "",IDC_VOLUME_PARAM_R4,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,141,175,12
306+ LTEXT "Sound Device #6",IDC_VOLUME_CAPTION5,6,156,60,8
307+ CONTROL "",IDC_VOLUME_PARAM_L5,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,156,175,12
308+ CONTROL "",IDC_VOLUME_PARAM_R5,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,171,175,12
309+ LTEXT "Sound Device #7",IDC_VOLUME_CAPTION6,6,186,60,8
310+ CONTROL "",IDC_VOLUME_PARAM_L6,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,186,175,12
311+ CONTROL "",IDC_VOLUME_PARAM_R6,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,201,175,12
312+ DEFPUSHBUTTON "OK",IDOK,70,220,50,14
313+ DEFPUSHBUTTON "Reset",IDC_VOLUME_RESET,130,220,50,14
314+END
315+
316+IDD_JOYSTICK DIALOG DISCARDABLE 0, 0, 175, 120
317+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
318+CAPTION "Joystick #1"
319+FONT 9, "MS PGothic"
320+BEGIN
321+ LTEXT "Button #1",IDC_JOYSTICK_CAPTION0,6,6,40,8
322+ EDITTEXT IDC_JOYSTICK_PARAM0,50,4,120,14,ES_MULTILINE
323+ LTEXT "Button #2",IDC_JOYSTICK_CAPTION1,6,21,40,8
324+ EDITTEXT IDC_JOYSTICK_PARAM1,50,19,120,14,ES_MULTILINE
325+ LTEXT "Button #3",IDC_JOYSTICK_CAPTION2,6,36,40,8
326+ EDITTEXT IDC_JOYSTICK_PARAM2,50,34,120,14,ES_MULTILINE
327+ LTEXT "Button #4",IDC_JOYSTICK_CAPTION3,6,51,40,8
328+ EDITTEXT IDC_JOYSTICK_PARAM3,50,49,120,14,ES_MULTILINE
329+ LTEXT "Button #5",IDC_JOYSTICK_CAPTION4,6,66,40,8
330+ EDITTEXT IDC_JOYSTICK_PARAM4,50,64,120,14,ES_MULTILINE
331+ LTEXT "Button #6",IDC_JOYSTICK_CAPTION5,6,81,40,8
332+ EDITTEXT IDC_JOYSTICK_PARAM5,50,79,120,14,ES_MULTILINE
333+ DEFPUSHBUTTON "OK",IDOK,35,100,50,14
334+ DEFPUSHBUTTON "Reset",IDC_JOYSTICK_RESET,90,100,50,14
335+END
336+
337+IDD_JOYTOKEY DIALOG DISCARDABLE 0, 0, 175, 235
338+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
339+CAPTION "Joystick To Keyboard"
340+FONT 9, "MS PGothic"
341+BEGIN
342+ CONTROL "Enable Joystick To Keyboard",IDC_JOYTOKEY_CHECK0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,164,8
343+ CONTROL "Cursor Key",IDC_JOYTOKEY_RADIO0,"Button",BS_AUTORADIOBUTTON,6,26,164,7
344+ CONTROL "NumPad Key (4-Directions)",IDC_JOYTOKEY_RADIO1,"Button",BS_AUTORADIOBUTTON,6,41,164,7
345+ CONTROL "NumPad Key (8-Directions)",IDC_JOYTOKEY_RADIO2,"Button",BS_AUTORADIOBUTTON,6,56,164,7
346+ CONTROL "Press NumPad 5 To Release Stick",IDC_JOYTOKEY_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,71,164,8
347+ LTEXT "Button #1",IDC_JOYSTICK_CAPTION0,6,91,40,8
348+ EDITTEXT IDC_JOYSTICK_PARAM0,50,89,120,14,ES_MULTILINE
349+ LTEXT "Button #2",IDC_JOYSTICK_CAPTION1,6,106,40,8
350+ EDITTEXT IDC_JOYSTICK_PARAM1,50,104,120,14,ES_MULTILINE
351+ LTEXT "Button #3",IDC_JOYSTICK_CAPTION2,6,121,40,8
352+ EDITTEXT IDC_JOYSTICK_PARAM2,50,119,120,14,ES_MULTILINE
353+ LTEXT "Button #4",IDC_JOYSTICK_CAPTION3,6,136,40,8
354+ EDITTEXT IDC_JOYSTICK_PARAM3,50,134,120,14,ES_MULTILINE
355+ LTEXT "Button #5",IDC_JOYSTICK_CAPTION4,6,151,40,8
356+ EDITTEXT IDC_JOYSTICK_PARAM4,50,149,120,14,ES_MULTILINE
357+ LTEXT "Button #6",IDC_JOYSTICK_CAPTION5,6,166,40,8
358+ EDITTEXT IDC_JOYSTICK_PARAM5,50,164,120,14,ES_MULTILINE
359+ LTEXT "Button #7",IDC_JOYSTICK_CAPTION6,6,181,40,8
360+ EDITTEXT IDC_JOYSTICK_PARAM6,50,179,120,14,ES_MULTILINE
361+ LTEXT "Button #8",IDC_JOYSTICK_CAPTION7,6,196,40,8
362+ EDITTEXT IDC_JOYSTICK_PARAM7,50,194,120,14,ES_MULTILINE
363+ DEFPUSHBUTTON "OK",IDOK,35,215,50,14
364+ DEFPUSHBUTTON "Reset",IDC_JOYSTICK_RESET,90,215,50,14
365+END
366+
367+
368+
369+#ifndef APSTUDIO_INVOKED
370+/////////////////////////////////////////////////////////////////////////////
371+//
372+// Generated from the TEXTINCLUDE 3 resource.
373+//
374+
375+
376+/////////////////////////////////////////////////////////////////////////////
377+#endif // not APSTUDIO_INVOKED
378+
--- a/source/src/res/pc8001mk2sr.rc
+++ b/source/src/res/pc8001mk2sr.rc
@@ -97,29 +97,29 @@ BEGIN
9797 MENUITEM SEPARATOR
9898 POPUP "Save State"
9999 BEGIN
100- MENUITEM "State 0", ID_SAVE_STATE0
101- MENUITEM "State 1", ID_SAVE_STATE1
102- MENUITEM "State 2", ID_SAVE_STATE2
103- MENUITEM "State 3", ID_SAVE_STATE3
104- MENUITEM "State 4", ID_SAVE_STATE4
105- MENUITEM "State 5", ID_SAVE_STATE5
106- MENUITEM "State 6", ID_SAVE_STATE6
107- MENUITEM "State 7", ID_SAVE_STATE7
108- MENUITEM "State 8", ID_SAVE_STATE8
109- MENUITEM "State 9", ID_SAVE_STATE9
100+ MENUITEM "State 0", ID_SAVE_STATE0
101+ MENUITEM "State 1", ID_SAVE_STATE1
102+ MENUITEM "State 2", ID_SAVE_STATE2
103+ MENUITEM "State 3", ID_SAVE_STATE3
104+ MENUITEM "State 4", ID_SAVE_STATE4
105+ MENUITEM "State 5", ID_SAVE_STATE5
106+ MENUITEM "State 6", ID_SAVE_STATE6
107+ MENUITEM "State 7", ID_SAVE_STATE7
108+ MENUITEM "State 8", ID_SAVE_STATE8
109+ MENUITEM "State 9", ID_SAVE_STATE9
110110 END
111111 POPUP "Load State"
112112 BEGIN
113- MENUITEM "State 0", ID_LOAD_STATE0
114- MENUITEM "State 1", ID_LOAD_STATE1
115- MENUITEM "State 2", ID_LOAD_STATE2
116- MENUITEM "State 3", ID_LOAD_STATE3
117- MENUITEM "State 4", ID_LOAD_STATE4
118- MENUITEM "State 5", ID_LOAD_STATE5
119- MENUITEM "State 6", ID_LOAD_STATE6
120- MENUITEM "State 7", ID_LOAD_STATE7
121- MENUITEM "State 8", ID_LOAD_STATE8
122- MENUITEM "State 9", ID_LOAD_STATE9
113+ MENUITEM "State 0", ID_LOAD_STATE0
114+ MENUITEM "State 1", ID_LOAD_STATE1
115+ MENUITEM "State 2", ID_LOAD_STATE2
116+ MENUITEM "State 3", ID_LOAD_STATE3
117+ MENUITEM "State 4", ID_LOAD_STATE4
118+ MENUITEM "State 5", ID_LOAD_STATE5
119+ MENUITEM "State 6", ID_LOAD_STATE6
120+ MENUITEM "State 7", ID_LOAD_STATE7
121+ MENUITEM "State 8", ID_LOAD_STATE8
122+ MENUITEM "State 9", ID_LOAD_STATE9
123123 END
124124 MENUITEM SEPARATOR
125125 MENUITEM "Debug Main CPU", ID_OPEN_DEBUGGER0
@@ -170,28 +170,27 @@ BEGIN
170170 END
171171 POPUP "DIP Switch"
172172 BEGIN
173- MENUITEM "Memory Wait", ID_VM_DIPSWITCH0
174- END
175- POPUP "Joystick"
176- BEGIN
177- MENUITEM "Joystick" ID_VM_JOYSTICK_TYPE0
178- MENUITEM "Bus Mouse" ID_VM_JOYSTICK_TYPE1
173+ MENUITEM "Memory Wait", ID_VM_DIPSWITCH0
179174 END
180175 POPUP "Sound"
181176 BEGIN
182- MENUITEM "Play FDD Noise", ID_VM_SOUND_NOISE_FDD
183- MENUITEM "Play CMT Noise", ID_VM_SOUND_NOISE_CMT, GRAYED
184- MENUITEM "Play CMT Sound", ID_VM_SOUND_PLAY_TAPE, GRAYED
177+ MENUITEM "OPN", ID_VM_SOUND_TYPE0
178+ MENUITEM "OPN+OPN", ID_VM_SOUND_TYPE1
179+ MENUITEM "OPN+OPNA", ID_VM_SOUND_TYPE2
180+ MENUITEM SEPARATOR
181+ MENUITEM "Play FDD Noise", ID_VM_SOUND_NOISE_FDD
182+ MENUITEM "Play CMT Noise", ID_VM_SOUND_NOISE_CMT, GRAYED
183+ MENUITEM "Play CMT Sound", ID_VM_SOUND_PLAY_TAPE, GRAYED
185184 END
186185 POPUP "Display"
187186 BEGIN
188- MENUITEM "Scanline", ID_VM_MONITOR_SCANLINE
187+ MENUITEM "Scanline", ID_VM_MONITOR_SCANLINE
189188 END
190189 POPUP "Printer"
191190 BEGIN
192- MENUITEM "Write Printer to File", ID_VM_PRINTER_TYPE0
193- MENUITEM "PC-PR201", ID_VM_PRINTER_TYPE1, GRAYED
194- MENUITEM "None", ID_VM_PRINTER_TYPE2
191+ MENUITEM "Write Printer to File", ID_VM_PRINTER_TYPE0
192+ MENUITEM "PC-PR201", ID_VM_PRINTER_TYPE1, GRAYED
193+ MENUITEM "None", ID_VM_PRINTER_TYPE2
195194 END
196195 END
197196 POPUP "Host"
@@ -205,54 +204,54 @@ BEGIN
205204 MENUITEM SEPARATOR
206205 POPUP "Screen"
207206 BEGIN
208- MENUITEM "Window x1", ID_SCREEN_WINDOW
209- MENUITEM "Fullscreen 640x400", ID_SCREEN_FULLSCREEN
207+ MENUITEM "Window x1", ID_SCREEN_WINDOW
208+ MENUITEM "Fullscreen 640x400", ID_SCREEN_FULLSCREEN
210209 MENUITEM SEPARATOR
211- MENUITEM "Window Stretch 1", ID_SCREEN_WINDOW_STRETCH
212- MENUITEM "Window Stretch 2", ID_SCREEN_WINDOW_ASPECT
210+ MENUITEM "Window Stretch 1", ID_SCREEN_WINDOW_STRETCH
211+ MENUITEM "Window Stretch 2", ID_SCREEN_WINDOW_ASPECT
213212 MENUITEM SEPARATOR
214- MENUITEM "Fullscreen Stretch 1", ID_SCREEN_FULLSCREEN_DOTBYDOT
215- MENUITEM "Fullscreen Stretch 2", ID_SCREEN_FULLSCREEN_STRETCH
216- MENUITEM "Fullscreen Stretch 3", ID_SCREEN_FULLSCREEN_ASPECT
217- MENUITEM "Fullscreen Stretch 4", ID_SCREEN_FULLSCREEN_FILL
213+ MENUITEM "Fullscreen Stretch 1", ID_SCREEN_FULLSCREEN_DOTBYDOT
214+ MENUITEM "Fullscreen Stretch 2", ID_SCREEN_FULLSCREEN_STRETCH
215+ MENUITEM "Fullscreen Stretch 3", ID_SCREEN_FULLSCREEN_ASPECT
216+ MENUITEM "Fullscreen Stretch 4", ID_SCREEN_FULLSCREEN_FILL
218217 MENUITEM SEPARATOR
219- MENUITEM "Rotate 0deg", ID_SCREEN_ROTATE_0
220- MENUITEM "Rotate +90deg", ID_SCREEN_ROTATE_90
221- MENUITEM "Rotate 180deg", ID_SCREEN_ROTATE_180
222- MENUITEM "Rotate -90deg", ID_SCREEN_ROTATE_270
218+ MENUITEM "Rotate 0deg", ID_SCREEN_ROTATE_0
219+ MENUITEM "Rotate +90deg", ID_SCREEN_ROTATE_90
220+ MENUITEM "Rotate 180deg", ID_SCREEN_ROTATE_180
221+ MENUITEM "Rotate -90deg", ID_SCREEN_ROTATE_270
223222 END
224223 POPUP "Filter"
225224 BEGIN
226- MENUITEM "RGB Filter", ID_FILTER_RGB
227- MENUITEM "None", ID_FILTER_NONE
225+ MENUITEM "RGB Filter", ID_FILTER_RGB
226+ MENUITEM "None", ID_FILTER_NONE
228227 END
229228 POPUP "Sound"
230229 BEGIN
231- MENUITEM "2000Hz", ID_SOUND_FREQ0
232- MENUITEM "4000Hz", ID_SOUND_FREQ1
233- MENUITEM "8000Hz", ID_SOUND_FREQ2
234- MENUITEM "11025Hz", ID_SOUND_FREQ3
235- MENUITEM "22050Hz", ID_SOUND_FREQ4
236- MENUITEM "44100Hz", ID_SOUND_FREQ5
237- MENUITEM "55467Hz", ID_SOUND_FREQ6
238- MENUITEM "96000Hz", ID_SOUND_FREQ7
230+ MENUITEM "2000Hz", ID_SOUND_FREQ0
231+ MENUITEM "4000Hz", ID_SOUND_FREQ1
232+ MENUITEM "8000Hz", ID_SOUND_FREQ2
233+ MENUITEM "11025Hz", ID_SOUND_FREQ3
234+ MENUITEM "22050Hz", ID_SOUND_FREQ4
235+ MENUITEM "44100Hz", ID_SOUND_FREQ5
236+ MENUITEM "55467Hz", ID_SOUND_FREQ6
237+ MENUITEM "96000Hz", ID_SOUND_FREQ7
239238 MENUITEM SEPARATOR
240- MENUITEM "50msec", ID_SOUND_LATE0
241- MENUITEM "100msec", ID_SOUND_LATE1
242- MENUITEM "200msec", ID_SOUND_LATE2
243- MENUITEM "300msec", ID_SOUND_LATE3
244- MENUITEM "400msec", ID_SOUND_LATE4
239+ MENUITEM "50msec", ID_SOUND_LATE0
240+ MENUITEM "100msec", ID_SOUND_LATE1
241+ MENUITEM "200msec", ID_SOUND_LATE2
242+ MENUITEM "300msec", ID_SOUND_LATE3
243+ MENUITEM "400msec", ID_SOUND_LATE4
245244 MENUITEM SEPARATOR
246- MENUITEM "Realtime Mix", ID_SOUND_STRICT_RENDER
247- MENUITEM "Light Weight Mix", ID_SOUND_LIGHT_RENDER
245+ MENUITEM "Realtime Mix", ID_SOUND_STRICT_RENDER
246+ MENUITEM "Light Weight Mix", ID_SOUND_LIGHT_RENDER
248247 MENUITEM SEPARATOR
249- MENUITEM "Volume", ID_SOUND_VOLUME
248+ MENUITEM "Volume", ID_SOUND_VOLUME
250249 END
251250 POPUP "Input"
252251 BEGIN
253- MENUITEM "Joystick #1", ID_INPUT_JOYSTICK0
254- MENUITEM "Joystick #2", ID_INPUT_JOYSTICK1
255- MENUITEM "Joystick To Keyboard", ID_INPUT_JOYTOKEY
252+ MENUITEM "Joystick #1", ID_INPUT_JOYSTICK0
253+ MENUITEM "Joystick #2", ID_INPUT_JOYSTICK1
254+ MENUITEM "Joystick To Keyboard", ID_INPUT_JOYTOKEY
256255 END
257256 MENUITEM SEPARATOR
258257 MENUITEM "Use Direct3D9", ID_HOST_USE_D3D9
@@ -290,7 +289,7 @@ IDI_ICON1 ICON DISCARDABLE "pc8001mk2sr.ico"
290289 // Dialog
291290 //
292291
293-IDD_VOLUME DIALOG DISCARDABLE 0, 0, 250, 180
292+IDD_VOLUME DIALOG DISCARDABLE 0, 0, 250, 360
294293 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
295294 CAPTION "Volume"
296295 FONT 9, "MS PGothic"
@@ -301,17 +300,35 @@ BEGIN
301300 LTEXT "Sound Device #2",IDC_VOLUME_CAPTION1,6,36,60,8
302301 CONTROL "",IDC_VOLUME_PARAM_L1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,36,175,12
303302 CONTROL "",IDC_VOLUME_PARAM_R1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,51,175,12
304- LTEXT "Sound Device #3",IDC_VOLUME_CAPTION2,6,66,60,8
305- CONTROL "",IDC_VOLUME_PARAM_L2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,66,175,12
306- CONTROL "",IDC_VOLUME_PARAM_R2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,81,175,12
307- LTEXT "Sound Device #4",IDC_VOLUME_CAPTION3,6,96,60,8
308- CONTROL "",IDC_VOLUME_PARAM_L3,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,96,175,12
309- CONTROL "",IDC_VOLUME_PARAM_R3,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,111,175,12
303+ LTEXT "Sound Device #3",IDC_VOLUME_CAPTION2,6,66,60,8,WS_DISABLED
304+ CONTROL "",IDC_VOLUME_PARAM_L2,"msctls_trackbar32",TBS_AUTOTICKS | WS_DISABLED | WS_TABSTOP,70,66,175,12
305+ CONTROL "",IDC_VOLUME_PARAM_R2,"msctls_trackbar32",TBS_AUTOTICKS | WS_DISABLED | WS_TABSTOP,70,81,175,12
306+ LTEXT "Sound Device #4",IDC_VOLUME_CAPTION3,6,96,60,8,WS_DISABLED
307+ CONTROL "",IDC_VOLUME_PARAM_L3,"msctls_trackbar32",TBS_AUTOTICKS | WS_DISABLED | WS_TABSTOP,70,96,175,12
308+ CONTROL "",IDC_VOLUME_PARAM_R3,"msctls_trackbar32",TBS_AUTOTICKS | WS_DISABLED | WS_TABSTOP,70,111,175,12
310309 LTEXT "Sound Device #5",IDC_VOLUME_CAPTION4,6,126,60,8
311310 CONTROL "",IDC_VOLUME_PARAM_L4,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,126,175,12
312311 CONTROL "",IDC_VOLUME_PARAM_R4,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,141,175,12
313- DEFPUSHBUTTON "OK",IDOK,70,160,50,14
314- DEFPUSHBUTTON "Reset",IDC_VOLUME_RESET,130,160,50,14
312+ LTEXT "Sound Device #6",IDC_VOLUME_CAPTION5,6,156,60,8
313+ CONTROL "",IDC_VOLUME_PARAM_L5,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,156,175,12
314+ CONTROL "",IDC_VOLUME_PARAM_R5,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,171,175,12
315+ LTEXT "Sound Device #7",IDC_VOLUME_CAPTION6,6,186,60,8
316+ CONTROL "",IDC_VOLUME_PARAM_L6,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,186,175,12
317+ CONTROL "",IDC_VOLUME_PARAM_R6,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,201,175,12
318+ LTEXT "Sound Device #8",IDC_VOLUME_CAPTION7,6,216,60,8
319+ CONTROL "",IDC_VOLUME_PARAM_L7,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,216,175,12
320+ CONTROL "",IDC_VOLUME_PARAM_R7,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,231,175,12
321+ LTEXT "Sound Device #9",IDC_VOLUME_CAPTION8,6,246,60,8
322+ CONTROL "",IDC_VOLUME_PARAM_L8,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,246,175,12
323+ CONTROL "",IDC_VOLUME_PARAM_R8,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,261,175,12
324+ LTEXT "Sound Device #10",IDC_VOLUME_CAPTION9,6,276,60,8
325+ CONTROL "",IDC_VOLUME_PARAM_L9,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,276,175,12
326+ CONTROL "",IDC_VOLUME_PARAM_R9,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,291,175,12
327+ LTEXT "Sound Device #11",IDC_VOLUME_CAPTION10,6,306,60,8
328+ CONTROL "",IDC_VOLUME_PARAM_L10,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,306,175,12
329+ CONTROL "",IDC_VOLUME_PARAM_R10,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,321,175,12
330+ DEFPUSHBUTTON "OK",IDOK,70,340,50,14
331+ DEFPUSHBUTTON "Reset",IDC_VOLUME_RESET,130,340,50,14
315332 END
316333
317334 IDD_JOYSTICK DIALOG DISCARDABLE 0, 0, 175, 120
--- /dev/null
+++ b/source/src/res/pc8801.rc
@@ -0,0 +1,363 @@
1+// Microsoft Visual C++ generated resource script.
2+//
3+#include "resource.h"
4+
5+#define APSTUDIO_READONLY_SYMBOLS
6+/////////////////////////////////////////////////////////////////////////////
7+//
8+// Generated from the TEXTINCLUDE 2 resource.
9+//
10+#include "afxres.h"
11+
12+/////////////////////////////////////////////////////////////////////////////
13+#undef APSTUDIO_READONLY_SYMBOLS
14+
15+/////////////////////////////////////////////////////////////////////////////
16+// Japanese resources
17+
18+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
19+#ifdef _WIN32
20+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
21+#pragma code_page(932)
22+#endif //_WIN32
23+
24+#ifdef APSTUDIO_INVOKED
25+/////////////////////////////////////////////////////////////////////////////
26+//
27+// TEXTINCLUDE
28+//
29+
30+1 TEXTINCLUDE DISCARDABLE
31+BEGIN
32+ "resource.h\0"
33+END
34+
35+2 TEXTINCLUDE DISCARDABLE
36+BEGIN
37+ "#include ""afxres.h""\r\n"
38+ "\0"
39+END
40+
41+3 TEXTINCLUDE DISCARDABLE
42+BEGIN
43+ "\r\n"
44+ "\0"
45+END
46+
47+#endif // APSTUDIO_INVOKED
48+
49+#endif // Japanese resources
50+/////////////////////////////////////////////////////////////////////////////
51+
52+
53+/////////////////////////////////////////////////////////////////////////////
54+// English (U.S.) resources
55+
56+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
57+#ifdef _WIN32
58+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
59+#pragma code_page(1252)
60+#endif //_WIN32
61+
62+/////////////////////////////////////////////////////////////////////////////
63+//
64+// Accelerator
65+//
66+
67+IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE
68+BEGIN
69+ VK_RETURN, ID_ACCEL_MOUSE, VIRTKEY, CONTROL, NOINVERT
70+ VK_RETURN, ID_ACCEL_SCREEN, VIRTKEY, ALT, NOINVERT
71+ VK_APPS, ID_ACCEL_SPEED, VIRTKEY, NOINVERT
72+ VK_APPS, ID_ACCEL_ROMAJI, VIRTKEY, CONTROL, NOINVERT
73+END
74+
75+
76+/////////////////////////////////////////////////////////////////////////////
77+//
78+// Menu
79+//
80+
81+IDR_MENU1 MENU DISCARDABLE
82+BEGIN
83+ POPUP "Control"
84+ BEGIN
85+ MENUITEM "Reset", ID_RESET
86+ MENUITEM SEPARATOR
87+ MENUITEM "CPU x1", ID_CPU_POWER0
88+ MENUITEM "CPU x2", ID_CPU_POWER1
89+ MENUITEM "CPU x4", ID_CPU_POWER2
90+ MENUITEM "CPU x8", ID_CPU_POWER3
91+ MENUITEM "CPU x16", ID_CPU_POWER4
92+ MENUITEM "Full Speed", ID_FULL_SPEED
93+ MENUITEM SEPARATOR
94+ MENUITEM "Paste", ID_AUTOKEY_START
95+ MENUITEM "Stop", ID_AUTOKEY_STOP
96+ MENUITEM "Romaji to Kana", ID_ROMAJI_TO_KANA
97+ MENUITEM SEPARATOR
98+ POPUP "Save State"
99+ BEGIN
100+ MENUITEM "State 0", ID_SAVE_STATE0
101+ MENUITEM "State 1", ID_SAVE_STATE1
102+ MENUITEM "State 2", ID_SAVE_STATE2
103+ MENUITEM "State 3", ID_SAVE_STATE3
104+ MENUITEM "State 4", ID_SAVE_STATE4
105+ MENUITEM "State 5", ID_SAVE_STATE5
106+ MENUITEM "State 6", ID_SAVE_STATE6
107+ MENUITEM "State 7", ID_SAVE_STATE7
108+ MENUITEM "State 8", ID_SAVE_STATE8
109+ MENUITEM "State 9", ID_SAVE_STATE9
110+ END
111+ POPUP "Load State"
112+ BEGIN
113+ MENUITEM "State 0", ID_LOAD_STATE0
114+ MENUITEM "State 1", ID_LOAD_STATE1
115+ MENUITEM "State 2", ID_LOAD_STATE2
116+ MENUITEM "State 3", ID_LOAD_STATE3
117+ MENUITEM "State 4", ID_LOAD_STATE4
118+ MENUITEM "State 5", ID_LOAD_STATE5
119+ MENUITEM "State 6", ID_LOAD_STATE6
120+ MENUITEM "State 7", ID_LOAD_STATE7
121+ MENUITEM "State 8", ID_LOAD_STATE8
122+ MENUITEM "State 9", ID_LOAD_STATE9
123+ END
124+ MENUITEM SEPARATOR
125+ MENUITEM "Debug Main CPU", ID_OPEN_DEBUGGER0
126+ MENUITEM "Debug PC-80S31K CPU", ID_OPEN_DEBUGGER1
127+ MENUITEM "Close Debugger", ID_CLOSE_DEBUGGER
128+ MENUITEM SEPARATOR
129+ MENUITEM "Exit", ID_EXIT
130+ END
131+ POPUP "FD1"
132+ BEGIN
133+ MENUITEM "Insert", ID_OPEN_FD1
134+ MENUITEM "Eject", ID_CLOSE_FD1
135+ MENUITEM "Insert Blank 2D Disk", ID_OPEN_BLANK_2D_FD1
136+ MENUITEM SEPARATOR
137+ MENUITEM "Write Protected", ID_WRITE_PROTECT_FD1
138+ MENUITEM "Correct Timing", ID_CORRECT_TIMING_FD1
139+ MENUITEM "Ignore CRC Errors", ID_IGNORE_CRC_FD1
140+ MENUITEM SEPARATOR
141+ MENUITEM "Recent", ID_RECENT_FD1
142+ END
143+ POPUP "FD2"
144+ BEGIN
145+ MENUITEM "Insert", ID_OPEN_FD2
146+ MENUITEM "Eject", ID_CLOSE_FD2
147+ MENUITEM "Insert Blank 2D Disk", ID_OPEN_BLANK_2D_FD2
148+ MENUITEM SEPARATOR
149+ MENUITEM "Write Protected", ID_WRITE_PROTECT_FD2
150+ MENUITEM "Correct Timing", ID_CORRECT_TIMING_FD2
151+ MENUITEM "Ignore CRC Errors", ID_IGNORE_CRC_FD2
152+ MENUITEM SEPARATOR
153+ MENUITEM "Recent", ID_RECENT_FD2
154+ END
155+ POPUP "CMT"
156+ BEGIN
157+ MENUITEM "Play", ID_PLAY_TAPE1
158+ MENUITEM "Rec", ID_REC_TAPE1
159+ MENUITEM "Eject", ID_CLOSE_TAPE1
160+ MENUITEM SEPARATOR
161+ MENUITEM "Recent", ID_RECENT_TAPE1
162+ END
163+ POPUP "Device"
164+ BEGIN
165+ POPUP "Boot"
166+ BEGIN
167+ MENUITEM "N88 mode" ID_VM_BOOT_MODE0
168+ MENUITEM "N mode" ID_VM_BOOT_MODE3
169+ END
170+ POPUP "Sound"
171+ BEGIN
172+ MENUITEM "Play FDD Noise", ID_VM_SOUND_NOISE_FDD
173+ MENUITEM "Play CMT Noise", ID_VM_SOUND_NOISE_CMT, GRAYED
174+ MENUITEM "Play CMT Sound", ID_VM_SOUND_PLAY_TAPE, GRAYED
175+ END
176+ POPUP "Display"
177+ BEGIN
178+ MENUITEM "Scanline", ID_VM_MONITOR_SCANLINE
179+ END
180+ POPUP "Printer"
181+ BEGIN
182+ MENUITEM "Write Printer to File", ID_VM_PRINTER_TYPE0
183+ MENUITEM "PC-PR201", ID_VM_PRINTER_TYPE1, GRAYED
184+ MENUITEM "None", ID_VM_PRINTER_TYPE2
185+ END
186+ END
187+ POPUP "Host"
188+ BEGIN
189+ MENUITEM "Rec Movie 60fps", ID_HOST_REC_MOVIE_60FPS
190+ MENUITEM "Rec Movie 30fps", ID_HOST_REC_MOVIE_30FPS
191+ MENUITEM "Rec Movie 15fps", ID_HOST_REC_MOVIE_15FPS
192+ MENUITEM "Rec Sound", ID_HOST_REC_SOUND
193+ MENUITEM "Stop", ID_HOST_REC_STOP
194+ MENUITEM "Capture Screen", ID_HOST_CAPTURE_SCREEN
195+ MENUITEM SEPARATOR
196+ POPUP "Screen"
197+ BEGIN
198+ MENUITEM "Window x1", ID_SCREEN_WINDOW
199+ MENUITEM "Fullscreen 640x400", ID_SCREEN_FULLSCREEN
200+ MENUITEM SEPARATOR
201+ MENUITEM "Window Stretch 1", ID_SCREEN_WINDOW_STRETCH
202+ MENUITEM "Window Stretch 2", ID_SCREEN_WINDOW_ASPECT
203+ MENUITEM SEPARATOR
204+ MENUITEM "Fullscreen Stretch 1", ID_SCREEN_FULLSCREEN_DOTBYDOT
205+ MENUITEM "Fullscreen Stretch 2", ID_SCREEN_FULLSCREEN_STRETCH
206+ MENUITEM "Fullscreen Stretch 3", ID_SCREEN_FULLSCREEN_ASPECT
207+ MENUITEM "Fullscreen Stretch 4", ID_SCREEN_FULLSCREEN_FILL
208+ MENUITEM SEPARATOR
209+ MENUITEM "Rotate 0deg", ID_SCREEN_ROTATE_0
210+ MENUITEM "Rotate +90deg", ID_SCREEN_ROTATE_90
211+ MENUITEM "Rotate 180deg", ID_SCREEN_ROTATE_180
212+ MENUITEM "Rotate -90deg", ID_SCREEN_ROTATE_270
213+ END
214+ POPUP "Filter"
215+ BEGIN
216+ MENUITEM "RGB Filter", ID_FILTER_RGB
217+ MENUITEM "None", ID_FILTER_NONE
218+ END
219+ POPUP "Sound"
220+ BEGIN
221+ MENUITEM "2000Hz", ID_SOUND_FREQ0
222+ MENUITEM "4000Hz", ID_SOUND_FREQ1
223+ MENUITEM "8000Hz", ID_SOUND_FREQ2
224+ MENUITEM "11025Hz", ID_SOUND_FREQ3
225+ MENUITEM "22050Hz", ID_SOUND_FREQ4
226+ MENUITEM "44100Hz", ID_SOUND_FREQ5
227+ MENUITEM "55467Hz", ID_SOUND_FREQ6
228+ MENUITEM "96000Hz", ID_SOUND_FREQ7
229+ MENUITEM SEPARATOR
230+ MENUITEM "50msec", ID_SOUND_LATE0
231+ MENUITEM "100msec", ID_SOUND_LATE1
232+ MENUITEM "200msec", ID_SOUND_LATE2
233+ MENUITEM "300msec", ID_SOUND_LATE3
234+ MENUITEM "400msec", ID_SOUND_LATE4
235+ MENUITEM SEPARATOR
236+ MENUITEM "Realtime Mix", ID_SOUND_STRICT_RENDER
237+ MENUITEM "Light Weight Mix", ID_SOUND_LIGHT_RENDER
238+ MENUITEM SEPARATOR
239+ MENUITEM "Volume", ID_SOUND_VOLUME
240+ END
241+ POPUP "Input"
242+ BEGIN
243+ MENUITEM "Joystick #1", ID_INPUT_JOYSTICK0
244+ MENUITEM "Joystick #2", ID_INPUT_JOYSTICK1
245+ MENUITEM "Joystick To Keyboard", ID_INPUT_JOYTOKEY
246+ END
247+ MENUITEM SEPARATOR
248+ MENUITEM "Use Direct3D9", ID_HOST_USE_D3D9
249+ MENUITEM "Wait Vsync", ID_HOST_WAIT_VSYNC
250+ MENUITEM "Use DirectInput", ID_HOST_USE_DINPUT
251+ MENUITEM "Disable Windows 8 DWM", ID_HOST_DISABLE_DWM
252+ MENUITEM "Show Status Bar", ID_HOST_SHOW_STATUS_BAR
253+ END
254+END
255+
256+
257+/////////////////////////////////////////////////////////////////////////////
258+//
259+// Image
260+//
261+
262+IDI_BITMAP_ACCESS_OFF BITMAP DISCARDABLE "indicator/access_off.bmp"
263+IDI_BITMAP_ACCESS_ON BITMAP DISCARDABLE "indicator/access_on.bmp"
264+
265+
266+/////////////////////////////////////////////////////////////////////////////
267+//
268+// Icon
269+//
270+
271+// Icon with lowest ID value placed first to ensure application icon
272+// remains consistent on all systems.
273+IDI_ICON1 ICON DISCARDABLE "pc8801.ico"
274+#endif // English (U.S.) resources
275+/////////////////////////////////////////////////////////////////////////////
276+
277+
278+/////////////////////////////////////////////////////////////////////////////
279+//
280+// Dialog
281+//
282+
283+IDD_VOLUME DIALOG DISCARDABLE 0, 0, 250, 120
284+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
285+CAPTION "Volume"
286+FONT 9, "MS PGothic"
287+BEGIN
288+ LTEXT "Sound Device #1",IDC_VOLUME_CAPTION0,6,6,60,8
289+ CONTROL "",IDC_VOLUME_PARAM_L0,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,6,175,12
290+ CONTROL "",IDC_VOLUME_PARAM_R0,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,21,175,12
291+ LTEXT "Sound Device #2",IDC_VOLUME_CAPTION1,6,36,60,8
292+ CONTROL "",IDC_VOLUME_PARAM_L1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,36,175,12
293+ CONTROL "",IDC_VOLUME_PARAM_R1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,51,175,12
294+ LTEXT "Sound Device #3",IDC_VOLUME_CAPTION2,6,66,60,8
295+ CONTROL "",IDC_VOLUME_PARAM_L2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,66,175,12
296+ CONTROL "",IDC_VOLUME_PARAM_R2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,81,175,12
297+ DEFPUSHBUTTON "OK",IDOK,70,100,50,14
298+ DEFPUSHBUTTON "Reset",IDC_VOLUME_RESET,130,100,50,14
299+END
300+
301+IDD_JOYSTICK DIALOG DISCARDABLE 0, 0, 175, 120
302+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
303+CAPTION "Joystick #1"
304+FONT 9, "MS PGothic"
305+BEGIN
306+ LTEXT "Button #1",IDC_JOYSTICK_CAPTION0,6,6,40,8
307+ EDITTEXT IDC_JOYSTICK_PARAM0,50,4,120,14,ES_MULTILINE
308+ LTEXT "Button #2",IDC_JOYSTICK_CAPTION1,6,21,40,8
309+ EDITTEXT IDC_JOYSTICK_PARAM1,50,19,120,14,ES_MULTILINE
310+ LTEXT "Button #3",IDC_JOYSTICK_CAPTION2,6,36,40,8
311+ EDITTEXT IDC_JOYSTICK_PARAM2,50,34,120,14,ES_MULTILINE
312+ LTEXT "Button #4",IDC_JOYSTICK_CAPTION3,6,51,40,8
313+ EDITTEXT IDC_JOYSTICK_PARAM3,50,49,120,14,ES_MULTILINE
314+ LTEXT "Button #5",IDC_JOYSTICK_CAPTION4,6,66,40,8
315+ EDITTEXT IDC_JOYSTICK_PARAM4,50,64,120,14,ES_MULTILINE
316+ LTEXT "Button #6",IDC_JOYSTICK_CAPTION5,6,81,40,8
317+ EDITTEXT IDC_JOYSTICK_PARAM5,50,79,120,14,ES_MULTILINE
318+ DEFPUSHBUTTON "OK",IDOK,35,100,50,14
319+ DEFPUSHBUTTON "Reset",IDC_JOYSTICK_RESET,90,100,50,14
320+END
321+
322+IDD_JOYTOKEY DIALOG DISCARDABLE 0, 0, 175, 235
323+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
324+CAPTION "Joystick To Keyboard"
325+FONT 9, "MS PGothic"
326+BEGIN
327+ CONTROL "Enable Joystick To Keyboard",IDC_JOYTOKEY_CHECK0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,164,8
328+ CONTROL "Cursor Key",IDC_JOYTOKEY_RADIO0,"Button",BS_AUTORADIOBUTTON,6,26,164,7
329+ CONTROL "NumPad Key (4-Directions)",IDC_JOYTOKEY_RADIO1,"Button",BS_AUTORADIOBUTTON,6,41,164,7
330+ CONTROL "NumPad Key (8-Directions)",IDC_JOYTOKEY_RADIO2,"Button",BS_AUTORADIOBUTTON,6,56,164,7
331+ CONTROL "Press NumPad 5 To Release Stick",IDC_JOYTOKEY_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,71,164,8
332+ LTEXT "Button #1",IDC_JOYSTICK_CAPTION0,6,91,40,8
333+ EDITTEXT IDC_JOYSTICK_PARAM0,50,89,120,14,ES_MULTILINE
334+ LTEXT "Button #2",IDC_JOYSTICK_CAPTION1,6,106,40,8
335+ EDITTEXT IDC_JOYSTICK_PARAM1,50,104,120,14,ES_MULTILINE
336+ LTEXT "Button #3",IDC_JOYSTICK_CAPTION2,6,121,40,8
337+ EDITTEXT IDC_JOYSTICK_PARAM2,50,119,120,14,ES_MULTILINE
338+ LTEXT "Button #4",IDC_JOYSTICK_CAPTION3,6,136,40,8
339+ EDITTEXT IDC_JOYSTICK_PARAM3,50,134,120,14,ES_MULTILINE
340+ LTEXT "Button #5",IDC_JOYSTICK_CAPTION4,6,151,40,8
341+ EDITTEXT IDC_JOYSTICK_PARAM4,50,149,120,14,ES_MULTILINE
342+ LTEXT "Button #6",IDC_JOYSTICK_CAPTION5,6,166,40,8
343+ EDITTEXT IDC_JOYSTICK_PARAM5,50,164,120,14,ES_MULTILINE
344+ LTEXT "Button #7",IDC_JOYSTICK_CAPTION6,6,181,40,8
345+ EDITTEXT IDC_JOYSTICK_PARAM6,50,179,120,14,ES_MULTILINE
346+ LTEXT "Button #8",IDC_JOYSTICK_CAPTION7,6,196,40,8
347+ EDITTEXT IDC_JOYSTICK_PARAM7,50,194,120,14,ES_MULTILINE
348+ DEFPUSHBUTTON "OK",IDOK,35,215,50,14
349+ DEFPUSHBUTTON "Reset",IDC_JOYSTICK_RESET,90,215,50,14
350+END
351+
352+
353+
354+#ifndef APSTUDIO_INVOKED
355+/////////////////////////////////////////////////////////////////////////////
356+//
357+// Generated from the TEXTINCLUDE 3 resource.
358+//
359+
360+
361+/////////////////////////////////////////////////////////////////////////////
362+#endif // not APSTUDIO_INVOKED
363+
Binary files /dev/null and b/source/src/res/pc8801mk2.ico differ
--- /dev/null
+++ b/source/src/res/pc8801mk2.rc
@@ -0,0 +1,378 @@
1+// Microsoft Visual C++ generated resource script.
2+//
3+#include "resource.h"
4+
5+#define APSTUDIO_READONLY_SYMBOLS
6+/////////////////////////////////////////////////////////////////////////////
7+//
8+// Generated from the TEXTINCLUDE 2 resource.
9+//
10+#include "afxres.h"
11+
12+/////////////////////////////////////////////////////////////////////////////
13+#undef APSTUDIO_READONLY_SYMBOLS
14+
15+/////////////////////////////////////////////////////////////////////////////
16+// Japanese resources
17+
18+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
19+#ifdef _WIN32
20+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
21+#pragma code_page(932)
22+#endif //_WIN32
23+
24+#ifdef APSTUDIO_INVOKED
25+/////////////////////////////////////////////////////////////////////////////
26+//
27+// TEXTINCLUDE
28+//
29+
30+1 TEXTINCLUDE DISCARDABLE
31+BEGIN
32+ "resource.h\0"
33+END
34+
35+2 TEXTINCLUDE DISCARDABLE
36+BEGIN
37+ "#include ""afxres.h""\r\n"
38+ "\0"
39+END
40+
41+3 TEXTINCLUDE DISCARDABLE
42+BEGIN
43+ "\r\n"
44+ "\0"
45+END
46+
47+#endif // APSTUDIO_INVOKED
48+
49+#endif // Japanese resources
50+/////////////////////////////////////////////////////////////////////////////
51+
52+
53+/////////////////////////////////////////////////////////////////////////////
54+// English (U.S.) resources
55+
56+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
57+#ifdef _WIN32
58+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
59+#pragma code_page(1252)
60+#endif //_WIN32
61+
62+/////////////////////////////////////////////////////////////////////////////
63+//
64+// Accelerator
65+//
66+
67+IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE
68+BEGIN
69+ VK_RETURN, ID_ACCEL_MOUSE, VIRTKEY, CONTROL, NOINVERT
70+ VK_RETURN, ID_ACCEL_SCREEN, VIRTKEY, ALT, NOINVERT
71+ VK_APPS, ID_ACCEL_SPEED, VIRTKEY, NOINVERT
72+ VK_APPS, ID_ACCEL_ROMAJI, VIRTKEY, CONTROL, NOINVERT
73+END
74+
75+
76+/////////////////////////////////////////////////////////////////////////////
77+//
78+// Menu
79+//
80+
81+IDR_MENU1 MENU DISCARDABLE
82+BEGIN
83+ POPUP "Control"
84+ BEGIN
85+ MENUITEM "Reset", ID_RESET
86+ MENUITEM SEPARATOR
87+ MENUITEM "CPU x1", ID_CPU_POWER0
88+ MENUITEM "CPU x2", ID_CPU_POWER1
89+ MENUITEM "CPU x4", ID_CPU_POWER2
90+ MENUITEM "CPU x8", ID_CPU_POWER3
91+ MENUITEM "CPU x16", ID_CPU_POWER4
92+ MENUITEM "Full Speed", ID_FULL_SPEED
93+ MENUITEM SEPARATOR
94+ MENUITEM "Paste", ID_AUTOKEY_START
95+ MENUITEM "Stop", ID_AUTOKEY_STOP
96+ MENUITEM "Romaji to Kana", ID_ROMAJI_TO_KANA
97+ MENUITEM SEPARATOR
98+ POPUP "Save State"
99+ BEGIN
100+ MENUITEM "State 0", ID_SAVE_STATE0
101+ MENUITEM "State 1", ID_SAVE_STATE1
102+ MENUITEM "State 2", ID_SAVE_STATE2
103+ MENUITEM "State 3", ID_SAVE_STATE3
104+ MENUITEM "State 4", ID_SAVE_STATE4
105+ MENUITEM "State 5", ID_SAVE_STATE5
106+ MENUITEM "State 6", ID_SAVE_STATE6
107+ MENUITEM "State 7", ID_SAVE_STATE7
108+ MENUITEM "State 8", ID_SAVE_STATE8
109+ MENUITEM "State 9", ID_SAVE_STATE9
110+ END
111+ POPUP "Load State"
112+ BEGIN
113+ MENUITEM "State 0", ID_LOAD_STATE0
114+ MENUITEM "State 1", ID_LOAD_STATE1
115+ MENUITEM "State 2", ID_LOAD_STATE2
116+ MENUITEM "State 3", ID_LOAD_STATE3
117+ MENUITEM "State 4", ID_LOAD_STATE4
118+ MENUITEM "State 5", ID_LOAD_STATE5
119+ MENUITEM "State 6", ID_LOAD_STATE6
120+ MENUITEM "State 7", ID_LOAD_STATE7
121+ MENUITEM "State 8", ID_LOAD_STATE8
122+ MENUITEM "State 9", ID_LOAD_STATE9
123+ END
124+ MENUITEM SEPARATOR
125+ MENUITEM "Debug Main CPU", ID_OPEN_DEBUGGER0
126+ MENUITEM "Debug PC-80S31K CPU", ID_OPEN_DEBUGGER1
127+ MENUITEM "Close Debugger", ID_CLOSE_DEBUGGER
128+ MENUITEM SEPARATOR
129+ MENUITEM "Exit", ID_EXIT
130+ END
131+ POPUP "FD1"
132+ BEGIN
133+ MENUITEM "Insert", ID_OPEN_FD1
134+ MENUITEM "Eject", ID_CLOSE_FD1
135+ MENUITEM "Insert Blank 2D Disk", ID_OPEN_BLANK_2D_FD1
136+ MENUITEM SEPARATOR
137+ MENUITEM "Write Protected", ID_WRITE_PROTECT_FD1
138+ MENUITEM "Correct Timing", ID_CORRECT_TIMING_FD1
139+ MENUITEM "Ignore CRC Errors", ID_IGNORE_CRC_FD1
140+ MENUITEM SEPARATOR
141+ MENUITEM "Recent", ID_RECENT_FD1
142+ END
143+ POPUP "FD2"
144+ BEGIN
145+ MENUITEM "Insert", ID_OPEN_FD2
146+ MENUITEM "Eject", ID_CLOSE_FD2
147+ MENUITEM "Insert Blank 2D Disk", ID_OPEN_BLANK_2D_FD2
148+ MENUITEM SEPARATOR
149+ MENUITEM "Write Protected", ID_WRITE_PROTECT_FD2
150+ MENUITEM "Correct Timing", ID_CORRECT_TIMING_FD2
151+ MENUITEM "Ignore CRC Errors", ID_IGNORE_CRC_FD2
152+ MENUITEM SEPARATOR
153+ MENUITEM "Recent", ID_RECENT_FD2
154+ END
155+ POPUP "CMT"
156+ BEGIN
157+ MENUITEM "Play", ID_PLAY_TAPE1
158+ MENUITEM "Rec", ID_REC_TAPE1
159+ MENUITEM "Eject", ID_CLOSE_TAPE1
160+ MENUITEM SEPARATOR
161+ MENUITEM "Recent", ID_RECENT_TAPE1
162+ END
163+ POPUP "Device"
164+ BEGIN
165+ POPUP "Boot"
166+ BEGIN
167+ MENUITEM "N88 mode" ID_VM_BOOT_MODE0
168+ MENUITEM "N mode" ID_VM_BOOT_MODE3
169+ END
170+ POPUP "Sound"
171+ BEGIN
172+ MENUITEM "OPN", ID_VM_SOUND_TYPE0
173+ MENUITEM "OPNA", ID_VM_SOUND_TYPE1
174+ MENUITEM SEPARATOR
175+ MENUITEM "Play FDD Noise", ID_VM_SOUND_NOISE_FDD
176+ MENUITEM "Play CMT Noise", ID_VM_SOUND_NOISE_CMT, GRAYED
177+ MENUITEM "Play CMT Sound", ID_VM_SOUND_PLAY_TAPE, GRAYED
178+ END
179+ POPUP "Display"
180+ BEGIN
181+ MENUITEM "Scanline", ID_VM_MONITOR_SCANLINE
182+ END
183+ POPUP "Printer"
184+ BEGIN
185+ MENUITEM "Write Printer to File", ID_VM_PRINTER_TYPE0
186+ MENUITEM "PC-PR201", ID_VM_PRINTER_TYPE1, GRAYED
187+ MENUITEM "None", ID_VM_PRINTER_TYPE2
188+ END
189+ END
190+ POPUP "Host"
191+ BEGIN
192+ MENUITEM "Rec Movie 60fps", ID_HOST_REC_MOVIE_60FPS
193+ MENUITEM "Rec Movie 30fps", ID_HOST_REC_MOVIE_30FPS
194+ MENUITEM "Rec Movie 15fps", ID_HOST_REC_MOVIE_15FPS
195+ MENUITEM "Rec Sound", ID_HOST_REC_SOUND
196+ MENUITEM "Stop", ID_HOST_REC_STOP
197+ MENUITEM "Capture Screen", ID_HOST_CAPTURE_SCREEN
198+ MENUITEM SEPARATOR
199+ POPUP "Screen"
200+ BEGIN
201+ MENUITEM "Window x1", ID_SCREEN_WINDOW
202+ MENUITEM "Fullscreen 640x400", ID_SCREEN_FULLSCREEN
203+ MENUITEM SEPARATOR
204+ MENUITEM "Window Stretch 1", ID_SCREEN_WINDOW_STRETCH
205+ MENUITEM "Window Stretch 2", ID_SCREEN_WINDOW_ASPECT
206+ MENUITEM SEPARATOR
207+ MENUITEM "Fullscreen Stretch 1", ID_SCREEN_FULLSCREEN_DOTBYDOT
208+ MENUITEM "Fullscreen Stretch 2", ID_SCREEN_FULLSCREEN_STRETCH
209+ MENUITEM "Fullscreen Stretch 3", ID_SCREEN_FULLSCREEN_ASPECT
210+ MENUITEM "Fullscreen Stretch 4", ID_SCREEN_FULLSCREEN_FILL
211+ MENUITEM SEPARATOR
212+ MENUITEM "Rotate 0deg", ID_SCREEN_ROTATE_0
213+ MENUITEM "Rotate +90deg", ID_SCREEN_ROTATE_90
214+ MENUITEM "Rotate 180deg", ID_SCREEN_ROTATE_180
215+ MENUITEM "Rotate -90deg", ID_SCREEN_ROTATE_270
216+ END
217+ POPUP "Filter"
218+ BEGIN
219+ MENUITEM "RGB Filter", ID_FILTER_RGB
220+ MENUITEM "None", ID_FILTER_NONE
221+ END
222+ POPUP "Sound"
223+ BEGIN
224+ MENUITEM "2000Hz", ID_SOUND_FREQ0
225+ MENUITEM "4000Hz", ID_SOUND_FREQ1
226+ MENUITEM "8000Hz", ID_SOUND_FREQ2
227+ MENUITEM "11025Hz", ID_SOUND_FREQ3
228+ MENUITEM "22050Hz", ID_SOUND_FREQ4
229+ MENUITEM "44100Hz", ID_SOUND_FREQ5
230+ MENUITEM "55467Hz", ID_SOUND_FREQ6
231+ MENUITEM "96000Hz", ID_SOUND_FREQ7
232+ MENUITEM SEPARATOR
233+ MENUITEM "50msec", ID_SOUND_LATE0
234+ MENUITEM "100msec", ID_SOUND_LATE1
235+ MENUITEM "200msec", ID_SOUND_LATE2
236+ MENUITEM "300msec", ID_SOUND_LATE3
237+ MENUITEM "400msec", ID_SOUND_LATE4
238+ MENUITEM SEPARATOR
239+ MENUITEM "Realtime Mix", ID_SOUND_STRICT_RENDER
240+ MENUITEM "Light Weight Mix", ID_SOUND_LIGHT_RENDER
241+ MENUITEM SEPARATOR
242+ MENUITEM "Volume", ID_SOUND_VOLUME
243+ END
244+ POPUP "Input"
245+ BEGIN
246+ MENUITEM "Joystick #1", ID_INPUT_JOYSTICK0
247+ MENUITEM "Joystick #2", ID_INPUT_JOYSTICK1
248+ MENUITEM "Joystick To Keyboard", ID_INPUT_JOYTOKEY
249+ END
250+ MENUITEM SEPARATOR
251+ MENUITEM "Use Direct3D9", ID_HOST_USE_D3D9
252+ MENUITEM "Wait Vsync", ID_HOST_WAIT_VSYNC
253+ MENUITEM "Use DirectInput", ID_HOST_USE_DINPUT
254+ MENUITEM "Disable Windows 8 DWM", ID_HOST_DISABLE_DWM
255+ MENUITEM "Show Status Bar", ID_HOST_SHOW_STATUS_BAR
256+ END
257+END
258+
259+
260+/////////////////////////////////////////////////////////////////////////////
261+//
262+// Image
263+//
264+
265+IDI_BITMAP_ACCESS_OFF BITMAP DISCARDABLE "indicator/access_off.bmp"
266+IDI_BITMAP_ACCESS_ON BITMAP DISCARDABLE "indicator/access_on.bmp"
267+
268+
269+/////////////////////////////////////////////////////////////////////////////
270+//
271+// Icon
272+//
273+
274+// Icon with lowest ID value placed first to ensure application icon
275+// remains consistent on all systems.
276+IDI_ICON1 ICON DISCARDABLE "pc8801mk2.ico"
277+#endif // English (U.S.) resources
278+/////////////////////////////////////////////////////////////////////////////
279+
280+
281+/////////////////////////////////////////////////////////////////////////////
282+//
283+// Dialog
284+//
285+
286+IDD_VOLUME DIALOG DISCARDABLE 0, 0, 250, 240
287+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
288+CAPTION "Volume"
289+FONT 9, "MS PGothic"
290+BEGIN
291+ LTEXT "Sound Device #1",IDC_VOLUME_CAPTION0,6,6,60,8
292+ CONTROL "",IDC_VOLUME_PARAM_L0,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,6,175,12
293+ CONTROL "",IDC_VOLUME_PARAM_R0,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,21,175,12
294+ LTEXT "Sound Device #2",IDC_VOLUME_CAPTION1,6,36,60,8
295+ CONTROL "",IDC_VOLUME_PARAM_L1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,36,175,12
296+ CONTROL "",IDC_VOLUME_PARAM_R1,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,51,175,12
297+ LTEXT "Sound Device #3",IDC_VOLUME_CAPTION2,6,66,60,8
298+ CONTROL "",IDC_VOLUME_PARAM_L2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,66,175,12
299+ CONTROL "",IDC_VOLUME_PARAM_R2,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,81,175,12
300+ LTEXT "Sound Device #4",IDC_VOLUME_CAPTION3,6,96,60,8
301+ CONTROL "",IDC_VOLUME_PARAM_L3,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,96,175,12
302+ CONTROL "",IDC_VOLUME_PARAM_R3,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,111,175,12
303+ LTEXT "Sound Device #5",IDC_VOLUME_CAPTION4,6,126,60,8
304+ CONTROL "",IDC_VOLUME_PARAM_L4,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,126,175,12
305+ CONTROL "",IDC_VOLUME_PARAM_R4,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,141,175,12
306+ LTEXT "Sound Device #6",IDC_VOLUME_CAPTION5,6,156,60,8
307+ CONTROL "",IDC_VOLUME_PARAM_L5,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,156,175,12
308+ CONTROL "",IDC_VOLUME_PARAM_R5,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,171,175,12
309+ LTEXT "Sound Device #7",IDC_VOLUME_CAPTION6,6,186,60,8
310+ CONTROL "",IDC_VOLUME_PARAM_L6,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,186,175,12
311+ CONTROL "",IDC_VOLUME_PARAM_R6,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,70,201,175,12
312+ DEFPUSHBUTTON "OK",IDOK,70,220,50,14
313+ DEFPUSHBUTTON "Reset",IDC_VOLUME_RESET,130,220,50,14
314+END
315+
316+IDD_JOYSTICK DIALOG DISCARDABLE 0, 0, 175, 120
317+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
318+CAPTION "Joystick #1"
319+FONT 9, "MS PGothic"
320+BEGIN
321+ LTEXT "Button #1",IDC_JOYSTICK_CAPTION0,6,6,40,8
322+ EDITTEXT IDC_JOYSTICK_PARAM0,50,4,120,14,ES_MULTILINE
323+ LTEXT "Button #2",IDC_JOYSTICK_CAPTION1,6,21,40,8
324+ EDITTEXT IDC_JOYSTICK_PARAM1,50,19,120,14,ES_MULTILINE
325+ LTEXT "Button #3",IDC_JOYSTICK_CAPTION2,6,36,40,8
326+ EDITTEXT IDC_JOYSTICK_PARAM2,50,34,120,14,ES_MULTILINE
327+ LTEXT "Button #4",IDC_JOYSTICK_CAPTION3,6,51,40,8
328+ EDITTEXT IDC_JOYSTICK_PARAM3,50,49,120,14,ES_MULTILINE
329+ LTEXT "Button #5",IDC_JOYSTICK_CAPTION4,6,66,40,8
330+ EDITTEXT IDC_JOYSTICK_PARAM4,50,64,120,14,ES_MULTILINE
331+ LTEXT "Button #6",IDC_JOYSTICK_CAPTION5,6,81,40,8
332+ EDITTEXT IDC_JOYSTICK_PARAM5,50,79,120,14,ES_MULTILINE
333+ DEFPUSHBUTTON "OK",IDOK,35,100,50,14
334+ DEFPUSHBUTTON "Reset",IDC_JOYSTICK_RESET,90,100,50,14
335+END
336+
337+IDD_JOYTOKEY DIALOG DISCARDABLE 0, 0, 175, 235
338+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
339+CAPTION "Joystick To Keyboard"
340+FONT 9, "MS PGothic"
341+BEGIN
342+ CONTROL "Enable Joystick To Keyboard",IDC_JOYTOKEY_CHECK0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,164,8
343+ CONTROL "Cursor Key",IDC_JOYTOKEY_RADIO0,"Button",BS_AUTORADIOBUTTON,6,26,164,7
344+ CONTROL "NumPad Key (4-Directions)",IDC_JOYTOKEY_RADIO1,"Button",BS_AUTORADIOBUTTON,6,41,164,7
345+ CONTROL "NumPad Key (8-Directions)",IDC_JOYTOKEY_RADIO2,"Button",BS_AUTORADIOBUTTON,6,56,164,7
346+ CONTROL "Press NumPad 5 To Release Stick",IDC_JOYTOKEY_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,71,164,8
347+ LTEXT "Button #1",IDC_JOYSTICK_CAPTION0,6,91,40,8
348+ EDITTEXT IDC_JOYSTICK_PARAM0,50,89,120,14,ES_MULTILINE
349+ LTEXT "Button #2",IDC_JOYSTICK_CAPTION1,6,106,40,8
350+ EDITTEXT IDC_JOYSTICK_PARAM1,50,104,120,14,ES_MULTILINE
351+ LTEXT "Button #3",IDC_JOYSTICK_CAPTION2,6,121,40,8
352+ EDITTEXT IDC_JOYSTICK_PARAM2,50,119,120,14,ES_MULTILINE
353+ LTEXT "Button #4",IDC_JOYSTICK_CAPTION3,6,136,40,8
354+ EDITTEXT IDC_JOYSTICK_PARAM3,50,134,120,14,ES_MULTILINE
355+ LTEXT "Button #5",IDC_JOYSTICK_CAPTION4,6,151,40,8
356+ EDITTEXT IDC_JOYSTICK_PARAM4,50,149,120,14,ES_MULTILINE
357+ LTEXT "Button #6",IDC_JOYSTICK_CAPTION5,6,166,40,8
358+ EDITTEXT IDC_JOYSTICK_PARAM5,50,164,120,14,ES_MULTILINE
359+ LTEXT "Button #7",IDC_JOYSTICK_CAPTION6,6,181,40,8
360+ EDITTEXT IDC_JOYSTICK_PARAM6,50,179,120,14,ES_MULTILINE
361+ LTEXT "Button #8",IDC_JOYSTICK_CAPTION7,6,196,40,8
362+ EDITTEXT IDC_JOYSTICK_PARAM7,50,194,120,14,ES_MULTILINE
363+ DEFPUSHBUTTON "OK",IDOK,35,215,50,14
364+ DEFPUSHBUTTON "Reset",IDC_JOYSTICK_RESET,90,215,50,14
365+END
366+
367+
368+
369+#ifndef APSTUDIO_INVOKED
370+/////////////////////////////////////////////////////////////////////////////
371+//
372+// Generated from the TEXTINCLUDE 3 resource.
373+//
374+
375+
376+/////////////////////////////////////////////////////////////////////////////
377+#endif // not APSTUDIO_INVOKED
378+
--- a/source/src/vm/pc8801/pc88.cpp
+++ b/source/src/vm/pc8801/pc88.cpp
@@ -1,7 +1,11 @@
11 /*
2- NEC PC-98DO Emulator 'ePC-98DO'
3- NEC PC-8801MA Emulator 'ePC-8801MA'
2+ NEC PC-8001 Emulator 'ePC-8001'
3+ NEC PC-8001mkII Emulator 'ePC-8001mkII'
44 NEC PC-8001mkIISR Emulator 'ePC-8001mkIISR'
5+ NEC PC-8801 Emulator 'ePC-8801'
6+ NEC PC-8801mkII Emulator 'ePC-8801mkII'
7+ NEC PC-8801MA Emulator 'ePC-8801MA'
8+ NEC PC-98DO Emulator 'ePC-98DO'
59
610 Author : Takeda.Toshiya
711 Date : 2011.12.29-
@@ -14,7 +18,9 @@
1418 #include "../i8251.h"
1519 #include "../pcm1bit.h"
1620 #include "../upd1990a.h"
21+#if defined(SUPPORT_PC88_OPN1) || defined(SUPPORT_PC88_OPN2)
1722 #include "../ym2203.h"
23+#endif
1824 #include "../z80.h"
1925
2026 #ifdef SUPPORT_PC88_CDROM
@@ -51,34 +57,53 @@ namespace PC88DEV
5157 #define Port30_RS232C (port[0x30] & 0x20)
5258
5359 #define Port31_MMODE (port[0x31] & 0x02)
60+#ifdef PC8801_VARIANT
5461 #define Port31_RMODE (port[0x31] & 0x04)
62+#endif
5563 #define Port31_GRAPH (port[0x31] & 0x08)
64+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
5665 #define Port31_HCOLOR (port[0x31] & 0x10)
57-#if !defined(_PC8001SR)
66+#else
67+#define Port31_HCOLOR false
68+#endif
69+#ifdef PC8801SR_VARIANT
5870 #define Port31_400LINE !(port[0x31] & 0x11)
5971 #else
6072 #define Port31_400LINE false
6173 #endif
6274
75+#ifdef PC8001_VARIANT
6376 #define Port31_V1_320x200 (port[0x31] & 0x10) // PC-8001 (V1)
6477 #define Port31_V1_MONO (port[0x31] & 0x04) // PC-8001 (V1)
65-
6678 #define Port31_320x200 (port[0x31] & 0x04) // PC-8001
79+#endif
6780
81+#if defined(_PC8001SR)
82+#define Port32_SINTM (port[0x33] & 0x02) // PC-8001SR
83+#define Port32_GVAM (port[0x33] & 0x40) // PC-8001SR
84+#elif defined(PC8801SR_VARIANT)
85+#define Port32_GVAM (port[0x32] & 0x40)
86+#define Port32_SINTM (port[0x32] & 0x80)
87+#endif
88+#if defined(PC8801SR_VARIANT)
6889 #define Port32_EROMSL (port[0x32] & 0x03)
6990 #define Port32_TMODE (port[0x32] & 0x10)
70-#if !defined(_PC8001SR)
7191 #define Port32_PMODE (port[0x32] & 0x20)
7292 #else
93+#define Port32_EROMSL 0
94+#define Port32_TMODE true
7395 #define Port32_PMODE false
7496 #endif
75-#define Port32_GVAM (port[0x32] & 0x40)
76-#define Port32_SINTM (port[0x32] & 0x80)
7797
78-#define Port33_SINTM (port[0x33] & 0x02) // PC-8001
79-#define Port33_GVAM (port[0x33] & 0x40) // PC-8001
80-#define Port33_N80SR (port[0x33] & 0x80) // PC-8001
98+#ifdef _PC8001SR
99+#define Port33_PR1 (port[0x33] & 0x04) // PC-8001SR
100+#define Port33_PR2 (port[0x33] & 0x08) // PC-8001SR
101+//#define Port33_SINTM (port[0x33] & 0x02) // PC-8001SR -> Port32_SINTM
102+//#define Port33_GVAM (port[0x33] & 0x40) // PC-8001SR -> Port32_GVAM
103+#define Port33_N80SR (port[0x33] & 0x80) // PC-8001SR
104+#endif
81105
106+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
82107 #define Port34_ALU port[0x34]
83108
84109 #define Port35_PLN0 (port[0x35] & 0x01)
@@ -86,32 +111,48 @@ namespace PC88DEV
86111 #define Port35_PLN2 (port[0x35] & 0x04)
87112 #define Port35_GDM (port[0x35] & 0x30)
88113 #define Port35_GAM (port[0x35] & 0x80)
114+#endif
89115
116+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
90117 #define Port40_GHSM (port[0x40] & 0x10)
118+#else
119+#define Port40_GHSM false
120+#endif
91121 #define Port40_JOP1 (port[0x40] & 0x40)
92122
123+#ifdef SUPPORT_PC88_OPN1
93124 #define Port44_OPNCH port[0x44]
125+#endif
94126
95127 #define Port53_TEXTDS (port[0x53] & 0x01)
96128 #define Port53_G0DS (port[0x53] & 0x02)
97129 #define Port53_G1DS (port[0x53] & 0x04)
98130 #define Port53_G2DS (port[0x53] & 0x08)
131+#if defined(PC8001_VARIANT)
99132 #define Port53_G3DS (port[0x53] & 0x10) // PC-8001
100133 #define Port53_G4DS (port[0x53] & 0x20) // PC-8001
101134 #define Port53_G5DS (port[0x53] & 0x40) // PC-8001
135+#endif
102136
137+#if defined(PC8801_VARIANT)
103138 #define Port70_TEXTWND port[0x70]
139+#endif
104140
141+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
105142 #define Port71_EROM port[0x71]
143+#endif
106144
107145 #ifdef SUPPORT_PC88_CDROM
108146 #define Port99_CDREN (port[0x99] & 0x10)
109147 #endif
110148
111149 // XM8 version 1.20
150+#ifdef SUPPORT_PC88_OPN2
112151 #define PortA8_OPNCH port[0xa8]
113152 #define PortAA_S2INTM (port[0xaa] & 0x80)
153+#endif
114154
155+#ifdef PC88_EXRAM_BANKS
115156 #define PortE2_RDEN (port[0xe2] & 0x01)
116157 #define PortE2_WREN (port[0xe2] & 0x10)
117158
@@ -120,14 +161,21 @@ namespace PC88DEV
120161 #else
121162 #define PortE3_ERAMSL (port[0xe3] & 0x0f)
122163 #endif
164+#endif
123165
166+#ifdef SUPPORT_PC88_KANJI1
124167 #define PortE8E9_KANJI1 (port[0xe8] | (port[0xe9] << 8))
168+#endif
169+#ifdef SUPPORT_PC88_KANJI2
125170 #define PortECED_KANJI2 (port[0xec] | (port[0xed] << 8))
171+#endif
126172
173+#ifdef SUPPORT_PC88_DICTIONARY
127174 #define PortF0_DICROMSL (port[0xf0] & 0x1f)
128175 #define PortF1_DICROM !(port[0xf1] & 0x01)
176+#endif
129177
130-#if defined(SUPPORT_PC88_VAB)
178+#ifdef SUPPORT_PC88_VAB
131179 // X88000
132180 #define PortB4_VAB_DISP ((port[0xb4] & 0x41) == 0x41)
133181 #define PortE3_VAB_SEL (((port[0xe3] >> 2) & 3) == PC88_VAB_PAGE)
@@ -216,17 +264,25 @@ void PC88::initialize()
216264 #endif
217265 memset(gvram, 0, sizeof(gvram));
218266 memset(gvram_null, 0, sizeof(gvram_null));
267+#if defined(PC8801SR_VARIANT)
219268 memset(tvram, 0, sizeof(tvram));
269+#endif
270+#if defined(PC8001_VARIANT)
271+ memset(n80rom, 0xff, sizeof(n80rom));
220272 #if defined(_PC8001SR)
221- memset(n80mk2rom, 0xff, sizeof(n80mk2rom));
222- memset(n80mk2srrom, 0xff, sizeof(n80mk2srrom));
273+ memset(n80srrom, 0xff, sizeof(n80srrom));
274+#endif
223275 #else
224276 memset(n88rom, 0xff, sizeof(n88rom));
225277 memset(n88exrom, 0xff, sizeof(n88exrom));
226278 memset(n80rom, 0xff, sizeof(n80rom));
227279 #endif
280+//#ifdef SUPPORT_PC88_KANJI1
228281 memset(kanji1, 0xff, sizeof(kanji1));
282+//#endif
283+#ifdef SUPPORT_PC88_KANJI2
229284 memset(kanji2, 0xff, sizeof(kanji2));
285+#endif
230286 #ifdef SUPPORT_PC88_DICTIONARY
231287 memset(dicrom, 0xff, sizeof(dicrom));
232288 #endif
@@ -237,15 +293,21 @@ void PC88::initialize()
237293
238294 // load rom images
239295 FILEIO* fio = new FILEIO();
240-#if defined(_PC8001SR)
296+#if defined(PC8001_VARIANT)
297+#if defined(_PC8001)
298+ if(fio->Fopen(create_local_path(_T("N80_1.ROM")), FILEIO_READ_BINARY)) {
299+#else
241300 if(fio->Fopen(create_local_path(_T("N80_2.ROM")), FILEIO_READ_BINARY)) {
242- fio->Fread(n80mk2rom, 0x8000, 1);
301+#endif
302+ fio->Fread(n80rom, 0x8000, 1);
243303 fio->Fclose();
244304 }
305+#if defined(_PC8001SR)
245306 if(fio->Fopen(create_local_path(_T("N80_3.ROM")), FILEIO_READ_BINARY)) {
246- fio->Fread(n80mk2srrom, 0xa000, 1);
307+ fio->Fread(n80srrom, 0xa000, 1);
247308 fio->Fclose();
248309 }
310+#endif
249311 #else
250312 if(fio->Fopen(create_local_path(_T("PC88.ROM")), FILEIO_READ_BINARY)) {
251313 fio->Fread(n88rom, 0x8000, 1);
@@ -281,14 +343,21 @@ void PC88::initialize()
281343 fio->Fclose();
282344 }
283345 #endif
346+//#ifdef SUPPORT_PC88_KANJI1
284347 if(fio->Fopen(create_local_path(_T("KANJI1.ROM")), FILEIO_READ_BINARY)) {
285348 fio->Fread(kanji1, 0x20000, 1);
286349 fio->Fclose();
350+ } else if(fio->Fopen(create_local_path(_T("FONT.ROM")), FILEIO_READ_BINARY)) {
351+ fio->Fread(&(kanji1[0x1000]), 0x800, 1);
352+ fio->Fclose();
287353 }
354+//#endif
355+#ifdef SUPPORT_PC88_KANJI2
288356 if(fio->Fopen(create_local_path(_T("KANJI2.ROM")), FILEIO_READ_BINARY)) {
289357 fio->Fread(kanji2, 0x20000, 1);
290358 fio->Fclose();
291359 }
360+#endif
292361 #ifdef SUPPORT_PC88_DICTIONARY
293362 if(fio->Fopen(create_local_path(_T("JISYO.ROM")), FILEIO_READ_BINARY)) {
294363 fio->Fread(dicrom, 0x80000, 1);
@@ -296,13 +365,13 @@ void PC88::initialize()
296365 }
297366 #endif
298367 #ifdef SUPPORT_PC88_CDROM
299- if(config.boot_mode == MODE_PC88_V2) {
368+// if(config.boot_mode == MODE_PC88_V2) {
300369 if(fio->Fopen(create_local_path(_T("CDBIOS.ROM")), FILEIO_READ_BINARY)) {
301370 fio->Fread(cdbios, 0x10000, 1);
302371 fio->Fclose();
303372 cdbios_loaded = true;
304373 }
305- }
374+// }
306375 #endif
307376 delete fio;
308377
@@ -380,9 +449,11 @@ void PC88::initialize()
380449 register_event(this, EVENT_TIMER, 1000000.0 / 600.0, true, NULL);
381450 register_event(this, EVENT_BEEP, 1000000.0 / 4800.0, true, NULL);
382451
383-#if !defined(_PC8001SR)
452+#if defined(PC8801SR_VARIANT)
384453 // hack to update config.scan_line at first
385454 hireso = !(config.monitor_type == 0);
455+#else
456+ hireso = false;
386457 #endif
387458 #ifdef SUPPORT_PC88_CDROM
388459 cdda_register_id = -1;
@@ -397,9 +468,7 @@ void PC88::release()
397468
398469 void PC88::reset()
399470 {
400-#if defined(_PC8001SR)
401- hireso = false;
402-#else
471+#if defined(PC8801SR_VARIANT)
403472 bool value = (config.monitor_type == 0);
404473 if(hireso != value) {
405474 // update config.scan_line when config.monitor_type is changed
@@ -418,41 +487,56 @@ void PC88::reset()
418487 // port[0x70] = 0x80; // XM8 version 1.10
419488 port[0x71] = port[0xf1] = 0xff;
420489 #if defined(SUPPORT_PC88_CDROM)
421- if (cdbios_loaded) {
422- port[0x99] = 0x10;
490+ if(config.boot_mode == MODE_PC88_V2) {
491+ if(cdbios_loaded) {
492+ port[0x99] = 0x10;
493+ }
423494 }
424495 #endif
496+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
425497 memset(alu_reg, 0, sizeof(alu_reg));
498+#endif
426499 gvram_plane = gvram_sel = 0;
427500
501+#if defined(PC8001_VARIANT)
428502 #if defined(_PC8001SR)
429503 if(config.boot_mode == MODE_PC80_V2) {
430- SET_BANK(0x0000, 0x7fff, wdmy, n80mk2srrom);
504+ SET_BANK(0x0000, 0x7fff, wdmy, n80srrom);
431505 port[0x33] = 0x80;
432- } else {
433- SET_BANK(0x0000, 0x7fff, wdmy, n80mk2rom);
506+ } else
507+#endif
508+ {
509+ SET_BANK(0x0000, 0x7fff, wdmy, n80rom);
434510 }
435511 SET_BANK(0x8000, 0xffff, ram + 0x8000, ram + 0x8000);
436512 #else
437-// SET_BANK(0x0000, 0x7fff, ram, n88rom);
438- SET_BANK(0x8000, 0xefff, ram + 0x8000, ram + 0x8000);
439- update_low_memmap();
513+ SET_BANK(0x8000, 0xffff, ram + 0x8000, ram + 0x8000);
514+ update_low_write();
515+ update_low_read();
516+#if defined(PC8801SR_VARIANT)
440517 update_tvram_memmap(); // XM8 version 1.10
441518 #endif
519+#endif
442520
443521 // misc
444522 usart_dcd = false;
445523 opn_busy = true;
446524
447525 // memory wait
526+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
448527 mem_wait_on = ((config.dipswitch & 1) != 0);
528+#else
529+ mem_wait_on = true;
530+#endif
449531
450532 m1_wait_clocks = get_m1_wait(false);
451533 f000_m1_wait_clocks = get_m1_wait(true);
452534 mem_wait_clocks_r = get_main_wait(true);
453535 mem_wait_clocks_w = get_main_wait(false);
536+#if defined(PC8801SR_VARIANT)
454537 tvram_wait_clocks_r = get_tvram_wait(true);
455538 tvram_wait_clocks_w = get_tvram_wait(false);
539+#endif
456540
457541 // crtc
458542 memset(&crtc, 0, sizeof(crtc));
@@ -494,9 +578,11 @@ void PC88::reset()
494578
495579 // interrupt
496580 intr_req = intr_mask1 = intr_mask2 = 0;
497- intr_req_sound = false;
498-#ifdef SUPPORT_PC88_SB2
499- intr_req_sb2 = false;
581+#ifdef SUPPORT_PC88_OPN1
582+ intr_req_opn1 = false;
583+#endif
584+#ifdef SUPPORT_PC88_OPN2
585+ intr_req_opn2 = false;
500586 #endif
501587
502588 // fdd i/f
@@ -537,7 +623,7 @@ void PC88::write_data8w(uint32_t addr, uint32_t data, int* wait)
537623 addr &= 0xffff;
538624 *wait = mem_wait_clocks_w;
539625
540-#if !defined(_PC8001SR)
626+#if defined(PC8801_VARIANT)
541627 if((addr & 0xfc00) == 0x8000) {
542628 // text window
543629 if(!Port31_MMODE && !Port31_RMODE) {
@@ -545,7 +631,11 @@ void PC88::write_data8w(uint32_t addr, uint32_t data, int* wait)
545631 }
546632 ram[addr & 0xffff] = data;
547633 return;
548- } else if((addr & 0xc000) == 0xc000) {
634+ }
635+#endif
636+#if defined(_PC8001MK2) || defined(_PC8001SR) || defined(PC8801_VARIANT)
637+#if defined(PC8801_VARIANT)
638+ if((addr & 0xc000) == 0xc000) {
549639 #else
550640 if((addr & 0xc000) == 0x8000) {
551641 #endif
@@ -554,6 +644,7 @@ void PC88::write_data8w(uint32_t addr, uint32_t data, int* wait)
554644 *wait = gvram_wait_clocks_w;
555645 gvram[(addr & 0x3fff) | 0x0000] = data;
556646 return;
647+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
557648 case 2:
558649 *wait = gvram_wait_clocks_w;
559650 gvram[(addr & 0x3fff) | 0x4000] = data;
@@ -562,6 +653,8 @@ void PC88::write_data8w(uint32_t addr, uint32_t data, int* wait)
562653 *wait = gvram_wait_clocks_w;
563654 gvram[(addr & 0x3fff) | 0x8000] = data;
564655 return;
656+#endif
657+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
565658 case 8:
566659 *wait = gvram_wait_clocks_w;
567660 addr &= 0x3fff;
@@ -594,9 +687,11 @@ void PC88::write_data8w(uint32_t addr, uint32_t data, int* wait)
594687 break;
595688 }
596689 return;
690+#endif
597691 }
598692 }
599-#if !defined(_PC8001SR)
693+#endif
694+#if defined(PC8801SR_VARIANT)
600695 if((addr & 0xf000) == 0xf000) {
601696 // high speed ram
602697 *wait += tvram_wait_clocks_w;
@@ -610,38 +705,47 @@ uint32_t PC88::read_data8w(uint32_t addr, int* wait)
610705 addr &= 0xffff;
611706 *wait = mem_wait_clocks_r;
612707
613-#if !defined(_PC8001SR)
708+#if defined(PC8801_VARIANT)
614709 if((addr & 0xfc00) == 0x8000) {
615710 // text window
616711 if(!Port31_MMODE && !Port31_RMODE) {
617712 addr = (Port70_TEXTWND << 8) + (addr & 0x3ff);
618713 }
619714 return ram[addr & 0xffff];
620- } else if((addr & 0xc000) == 0xc000) {
715+ }
716+#endif
717+#if defined(_PC8001MK2) || defined(_PC8001SR) || defined(PC8801_VARIANT)
718+#if defined(PC8801_VARIANT)
719+ if((addr & 0xc000) == 0xc000) {
621720 #else
622721 if((addr & 0xc000) == 0x8000) {
623722 #endif
624- uint8_t b, r, g;
625- switch(gvram_sel) {
723+ switch (gvram_sel) {
626724 case 1:
627725 *wait = gvram_wait_clocks_r;
628726 return gvram[(addr & 0x3fff) | 0x0000];
727+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
629728 case 2:
630729 *wait = gvram_wait_clocks_r;
631730 return gvram[(addr & 0x3fff) | 0x4000];
632731 case 4:
633732 *wait = gvram_wait_clocks_r;
634733 return gvram[(addr & 0x3fff) | 0x8000];
734+#endif
735+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
635736 case 8:
636- *wait = gvram_wait_clocks_r;
637- addr &= 0x3fff;
638- alu_reg[0] = gvram[addr | 0x0000];
639- alu_reg[1] = gvram[addr | 0x4000];
640- alu_reg[2] = gvram[addr | 0x8000];
641- b = alu_reg[0]; if(!Port35_PLN0) b ^= 0xff;
642- r = alu_reg[1]; if(!Port35_PLN1) r ^= 0xff;
643- g = alu_reg[2]; if(!Port35_PLN2) g ^= 0xff;
644- return b & r & g;
737+ {
738+ *wait = gvram_wait_clocks_r;
739+ addr &= 0x3fff;
740+ alu_reg[0] = gvram[addr | 0x0000];
741+ alu_reg[1] = gvram[addr | 0x4000];
742+ alu_reg[2] = gvram[addr | 0x8000];
743+ uint8_t b = alu_reg[0]; if(!Port35_PLN0) b ^= 0xff;
744+ uint8_t r = alu_reg[1]; if(!Port35_PLN1) r ^= 0xff;
745+ uint8_t g = alu_reg[2]; if(!Port35_PLN2) g ^= 0xff;
746+ return b & r & g;
747+ }
748+#endif
645749 }
646750 #ifdef SUPPORT_PC88_DICTIONARY
647751 if(PortF1_DICROM) {
@@ -649,7 +753,8 @@ uint32_t PC88::read_data8w(uint32_t addr, int* wait)
649753 }
650754 #endif
651755 }
652-#if !defined(_PC8001SR)
756+#endif
757+#if defined(PC8801SR_VARIANT)
653758 if((addr & 0xf000) == 0xf000) {
654759 // high speed ram
655760 *wait += tvram_wait_clocks_r;
@@ -675,6 +780,38 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
675780 #ifdef _IO_DEBUG_LOG
676781 this->out_debug_log(_T("%06x\tOUT8\t%02x,%02x\n"), d_cpu->get_pc(), addr, data);
677782 #endif
783+#if defined(_PC8001) || defined(_PC8001MK2) || defined(_PC8801) || defined(_PC8801MK2)
784+ // i/o address is not full-decoded
785+ switch(addr) {
786+ case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
787+ addr = 0x10;
788+ break;
789+ case 0x22: case 0x24: case 0x26: case 0x28: case 0x2a: case 0x2c: case 0x2e:
790+ addr = 0x20;
791+ break;
792+ case 0x23: case 0x25: case 0x27: case 0x29: case 0x2b: case 0x2d: case 0x2f:
793+ addr = 0x21;
794+ break;
795+#if defined(_PC8001)
796+ case 0x31: case 0x33: case 0x35: case 0x37: case 0x39: case 0x3b: case 0x3d: case 0x3f:
797+#endif
798+ case 0x32: case 0x34: case 0x36: case 0x38: case 0x3a: case 0x3c: case 0x3e:
799+ addr = 0x30;
800+ break;
801+#if defined(_PC8001MK2) || defined(_PC8801MK2)
802+ case 0x33: case 0x35: case 0x37: case 0x39: case 0x3b: case 0x3d: case 0x3f:
803+ addr = 0x31;
804+ break;
805+#endif
806+ case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f:
807+ addr = 0x40;
808+ break;
809+ // correct ???
810+ case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
811+ addr &= 0xf7;
812+ break;
813+ }
814+#endif
678815 #ifdef NIPPY_PATCH
679816 // dirty patch for NIPPY
680817 if(addr == 0x31 && data == 0x3f && d_cpu->get_pc() == 0xaa4f && nippy_patch) {
@@ -741,8 +878,8 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
741878 case 0x0e:
742879 case 0x0f:
743880 d_pcg_pit->write_io8(addr & 3, data);
744-#endif
745881 break;
882+#endif
746883 case 0x10:
747884 d_prn->write_signal(SIG_PRINTER_DATA, data, 0xff);
748885 d_rtc->write_signal(SIG_UPD1990A_C0, data, 1);
@@ -787,7 +924,8 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
787924 }
788925 }
789926 break;
790-#if defined(_PC8001SR)
927+#if defined(PC8001_VARIANT)
928+#if defined(_PC8001MK2) || defined(_PC8001SR)
791929 case 0x31:
792930 if(mod & 0x03) {
793931 update_n80_write();
@@ -800,6 +938,8 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
800938 update_palette = true;
801939 }
802940 break;
941+#endif
942+#if defined(_PC8001SR)
803943 case 0x33:
804944 if(mod & 0x80) {
805945 update_n80_read();
@@ -810,15 +950,16 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
810950 update_gvram_sel();
811951 }
812952 if(mod & 0x02) {
813- if(intr_req_sound && !Port33_SINTM) {
953+ if(intr_req_opn1 && !Port32_SINTM) {
814954 request_intr(IRQ_SOUND, true);
815955 }
816956 }
817957 break;
958+#endif
818959 #else
819960 case 0x31:
820961 if(mod & 0x06) {
821- update_low_memmap();
962+ update_low_read();
822963 }
823964 if(mod & 0x08) {
824965 update_gvram_wait();
@@ -833,10 +974,11 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
833974 nippy_patch = (data == 0x37 && d_cpu->get_pc() == 0xaa32);
834975 #endif
835976 break;
977+#if defined(PC8801SR_VARIANT)
836978 case 0x32:
837979 if(mod & 0x03) {
838980 if(!(Port71_EROM & 1)) {
839- update_low_memmap();
981+ update_low_read();
840982 }
841983 }
842984 if(mod & 0x10) {
@@ -850,17 +992,20 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
850992 update_gvram_sel();
851993 }
852994 if(mod & 0x80) {
853- if(intr_req_sound && !Port32_SINTM) {
995+ if(intr_req_opn1 && !Port32_SINTM) {
854996 request_intr(IRQ_SOUND, true);
855997 }
856998 }
857999 break;
8581000 #endif
1001+#endif
1002+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
8591003 case 0x35:
8601004 if(mod & 0x80) {
8611005 update_gvram_sel();
8621006 }
8631007 break;
1008+#endif
8641009 case 0x40:
8651010 d_prn->write_signal(SIG_PRINTER_STROBE, data, 1);
8661011 d_rtc->write_signal(SIG_UPD1990A_STB, ~data, 2);
@@ -889,18 +1034,22 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
8891034 sing_signal = ((data & 0x80) != 0);
8901035 d_pcm->write_signal(SIG_PCM1BIT_SIGNAL, ((beep_on && beep_signal) || sing_signal) ? 1 : 0, 1);
8911036 break;
1037+#ifdef SUPPORT_PC88_OPN1
8921038 case 0x44:
8931039 case 0x45:
894- d_opn->write_io8(addr, data);
1040+ if(d_opn1 != NULL) {
1041+ d_opn1->write_io8(addr, data);
1042+ }
8951043 break;
8961044 #ifdef SUPPORT_PC88_OPNA
8971045 case 0x46:
8981046 case 0x47:
899- if(d_opn->is_ym2608) {
900- d_opn->write_io8(addr, data);
1047+ if(d_opn1 != NULL && d_opn1->is_ym2608) {
1048+ d_opn1->write_io8(addr, data);
9011049 }
9021050 break;
9031051 #endif
1052+#endif
9041053 case 0x50:
9051054 crtc.write_param(data);
9061055 if(crtc.timing_changed) {
@@ -911,7 +1060,7 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
9111060 case 0x51:
9121061 crtc.write_cmd(data);
9131062 break;
914-#if !defined(_PC8001SR)
1063+#if defined(PC8801_VARIANT)
9151064 case 0x52:
9161065 palette[8].b = (data & 0x10) ? 7 : 0;
9171066 palette[8].r = (data & 0x20) ? 7 : 0;
@@ -919,6 +1068,7 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
9191068 update_palette = true;
9201069 break;
9211070 #endif
1071+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
9221072 case 0x54:
9231073 case 0x55:
9241074 case 0x56:
@@ -927,7 +1077,7 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
9271077 case 0x59:
9281078 case 0x5a:
9291079 case 0x5b:
930-#if !defined(_PC8001SR)
1080+#if defined(PC8801SR_VARIANT)
9311081 if(Port32_PMODE) {
9321082 int n = (data & 0x80) ? 9 : (addr - 0x54);
9331083 if(data & 0x40) {
@@ -936,21 +1086,25 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
9361086 palette[n].b = data & 7;
9371087 palette[n].r = (data >> 3) & 7;
9381088 }
939- } else {
1089+ } else
1090+#endif
1091+ {
9401092 int n = addr - 0x54;
9411093 palette[n].b = (data & 1) ? 7 : 0;
9421094 palette[n].r = (data & 2) ? 7 : 0;
9431095 palette[n].g = (data & 4) ? 7 : 0;
9441096 }
945-#endif
9461097 update_palette = true;
9471098 break;
1099+#endif
1100+#if defined(_PC8001MK2) || defined(_PC8001SR) || defined(PC8801_VARIANT)
9481101 case 0x5c:
9491102 if(gvram_plane != 1) {
9501103 gvram_plane = 1;
9511104 update_gvram_sel();
9521105 }
9531106 break;
1107+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
9541108 case 0x5d:
9551109 if(gvram_plane != 2) {
9561110 gvram_plane = 2;
@@ -963,12 +1117,14 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
9631117 update_gvram_sel();
9641118 }
9651119 break;
1120+#endif
9661121 case 0x5f:
9671122 if(gvram_plane != 0) {
9681123 gvram_plane = 0;
9691124 update_gvram_sel();
9701125 }
9711126 break;
1127+#endif
9721128 case 0x60:
9731129 case 0x61:
9741130 case 0x62:
@@ -980,30 +1136,18 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
9801136 case 0x68:
9811137 dmac.write_io8(addr, data);
9821138 break;
1139+#if defined(PC8001_VARIANT)
9831140 #if defined(_PC8001SR)
9841141 case 0x71:
9851142 if((mod & 1) && Port33_N80SR) {
9861143 update_n80_read();
9871144 }
9881145 break;
989- case 0xe2:
990- if(mod & 0x01) {
991- update_n80_read();
992- }
993- if(mod & 0x10) {
994- update_n80_write();
995- }
996- break;
997- case 0xe3:
998- if(mod) {
999- update_n80_write();
1000- update_n80_read();
1001- }
1002- break;
1146+#endif
10031147 #else
10041148 case 0x71:
10051149 if(mod & 0x01) {
1006- update_low_memmap();
1150+ update_low_read();
10071151 }
10081152 break;
10091153 case 0x78:
@@ -1093,20 +1237,21 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
10931237 break;
10941238 case 0x99:
10951239 if(cdbios_loaded && (mod & 0x10)) {
1096- update_low_memmap();
1240+ update_low_read();
10971241 }
10981242 break;
10991243 #endif
1100-#ifdef SUPPORT_PC88_SB2
1244+#endif
1245+#ifdef SUPPORT_PC88_OPN2
11011246 case 0xa8:
11021247 case 0xa9:
1103- if(d_sb2 != NULL) {
1104- d_sb2->write_io8(addr, data);
1248+ if(d_opn2 != NULL) {
1249+ d_opn2->write_io8(addr, data);
11051250 }
11061251 break;
11071252 case 0xaa:
11081253 if(mod & 0x80) {
1109- if(intr_req_sb2 && !PortAA_S2INTM) {
1254+ if(intr_req_opn2 && !PortAA_S2INTM) {
11101255 request_intr(IRQ_SOUND, true);
11111256 }
11121257 }
@@ -1114,15 +1259,35 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
11141259 #ifdef SUPPORT_PC88_OPNA
11151260 case 0xac:
11161261 case 0xad:
1117- if(d_sb2 != NULL && d_sb2->is_ym2608) {
1118- d_sb2->write_io8(addr | 2, data);
1262+ if(d_opn2 != NULL && d_opn2->is_ym2608) {
1263+ d_opn2->write_io8(addr | 2, data);
11191264 }
11201265 break;
11211266 #endif
11221267 #endif
1268+#if defined(PC88_EXRAM_BANKS)
1269+#if defined(PC8001_VARIANT)
11231270 case 0xe2:
1124- if(mod & 0x11) {
1125- update_low_memmap();
1271+ if(mod & 0x01) {
1272+ update_n80_read();
1273+ }
1274+ if(mod & 0x10) {
1275+ update_n80_write();
1276+ }
1277+ break;
1278+ case 0xe3:
1279+ if(mod) {
1280+ update_n80_write();
1281+ update_n80_read();
1282+ }
1283+ break;
1284+#else
1285+ case 0xe2:
1286+ if(mod & 0x01) {
1287+ update_low_read();
1288+ }
1289+ if(mod & 0x10) {
1290+ update_low_write();
11261291 }
11271292 break;
11281293 case 0xe3:
@@ -1131,12 +1296,16 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
11311296 #else
11321297 if(mod & 0x0f) {
11331298 #endif
1134- if(PortE2_RDEN || PortE2_WREN) {
1135- update_low_memmap();
1299+ if(PortE2_RDEN) {
1300+ update_low_read();
1301+ }
1302+ if(PortE2_WREN) {
1303+ update_low_write();
11361304 }
11371305 }
11381306 break;
11391307 #endif
1308+#endif
11401309 case 0xe4:
11411310 intr_mask1 = ~(0xff << (data < 8 ? data : 8));
11421311 update_intr();
@@ -1189,6 +1358,38 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
11891358 uint32_t val = 0xff;
11901359
11911360 addr &= 0xff;
1361+#if defined(_PC8001) || defined(_PC8001MK2) || defined(_PC8801) || defined(_PC8801MK2)
1362+ // i/o address is not full-decoded
1363+ switch(addr) {
1364+ case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
1365+ addr = 0x10;
1366+ break;
1367+ case 0x22: case 0x24: case 0x26: case 0x28: case 0x2a: case 0x2c: case 0x2e:
1368+ addr = 0x20;
1369+ break;
1370+ case 0x23: case 0x25: case 0x27: case 0x29: case 0x2b: case 0x2d: case 0x2f:
1371+ addr = 0x21;
1372+ break;
1373+#if defined(_PC8001)
1374+ case 0x31: case 0x33: case 0x35: case 0x37: case 0x39: case 0x3b: case 0x3d: case 0x3f:
1375+#endif
1376+ case 0x32: case 0x34: case 0x36: case 0x38: case 0x3a: case 0x3c: case 0x3e:
1377+ addr = 0x30;
1378+ break;
1379+#if defined(_PC8001MK2) || defined(_PC8801MK2)
1380+ case 0x33: case 0x35: case 0x37: case 0x39: case 0x3b: case 0x3d: case 0x3f:
1381+ addr = 0x31;
1382+ break;
1383+#endif
1384+ case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f:
1385+ addr = 0x40;
1386+ break;
1387+ // correct ???
1388+ case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
1389+ addr &= 0xf7;
1390+ break;
1391+ }
1392+#endif
11921393 switch(addr) {
11931394 case 0x00:
11941395 case 0x01:
@@ -1200,11 +1401,17 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
12001401 case 0x07:
12011402 case 0x08:
12021403 case 0x09:
1404+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
12031405 case 0x0a:
1406+#endif
1407+#if defined(PC8801_VARIANT)
12041408 case 0x0b:
12051409 case 0x0c:
1410+#endif
1411+#if defined(PC8801SR_VARIANT)
12061412 case 0x0d:
12071413 case 0x0e:
1414+#endif
12081415 for(int i = 0; i < 8; i++) {
12091416 if(key_status[key_table[addr & 0x0f][i]]) {
12101417 val &= ~(1 << i);
@@ -1217,13 +1424,19 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
12171424 case 0x20:
12181425 case 0x21:
12191426 return d_sio->read_io8(addr);
1220-#if defined(_PC8001SR)
1427+#if defined(PC8001_VARIANT)
1428+#if defined(_PC8001MK2) || defined(_PC8001SR)
12211429 case 0x30:
12221430 return (config.boot_mode == MODE_PC80_N ? 0 : 1) | (config.boot_mode == MODE_PC80_V2 ? 0 : 2) | 0xfc;
12231431 case 0x31:
12241432 return (config.boot_mode == MODE_PC80_V2 ? 0 : 0x80) | 0x39;
1433+#endif
1434+#if defined(_PC8801SR)
1435+ case 0x32:
1436+ return port[0x32];
12251437 case 0x33:
12261438 return port[0x33];
1439+#endif
12271440 #else
12281441 case 0x30:
12291442 // return (config.boot_mode == MODE_PC88_N ? 0 : 1) | 0xca; // 80x20 (XM8 version 1.00)
@@ -1239,61 +1452,73 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
12391452 // XM8 version 1.10
12401453 // return (crtc.vblank ? 0x20 : 0) | (d_rtc->read_signal(0) ? 0x10 : 0) | (usart_dcd ? 4 : 0) | (hireso ? 0 : 2) | 0xc1;
12411454 return (crtc.vblank ? 0x20 : 0) | (d_rtc->read_signal(0) ? 0x10 : 0) | (usart_dcd ? 4 : 0) | (hireso ? 0 : 2) | (d_prn->read_signal(SIG_PRINTER_BUSY) ? 1 : 0) | 0xc0;
1455+#ifdef SUPPORT_PC88_OPN1
12421456 case 0x44:
1243- val = d_opn->read_io8(addr);
1244- if(opn_busy) {
1245- // show busy flag for first access (for ALPHA)
1246- if(d_cpu->get_pc() == 0xe615) {
1247- val |= 0x80;
1457+ if(d_opn1 != NULL) {
1458+ val = d_opn1->read_io8(addr);
1459+#ifdef PC8801_VARIANT
1460+ if(opn_busy) {
1461+ // show busy flag for first access (for ALPHA)
1462+ if(d_cpu->get_pc() == 0xe615) {
1463+ val |= 0x80;
1464+ }
1465+ opn_busy = false;
12481466 }
1249- opn_busy = false;
1467+#endif
1468+ return val;
12501469 }
1251- return val;
1470+ break;
12521471 case 0x45:
1253- if(Port44_OPNCH == 14) {
1472+ if(d_opn1 != NULL) {
1473+ if(Port44_OPNCH == 14) {
12541474 #ifdef SUPPORT_PC88_JOYSTICK
1255- if(config.joystick_type == DEVICE_JOYSTICK) {
1256- return (~(joystick_status[0] >> 0) & 0x0f) | 0xf0;
1257- } else if(config.joystick_type == DEVICE_MOUSE) {
1258- switch(mouse_phase) {
1259- case 0:
1260- return ((mouse_lx >> 4) & 0x0f) | 0xf0;
1261- case 1:
1262- return ((mouse_lx >> 0) & 0x0f) | 0xf0;
1263- case 2:
1264- return ((mouse_ly >> 4) & 0x0f) | 0xf0;
1265- case 3:
1266- return ((mouse_ly >> 0) & 0x0f) | 0xf0;
1475+ if(config.joystick_type == DEVICE_JOYSTICK) {
1476+ return (~(joystick_status[0] >> 0) & 0x0f) | 0xf0;
1477+ } else if(config.joystick_type == DEVICE_MOUSE) {
1478+ switch(mouse_phase) {
1479+ case 0:
1480+ return ((mouse_lx >> 4) & 0x0f) | 0xf0;
1481+ case 1:
1482+ return ((mouse_lx >> 0) & 0x0f) | 0xf0;
1483+ case 2:
1484+ return ((mouse_ly >> 4) & 0x0f) | 0xf0;
1485+ case 3:
1486+ return ((mouse_ly >> 0) & 0x0f) | 0xf0;
1487+ }
1488+ return 0xf0; // ???
12671489 }
1268- return 0xf0; // ???
1269- }
12701490 #endif
1271- return 0xff;
1272- } else if(Port44_OPNCH == 15) {
1491+ return 0xff;
1492+ } else if(Port44_OPNCH == 15) {
12731493 #ifdef SUPPORT_PC88_JOYSTICK
1274- if(config.joystick_type == DEVICE_JOYSTICK) {
1275- return (~(joystick_status[0] >> 4) & 0x03) | 0xfc;
1276- } else if(config.joystick_type == DEVICE_MOUSE) {
1277- return (~mouse_status[2] & 0x03) | 0xfc;
1278- }
1494+ if(config.joystick_type == DEVICE_JOYSTICK) {
1495+ return (~(joystick_status[0] >> 4) & 0x03) | 0xfc;
1496+ } else if(config.joystick_type == DEVICE_MOUSE) {
1497+ return (~mouse_status[2] & 0x03) | 0xfc;
1498+ }
12791499 #endif
1280- return 0xff;
1500+ return 0xff;
1501+ }
1502+ return d_opn1->read_io8(addr);
12811503 }
1282- return d_opn->read_io8(addr);
1504+ break;
12831505 #ifdef SUPPORT_PC88_OPNA
12841506 case 0x46:
12851507 case 0x47:
1286- if(d_opn->is_ym2608) {
1287- return d_opn->read_io8(addr);
1508+ if(d_opn1 != NULL && d_opn1->is_ym2608) {
1509+ return d_opn1->read_io8(addr);
12881510 }
12891511 break;
12901512 #endif
1513+#endif
12911514 case 0x50:
12921515 return crtc.read_param();
12931516 case 0x51:
12941517 return crtc.read_status();
1518+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
12951519 case 0x5c:
12961520 return gvram_plane | 0xf8;
1521+#endif
12971522 case 0x60:
12981523 case 0x61:
12991524 case 0x62:
@@ -1304,20 +1529,24 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
13041529 case 0x67:
13051530 case 0x68:
13061531 return dmac.read_io8(addr);
1532+#if defined(PC8801SR_VARIANT)
13071533 case 0x6e:
13081534 // XM8 version 1.20
13091535 return (cpu_clock_low ? 0x80 : 0) | (is_sr_mr() ? 0x7f : 0x10);
13101536 case 0x6f:
13111537 // XM8 version 1.20
13121538 return is_sr_mr() ? 0xff : (port[0x6f] | 0xf0);
1313-#if !defined(_PC8001SR)
1539+#endif
1540+#if defined(PC8801_VARIANT)
13141541 case 0x70:
13151542 // PC-8001mkIISR returns the constant value
13161543 // this port is used to detect PC-8001mkIISR or 8801mkIISR
13171544 return port[0x70];
13181545 #endif
1546+#if defined(_PC8001SR) || defined(PC8801_VARIANT)
13191547 case 0x71:
13201548 return port[0x71];
1549+#endif
13211550 #ifdef SUPPORT_PC88_HMB20
13221551 // case 0x88:
13231552 case 0x89:
@@ -1374,14 +1603,14 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
13741603 }
13751604 break;
13761605 #endif
1377-#ifdef SUPPORT_PC88_SB2
1606+#ifdef SUPPORT_PC88_OPN2
13781607 case 0xa8:
1379- if(d_sb2 != NULL) {
1380- return d_sb2->read_io8(addr);
1608+ if(d_opn2 != NULL) {
1609+ return d_opn2->read_io8(addr);
13811610 }
13821611 break;
13831612 case 0xa9:
1384- if(d_sb2 != NULL) {
1613+ if(d_opn2 != NULL) {
13851614 if(PortA8_OPNCH == 14) {
13861615 #ifdef SUPPORT_PC88_JOYSTICK
13871616 if(config.joystick_type == DEVICE_JOYSTICK) {
@@ -1411,7 +1640,7 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
14111640 #endif
14121641 return 0xff;
14131642 }
1414- return d_sb2->read_io8(addr);
1643+ return d_opn2->read_io8(addr);
14151644 }
14161645 break;
14171646 case 0xaa:
@@ -1419,8 +1648,8 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
14191648 #ifdef SUPPORT_PC88_OPNA
14201649 case 0xac:
14211650 case 0xad:
1422- if(d_sb2 != NULL && d_sb2->is_ym2608) {
1423- d_sb2->read_io8(addr | 2);
1651+ if(d_opn2 != NULL && d_opn2->is_ym2608) {
1652+ d_opn2->read_io8(addr | 2);
14241653 }
14251654 break;
14261655 #endif
@@ -1434,6 +1663,7 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
14341663 }
14351664 break;
14361665 #endif
1666+#if defined(PC88_EXRAM_BANKS)
14371667 case 0xe2:
14381668 return (~port[0xe2]) | 0xee;
14391669 case 0xe3:
@@ -1442,14 +1672,19 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
14421672 #else
14431673 return port[0xe3] | 0xf0;
14441674 #endif
1675+#endif
1676+#ifdef SUPPORT_PC88_KANJI1
14451677 case 0xe8:
14461678 return kanji1[PortE8E9_KANJI1 * 2 + 1];
14471679 case 0xe9:
14481680 return kanji1[PortE8E9_KANJI1 * 2];
1681+#endif
1682+#ifdef SUPPORT_PC88_KANJI2
14491683 case 0xec:
14501684 return kanji2[PortECED_KANJI2 * 2 + 1];
14511685 case 0xed:
14521686 return kanji2[PortECED_KANJI2 * 2];
1687+#endif
14531688 case 0xfc:
14541689 case 0xfd:
14551690 case 0xfe:
@@ -1461,15 +1696,12 @@ uint32_t PC88::read_io8_debug(uint32_t addr)
14611696 uint32_t PC88::read_dma_data8(uint32_t addr)
14621697 {
14631698 // from ram
1464-#if defined(_PC8001SR)
1465- return ram[addr & 0xffff];
1466-#else
1699+#if defined(PC8801SR_VARIANT)
14671700 if((addr & 0xf000) == 0xf000 && (config.boot_mode == MODE_PC88_V1H || config.boot_mode == MODE_PC88_V2)) {
14681701 return tvram[addr & 0xfff];
1469- } else {
1470- return ram[addr & 0xffff];
14711702 }
14721703 #endif
1704+ return ram[addr & 0xffff];
14731705 }
14741706
14751707 void PC88::write_dma_data8(uint32_t addr, uint32_t data)
@@ -1500,7 +1732,7 @@ int PC88::get_m1_wait(bool addr_f000)
15001732 // XM8 version 1.20
15011733 int wait = 0;
15021734
1503-#if defined(_PC8001SR)
1735+#if defined(PC8001_VARIANT)
15041736 if(config.boot_mode == MODE_PC80_V1 || config.boot_mode == MODE_PC80_N) {
15051737 #else
15061738 if(config.boot_mode == MODE_PC88_V1S || config.boot_mode == MODE_PC88_N) {
@@ -1531,7 +1763,7 @@ int PC88::get_m1_wait(bool addr_f000)
15311763 return wait;
15321764 }
15331765
1534-int PC88::get_main_wait(bool read)
1766+int PC88::get_main_wait(bool read)
15351767 {
15361768 // XM8 version 1.20
15371769 int wait = 0;
@@ -1546,7 +1778,7 @@ int PC88::get_main_wait(bool read)
15461778 }
15471779 } else {
15481780 // 8MHz
1549-#if !defined(_PC8001SR)
1781+#if defined(PC8801SR_VARIANT)
15501782 if(!cpu_clock_high_fe2) {
15511783 // not 8MHzH
15521784 wait += 1;
@@ -1560,6 +1792,7 @@ int PC88::get_main_wait(bool read)
15601792 return wait;
15611793 }
15621794
1795+#if defined(PC8801SR_VARIANT)
15631796 int PC88::get_tvram_wait(bool read)
15641797 {
15651798 int wait = 0;
@@ -1584,8 +1817,9 @@ int PC88::get_tvram_wait(bool read)
15841817 }
15851818 return wait;
15861819 }
1820+#endif
15871821
1588-int PC88::get_gvram_wait(bool read)
1822+int PC88::get_gvram_wait(bool read)
15891823 {
15901824 // XM8 version 1.20
15911825 int wait = 0;
@@ -1594,7 +1828,7 @@ int PC88::get_gvram_wait(bool read)
15941828 // graphic on
15951829 if(cpu_clock_low) {
15961830 // 4MHz
1597-#if defined(_PC8001SR)
1831+#if defined(PC8001_VARIANT)
15981832 if(config.boot_mode == MODE_PC80_V1 || config.boot_mode == MODE_PC80_N) {
15991833 #else
16001834 if(config.boot_mode == MODE_PC88_V1S || config.boot_mode == MODE_PC88_N) {
@@ -1622,10 +1856,9 @@ int PC88::get_gvram_wait(bool read)
16221856 wait += 2;
16231857 }
16241858 }
1625- }
1626- else {
1859+ } else {
16271860 // 8MHz
1628-#if defined(_PC8001SR)
1861+#if defined(PC8001_VARIANT)
16291862 if(config.boot_mode == MODE_PC80_V1 || config.boot_mode == MODE_PC80_N) {
16301863 #else
16311864 if(config.boot_mode == MODE_PC88_V1S || config.boot_mode == MODE_PC88_N) {
@@ -1680,87 +1913,99 @@ void PC88::update_gvram_wait()
16801913
16811914 void PC88::update_gvram_sel()
16821915 {
1683-#if defined(_PC8001SR)
1684- if(Port33_GVAM) {
1685-#else
1916+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
16861917 if(Port32_GVAM) {
1687-#endif
16881918 if(Port35_GAM) {
16891919 gvram_sel = 8;
16901920 } else {
16911921 gvram_sel = 0;
16921922 }
16931923 gvram_plane = 0; // from M88
1694- } else {
1924+ } else
1925+#endif
1926+ {
16951927 gvram_sel = gvram_plane;
16961928 }
16971929 f000_m1_wait_clocks = get_m1_wait(true);
16981930 }
16991931
1700-#if defined(_PC8001SR)
1932+#if defined(PC8001_VARIANT)
17011933 void PC88::update_n80_write()
17021934 {
1935+#if defined(PC88_EXRAM_BANKS)
17031936 if(PortE2_WREN || Port31_MMODE) {
17041937 if(PortE3_ERAMSL < PC88_EXRAM_BANKS) {
17051938 SET_BANK_W(0x0000, 0x7fff, exram + 0x8000 * PortE3_ERAMSL);
17061939 } else {
17071940 SET_BANK_W(0x0000, 0x7fff, exram);
17081941 }
1709- } else {
1710- SET_BANK_W(0x0000, 0x7fff, wdmy);
1942+ return;
17111943 }
1944+#endif
1945+ SET_BANK_W(0x0000, 0x7fff, wdmy);
17121946 }
17131947
17141948 void PC88::update_n80_read()
17151949 {
1950+#if defined(PC88_EXRAM_BANKS)
17161951 if(PortE2_RDEN || Port31_MMODE) {
17171952 if(PortE3_ERAMSL < PC88_EXRAM_BANKS) {
17181953 SET_BANK_R(0x0000, 0x7fff, exram + 0x8000 * PortE3_ERAMSL);
17191954 } else {
17201955 SET_BANK_R(0x0000, 0x7fff, exram);
17211956 }
1722- } else if(Port33_N80SR) {
1957+ return;
1958+ }
1959+#endif
1960+#if defined(_PC8001SR)
1961+ if(Port33_N80SR) {
17231962 if(port[0x71] & 1) {
1724- SET_BANK_R(0x0000, 0x7fff, n80mk2srrom);
1725- } else {
1726- SET_BANK_R(0x0000, 0x5fff, n80mk2srrom);
1727- SET_BANK_R(0x6000, 0x7fff, n80mk2srrom + 0x8000);
1728- }
1729- } else {
1730- if(port[0x31] & 1) {
1731- SET_BANK_R(0x0000, 0x7fff, n80mk2rom);
1963+ SET_BANK_R(0x0000, 0x7fff, n80srrom);
17321964 } else {
1733- SET_BANK_R(0x0000, 0x5fff, n80mk2rom);
1734- SET_BANK_R(0x6000, 0x7fff, rdmy);
1965+ SET_BANK_R(0x0000, 0x5fff, n80srrom);
1966+ SET_BANK_R(0x6000, 0x7fff, n80srrom + 0x8000);
17351967 }
1968+ return;
1969+ }
1970+#endif
1971+#if defined(_PC8001MK2) || defined(_PC8001SR)
1972+ if(!(port[0x31] & 1)) {
1973+ SET_BANK_R(0x0000, 0x5fff, n80rom);
1974+ SET_BANK_R(0x6000, 0x7fff, rdmy);
1975+ return;
17361976 }
1977+#endif
1978+ SET_BANK_R(0x0000, 0x7fff, n80rom);
17371979 }
17381980 #else
1739-void PC88::update_low_memmap()
1981+void PC88::update_low_read()
17401982 {
1741- // read
1983+#if defined(PC88_EXRAM_BANKS)
17421984 if(PortE2_RDEN) {
1743-#ifdef PC88_EXRAM_BANKS
17441985 if(PortE3_ERAMSL < PC88_EXRAM_BANKS) {
17451986 SET_BANK_R(0x0000, 0x7fff, exram + 0x8000 * PortE3_ERAMSL);
17461987 } else {
1747-#endif
17481988 // SET_BANK_R(0x0000, 0x7fff, rdmy);
1749-#ifdef PC88_EXRAM_BANKS
17501989 }
1990+ return;
1991+ }
17511992 #endif
1752- } else if(Port31_MMODE) {
1993+ if(Port31_MMODE) {
17531994 // 64K RAM
17541995 SET_BANK_R(0x0000, 0x7fff, ram);
1996+ return;
1997+ }
17551998 #ifdef SUPPORT_PC88_CDROM
1756- } else if(cdbios_loaded && Port99_CDREN) {
1999+ if(cdbios_loaded && Port99_CDREN) {
17572000 if(Port31_RMODE) {
17582001 SET_BANK_R(0x0000, 0x7fff, cdbios + 0x8000);
17592002 } else {
17602003 SET_BANK_R(0x0000, 0x7fff, cdbios + 0x0000);
17612004 }
2005+ return;
2006+ }
17622007 #endif
1763- } else if(Port31_RMODE) {
2008+ if(Port31_RMODE) {
17642009 // N-BASIC
17652010 SET_BANK_R(0x0000, 0x7fff, n80rom);
17662011 } else {
@@ -1772,24 +2017,25 @@ void PC88::update_low_memmap()
17722017 SET_BANK_R(0x6000, 0x7fff, n88exrom + 0x2000 * Port32_EROMSL);
17732018 }
17742019 }
1775-
1776- // write
2020+}
2021+
2022+void PC88::update_low_write()
2023+{
2024+#if defined(PC88_EXRAM_BANKS)
17772025 if(PortE2_WREN) {
1778-#ifdef PC88_EXRAM_BANKS
17792026 if(PortE3_ERAMSL < PC88_EXRAM_BANKS) {
17802027 SET_BANK_W(0x0000, 0x7fff, exram + 0x8000 * PortE3_ERAMSL);
17812028 } else {
1782-#endif
17832029 // SET_BANK_W(0x0000, 0x7fff, wdmy);
17842030 SET_BANK_W(0x0000, 0x7fff, ram);
1785-#ifdef PC88_EXRAM_BANKS
17862031 }
1787-#endif
1788- } else {
1789- SET_BANK_W(0x0000, 0x7fff, ram);
2032+ return;
17902033 }
2034+#endif
2035+ SET_BANK_W(0x0000, 0x7fff, ram);
17912036 }
17922037
2038+#if defined(PC8801SR_VARIANT)
17932039 void PC88::update_tvram_memmap()
17942040 {
17952041 // XM8 version 1.10
@@ -1800,24 +2046,23 @@ void PC88::update_tvram_memmap()
18002046 }
18012047 }
18022048 #endif
2049+#endif
18032050
18042051 void PC88::write_signal(int id, uint32_t data, uint32_t mask)
18052052 {
18062053 if(id == SIG_PC88_USART_IRQ) {
18072054 request_intr(IRQ_USART, ((data & mask) != 0));
1808- } else if(id == SIG_PC88_SOUND_IRQ) {
1809- intr_req_sound = ((data & mask) != 0);
1810-#if defined(_PC8001SR)
1811- if(intr_req_sound && !Port33_SINTM) {
1812-#else
1813- if(intr_req_sound && !Port32_SINTM) {
1814-#endif
2055+#ifdef SUPPORT_PC88_OPN1
2056+ } else if(id == SIG_PC88_OPN1_IRQ) {
2057+ intr_req_opn1 = ((data & mask) != 0);
2058+ if(intr_req_opn1 && !Port32_SINTM) {
18152059 request_intr(IRQ_SOUND, true);
18162060 }
1817-#ifdef SUPPORT_PC88_SB2
1818- } else if(id == SIG_PC88_SB2_IRQ) {
1819- intr_req_sb2 = ((data & mask) != 0);
1820- if(intr_req_sb2 && !PortAA_S2INTM) {
2061+#endif
2062+#ifdef SUPPORT_PC88_OPN2
2063+ } else if(id == SIG_PC88_OPN2_IRQ) {
2064+ intr_req_opn2 = ((data & mask) != 0);
2065+ if(intr_req_opn2 && !PortAA_S2INTM) {
18212066 request_intr(IRQ_SOUND, true);
18222067 }
18232068 #endif
@@ -1963,7 +2208,7 @@ void PC88::event_vline(int v, int clock)
19632208 if(v < disp_line) {
19642209 if(/*(crtc.status & 0x10) && */dmac.ch[2].running) {
19652210 // bus request
1966-#if defined(_PC8001SR)
2211+#if defined(PC8001_VARIANT)
19672212 if(config.boot_mode == MODE_PC80_V1 || config.boot_mode == MODE_PC80_N) {
19682213 #else
19692214 if(config.boot_mode == MODE_PC88_V1S || config.boot_mode == MODE_PC88_N) {
@@ -1990,7 +2235,7 @@ void PC88::event_vline(int v, int clock)
19902235 update_gvram_wait();
19912236 }
19922237 // update palette
1993-#if !defined(_PC8001SR)
2238+#if defined(PC8801SR_VARIANT)
19942239 if(v < (disp_line <= 200 ? 200 : 400)) {
19952240 #else
19962241 if(v < 200) {
@@ -2010,8 +2255,10 @@ void PC88::event_vline(int v, int clock)
20102255 for(int i = 0; i < 9; i++) {
20112256 palette_digital[i] = palette_analog[i] = initial[i];
20122257 }
2258+#if defined(PC8001_VARIANT)
20132259 #if defined(_PC8001SR)
20142260 if(config.boot_mode != MODE_PC80_V2) {
2261+#endif
20152262 if(Port31_V1_320x200) {
20162263 for(int i = 0; i < 3; i++) {
20172264 palette_analog[i].b = (port[0x31] & 4) ? 7 : 0;
@@ -2035,6 +2282,7 @@ void PC88::event_vline(int v, int clock)
20352282 } else {
20362283 palette_digital[0] = palette_analog[0];
20372284 }
2285+#if defined(_PC8001SR)
20382286 } else {
20392287 for(int i = 0; i < 8; i++) {
20402288 palette_analog[i].b = (port[0x54 + i] & 1) ? 7 : 0;
@@ -2046,6 +2294,7 @@ void PC88::event_vline(int v, int clock)
20462294 }
20472295 palette_digital[0] = palette_analog[0];
20482296 }
2297+#endif
20492298 #else
20502299 for(int i = 0; i < 8; i++) {
20512300 palette_analog[i] = palette[i];
@@ -2215,8 +2464,13 @@ void PC88::draw_screen()
22152464 // render graph screen
22162465 bool disp_color_graph = true;
22172466 bool draw_scanline_black = config.scan_line;
2467+#if defined(PC8001_VARIANT)
22182468 #if defined(_PC8001SR)
22192469 if(config.boot_mode != MODE_PC80_V2) {
2470+#endif
2471+#if defined(_PC8001)
2472+ memset(graph, 0, sizeof(graph));
2473+#else
22202474 if(Port31_V1_320x200) {
22212475 disp_color_graph = draw_320x200_4color_graph();
22222476 } else if(Port31_V1_MONO) {
@@ -2227,7 +2481,9 @@ void PC88::draw_screen()
22272481 }
22282482 draw_640x200_attrib_graph();
22292483 }
2484+#endif
22302485 emu->set_vm_screen_lines(200);
2486+#if defined(_PC8001SR)
22312487 } else {
22322488 if(Port31_HCOLOR) {
22332489 if(Port31_320x200) {
@@ -2248,29 +2504,32 @@ void PC88::draw_screen()
22482504 emu->set_vm_screen_lines(200);
22492505 }
22502506 }
2507+#endif
22512508 #else
22522509 if(Port31_HCOLOR) {
22532510 disp_color_graph = draw_640x200_color_graph();
22542511 emu->set_vm_screen_lines(200);
2255- } else if(!Port31_400LINE) {
2512+#if defined(PC8801SR_VARIANT)
2513+ } else if (Port31_400LINE) {
22562514 if(hireso) {
22572515 draw_scanline_black = false;
22582516 }
2259- draw_640x200_attrib_graph();
2260-// draw_640x200_mono_graph();
2261- emu->set_vm_screen_lines(200);
2517+ draw_640x400_attrib_graph();
2518+// draw_640x400_mono_graph();
2519+ emu->set_vm_screen_lines(400);
2520+#endif
22622521 } else {
22632522 if(hireso) {
22642523 draw_scanline_black = false;
22652524 }
2266- draw_640x400_attrib_graph();
2267-// draw_640x400_mono_graph();
2268- emu->set_vm_screen_lines(400);
2525+ draw_640x200_attrib_graph();
2526+// draw_640x200_mono_graph();
2527+ emu->set_vm_screen_lines(200);
22692528 }
22702529 #endif
22712530
22722531 // create palette for each scanline
2273-#if !defined(_PC8001SR)
2532+#if defined(PC8801SR_VARIANT)
22742533 int disp_line = crtc.height * crtc.char_height;
22752534 int ymax = (disp_line <= 200) ? 200 : 400;
22762535 #else
@@ -2286,7 +2545,7 @@ void PC88::draw_screen()
22862545
22872546 scrntype_t palette_line_digital_text_pc [400][9];
22882547 scrntype_t palette_line_analog_graph_pc [400][9];
2289-#if !defined(_PC8001SR)
2548+#if defined(PC8801_VARIANT)
22902549 scrntype_t palette_line_analog_text_pc [400][9];
22912550 scrntype_t palette_line_digital_graph_pc[400][9];
22922551 #endif
@@ -2316,7 +2575,7 @@ void PC88::draw_screen()
23162575 palette_line_digital_text_pc [2 * y + 1][i] = palette_digital_text_pc [i];
23172576 palette_line_analog_graph_pc [2 * y ][i] =
23182577 palette_line_analog_graph_pc [2 * y + 1][i] = palette_analog_graph_pc [i];
2319-#if !defined(_PC8001SR)
2578+#if defined(PC8801_VARIANT)
23202579 palette_line_analog_text_pc [2 * y ][i] =
23212580 palette_line_analog_text_pc [2 * y + 1][i] = palette_analog_text_pc [i];
23222581 palette_line_digital_graph_pc[2 * y ][i] =
@@ -2327,7 +2586,7 @@ void PC88::draw_screen()
23272586 for(int i = 0; i < 9; i++) {
23282587 palette_line_digital_text_pc [y][i] = palette_digital_text_pc [i];
23292588 palette_line_analog_graph_pc [y][i] = palette_analog_graph_pc [i];
2330-#if !defined(_PC8001SR)
2589+#if defined(PC8801_VARIANT)
23312590 palette_line_analog_text_pc [y][i] = palette_analog_text_pc [i];
23322591 palette_line_digital_graph_pc[y][i] = palette_digital_graph_pc[i];
23332592 #endif
@@ -2336,7 +2595,7 @@ void PC88::draw_screen()
23362595 }
23372596
23382597 // copy to screen buffer
2339-#if !defined(_PC8001SR)
2598+#if defined(PC8801SR_VARIANT)
23402599 #if defined(SUPPORT_PC88_VAB)
23412600 // X88000
23422601 if(PortB4_VAB_DISP) {
@@ -2395,17 +2654,20 @@ void PC88::draw_screen()
23952654 uint8_t* src_g = graph[y];
23962655 scrntype_t* pal_t;
23972656 scrntype_t* pal_g;
2398-#if defined(_PC8001SR)
2657+#if defined(PC8001_VARIANT)
23992658 pal_t = palette_line_digital_text_pc[y];
24002659 pal_g = palette_line_analog_graph_pc[y];
24012660
2402- if(port[0x33] & 8) {
2661+#if defined(_PC8001SR)
2662+ if(Port33_PR2) {
24032663 for(int x = 0; x < 640; x++) {
24042664 uint32_t t = src_t[x];
24052665 uint32_t g = src_g[x];
24062666 dest[x] = (!g && t) ? pal_t[t] : ((y & 1) && draw_scanline_black) ? 0 : pal_g[g];
24072667 }
2408- } else {
2668+ } else
2669+#endif
2670+ {
24092671 for(int x = 0; x < 640; x++) {
24102672 uint32_t t = src_t[x];
24112673 dest[x] = t ? pal_t[t] : ((y & 1) && draw_scanline_black) ? 0 : pal_g[src_g[x]];
@@ -2552,6 +2814,7 @@ void PC88::draw_text()
25522814 }
25532815 }
25542816
2817+#if defined(PC8001_VARIANT)
25552818 #if defined(_PC8001SR)
25562819 bool PC88::draw_320x200_color_graph()
25572820 {
@@ -2566,7 +2829,7 @@ bool PC88::draw_320x200_color_graph()
25662829 uint8_t *gvram_r1 = Port53_G1DS ? gvram_null : (gvram + 0x6000);
25672830 uint8_t *gvram_g1 = Port53_G1DS ? gvram_null : (gvram + 0xa000);
25682831
2569- if(port[0x33] & 4) {
2832+ if(Port33_PR1) {
25702833 // G1>G0
25712834 uint8_t *tmp;
25722835 tmp = gvram_b0; gvram_b0 = gvram_b1; gvram_b1 = tmp;
@@ -2618,6 +2881,7 @@ bool PC88::draw_320x200_color_graph()
26182881 }
26192882 return true;
26202883 }
2884+#endif
26212885
26222886 bool PC88::draw_320x200_4color_graph()
26232887 {
@@ -2871,7 +3135,7 @@ void PC88::draw_640x200_attrib_graph()
28713135 }
28723136 }
28733137
2874-#if !defined(_PC8001SR)
3138+#if defined(PC8801SR_VARIANT)
28753139 void PC88::draw_640x400_mono_graph()
28763140 {
28773141 if(!Port31_GRAPH || (Port53_G0DS && Port53_G1DS)) {
@@ -3305,10 +3569,10 @@ void pc88_dmac_t::write_io8(uint32_t addr, uint32_t data)
33053569 int c = (addr >> 1) & 3;
33063570
33073571 switch(addr & 0x0f) {
3308- case 0:
3309- case 2:
3310- case 4:
3311- case 6:
3572+ case 0x00:
3573+ case 0x02: case 0x0a:
3574+ case 0x04: case 0x0c:
3575+ case 0x06: case 0x0e:
33123576 if(!high_low) {
33133577 if((mode & 0x80) && c == 2) {
33143578 ch[3].addr.b.l = data;
@@ -3324,10 +3588,10 @@ void pc88_dmac_t::write_io8(uint32_t addr, uint32_t data)
33243588 }
33253589 high_low = !high_low;
33263590 break;
3327- case 1:
3328- case 3:
3329- case 5:
3330- case 7:
3591+ case 0x01: case 0x09:
3592+ case 0x03: case 0x0b:
3593+ case 0x05: case 0x0d:
3594+ case 0x07: case 0x0f:
33313595 if(!high_low) {
33323596 if((mode & 0x80) && c == 2) {
33333597 ch[3].count.b.l = data;
@@ -3345,7 +3609,7 @@ void pc88_dmac_t::write_io8(uint32_t addr, uint32_t data)
33453609 }
33463610 high_low = !high_low;
33473611 break;
3348- case 8:
3612+ case 0x08:
33493613 mode = data;
33503614 high_low = false;
33513615 break;
@@ -3358,10 +3622,10 @@ uint32_t pc88_dmac_t::read_io8(uint32_t addr)
33583622 int c = (addr >> 1) & 3;
33593623
33603624 switch(addr & 0x0f) {
3361- case 0:
3362- case 2:
3363- case 4:
3364- case 6:
3625+ case 0x00:
3626+ case 0x02: case 0x0a:
3627+ case 0x04: case 0x0c:
3628+ case 0x06: case 0x0e:
33653629 if(!high_low) {
33663630 val = ch[c].addr.b.l;
33673631 } else {
@@ -3369,10 +3633,10 @@ uint32_t pc88_dmac_t::read_io8(uint32_t addr)
33693633 }
33703634 high_low = !high_low;
33713635 break;
3372- case 1:
3373- case 3:
3374- case 5:
3375- case 7:
3636+ case 0x01: case 0x09:
3637+ case 0x03: case 0x0b:
3638+ case 0x05: case 0x0d:
3639+ case 0x07: case 0x0f:
33763640 if(!high_low) {
33773641 val = ch[c].count.b.l;
33783642 } else {
@@ -3380,7 +3644,7 @@ uint32_t pc88_dmac_t::read_io8(uint32_t addr)
33803644 }
33813645 high_low = !high_low;
33823646 break;
3383- case 8:
3647+ case 0x08:
33843648 val = status;
33853649 status &= 0xf0;
33863650 // high_low = false;
@@ -3446,7 +3710,7 @@ void pc88_dmac_t::finish(int c)
34463710 }
34473711 }
34483712
3449-#define STATE_VERSION 10
3713+#define STATE_VERSION 11
34503714
34513715 bool PC88::process_state(FILEIO* state_fio, bool loading)
34523716 {
@@ -3461,7 +3725,9 @@ bool PC88::process_state(FILEIO* state_fio, bool loading)
34613725 state_fio->StateArray(exram, sizeof(exram), 1);
34623726 #endif
34633727 state_fio->StateArray(gvram, sizeof(gvram), 1);
3728+#if defined(PC8801SR_VARIANT)
34643729 state_fio->StateArray(tvram, sizeof(tvram), 1);
3730+#endif
34653731 state_fio->StateArray(port, sizeof(port), 1);
34663732 state_fio->StateValue(crtc.blink.rate);
34673733 state_fio->StateValue(crtc.blink.counter);
@@ -3500,7 +3766,9 @@ bool PC88::process_state(FILEIO* state_fio, bool loading)
35003766 state_fio->StateValue(dmac.mode);
35013767 state_fio->StateValue(dmac.status);
35023768 state_fio->StateValue(dmac.high_low);
3769+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
35033770 state_fio->StateArray(alu_reg, sizeof(alu_reg), 1);
3771+#endif
35043772 state_fio->StateValue(gvram_plane);
35053773 state_fio->StateValue(gvram_sel);
35063774 state_fio->StateValue(cpu_clock_low);
@@ -3512,8 +3780,10 @@ bool PC88::process_state(FILEIO* state_fio, bool loading)
35123780 state_fio->StateValue(f000_m1_wait_clocks);
35133781 state_fio->StateValue(mem_wait_clocks_r);
35143782 state_fio->StateValue(mem_wait_clocks_w);
3783+#if defined(PC8801SR_VARIANT)
35153784 state_fio->StateValue(tvram_wait_clocks_r);
35163785 state_fio->StateValue(tvram_wait_clocks_w);
3786+#endif
35173787 state_fio->StateValue(gvram_wait_clocks_r);
35183788 state_fio->StateValue(gvram_wait_clocks_w);
35193789 state_fio->StateValue(busreq_clocks);
@@ -3550,9 +3820,11 @@ bool PC88::process_state(FILEIO* state_fio, bool loading)
35503820 state_fio->StateValue(mouse_ly);
35513821 #endif
35523822 state_fio->StateValue(intr_req);
3553- state_fio->StateValue(intr_req_sound);
3554-#ifdef SUPPORT_PC88_SB2
3555- state_fio->StateValue(intr_req_sb2);
3823+#ifdef SUPPORT_PC88_OPN1
3824+ state_fio->StateValue(intr_req_opn1);
3825+#endif
3826+#ifdef SUPPORT_PC88_OPN2
3827+ state_fio->StateValue(intr_req_opn2);
35563828 #endif
35573829 state_fio->StateValue(intr_mask1);
35583830 state_fio->StateValue(intr_mask2);
@@ -3614,13 +3886,16 @@ bool PC88::process_state(FILEIO* state_fio, bool loading)
36143886
36153887 // post process
36163888 if(loading) {
3617-#if defined(_PC8001SR)
3889+#if defined(PC8001_VARIANT)
36183890 update_n80_write();
36193891 update_n80_read();
36203892 #else
3621- update_low_memmap();
3893+ update_low_write();
3894+ update_low_read();
3895+#if defined(PC8801SR_VARIANT)
36223896 update_tvram_memmap();
36233897 #endif
3898+#endif
36243899 // force update palette when state file is loaded
36253900 update_palette = true;
36263901 }
--- a/source/src/vm/pc8801/pc88.h
+++ b/source/src/vm/pc8801/pc88.h
@@ -1,7 +1,11 @@
11 /*
2- NEC PC-98DO Emulator 'ePC-98DO'
3- NEC PC-8801MA Emulator 'ePC-8801MA'
2+ NEC PC-8001 Emulator 'ePC-8001'
3+ NEC PC-8001mkII Emulator 'ePC-8001mkII'
44 NEC PC-8001mkIISR Emulator 'ePC-8001mkIISR'
5+ NEC PC-8801 Emulator 'ePC-8801'
6+ NEC PC-8801mkII Emulator 'ePC-8801mkII'
7+ NEC PC-8801MA Emulator 'ePC-8801MA'
8+ NEC PC-98DO Emulator 'ePC-98DO'
59
610 Author : Takeda.Toshiya
711 Date : 2011.12.29-
@@ -17,9 +21,11 @@
1721 #include "../device.h"
1822
1923 #define SIG_PC88_USART_IRQ 0
20-#define SIG_PC88_SOUND_IRQ 1
21-#ifdef SUPPORT_PC88_SB2
22-#define SIG_PC88_SB2_IRQ 2
24+#ifdef SUPPORT_PC88_OPN1
25+#define SIG_PC88_OPN1_IRQ 1
26+#endif
27+#ifdef SUPPORT_PC88_OPN2
28+#define SIG_PC88_OPN2_IRQ 2
2329 #endif
2430 #ifdef SUPPORT_PC88_CDROM
2531 #define SIG_PC88_SCSI_DRQ 3
@@ -28,15 +34,13 @@
2834
2935 #define CMT_BUFFER_SIZE 0x40000
3036
31-#if defined(_PC8001SR) && !defined(PC88_EXRAM_BANKS)
32-#define PC88_EXRAM_BANKS 1
33-#endif
34-
35-#if !defined(_PC8001SR)
37+#if defined(PC8801_VARIANT)
3638 #define NIPPY_PATCH
3739 #endif
3840
41+#if defined(SUPPORT_PC88_OPN1) || defined(SUPPORT_PC88_OPN2)
3942 class YM2203;
43+#endif
4044 class Z80;
4145 #ifdef SUPPORT_PC88_CDROM
4246 class SCSI_HOST;
@@ -109,9 +113,11 @@ typedef struct {
109113 class PC88 : public DEVICE
110114 {
111115 private:
112- YM2203 *d_opn;
113-#ifdef SUPPORT_PC88_SB2
114- YM2203 *d_sb2;
116+#ifdef SUPPORT_PC88_OPN1
117+ YM2203 *d_opn1;
118+#endif
119+#ifdef SUPPORT_PC88_OPN2
120+ YM2203 *d_opn2;
115121 #endif
116122 Z80 *d_cpu;
117123 DEVICE *d_pcm, *d_pio, *d_prn, *d_rtc, *d_sio;
@@ -137,17 +143,25 @@ private:
137143 #endif
138144 uint8_t gvram[0xc000];
139145 uint8_t gvram_null[0x4000];
146+#if defined(PC8801SR_VARIANT)
140147 uint8_t tvram[0x1000];
148+#endif
149+#if defined(PC8001_VARIANT)
150+ uint8_t n80rom[0x8000];
141151 #if defined(_PC8001SR)
142- uint8_t n80mk2rom[0x8000];
143- uint8_t n80mk2srrom[0xa000];
152+ uint8_t n80srrom[0xa000];
153+#endif
144154 #else
145155 uint8_t n88rom[0x8000];
146156 uint8_t n88exrom[0x8000];
147157 uint8_t n80rom[0x8000];
148158 #endif
159+//#ifdef SUPPORT_PC88_KANJI1
149160 uint8_t kanji1[0x20000];
161+//#endif
162+#ifdef SUPPORT_PC88_KANJI2
150163 uint8_t kanji2[0x20000];
164+#endif
151165 #ifdef SUPPORT_PC88_DICTIONARY
152166 uint8_t dicrom[0x80000];
153167 #endif
@@ -163,23 +177,30 @@ private:
163177 pc88_dmac_t dmac;
164178
165179 // memory mapper
180+#if defined(_PC8001SR) || defined(PC8801SR_VARIANT)
166181 uint8_t alu_reg[3];
182+#endif
167183 uint8_t gvram_plane, gvram_sel;
168184
169185 void update_timing();
170186 int get_m1_wait(bool addr_f000);
171187 int get_main_wait(bool read);
188+#if defined(PC8801SR_VARIANT)
172189 int get_tvram_wait(bool read);
190+#endif
173191 int get_gvram_wait(bool read);
174192 void update_gvram_wait();
175193 void update_gvram_sel();
176-#if defined(_PC8001SR)
194+#if defined(PC8001_VARIANT)
177195 void update_n80_write();
178196 void update_n80_read();
179197 #else
180- void update_low_memmap();
198+ void update_low_write();
199+ void update_low_read();
200+#if defined(PC8801SR_VARIANT)
181201 void update_tvram_memmap();
182202 #endif
203+#endif
183204
184205 // cpu
185206 bool cpu_clock_low;
@@ -190,7 +211,9 @@ private:
190211 int m1_wait_clocks;
191212 int f000_m1_wait_clocks;
192213 int mem_wait_clocks_r, mem_wait_clocks_w;
214+#if defined(PC8801SR_VARIANT)
193215 int tvram_wait_clocks_r, tvram_wait_clocks_w;
216+#endif
194217 int gvram_wait_clocks_r, gvram_wait_clocks_w;
195218 int busreq_clocks;
196219
@@ -218,15 +241,17 @@ private:
218241 #endif
219242
220243 void draw_text();
244+#if defined(PC8001_VARIANT)
221245 #if defined(_PC8001SR)
222246 bool draw_320x200_color_graph();
247+#endif
223248 bool draw_320x200_4color_graph();
224249 void draw_320x200_attrib_graph();
225250 #endif
226251 bool draw_640x200_color_graph();
227252 void draw_640x200_mono_graph();
228253 void draw_640x200_attrib_graph();
229-#if !defined(_PC8001SR)
254+#if defined(PC8801SR_VARIANT)
230255 void draw_640x400_mono_graph();
231256 void draw_640x400_attrib_graph();
232257 #endif
@@ -252,9 +277,11 @@ private:
252277
253278 // intterrupt
254279 uint8_t intr_req;
255- bool intr_req_sound;
256-#ifdef SUPPORT_PC88_SB2
257- bool intr_req_sb2;
280+#ifdef SUPPORT_PC88_OPN1
281+ bool intr_req_opn1;
282+#endif
283+#ifdef SUPPORT_PC88_OPN2
284+ bool intr_req_opn2;
258285 #endif
259286 uint8_t intr_mask1, intr_mask2;
260287 void request_intr(int level, bool status);
@@ -294,7 +321,7 @@ private:
294321 public:
295322 PC88(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
296323 {
297-#if defined(_PC8001SR)
324+#if defined(PC8001_VARIANT)
298325 set_device_name(_T("PC-8001 Core"));
299326 #else
300327 set_device_name(_T("PC-8801 Core"));
@@ -329,26 +356,26 @@ public:
329356 bool process_state(FILEIO* state_fio, bool loading);
330357
331358 // unique functions
359+#ifdef PC8801SR_VARIANT
332360 bool is_sr_mr()
333361 {
334-#if !defined(_PC8001SR)
335362 return (n88rom[0x79d7] < 0x38);
336-#else
337- return true;
338-#endif
339363 }
364+#endif
340365 void set_context_cpu(Z80* device)
341366 {
342367 d_cpu = device;
343368 }
344- void set_context_opn(YM2203* device)
369+#ifdef SUPPORT_PC88_OPN1
370+ void set_context_opn1(YM2203* device)
345371 {
346- d_opn = device;
372+ d_opn1 = device;
347373 }
348-#ifdef SUPPORT_PC88_SB2
349- void set_context_sb2(YM2203* device)
374+#endif
375+#ifdef SUPPORT_PC88_OPN2
376+ void set_context_opn2(YM2203* device)
350377 {
351- d_sb2 = device;
378+ d_opn2 = device;
352379 }
353380 #endif
354381 void set_context_pcm(DEVICE* device)
--- a/source/src/vm/pc8801/pc8801.cpp
+++ b/source/src/vm/pc8801/pc8801.cpp
@@ -1,7 +1,11 @@
11
22 /*
3- NEC PC-8801MA Emulator 'ePC-8801MA'
3+ NEC PC-8001 Emulator 'ePC-8001'
4+ NEC PC-8001mkII Emulator 'ePC-8001mkII'
45 NEC PC-8001mkIISR Emulator 'ePC-8001mkIISR'
6+ NEC PC-8801 Emulator 'ePC-8801'
7+ NEC PC-8801mkII Emulator 'ePC-8801mkII'
8+ NEC PC-8801MA Emulator 'ePC-8801MA'
59
610 Author : Takeda.Toshiya
711 Date : 2012.02.16-
@@ -20,7 +24,9 @@
2024 //#include "../pcpr201.h"
2125 #include "../prnfile.h"
2226 #include "../upd1990a.h"
27+#if defined(SUPPORT_PC88_OPN1) || defined(SUPPORT_PC88_OPN2)
2328 #include "../ym2203.h"
29+#endif
2430 #include "../z80.h"
2531
2632 #include "../disk.h"
@@ -55,6 +61,23 @@ using PC88DEV::PC88;
5561 VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
5662 {
5763 // check configs
64+#if defined(PC8001_VARIANT)
65+#if defined(_PC8001)
66+ if(config.boot_mode != MODE_PC80_N) {
67+ config.boot_mode = MODE_PC80_N;
68+ }
69+#elif defined(_PC8001MK2)
70+ if(config.boot_mode == MODE_PC80_V2) {
71+ config.boot_mode = MODE_PC80_V1;
72+ }
73+#endif
74+#else
75+#if !defined(PC8801SR_VARIANT)
76+ if(config.boot_mode == MODE_PC88_V1H || config.boot_mode == MODE_PC88_V2) {
77+ config.boot_mode = MODE_PC88_V1S;
78+ }
79+#endif
80+#endif
5881 boot_mode = config.boot_mode;
5982
6083 // create devices
@@ -80,6 +103,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
80103 pc88rtc = new UPD1990A(this, emu);
81104 // pc88rtc->set_device_name(_T("uPD1990A RTC (PC-8801)"));
82105 // pc88rtc->set_context_event_manager(pc88event);
106+#if defined(_PC8801MA)
83107 // config.sound_type
84108 // 0: 44h:OPNA A4h:None PC-8801FH/MH or later
85109 // 1: 44h:OPN A4h:None PC-8801mkIISR/TR/FR/MR
@@ -87,39 +111,90 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
87111 // 3: 44h:OPN A4h:OPN PC-8801mkIISR/TR/FR/MR + PC-8801-11
88112 // 4: 44h:OPNA A4h:OPNA PC-8801FH/MH or later + PC-8801-24
89113 // 5: 44h:OPNA A4h:OPN PC-8801FH/MH or later + PC-8801-11
90- pc88opn = new YM2203(this, emu);
91-// pc88opn->set_context_event_manager(pc88event);
92-#ifdef USE_SOUND_TYPE
93-#ifdef SUPPORT_PC88_OPNA
114+ pc88opn1 = new YM2203(this, emu);
115+// pc88opn1->set_context_event_manager(pc88event);
94116 if(config.sound_type == 0 || config.sound_type == 4 || config.sound_type == 5) {
95- pc88opn->is_ym2608 = true;
96- pc88opn->set_device_name(_T("YM2608 OPNA"));
117+ pc88opn1->is_ym2608 = true;
118+ pc88opn1->set_device_name(_T("YM2608 OPNA #1"));
97119 } else {
98-#endif
99- pc88opn->is_ym2608 = false;
100- pc88opn->set_device_name(_T("YM2203 OPN"));
101-#ifdef SUPPORT_PC88_OPNA
120+ pc88opn1->is_ym2608 = false;
121+ pc88opn1->set_device_name(_T("YM2203 OPN #1"));
102122 }
103-#endif
104-#ifdef SUPPORT_PC88_SB2
105123 if(config.sound_type >= 2) {
106- pc88sb2 = new YM2203(this, emu);
107-// pc88sb2->set_context_event_manager(pc88event);
108-#ifdef SUPPORT_PC88_OPNA
124+ pc88opn2 = new YM2203(this, emu);
125+// pc88opn2->set_context_event_manager(pc88event);
109126 if(config.sound_type == 2 || config.sound_type == 4) {
110- pc88sb2->is_ym2608 = true;
111- pc88sb2->set_device_name(_T("YM2608 OPNA (SB2)"));
112- } else {
113-#endif
114- pc88sb2->is_ym2608 = false;
115- pc88sb2->set_device_name(_T("YM2203 OPN (SB2)"));
116-#ifdef SUPPORT_PC88_OPNA
127+ pc88opn2->is_ym2608 = true;
128+ pc88opn2->set_device_name(_T("YM2608 OPNA #2"));
129+ } else if(config.sound_type == 3 || config.sound_type == 5) {
130+ pc88opn2->is_ym2608 = false;
131+ pc88opn2->set_device_name(_T("YM2203 OPN #2"));
117132 }
118-#endif
119133 } else {
120- pc88sb2 = NULL;
134+ pc88opn2 = NULL;
121135 }
122-#endif
136+#elif defined(_PC8001SR)
137+ // config.sound_type
138+ // 0: 44h:OPN A4h:None PC-8001mkIISR
139+ // 1: 44h:OPN A4h:OPN PC-8001mkIISR + PC-8801-11
140+ // 2: 44h:OPN A4h:OPNA PC-8001mkIISR + PC-8801-23
141+ pc88opn1 = new YM2203(this, emu);
142+// pc88opn1->set_context_event_manager(pc88event);
143+ pc88opn1->is_ym2608 = false;
144+ pc88opn1->set_device_name(_T("YM2203 OPN #1"));
145+ if(config.sound_type == 1) {
146+ pc88opn2 = new YM2203(this, emu);
147+// pc88opn2->set_context_event_manager(pc88event);
148+ pc88opn2->is_ym2608 = false;
149+ pc88opn2->set_device_name(_T("YM2203 OPN #2"));
150+ } else if(config.sound_type == 2) {
151+ pc88opn2 = new YM2203(this, emu);
152+// pc88opn2->set_context_event_manager(pc88event);
153+ pc88opn2->is_ym2608 = true;
154+ pc88opn2->set_device_name(_T("YM2608 OPNA #2"));
155+ } else {
156+ pc88opn2 = NULL;
157+ }
158+#elif defined(_PC8001MK2) || defined(_PC8801MK2)
159+ // 0: 44h:None A4h:None PC-8001/8801mkII
160+ // 1: 44h:None A4h:OPN PC-8001/8801mkII + PC-8801-11
161+ // 2: 44h:None A4h:OPNA PC-8001/8801mkII + PC-8801-23
162+ if(config.sound_type == 1) {
163+ pc88opn2 = new YM2203(this, emu);
164+// pc88opn2->set_context_event_manager(pc88event);
165+ pc88opn2->is_ym2608 = false;
166+ pc88opn2->set_device_name(_T("YM2203 OPN #2"));
167+ } else if(config.sound_type == 2) {
168+ pc88opn2 = new YM2203(this, emu);
169+// pc88opn2->set_context_event_manager(pc88event);
170+ pc88opn2->is_ym2608 = true;
171+ pc88opn2->set_device_name(_T("YM2608 OPNA #2"));
172+ } else {
173+ pc88opn2 = NULL;
174+ }
175+#else
176+ #if defined(SUPPORT_PC88_OPN1)
177+ pc88opn1 = new YM2203(this, emu);
178+// pc88opn1->set_context_event_manager(pc88event);
179+ #if defined(SUPPORT_PC88_OPNA)
180+ pc88opn1->is_ym2608 = true;
181+ pc88opn1->set_device_name(_T("YM2608 OPNA #1"));
182+ #else
183+ pc88opn1->is_ym2608 = false;
184+ pc88opn1->set_device_name(_T("YM2203 OPN #1"));
185+ #endif
186+ #endif
187+ #if defined(SUPPORT_PC88_OPN2)
188+ pc88opn2 = new YM2203(this, emu);
189+// pc88opn2->set_context_event_manager(pc88event);
190+ #if defined(SUPPORT_PC88_OPNA)
191+ pc88opn2->is_ym2608 = true;
192+ pc88opn2->set_device_name(_T("YM2608 OPNA #2"));
193+ #else
194+ pc88opn2->is_ym2608 = false;
195+ pc88opn2->set_device_name(_T("YM2203 OPN #2"));
196+ #endif
197+ #endif
123198 #endif
124199 if(config.printer_type == 0) {
125200 pc88prn = new PRNFILE(this, emu);
@@ -186,10 +261,14 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
186261 pc88event->set_context_cpu(pc88cpu, 3993624);
187262 #endif
188263 pc88event->set_context_cpu(pc88cpu_sub, 3993624);
189- pc88event->set_context_sound(pc88opn);
190-#ifdef SUPPORT_PC88_SB2
191- if(pc88sb2 != NULL) {
192- pc88event->set_context_sound(pc88sb2);
264+#ifdef SUPPORT_PC88_OPN1
265+ if(pc88opn1 != NULL) {
266+ pc88event->set_context_sound(pc88opn1);
267+ }
268+#endif
269+#ifdef SUPPORT_PC88_OPN2
270+ if(pc88opn2 != NULL) {
271+ pc88event->set_context_sound(pc88opn2);
193272 }
194273 #endif
195274 pc88event->set_context_sound(pc88pcm);
@@ -209,9 +288,15 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
209288 pc88event->set_context_sound(pc88noise_head_up);
210289
211290 pc88->set_context_cpu(pc88cpu);
212- pc88->set_context_opn(pc88opn);
213-#ifdef SUPPORT_PC88_SB2
214- pc88->set_context_sb2(pc88sb2);
291+#ifdef SUPPORT_PC88_OPN1
292+ if(pc88opn1 != NULL) {
293+ pc88->set_context_opn1(pc88opn1);
294+ }
295+#endif
296+#ifdef SUPPORT_PC88_OPN2
297+ if(pc88opn2 != NULL) {
298+ pc88->set_context_opn2(pc88opn2);
299+ }
215300 #endif
216301 pc88->set_context_pcm(pc88pcm);
217302 pc88->set_context_pio(pc88pio);
@@ -237,10 +322,14 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
237322 #ifdef USE_DEBUGGER
238323 pc88cpu->set_context_debugger(new DEBUGGER(this, emu));
239324 #endif
240- pc88opn->set_context_irq(pc88, SIG_PC88_SOUND_IRQ, 1);
241-#ifdef SUPPORT_PC88_SB2
242- if(pc88sb2 != NULL) {
243- pc88sb2->set_context_irq(pc88, SIG_PC88_SB2_IRQ, 1);
325+#ifdef SUPPORT_PC88_OPN1
326+ if(pc88opn1 != NULL) {
327+ pc88opn1->set_context_irq(pc88, SIG_PC88_OPN1_IRQ, 1);
328+ }
329+#endif
330+#ifdef SUPPORT_PC88_OPN2
331+ if(pc88opn2 != NULL) {
332+ pc88opn2->set_context_irq(pc88, SIG_PC88_OPN2_IRQ, 1);
244333 }
245334 #endif
246335 pc88sio->set_context_rxrdy(pc88, SIG_PC88_USART_IRQ, 1);
@@ -327,7 +416,11 @@ void VM::reset()
327416 }
328417
329418 // initial device settings
330- pc88opn->set_reg(0x29, 3); // for Misty Blue
419+#ifdef SUPPORT_PC88_OPN1
420+ if(pc88opn1 != NULL) {
421+ pc88opn1->set_reg(0x29, 3); // for Misty Blue
422+ }
423+#endif
331424 pc88pio->write_signal(SIG_I8255_PORT_C, 0, 0xff);
332425 pc88pio_sub->write_signal(SIG_I8255_PORT_C, 0, 0xff);
333426 }
@@ -377,17 +470,21 @@ void VM::initialize_sound(int rate, int samples)
377470 pc88event->initialize_sound(rate, samples);
378471
379472 // init sound gen
380- if(pc88opn->is_ym2608) {
381- pc88opn->initialize_sound(rate, 7987248, samples, 0, 0);
382- } else {
383- pc88opn->initialize_sound(rate, 3993624, samples, 0, 0);
473+#ifdef SUPPORT_PC88_OPN1
474+ if(pc88opn1 != NULL) {
475+ if(pc88opn1->is_ym2608) {
476+ pc88opn1->initialize_sound(rate, 7987248, samples, 0, 0);
477+ } else {
478+ pc88opn1->initialize_sound(rate, 3993624, samples, 0, 0);
479+ }
384480 }
385-#ifdef SUPPORT_PC88_SB2
386- if(pc88sb2 != NULL) {
387- if(pc88sb2->is_ym2608) {
388- pc88sb2->initialize_sound(rate, 7987248, samples, 0, 0);
481+#endif
482+#ifdef SUPPORT_PC88_OPN2
483+ if(pc88opn2 != NULL) {
484+ if(pc88opn2->is_ym2608) {
485+ pc88opn2->initialize_sound(rate, 7987248, samples, 0, 0);
389486 } else {
390- pc88sb2->initialize_sound(rate, 3993624, samples, 0, 0);
487+ pc88opn2->initialize_sound(rate, 3993624, samples, 0, 0);
391488 }
392489 }
393490 #endif
@@ -415,56 +512,91 @@ int VM::get_sound_buffer_ptr()
415512 #ifdef USE_SOUND_VOLUME
416513 void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
417514 {
515+#ifdef SUPPORT_PC88_OPN1
418516 if(ch-- == 0) {
419- pc88opn->set_volume(0, decibel_l, decibel_r);
420- } else if(ch-- == 0) {
421- pc88opn->set_volume(1, decibel_l, decibel_r);
517+ if(pc88opn1 != NULL) {
518+ pc88opn1->set_volume(0, decibel_l, decibel_r);
519+ }
520+ return;
521+ }
522+ if(ch-- == 0) {
523+ if(pc88opn1 != NULL) {
524+ pc88opn1->set_volume(1, decibel_l, decibel_r);
525+ }
526+ return;
527+ }
422528 #ifdef SUPPORT_PC88_OPNA
423- } else if(ch-- == 0) {
424- pc88opn->set_volume(2, decibel_l, decibel_r);
425- } else if(ch-- == 0) {
426- pc88opn->set_volume(3, decibel_l, decibel_r);
427-#endif
428-#ifdef SUPPORT_PC88_SB2
429- } else if(ch-- == 0) {
430- if(pc88sb2 != NULL) {
431- pc88sb2->set_volume(0, decibel_l, decibel_r);
529+ if(ch-- == 0) {
530+ if(pc88opn1 != NULL && pc88opn1->is_ym2608) {
531+ pc88opn1->set_volume(2, decibel_l, decibel_r);
532+ }
533+ return;
534+ }
535+ if(ch-- == 0) {
536+ if(pc88opn1 != NULL && pc88opn1->is_ym2608) {
537+ pc88opn1->set_volume(3, decibel_l, decibel_r);
538+ }
539+ return;
540+ }
541+#endif
542+#endif
543+#ifdef SUPPORT_PC88_OPN2
544+ if(ch-- == 0) {
545+ if(pc88opn2 != NULL) {
546+ pc88opn2->set_volume(0, decibel_l, decibel_r);
432547 }
433- } else if(ch-- == 0) {
434- if(pc88sb2 != NULL) {
435- pc88sb2->set_volume(1, decibel_l, decibel_r);
548+ return;
549+ }
550+ if(ch-- == 0) {
551+ if(pc88opn2 != NULL) {
552+ pc88opn2->set_volume(1, decibel_l, decibel_r);
436553 }
554+ return;
555+ }
437556 #ifdef SUPPORT_PC88_OPNA
438- } else if(ch-- == 0) {
439- if(pc88sb2 != NULL) {
440- pc88sb2->set_volume(2, decibel_l, decibel_r);
557+ if(ch-- == 0) {
558+ if(pc88opn2 != NULL && pc88opn2->is_ym2608) {
559+ pc88opn2->set_volume(2, decibel_l, decibel_r);
441560 }
442- } else if(ch-- == 0) {
443- if(pc88sb2 != NULL) {
444- pc88sb2->set_volume(3, decibel_l, decibel_r);
561+ return;
562+ }
563+ if(ch-- == 0) {
564+ if(pc88opn2 != NULL && pc88opn2->is_ym2608) {
565+ pc88opn2->set_volume(3, decibel_l, decibel_r);
445566 }
567+ return;
568+ }
446569 #endif
447570 #endif
448571 #ifdef SUPPORT_PC88_CDROM
449- } else if(ch-- == 0) {
572+ if(ch-- == 0) {
450573 pc88scsi_cdrom->set_volume(0, decibel_l, decibel_r);
574+ return;
575+ }
451576 #endif
452577 #ifdef SUPPORT_PC88_HMB20
453- } else if(ch-- == 0) {
578+ if(ch-- == 0) {
454579 pc88opm->set_volume(0, decibel_l, decibel_r);
580+ return;
581+ }
455582 #endif
456583 #ifdef SUPPORT_PC88_PCG8100
457- } else if(ch-- == 0) {
584+ if(ch-- == 0) {
458585 pc88pcm0->set_volume(0, decibel_l, decibel_r);
459586 pc88pcm1->set_volume(0, decibel_l, decibel_r);
460587 pc88pcm2->set_volume(0, decibel_l, decibel_r);
588+ return;
589+ }
461590 #endif
462- } else if(ch-- == 0) {
591+ if(ch-- == 0) {
463592 pc88pcm->set_volume(0, decibel_l, decibel_r);
464- } else if(ch-- == 0) {
593+ return;
594+ }
595+ if(ch-- == 0) {
465596 pc88noise_seek->set_volume(0, decibel_l, decibel_r);
466597 pc88noise_head_down->set_volume(0, decibel_l, decibel_r);
467598 pc88noise_head_up->set_volume(0, decibel_l, decibel_r);
599+ return;
468600 }
469601 }
470602 #endif
--- a/source/src/vm/pc8801/pc8801.h
+++ b/source/src/vm/pc8801/pc8801.h
@@ -1,6 +1,10 @@
11 /*
2- NEC PC-8801MA Emulator 'ePC-8801MA'
2+ NEC PC-8001 Emulator 'ePC-8001'
3+ NEC PC-8001mkII Emulator 'ePC-8001mkII'
34 NEC PC-8001mkIISR Emulator 'ePC-8001mkIISR'
5+ NEC PC-8801 Emulator 'ePC-8801'
6+ NEC PC-8801mkII Emulator 'ePC-8801mkII'
7+ NEC PC-8801MA Emulator 'ePC-8801MA'
48
59 Author : Takeda.Toshiya
610 Date : 2012.02.16-
@@ -14,40 +18,92 @@
1418 #if defined(_PC8801MA)
1519 #define DEVICE_NAME "NEC PC-8801MA"
1620 #define CONFIG_NAME "pc8801ma"
21+#elif defined(_PC8801MK2)
22+#define DEVICE_NAME "NEC PC-8801mkII"
23+#define CONFIG_NAME "pc8801mk2"
24+#elif defined(_PC8801)
25+#define DEVICE_NAME "NEC PC-8801"
26+#define CONFIG_NAME "pc8801"
1727 #elif defined(_PC8001SR)
1828 #define DEVICE_NAME "NEC PC-8001mkIISR"
1929 #define CONFIG_NAME "pc8001mk2sr"
30+#elif defined(_PC8001MK2)
31+#define DEVICE_NAME "NEC PC-8001mkII"
32+#define CONFIG_NAME "pc8001mk2"
33+#elif defined(_PC8001)
34+#define DEVICE_NAME "NEC PC-8001"
35+#define CONFIG_NAME "pc8001"
2036 #endif
2137
22-#if defined(_PC8001SR)
23-#define MODE_PC80_V1 0
24-#define MODE_PC80_V2 1
25-#define MODE_PC80_N 2
38+#if defined(_PC8001) || defined(_PC8001MK2) || defined(_PC8001SR)
39+#define PC8001_VARIANT
2640 #else
27-#define MODE_PC88_V1S 0
28-#define MODE_PC88_V1H 1
29-#define MODE_PC88_V2 2
30-#define MODE_PC88_N 3
41+#define PC8801_VARIANT
3142 #endif
32-
3343 #if defined(_PC8801MA)
34-#define SUPPORT_PC88_DICTIONARY
35-#define SUPPORT_PC88_HIGH_CLOCK
36-#define SUPPORT_PC88_OPNA
37-#define SUPPORT_PC88_SB2
38-#define SUPPORT_PC88_CDROM
39-#define SUPPORT_PC88_VAB
40-#define SUPPORT_PC88_HMB20
41-#if defined(SUPPORT_PC88_VAB)
42-// X88000
43-#define PC88_EXRAM_BANKS 8
44-#define PC88_VAB_PAGE 1
44+#define PC8801SR_VARIANT
45+#endif
46+
47+#if defined(PC8001_VARIANT)
48+ #define MODE_PC80_V1 0
49+ #define MODE_PC80_V2 1
50+ #define MODE_PC80_N 2
4551 #else
46-#define PC88_EXRAM_BANKS 4
52+ #define MODE_PC88_V1S 0
53+ #define MODE_PC88_V1H 1
54+ #define MODE_PC88_V2 2
55+ #define MODE_PC88_N 3
4756 #endif
48-#define HAS_UPD4990A
57+
58+#if defined(_PC8801MA)
59+ #define SUPPORT_PC88_KANJI1
60+ #define SUPPORT_PC88_KANJI2
61+ #define SUPPORT_PC88_DICTIONARY
62+ #define SUPPORT_PC88_HIGH_CLOCK
63+ #define SUPPORT_PC88_OPN1
64+ #define SUPPORT_PC88_OPN2
65+ #define SUPPORT_PC88_OPNA
66+ #define SUPPORT_PC88_CDROM
67+ #define SUPPORT_PC88_VAB
68+ #define SUPPORT_PC88_HMB20
69+ #define SUPPORT_PC88_JOYSTICK
70+ #if defined(SUPPORT_PC88_VAB)
71+ // X88000
72+ #define PC88_EXRAM_BANKS 8
73+ #define PC88_VAB_PAGE 1
74+ #else
75+ #define PC88_EXRAM_BANKS 4
76+ #endif
77+ #define HAS_UPD4990A
78+#elif defined(_PC8801MK2)
79+ #define SUPPORT_PC88_KANJI1
80+// #define SUPPORT_PC88_KANJI2
81+ #define SUPPORT_PC88_OPN2
82+ #define SUPPORT_PC88_OPNA
83+#elif defined(_PC8801)
84+ #define SUPPORT_PC88_KANJI1
85+// #define SUPPORT_PC88_KANJI2
86+// #define SUPPORT_PC88_OPN2
87+// #define SUPPORT_PC88_OPNA
88+#elif defined(_PC8001SR)
89+ #define SUPPORT_PC88_KANJI1
90+// #define SUPPORT_PC88_KANJI2
91+ #define SUPPORT_PC88_OPN1
92+ #define SUPPORT_PC88_OPN2
93+ #define SUPPORT_PC88_OPNA
94+ #define PC88_EXRAM_BANKS 1
95+#elif defined(_PC8001MK2)
96+ #define SUPPORT_PC88_KANJI1
97+// #define SUPPORT_PC88_KANJI2
98+ #define SUPPORT_PC88_OPN2
99+ #define SUPPORT_PC88_OPNA
100+ #define PC88_EXRAM_BANKS 1
101+#elif defined(_PC8001)
102+// #define SUPPORT_PC88_KANJI1
103+// #define SUPPORT_PC88_KANJI2
104+// #define SUPPORT_PC88_OPN2
105+// #define SUPPORT_PC88_OPNA
49106 #endif
50-#define SUPPORT_PC88_JOYSTICK
51107 #define SUPPORT_PC88_PCG8100
52108
53109 // device informations for virtual machine
@@ -59,7 +115,7 @@
59115 #define WINDOW_HEIGHT_ASPECT 480
60116 #define MAX_DRIVE 2
61117 #define UPD765A_NO_ST1_EN_OR_FOR_RESULT7
62-#if defined(_PC8801MA)
118+#if defined(PC8801_VARIANT)
63119 #define PC80S31K_NO_WAIT
64120 #endif
65121 #if defined(SUPPORT_PC88_CDROM)
@@ -70,7 +126,7 @@
70126 #define OVERRIDE_SOUND_FREQ_48000HZ 55467
71127
72128 // device informations for win32
73-#if defined(_PC8001SR)
129+#if defined(PC8001_VARIANT)
74130 #define USE_BOOT_MODE 3
75131 #define USE_CPU_TYPE 2
76132 #else
@@ -98,56 +154,49 @@
98154 #define USE_MONITOR_TYPE 2
99155 #define USE_SCREEN_FILTER
100156 #define USE_SCANLINE
101-#ifdef SUPPORT_PC88_OPNA
102-#ifdef SUPPORT_PC88_SB2
103-#define USE_SOUND_TYPE 6
104-#else
105-#define USE_SOUND_TYPE 2
106-#endif
107-#endif
108157
109-#undef _SOUNDS_OPN
110-#undef _SOUNDS_SB2
111-#undef _SOUNDS_PCG8100
112-#undef _SOUNDS_CDROM
113-#undef _SOUNDS_HMB20
114-#undef _SOUNDS_BEEP
115-#undef _SOUNDS_NOISE
116-
117-#if defined(SUPPORT_PC88_OPNA)
118- #define _SOUNDS_OPN 4
119-#else /* ToDo: PC8001 without OPN/OPNA */
120- #define _SOUNDS_OPN 2
158+#if defined(_PC8801MA)
159+ #define USE_SOUND_TYPE 6 // OPNA,OPN,OPN+OPNA,OPN+OPN,OPNA+OPNA,OPNA+OPN
160+#elif defined(_PC8001SR)
161+ #define USE_SOUND_TYPE 3 // OPN,OPN+OPN,OPN+OPNA
162+#elif defined(_PC8001MK2) || defined(_PC8801MK2)
163+ #define USE_SOUND_TYPE 3 // None,OPN,OPNA
121164 #endif
122-#if defined(SUPPORT_PC88_SB2)
165+#if defined(SUPPORT_PC88_OPN1)
123166 #if defined(SUPPORT_PC88_OPNA)
124- #define _SOUNDS_SB2 4
125- #else /* SB2=OPN */
126- #define _SOUNDS_SB2 2
167+ #define SOUND_VOLUME_OPN1 4
168+ #else
169+ #define SOUND_VOLUME_OPN1 2
127170 #endif
128-#else /* Have not SB2 */
129- #define _SOUNDS_SB2 0
171+#else
172+ #define SOUND_VOLUME_OPN1 0
130173 #endif
131-#if defined(SUPPORT_PC88_PCG8100)
132- #define _SOUNDS_PCG8100 1
174+#if defined(SUPPORT_PC88_OPN2)
175+ #if defined(SUPPORT_PC88_OPNA)
176+ #define SOUND_VOLUME_OPN2 4
177+ #else
178+ #define SOUND_VOLUME_OPN2 2
179+ #endif
133180 #else
134- #define _SOUNDS_PCG8100 0
181+ #define SOUND_VOLUME_OPN2 0
135182 #endif
136-#if defined(SUPPORT_PC88_CDROM)
137- #define _SOUNDS_CDROM 1
183+ #if defined(SUPPORT_PC88_CDROM)
184+#define SOUND_VOLUME_CDROM 1
185+ #define SOUND_VOLUME_CDROM 1
138186 #else
139- #define _SOUNDS_CDROM 0
187+ #define SOUND_VOLUME_CDROM 0
140188 #endif
141189 #if defined(SUPPORT_PC88_HMB20)
142- #define _SOUNDS_HMB20 1
190+ #define SOUND_VOLUME_HMB20 1
143191 #else
144- #define _SOUNDS_HMB20 0
192+ #define SOUND_VOLUME_HMB20 0
145193 #endif
146-#define _SOUNDS_BEEP 1
147-#define _SOUNDS_NOISE 1
148-
149-#define USE_SOUND_VOLUME (_SOUNDS_OPN + _SOUNDS_SB2 + _SOUNDS_PCG8100 + _SOUNDS_CDROM + _SOUNDS_HMB20 + _SOUNDS_BEEP + _SOUNDS_NOISE)
150-
194+#if defined(SUPPORT_PC88_PCG8100)
195+ #define SOUND_VOLUME_PCG8100 1
196+#else
197+ #define SOUND_VOLUME_PCG8100 0
198+#endif
199+#define USE_SOUND_VOLUME (SOUND_VOLUME_OPN1 + SOUND_VOLUME_OPN2 + SOUND_VOLUME_CDROM + SOUND_VOLUME_HMB20 + SOUND_VOLUME_PCG8100 + 1 + 1)
151200
152201 #define SUPPORT_TV_RENDER
153202 #define USE_JOYSTICK
@@ -164,16 +213,16 @@
164213
165214 #ifdef USE_SOUND_VOLUME
166215 static const _TCHAR *sound_device_caption[USE_SOUND_VOLUME] = {
216+#ifdef SUPPORT_PC88_OPN1
217+ _T("OPN1 (FM)"), _T("OPN1 (PSG)"),
167218 #ifdef SUPPORT_PC88_OPNA
168- _T("OPNA (FM)"), _T("OPNA (PSG)"), _T("OPNA (ADPCM)"), _T("OPNA (Rhythm)"),
169-#else
170- _T("OPN (FM)"), _T("OPN (PSG)"),
219+ _T("OPN1 (ADPCM)"), _T("OPN1 (Rhythm)"),
171220 #endif
172-#ifdef SUPPORT_PC88_SB2
221+#endif
222+#ifdef SUPPORT_PC88_OPN2
223+ _T("OPN2 (FM)"), _T("OPN2 (PSG)"),
173224 #ifdef SUPPORT_PC88_OPNA
174- _T("SB2 (FM)"), _T("SB2 (PSG)"), _T("SB2 (ADPCM)"), _T("SB2 (Rhythm)"),
175-#else
176- _T("SB2 (FM)"), _T("SB2 (PSG)"),
225+ _T("OPN2 (ADPCM)"), _T("OPN2 (Rhythm)"),
177226 #endif
178227 #endif
179228 #ifdef SUPPORT_PC88_CDROM
@@ -198,7 +247,9 @@ class I8255;
198247 class NOISE;
199248 class PCM1BIT;
200249 class UPD1990A;
250+#if defined(SUPPORT_PC88_OPN1) || defined(SUPPORT_PC88_OPN2)
201251 class YM2203;
252+#endif
202253 class Z80;
203254
204255 class PC80S31K;
@@ -233,9 +284,11 @@ protected:
233284 I8255* pc88pio;
234285 PCM1BIT* pc88pcm;
235286 UPD1990A* pc88rtc;
236- YM2203* pc88opn;
237-#ifdef SUPPORT_PC88_SB2
238- YM2203* pc88sb2;
287+#ifdef SUPPORT_PC88_OPN1
288+ YM2203* pc88opn1;
289+#endif
290+#ifdef SUPPORT_PC88_OPN2
291+ YM2203* pc88opn2;
239292 #endif
240293 DEVICE* dummycpu;
241294 Z80* pc88cpu;
Show on old repository browser