Submit issues and contribute: Source
This is the guide for the PC-98 era games. The Windows era Touhou guide is here.
This guide focuses on using DOSBox-X and Neko Project II Kai for a simple and consistent experience. It does not cover every setup or edge case.
The goal here is to get most users running their PC-98 Touhou games quickly and cleanly.
If you're looking for more advanced or alternative methods, other resources may be better suited.
Skip this section if you already have chosen your distro.
Most major distros and desktop environments should work well with this guide.
This guide has been personally tested with:
My only recommendation is to choose a well-known, widely-supported, and stable distro, which includes but is not limited to the following:
Before continuing, ensure you have the necessary graphics drivers and system firmware installed.
Consult your distro's documentation or other online resources for a proper setup (e.g., RPM Fusion for Nvidia drivers on Fedora, multilib repo on Arch, etc.).
Debian/Ubuntu/Linux Mint
sudo apt update && sudo apt upgrade
Fedora
sudo dnf update
Arch
sudo pacman -Syu
There exists several emulators of the PC-98 platform, many of which work very well on Windows or older hardware.
However, they're more likely to have issues and inconsistent behavior when running on Linux with Wine, especially on certain distributions.
As such, this guide will only cover two Linux-native emulators in detail. Choose the one that fits you the most:
All-around good choice for most users
Cross-platform (Windows, Linux, MacOS, DOS)
Great if you emulate other DOS systems
Included in many distros' repos
Has save states
Generally considered more accurate in terms of emulation
Better choice if you're doing serious runs
Great if you already use RetroArch (cross-platform)
Can be built from source as xnp21kai
Has an AUR package
A list of other PC-98 emulators can be found here.
Install DOSBox-X through your package manager
Flatpak
Recommended option for most users*
flatpak install flathub com.dosbox_x.DOSBox-X
Debian/Ubuntu/Linux Mint
sudo apt install dosbox-x
Fedora
sudo dnf copr enable rob72/DOSBox-X
sudo dnf install dosbox-x
Arch
git clone https://aur.archlinux.org/dosbox-x.git
cd dosbox-x && less PKGBUILD
makepkg -si dosbox-x
* The Flatpak version helps avoid most inconsistencies between distros and will always be the most up-to-date version, at the cost of taking up more storage and less file permissions by default.
DOSBox-X relies on a configuration file to apply the correct settings for various types of programs.
By default, DOSBox-X uses its own config file located at:
Non-Flatpak
~/.config/dosbox-x/dosbox-x-(version).conf
Flatpak
~/.var/app/com.dosbox_x.DOSBox-X/config/dosbox-x/dosbox-x-(version).conf
If the working directory contains a file named
dosbox-x.conf,
the settings that it contains will override the respective ones in the default config file.
As such, a ready-to-use config file is available for you to download; Simply save it to the same directory as your HDI files.
If you prefer writing your own config file or directly editing the main config file, continue to the next sections.
Otherwise, download a font to the directory, then start running the games.
The working directory is where DOSBox-X will run. By default, DOSBox-X will ask you to choose a directory in your system.*
If you intend on using DOSBox-X only to play the PC-98 Touhou games, set the directory with the HDI files as the default working directory in the default config file
[dosbox]
working directory option = default
working directory default = /your/path/to/pc98touhou/
* If ran from the desktop. If it was ran in the terminal, DOSBox-X uses the current directory as the working directory.
To always start in fullscreen, set:
[sdl]
fullscreen = true
fullresolution = desktop
To ensure the graphics stay consistent, set:
[sdl]
output = openglpp
[render]
aspect = true
aspect_ratio = -1:-1
To always enable PC-98 mode, set
[dosbox]
machine = pc98
The default CPU cycle count (3000) is too low for the Touhou games, resulting in extremely slow gameplay.
For a consistently smooth experience,* set
[cpu]
cycles = 72000
If your hardware allows it,† set
[cpu]
core = dynamic_x86
* In testing, most values between 10000 and 100000 worked well for the Touhou games. 72000 is suggested in this guide for most systems.
† DOSBox-X used less of the CPU compared to "Normal" during testing with the same number of cycles.
This is especially helpful if you intend on always using only one HDI file* and do not want to always type the commands by hand
[autoexec]
IMGMOUNT C TOUHOU.HDI
BOOT C:
Substitute TOUHOU.HDI with the actual name of your HDI file.
* For example, an HDI with all the PC-98 Touhou games or a full system
There are many different ways to have NP21kai installed to your system.
Recommended option for most users
Good and stable choice if you already use RetroArch for other games, but not great if you're tight on storage. Modern UI navigation is biased towards controllers.
Good choice if you use an Arch-based system. Doesn't help if you don't use Arch, by the way.
Has bugs and missing features.
Not recommended for users new to Linux or unfamiliar with CLI. Only choose this if you have no other options.
Install RetroArch as a Flatpak
flatpak install flathub org.libretro.RetroArch
flatpak run org.libretro.RetroArch
In the Main Menu, select† "Load Core", then "Download Core"
Scroll down the list to NEC - PC-98 (Neko Project II Kai), then select to install it.
† Enter key on keyboard
If you're new to Arch, please consider first reading the Arch Wiki article on how to install packages from the AUR, along with the article on makepkg.
Install gtk2 from the AUR
git clone https://aur.archlinux.org/gtk2.git
cd gtk2 && less PKGBUILD
makepkg -si gtk2
Install np21kai from the AUR
git clone https://aur.archlinux.org/np2kai-git.git
cd np2kai-git && less PKGBUILD
makepkg -si np21kai
Proceed with adjusting the necessary settings.
The steps below are from the README document.
Install the required programs and libraries*
Debian/Ubuntu/Linux Mint
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
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
* Installing these libraries may cause some of your programs or dependencies to be automatically removed. Always check what packages will be installed and removed before confirmation.
Clone the np21kai repo
git clone https://github.com/AZO234/NP2kai.git
Navigate to the repo and make the work directory
cd NP2kai
mkdir build
cd build
Generate the makefile
cmake .. -D BUILD_X=ON
Make. Errors are normal.
make -j
Install the binary (to /usr/local/bin/)
sudo make install
xnp21kai
Go back* to the previous menu and select the respective core. On the Main Menu, "Start Core" will be in place of "Load Core".
Start the core without content and press F1 to open the Quick Menu
Select "Core Options", and apply these settings:
5216PC9801-26K+86128128128DefaultGo back and restart the core.
You're now ready to run the games
* Backspace key on keyboard
† These settings are required for smooth gameplay.
In the menu bar, adjust these settings for a smooth experience. To apply them, hit "Reset" in "Emulator"
2.4576MHz x 52PC-9801VX44100 kHz20 msInstall the necessary ROM files to ~/.config/xnp21kai/
* The default multiplier of 20 should be enough for most systems, but can result in slowdowns on sections with large amount of enemies or danmaku.
† It has been known that a buffer of 100 ms or more will result in noticeable sound delay, especially for sound effects.
You may need to install some PC-98 ROM files for your emulator to work properly.
NP2Kai on RetroArch and DOSBox-X both already include the necessary files.
However, xnp21kai does require these files:
Both Neko Project II Kai and DOSBox-X require the a font file.
Some popular font files are available to download from here:
Move/copy the font file to the same directory/folder as your PC-98 Touhou HDI file(s).
For xnp21kai, place it in ~/.config/xnp21kai. If you are using a font besides
FONT.ROM, edit fontfile in xnp21kairc to the abosolute filepath of the font.
It is highly recommended that you store your HDI files in a directory/folder like "Games" or "Touhou"
If prompted, select the directory/folder with your HDI files as your working directory.
Wait for it to finish loading, then run these two commands in DOSBox-X:
IMGMOUNT C TOUHOU.HDI
BOOT C:
Substitute TOUHOU.HDI with the actual
filename* of the HDI file† you want to load.
Enjoy!
See next section on how to remove or change the HDI file
* The filename is case-sensitive!
† Depending on the type of HDI file you obtained, you'll either directly boot into the game or a menu with the games listed.
Navigate to the directory folder with your HDI(s) and config file, then run
Non-Flatpak: dosbox-x
Flatpak: flatpak run com.dosbox_x.DOSBox-X
In the Main Menu, select "Load Core", then "NEC - PC-98 (Neko Project II Kai)"
If it's your first time loading the HDI file:
Select "Load Content"
Navigate to to directory with the file and select it
If you have loaded the HDI file before:
Select "Playlists", then "History"
Select the HDI file, then run it.
Enjoy!
To remove the HDI file, go into the Quick Menu and select "Close Content"
In the menu bar, select "HardDisk"
Choose IDE0-0*, then "Open"
Find your Touhou HDI file and open it.
Reset the emulator.
Enjoy!
To remove† the HDI, simply choose "Remove" on the "hard disk" the HDI is located in and reset the emulator.
* IDE0-0 acts like the C: drive, while IDE0-1 is the A: drive.
† To switch to another HDI, simply choose "Open" again.
Unless you're directly using the original PC-98 files, HDI files contain everything!
Restarting the DOSBox-X instance will make it unable to mount any HDI file in your working directory.
Instead:
If you want to use the same HDI file, Reboot the guest system (F12+B).
If you want to use a different HDI file in the same working directory, reset the virtual machine (F12+R).
If you only use one HDI and only use DOSBox-X for that purpose, it's useful to make DOSBox-X automatically load it every time you run DOSBox-X.
To enable savestates, add the following line to xnp21kairc:
STATSAVE = true
Your window position and size is not remembered!
Your last used HDI file, however, is remembered!
When ran from the terminal, closing the terminal emulator will also close xnp21kai
There has been issues where closing the window via the "X" button may not cause the program to stop running.
By default, pressing the Esc key twice will quit RetroArch!
It's recommended to set your HDI file(s) as favorites to access them faster in the future.
There are two ways of adding them to your favorites:
Quick Menu → Add to Favorites (while running)
Playlist → History → your HDI file(s) → Add to Favorites
Make sure to run this command before using older emulators (np2, anex86, t98next) with Wine:
winetricks ddr=gdi
This section is under expansion. Submit issues here.
Try stopping the program and run it again. (Ctrl+C if launched from the terminal)
Includes errors being thrown even when pressing Ctrl+C in the terminal.
Unfortunately, This is arbitrary behavior that there is no exact solution to so far.
Testing by the author suggests that directly running xnp21kai from /usr/local/bin/
may solve this issue if it repeatedly happens.
Unfortunately there is currently no option to scale up the display.
The author would like to thank the following for their support: