AZO234 / NP2kai

Neko Project II kai
http://domisan.sakura.ne.jp/article/np2kai/np2kai.html
MIT License
246 stars 61 forks source link
libretro

Neko Project II 0.86 kai

Oct 24, 2023

NP2kai is PC-9801 series emulator

Build and Install

libretro core

for Windows/Linux/macOS
#### Install tools 1. MSYS2 64bit + 64bit console(Windows). 2. Install compiler, etc. #### Build 1. Change directory to sdl. ``` $ cd NP2kai/sdl ``` 2. Make. ``` $ make ``` #### Install binary 1. Install shared library(.dll or .so or .dylib) to libretro's cores directory (libretro/cores). 2. Locate BIOS files to np2kai in libretro's system directory (libretro/system/np2kai).
for Android/iOS
#### Install tools 1. MSYS2 64bit + 64bit console(Windows). 2. Install Android Studio, and NDK. And PATH there. 3. Clone libretro-super. ``` $ git clone --depth 1 https://github.com/libretro/libretro-super.git ``` #### Build 1. Change directory to libretro-super. ``` $ cd libretro-super ``` 2. Fetch np2kai. ``` $ ./libretro-fetsh.sh np2kai ``` 3. Build. - Android ``` $ ./libretro-build-android-mk.sh np2kai ``` - iOS ``` $ ./libretro-build-ios.sh np2kai ``` #### Install binary 1. Install shared library(.so or .dylib) to libretro's cores directory (libretro/cores). 2. Locate BIOS files to np2kai in libretro's system directory (libretro/system/np2kai). NP2 menu is shown F12 or mouse middle button or L2, to swap FDD/HDD diskimages. On Android, Game Files are need to locate in '/storage/emulated/0/RetroArch' by access rights reason. Game Files cannot locate on external storage.

VisualStudio 2022

You should NP2fmgen or NP21/W, maybe.

VisualStudio 2022
#### Install tools 1. Install VisualStudio 2022. - Desktop Development with C++ - .NET Framework 4.8 SDK - C++ ATL - C++ MFC - Connecting USB Device - Windows 10 SDK - Windows Universal CRT - Graphics Debugger and GPU Profiler for DirectX - Developer Analytics Tools - Git for Windows - NuGet Package manager - GitHub extention for Visual Studio - C++ 2019 redistoributable package - C++ 2019 redistoributable package updater - MSBuild - CMake for Windows - IntelliCode 2. Install [WDK KMDF](https://docs.microsoft.com/ja-jp/windows-hardware/drivers/download-the-wdk) 3. Install [vcpkg](https://github.com/Microsoft/vcpkg) 4. Install packages with vcpkg. - OpenSSL - SDL2 SDL2_mixer SDL2_ttf - libusb 5. Install [Ninja](http://www.projectmanager.ninja/home.html) #### Build 1. Start VisualStudio 2022 (and without code). 2. File -> Open -> CMake -> CMakeLists.txt in NP2kai directory. 3. Build -> Build all. 4. Output np21kai_windows.exe in out directory. - CMake options of VisualStudio 2022 port (*=default) |name|value|work|output| |:---:|:---:|:---:|:---:| |BUILD_I286|ON|Build i286|NP2kai_windows| |BUILD_I286|OFF*|Build IA-32|NP21kai_windows| |BUILD_HAXM|ON|Build IA-32 HAXM|NP21kai_HAXM_windows| #### Install binary 1. Locate .exe file anywhere. 2. Locate BIOS files to .exe same filder.

SDL

SDL
#### Install tools - MSYS2 1. Install MSYS2 64bit. 2. Run MSYS2 64bit console. 3. Run follow command. ``` $ pacman -S git cmake make mingw-w64-x86_64-toolchain mingw-w64-x86_64-ntldd mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL mingw-w64-x86_64-SDL_mixer mingw-w64-x86_64-SDL_ttf mingw-w64-x86_64-openssl mingw-w64-x86_64-libusb ``` - Linux 1. Run follow command. ``` $ sudo apt install git cmake ninja-build build-essential libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libusb-1.0-0-dev libssl-dev ``` - macOS 1. Install XCode and brew. 2. Run follow command. ``` $ sudo brew install cmake ninja sdl sdl_mixer sdl_ttf sdl2 sdl2_mixer sdl2_ttf libusb ``` #### Build 1. Change directory to NP2kai. ``` $ cd NP2kai ``` 2. Make work directory, and step into there. ``` $ mkdir build $ cd build ``` 3. Generate Makefile. ``` $ cmake .. -D BUILD_SDL=ON ``` 4. Make. ``` $ make -j ``` - CMake options of SDL port (*=default) |name|value|work|output| |:---:|:---:|:---:|:---:| |BUILD_SDL|ON(*)|Build SDL port|| |USE_SDL2|ON*|Build with SDL2|sdlnp21kai| |USE_SDL2|OFF|Build with SDL|sdlnp21kai_sdl1| |USE_SDL_MIXER|ON*|Build with SDL_mixer or SDL2_mixer|| |USE_SDL_TTF|ON*|Build with SDL_ttf or SDL2_ttf|| |BUILD_I286|ON|Build i286|sdlnp2kai| |BUILD_I286|OFF*|Build IA-32|sdlnp21kai| |BUILD_HAXM|ON|Build IA-32 HAXM|sdlnp21kai_HAXM| - BUILD_SDL=ON default on macOS #### Install binary 1. Install. ``` $ make install ``` 2. Locate BIOS files to ~/.config/<SDL NP2kai filename> 3. Run SDL NP2kai. - NP2 menu is shown F11 or mouse middle button, to swap FDD/HDD diskimages.

X with GTK2 and SDL

Arch Linux

For the latest release, a package can be found in the AUR

Fonts are NOT included in the AUR package.

temporary
It seems slow xnp2kai's dialog now, on Ubuntu GNOME.
(Maybe GTK issue. No problem on Ubuntu MATE.)
This issue is can aboid with follow command when starting

$ dbus-launch --exit-with-session xnp2kai
X with GTK2 and SDL
#### Install tools 1. Run follow command. - Debian/Ubuntu series ``` $ sudo apt install git cmake ninja-build build-essential libx11-dev libglib2.0-dev libgtk2.0-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libusb-1.0-0-dev libfreetype-dev libfontconfig1-dev libssl-dev ``` - Fedora series ``` $ sudo dnf groupinstall "Development Tools" $ sudo dnf install gcc-c++ cmake libusb-devel SDL-devel SDL_mixer-devel SDL_ttf-devel SDL2-devel SDL2_mixer-devel SDL2_ttf-devel gtk2-devel libX11-devel fontconfig-devel freetype-devel ``` #### Build 1. Change directory to NP2kai. ``` $ cd NP2kai ``` 2. Make work directory, and step in. ``` $ mkdir build $ cd build ``` 3. Generate Makefile. ``` $ cmake .. -D BUILD_X=ON ``` 4. Make. ``` $ make -j ``` - CMake options of X port (*=default) |name|value|work|output| |:---:|:---:|:---:|:---:| |BUILD_X|ON(*)|Build X port|| |USE_SDL2|ON*|Build with SDL2|xnp21kai| |USE_SDL2|OFF|Build with SDL|xnp21kai_sdl1| |USE_SDL_MIXER|ON*|Build with SDL_mixer or SDL2_mixer|| |USE_SDL_TTF|ON*|Build with SDL_ttf or SDL2_ttf|| |BUILD_I286|ON|Build i286|xnp2kai| |BUILD_I286|OFF*|Build IA-32|xnp21kai| |BUILD_HAXM|ON|Build IA-32 HAXM|xnp21kai_HAXM| - BUILD_X=ON default on UNIX #### Install binary 1. Install. ``` $ sudo make install ``` 2. Locate BIOS files to ~/.config/ 3. Run X NP2kai. - NP2 menu is shown F11 key or mouse middle button, to swap FDD/HDD diskimages.

Emscripten

Emscripten
#### Install tools - MSYS2 1. Install [Emscripten](https://emscripten.org/). 2. Run MSYS2 64bit console 3. Run follow command. ``` $ pacman -S git cmake make ``` - Linux 1. Install [Emscripten](https://emscripten.org/). 2. Run follow command. ``` $ sudo apt install git cmake build-essential ``` - macOS 1. Install [Emscripten](https://emscripten.org/). 2. Install XCode and brew. 3. Run follow command. ``` $ sudo brew install cmake ``` #### Build 1. Change directory to NP2kai. ``` $ cd NP2kai ``` 2. Make work directory, and step in. ``` $ mkdir build $ cd build ``` 3. Generate Makefile. ``` $ emcmake cmake .. ``` 4. Make. ``` $ make -j ``` - CMake options of Emscripten port (*=default) |name|value|work|output| |:---:|:---:|:---:|:---:| |USE_SDL2|ON*|Build with SDL2|emnp21kai.html| |USE_SDL2|OFF|Build with SDL|emnp21kai_sdl1.html| |USE_SDL_MIXER|ON*|Build with SDL2_mixer|| |USE_SDL_TTF|ON*|Build with SDL2_ttf|| |BUILD_I286|ON|Build i286|emnp2kai.html| |BUILD_I286|OFF*|Build IA-32|emnp21kai.html| - Emscripten SDL1 port cannot be with SDL_mixer and SDL_ttf #### Run 1. Run on emrun. ``` $ emrun .html ```

OpenDingux

OpenDingux
#### Install tools - GCW0 1. Install host toolchain to /opt/gcw0-toolchain with [buildroot](https://github.com/OpenDingux/buildroot). - RG350 1. Install host toolchain to /opt/rg350-toolchain with [RG350_buildroot](https://github.com/tonyjih/RG350_buildroot). 2. [patch](https://raw.githubusercontent.com/AZO234/RAcross_linux/master/RG350_buildroot.patch). - RS90 1. Install host toolchain to /opt/rs90-toolchain with [buildroot](https://github.com/OpenDingux/buildroot). #### Build 1. Change directory to NP2kai. ``` $ cd NP2kai ``` 2. Make work directory, and step in. ``` $ mkdir build $ cd build ``` 3. Generate Makefile. - GCW0 ``` $ cmake .. -D BUILD_OPENDINGUX_GCW0=ON ``` - RG350 ``` $ cmake .. -D BUILD_OPENDINGUX_RG350=ON ``` - RS90 ``` $ cmake .. -D BUILD_OPENDINGUX_RS90=ON ``` 4. Make. ``` $ make -j ``` - CMake options of OpenDingux port (*=default) |name|value|work|output| |:---:|:---:|:---:|:---:| |BUILD_OPENDINGUX_GCW0|ON|Build OpenDingux GCW0|np21kai_gcw0.opk| |BUILD_OPENDINGUX_RG350|ON|Build OpenDingux RG350|np21kai_rg350.opk| |BUILD_OPENDINGUX_RS90|ON|Build OpenDingux RS90|np21kai_rs90.opk| |USE_SDL2|ON*|Build with SDL2|<machine>_np21kai.opk| |USE_SDL2|OFF|Build with SDL|<machine>_np21kai_sdl1.opk| |USE_SDL_MIXER|ON*|Build with SDL_mixer or SDL2_mixer|| |USE_SDL_TTF|ON*|Build with SDL_ttf or SDL2_ttf|| |BUILD_I286|ON|Build i286|np2kai_<machine>.opk| |BUILD_I286|OFF*|Build IA-32|np21kai_<machine>.opk| - RS90 port cannot be with SDL2 - RS90 port cannot be with SDL_ttf

About libretro port

BIOS files location
- bios.rom - font.rom or font.bmp - itf.rom - sound.rom - (bios9821.rom or d8000.rom
But I never see good dump file.) - 2608_bd.wav - 2608_sd.wav - 2608_top.wav - 2608_hh.wav - 2608_tom.wav - 2608_rim.wav BIOS files locate in 'np2kai' directory at BIOS directory (configured by RetroArch).
Configure file (np2kai.cfg) is made in 'np2kai' BIOS directory.
To get BIOS files, you need actual PC-98 machine.
Start MS-DOS on the actual PC-98 and execute the GETBIOS command
(included in the np2tool/np2tool.zip floppy image)
to create BIOS files.
Rhythm sound files are dumped from PC-98 machine with FM sound gen.
You can get sound files from [here](https://sites.google.com/site/ym2608rhythm/).
Fonts
NP2kai recommend font is using font.rom.
### Windows You can use 'MS Gothic'. To install add your windows,
'install files Easten Asian languages' at 'language' option.
After installation, 'msgothic.ttc' file's shortcut named 'default.ttf' put in BIOS directory.
(Already exist 'font.tmp', delete this.)
And start NP2kai. ### Linux I recommend use 'Takao Gothic'.
Install with follow command. After installation, 'TakaoGothic.ttf' file's shortcut put in BIOS directory.
``` sudo apt install 'fonts-takao-*' ``` and ``` ln -s /usr/share/fonts/truetype/takao-gothic/TakaoGothic.ttf BIOSdirectory/default.ttf' ``` Already exist 'font.tmp', delete this.
And start NP2kai.
You can use 'Noto sans mono CJK', 'MS Gothic'(Japanese) also.
NP2 menu (different libretro menu)
NP2 menu is shown F12 or mouse middle button or L2.
NP2 menu can swap FDD/HDD diskimages.(Swapping HDD need reset.)
Mounting/Swaping Disk and HDD/CD mounting at start
Using .m3u file listed floppy disk images,
You can use libretro swap interface.
(This file must be wiritten in UTF-8.)
(On libretro m3u file supported is not in core now.) ``` 1st.d88 2nd.d88 3rd.d88 ``` 1st image is mouted to FDD1, 2nd image is mouted to FDD2.
(Not suitable when using only one FDD1 drive. Use NP2 menu.)
To swap FDD2 imagefile, libretro menu durling run core,
'Disk Control' -> 'Disk Cycle Tray Status' (eject) -> 'Disk Index' -> 'Disk Cycle Tray Status' (disk set)
So, to swap FDD1 imagefile, libretro 'Option' menu -> 'Swap Disks on Drive' set 'FDD1'
HDD/CD image can't be wiritten in .m3u file
You can write to .cmd file commandline,
(This file must be wiritten in UTF-8.) ``` np2kai fdilocation/aaa.fdi hdilocation/bbb.hdi isolocation/ccc.iso ``` 'aaa.fdi' is mounted to FDD1,
'bbb.hdi' is mounted to HDD1,
'ccc.iso' is mounted to CD drive.
(Determined by extension)
.m3u files can written in .cmd file.
Then, You can FDs+HD and FDs+CD contents file.
Using mouse (Joypad mouse mode)
Mouse cursor moving is always enable with mouse on PC.
If mouse cannot use on a game,
check mouse driver for the game or included in MS-DOS is loaded by CONFIG.SYS.
(Or MS-DOS's mouse driver inhibit the game only mouse driver.)
DEVICE=A:¥DOS¥MOUSE.SYS Mouse cursor moving and left-button be able to controled with joypad stick.
Switch Stick2Mouse mode in config to 'L-stick' or 'R-stick(default)'.
- Stick: mouse move - Thumb: mouse left button - ClickShift+Thumb: mouse right button ClickShift button is assigned to R1 default.
To using digital pad, switch 'Joypad mode' in config to 'Mouse'.
Mouse cursor is able to move with joypad's digital button also.
- D-UP/DOWN/LEFT/RIGHT: mouse move - B button: mouse left button - A button: mouse right button - R button: mouse speed up durling hold
Using keyboard (Joypad Keyboard mode)
Keyboard is able to control with joypad.
Switch 'Joypad mode' in config to 'Arrows' or 'Keypad' (or 'Manual keyboard').
- D-UP/DOWN/LEFT/RIGHT: Arrow key or Keypad(2468) key (No notation) - B button: Z key - A button: X key - X button: Space key - Y button: left Ctrl key (3 button) - B button: X key - A button: C key - X button: Space key - Y button: Z key
- L button: Backspace key - R button: right Shift key - Select button: Escape key - Start button: Return key By setting 'Manual Kayboard', you can custom keycode for button.
Change 'lrjoybtn' value in system/np2kai/np2kai.cfg.
This value is little endian and 12 values ​​of 16bits(2Bytes) are arranged.
Write the key code of RETROK (see libretro.h) to this value.
The order is D-UP/DOWN/LEFT/RIGHT/A/B/X/Y/L/R/Select/Start.
Using ATARI joypad (Joypad ATARI mode)
By setting 'ATARI joypad', you can use ATARI joypad port. - A button: A button - B button: B button - X button: Rapid A button - Y button: Rapid B button
Tuning performance
- CPU clock Change "CPU Clock Multiplyer". - Memory size Change "RAM Size". - MS-DOS 5 or older : lower 16.6MB - MS-DOS 6 : lower 64.6MB - Sound device - 26K: for old games. - 86: for newer games. - Sound Generator (to change need reset) - fmgen: fmgen sound generator. - Default: NP2's default sound generator. - How to set GDC 2.5MHz/5MHz? 1. Press End key(assigned Help key) + reset 2. Select 'ディップスイッチ2'(DIP switch 2) - How to key typing? There are two ways: 1. map the 'enable hotkeys' hotkey in settings > input > input hotkey binds and RetroArch will stop listening for hotkeys unless/until you hold that button/key 2. enable the "game focus mode" (mapped to scroll_lock by default) and it will send all of your inputs to the core instead of the frontend. However, some people have reported having trouble getting out of game focus mode. (Thanks hasenbanck)

Keyboard mapping (libretro)

Common
|PC-98key|key|problem|menu| |:---:|:---:|:---:|:---:| |STOP|Pause||| |COPY|PrintScreen|don't come event|implemented| |v.f1||can't push|| |v.f2||can't push|| |v.f3||can't push|| |v.f4||can't push|| |v.f5||can't push|| |Kana||can't push|implemented| |GRPH|RCtrl||| |NFER|LAlt||| |XFER|RAlt||| |HOME/CLR|Home||| |HELP|End||| |KP=|KP=|can't push|implemented| |KP.|KP.|don't come event|implemented|
JP106 keyboard(default)
|PC-98key|key|info|menu| |:---:|:---:|:---:|:---:| |¥ \|¥ \|don't come event|implemented| |_ _||L2? Menu has open?|implemented|
US101 keyboard
|PC-98key|key|info|menu| |:---:|:---:|:---:|:---:| |2 "|2 @|two event 0x02,0x2A|| |¥ \|\\ \||| |@ `|` ~|don't come event|implemented| |; +|; :||| |: *|' "||| |_ _||can't push|implemented|

Keyboard mapping (X11)

Common
|PC-98key|key|problem|menu| |:---:|:---:|:---:|:---:| |STOP|Pause||| |COPY||can't push|| |v.f1||can't push|| |v.f2||can't push|| |v.f3||can't push|| |v.f4||can't push|| |v.f5||can't push|| |Kana||can't push|| |GRPH|RCtrl||| |NFER|LAlt||| |XFER|RAlt||| |HOME/CLR|Home||| |HELP|End||| |KP=|KP=|can't push||
JP106 keyboard(default)
All keys are used, OK.
US101 keyboard
|PC-98key|key|info|menu| |:---:|:---:|:---:|:---:| |2 "|2 @||| |6 &|6 ^||| |7 '|7 &||| |8 (|8 *||| |9 )|9 (||| |0
|0 )||| |- =|- _||| |^ ~|= +||| |¥ \|\\ \||| |@ `|[ {||| |[ {|] }||| |; +|; :||| |: *|' "||| |] }|` ~||| |_ _||can't push|implemented|
Setting to RetroPie
1. Install Japanese font. (umefont need SDL2 port only) ``` $ sudo apt-get install fonts-droid fonts-horai-umefont ``` 2. Locate libretro & SDL2 port files. ``` $ sudo mkdir /opt/retropie/libretrocores/lr-np2kai $ sudo cp np2kai_libretro.so /opt/retropie/libretrocores/lr-np2kai/ $ sudo mkdir /opt/retropie/emulators/np2kai $ sudo cp np2kai /opt/retropie/emulators/np2kai/ $ sudo touch /opt/retropie/emulators/np2kai/np2kai.cfg $ sudo chmod 666 /opt/retropie/emulators/np2kai/np2kai.cfg ``` 3. Write & locate retroarch.cfg. ``` $ sudo vi /opt/retropie/configs/pc98/retroarch.cfg` ``` Settings made here will only override settings in the global retroarch.cfg if placed above the #include line ``` input_remapping_directory = "/opt/retropie/configs/pc98/" #include "/opt/retropie/configs/all/retroarch.cfg" ``` 4. Locate BIOS files. BIOS files locate in "˜/RetroPie/BIOS/np2kai/" directory.
and "/opt/retropie/emulators/np2kai/" too. 5. Make shortcut to Japanese font. (SDL2 port only) ``` $ sudo ln -s /usr/share/fonts/truetype/horai-umefont/ume-ugo4.ttf /opt/retropie/emulators/np2kai/default.ttf ``` 6. Add "carbon-mod". (Japanese nize) ``` $ git clone https://github.com/eagle0wl/es-theme-carbon.git` $ sudo cp -r ./es-theme-carbon /etc/emulationstation/themes/carbon-mod ``` 7. Add to "/etc/emulationstation/es_systems.cfg" writing. ``` $ sudo nano /etc/emulationstation/es_systems.cfg` ``` ``` pc98 PC-98 /home/pi/RetroPie/roms/pc98 .d88 .88d .d98 .98d .fdi .xdf .hdm .dup .2hd .tfd .nfd .hd4 .hd5 .hd9 .fdd .h01 .hdb .ddb .dd6 .dcp .dcu .flp .bin .fim .img .ima .D88 .88D .D98 .98D .FDI .XDF .HDM .DUP .2HD .TFD .NFD .HD4 .HD5 .HD9 .FDD .H01 .HDB .DDB .DD6 .DCP .DCU .FLP .BIN .FIM .IMG .IMA .thd .nhd .hdi .vhd .sln .hdn .hdd .THD .NHD .HDI .VHD .SLN .HDN .HDD .m3u .M3U /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ pc98 %ROM% pc98 pc98 ``` 8. Add to "/opt/retropie/configs/pc98/emulators.cfg" writing. ``` $ cd /opt/retropie/configs $ sudo mkdir pc98 $ cd pc98 $ sudo nano emulators.cfg ``` ``` np2kai="/opt/retropie/emulators/np2kai %ROM%" lr-np2kai="/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-np2kai/np2kai_libretro.so --config /opt/retropie/configs/pc98/retroarch.cfg %ROM%"

default="lr-np2kai" ``` 9. Launch ES and set "CARBON-MOD" to "THEME-SET".

Informaion

Key-repeat (libretro and SDL)
To use Key-repeat, enable in menu.
On default, Key-repeat's delay is 500ms, Key-repeat's interval is 50ms.
Using CD-ROM drive
To use CD drive with MS-DOS 6.2,
write follow to CONFIG.SYS.
LASTDRIVE=Z
DEVICE=A:¥DOS¥NECCDD.SYS /D:CD_101
And write follow to AUTOEXEC.BAT.
A:¥DOS¥MSCDEX.EXE /D:CD_101 /L:Q
Then, you'll can use CD drive as Q drive.
How many files(0-15)?
This screen is boot as PC-98 ROM BASIC mode.
You succeed to locate BIOS files.
Your floppy/harddisk image isn't mount correctry.
Check selecting image files and restart.
About PC-9801 floppy disk image
NP2 is made according to PC-98 specifications.
Floppy disk types are 720KB(2DD) and 1.23MB(2HD).
The floppy drive differs from the one of the PC/AT on the hardware level.
(There are a few floppies formatted to 1.44MB(2HD) using MS-DOS 6.2.)
A common mistake is to create a floppy disk image with PC/AT.
Some disk imager for PC/AT software is useful, but can't use PC-98 formatted floppy disk.
To read data from PC-98 formatted floppy disk,
You must use Win2000 older and '3-mode' floppy disk drive.
Also, many PC-98 floppy disks are provided with powerful copy guard for DRM.
If you are in the way, you should use WIZARD V3/V5.
It is better to have no obstacle.
And also, you may simply convert the image format.
VFIC (Virtual Floppy Image Converter)
https://www.vector.co.jp/soft/win95/util/se151106.html
Virtual Floppy Drive
https://sites.google.com/site/chitchatvmback/vfd
Hard disk image
DiskExplorer is useful for hard disk image management.
This software can access files in image nicely.
Only FAT is supported, NTFS does not correspond.
DiskExplorer
https://hp.vector.co.jp/authors/VA013937/editdisk/index.html
To use libnvl.so functions (X11)
http://euee.web.fc2.com/tool/nvl/np2kainvl.html
Locate libnvl.so to /usr/local/lib/.
Then we can use follow types HDD image files.
- vmdk - dsk - vmdx - vdi - qcow - qcow2 - hdd
Text editor
MS-DOS for PC-9801 include 'SEDIT.EXE' text editor.
Also there is 'VZ Editor' product.
About LHA(lzh) archived file
File has extention '.lzh' is compressed file by [LHA](https://www.vector.co.jp/soft/dos/util/se002413.html).
If to extract only, you can use [LHE](https://www.vector.co.jp/soft/dos/util/se017776.html).
File manager
To file management, you can use [FILMTN](https://www.vector.co.jp/soft/dos/util/se001385.html) and [LHMTN](https://www.vector.co.jp/soft/dos/util/se001396.html),
or [FD](https://www.vector.co.jp/soft/dos/util/se000010.html).
Memory driver
When start PC-98, memory amount is displaied. ``` MEMORY 640KB + 13312KB ``` 640KB is conventional memory.
(For example) 13312KB is extnded memory. Extnded memory is use as XMS(eXtended Memory Specification)
by HIMEM.SYS is written in CONFIG.SYS.
DEVICE=A:¥DOS¥HIMEM.SYS
Drivers and daemons can be loaded on XMB.
(But EMM386.EXE, SMARTDRV.EXE, NECCD*.SYS cannot be loaded on XMB.)
DEVICEHIGH=A:¥DOS¥MOUSE.SYS
DEVICEHIGH=A:¥DOS¥RAMDISK.SYS /X 1536
8086 or V30 can use HMA(448KB XMS).
i286 or later,
MS-DOS 5 or older can use lower 16MB XMS.
MS-DOS 6 can use lower 64MB XMS. XMB can use as UMB(386KB), EMB by
EMM386.EXE(old EMM386.SYS) is written in CONFIG.SYS.
DEVICE=A:¥DOS¥EMM386.EXE /P=64 /UMB /DPMI
'/P=64' means using EMS 64page (1page=16KB).
'/DPMI' means with DPMI support. Normaly, MS-DOS is located on conventional memory.
You can use XMB and UMB, DOS can be located on them, ``` DOS=HIGH,UMB ``` If you use upper 64MB XMB,
you can use [VEM486](https://www.vector.co.jp/soft/dos/hardware/se025675.html) (deposit software)
instead of HIMEM.SYS and EMM386.EXE.
DEVICE=A:¥VEM486¥VEM486.EXE
Running Turbo C++ 4.0
To run Turbo C++ 4.0, use HIMEM.SYS only.
Running NASM
To run NASM, use DPMI(HIMEM.SYS + EMM386.EXE + DPMI option).
And before run NASM, set swap follow command.
A:¥NASM¥CWSDPMI.EXE -S A:¥NASM¥CWSDPMI.SWP CWSDPMI.EXE is loaded on memory continuous.
A:¥NASM¥CWSDPMI.EXE -P -S A:¥NASM¥CWSDPMI.SWP
To free
A:¥NASM¥CWSDPMI.EXE -U
Using linker
I think better linker is genarate 16bit executable one.
(Ex.LNK563)
if Not careful, you can use MASM's linker.
About MS-C
When MS-C ver.5 is released, users use MS-DOS 3.0.
MS-C ver.6 is worked on Windows DOS prompt only.
Then MS-C is unconvenience to MS-DOS.
I think Turbo C++ 4.0 is used.
Network Card
NP2kai can use NIC that is follow spec.
MELCO LGY-98
IRQ:6
I/O:0x00D0
WAB (Window Accelerator Boards)
NP2kai can use WAB (Window Accelerator Boards).
To use WAB, enable WAB in menu and restart.
WAB Type normally uses 'PC-9821Xe10,Xa7e,Xb10 built-in'.
**640x480 256 color support for Windows 3.1** 1. Switch to directory 'A:¥WINDOWS', then run 'SETUP' command. 2. Select display mode '640x480 256色 16ドット(9821シリーズ対応)', or '640x480 256色 12ドット(9821シリーズ対応)' for smaller system font, then complete the changes. You may need Windows 3.1 installation disks when applying changes for the display driver. 3. Extract 'EGCN4.DRV' and 'PEGCV8.DRV' from 'MINI3.CAB' in Windows 98 CD. 4. Copy extracted 'EGCN4.DRV' and 'PEGCV8.DRV' to 'A:¥WINDOWS¥SYSTEM' directory, so as to replace the original driver files from Windows 3.1 installation disk. 5. Type 'win' command to check if the driver works well. **NOTE:** Do not run MS-DOS prompt with fullscreen mode, or your screen will get garbled when switching back to Windows environment. You can use WAB Type 'WAB-S', 'WSN', 'GA-98NB'.
- WAB-S driver http://buffalo.jp/download/driver/multi/wab.html
- WSN driver http://buffalo.jp/download/driver/multi/wgna_95.html
- GA-98NB driver https://www.iodata.jp/lib/product/g/175_win95.htm
Hook fontrom (textize)
Enable 'Hook fontrom' in menu,
Hook to using fontrom and output text to 'hook_fontrom.txt' in BIOS directory.
This function is disable at start NP2kai.
Debug snapshot
Debug snapshot is 'save state' plus various information for debug.
(version, SHA-1 hash of FDs and CDs, displaied image, state of machine.) Those information files are saved into 'debugss' directory in BIOS directory.

Take snapshot before and after the problem with reproducibility,
This function is used for communication purposes.
(Probably will be large file, so compression with ZIP
and be careful hosting when reporting.)
Video filter
To enable and select profile, control by menu.
Video filter1 have 3 profiles.

A profile include 3 filters.
Filters are applied in order.
filter0 -> filter1 -> filter2

Filter's parameters are set to 'vf1_p(profile no)_p(filter no)' to 8 params. |Param No|Name|value| |:---:|:---:|:---:| |0|Enable|0:OFF/1:ON| |1|Filter Type No|(follow table Filter Type no)| |2|Param 0|| |3|Param 1|| |4|Param 2|| |5|Param 3|| |6|Param 4|| |7|Param 5|| |Filter Type No|Filter Name|Param 0|Param 1|Param 2|Param 3|Param 4|Param 5| |:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| |0|THRU|-|-|-|-|-|-| |1|NP(Nega/Posi) invert|-|-|-|-|-|-| |2|Depth down|0-7:downbits
(default 7)|-|-|-|-|-| |3|Grey|0-8:Grey depth|0-359:H of white
(default 0)|0-255:S of white
(default 0)|0-255:V of white
(default 255)|-|-| |4|V Gamma|1-255:Gamma*10
(default 10)|-|-|-|-|-| |5|Rotate H|0-359:Rotate H
(default 0)|-|-|-|-|-| |6|HSV smoothing|5-25:Radius*10
(default 5)|1/3/5:Sample count
(default 3)|0-180:Merge H diff
(default 30)|0-128:Merge S diff
(default 30)|0-128:Merge V diff
(default 90)|Weight 0:Same/1:Linear/2:Sign
(default 0)| |7|RGB smoothing|5-25:Radius*10
(default 5)|1/3/5:Sample count
(default 3)|0-128:Merge R diff
(default 30)|0-128:Merge G diff
(default 30)|0-128:Merge B diff
(default 30)|Weight 0:Same/1:Linear/2:Sign
(default 0)| HSV/RGB smoothing is heavy to work.

MIDI sound (libretro)

Common
Set RetroArch's 'Setting' -> 'Audio' -> 'MIDI' -> 'Output' -> '(MIDI device)' in menu.
Windows
NP2kai can use 'Microsoft GS Wavetable Synth'.
NP2kai can use external MIDI sound generator with UM-1(USB-MIDI interface).
Linux
External MIDI
NP2kai can use external MIDI sound generator with UM-1(USB-MIDI interface).
Timidity++ (software MIDI synthesizer)
NP2kai can software synthesizer Timidity++ as ALSA Virtual MIDI.
1. Install Timidity++ and fluid-soundfont ``` $ sudo apt install timidity timidity-interfaces-extra fluid-soundfont-gm fluid-soundfont-gs ``` 2. Edit timidity.cfg ``` $ sudo nano /etc/timidity/timidity.cfg ``` ``` #source /etc/timidity/freepats.cfg
source /etc/timidity/fluidr3_gm.cfg ``` 3. Restart timidity ``` $ sudo service timidity restart ``` 4. Run timidity daemon output to ALSA. ``` $ timidity -iA -B2,8 -Os & ``` 5. It maybe able to select 'Timidity port 0' RetroArch's MIDI device. Next boot computer, you command from 4. You can write to .profile, but Timidity daemon spend a bit CPU performance.

MIDI sound (X11)

Common
NP2kai's MIDI setting is in 'Device' -> 'MIDI option...'. Set device file to 'Device'\'s 'MIDI-OUT'. (ex. /dev/snd/midiC0D0)
And set 'Assign''s 'MIDI-OUT' to 'MIDI-OUT device'.
External MIDI
NP2kai can use external MIDI sound generator with UM-1(USB-MIDI interface).
1. Connect UM-1 to USB 2. Check you can see 'midiC4D0' by '$ ls /dev/snd' command 3. Open xnp2kai and set MIDI device. I tried with Touhou 2 (set MIDI option), I could listen MIDI sound.
Timidity++ (software MIDI synthesizer)
NP2kai can software synthesizer Timidity++ as Virtual MIDI.
To using, necessaly setup Virtual MIDI Port module too. 1. Install Timidity++ and fluid-soundfont ``` $ sudo apt install timidity timidity-interfaces-extra fluid-soundfont-gm fluid-soundfont-gs ``` 2. Edit timidity.cfg ``` $ sudo nano /etc/timidity/timidity.cfg ``` ``` #source /etc/timidity/freepats.cfg
source /etc/timidity/fluidr3_gm.cfg ``` 3. Restart timidity ``` $ sudo service timidity restart ``` 4. Run timidity daemon output to ALSA. ``` $ timidity -iA -B2,8 -Os & ``` You will see like ALSAed Timidity port 128:0 to 128:3.
``` $ aconnect -o ``` 5. Add virtual MIDI port module. ``` $ sudo modprobe snd-virmidi ``` (If you want to use snd-virmidi permanently, see [detail info](https://wiki.archlinux.org/index.php/Timidity%2B%2B).) ``` $ aconnect -o ``` You can see like VirMIDI 0-0 to 0-3 at 16:0 to 19:0.
6. You can also see VirMIDI 0-0 to 0-3 as midiC0D0 to midiC0D3.
``` $ ls /dev/snd ``` 7. Connect VirMIDI 0-0 and ALSAed Timidity port 0. ``` $ aconnect 16:0 128:0 ``` 8. Finally set '/dev/snd/midiC0D0' to xnp2kai. Next boot computer, you command from 4.

Release

ToDo

SDL2

libretro

Linux

Windows

Reference