# HOW TO: Emulate PC-9821 games on FreeBSD 10



## BSD-Kitsune (Mar 22, 2014)

So when migrating to FreeBSD, one of the things I wanted to do that I could not in Linux was run PC-9821 games. The emulator for the UNIX and UNIX-like OSes is a port of Neko Project II called xnp2. Its really easy to get it running, but since its not in ports, I thought I'd do a little guide on it.

For reference, I did this successfully on a RELEASE of FreeBSD 10 as well as STABLE of FreeBSD 10.

*Introduction*
The PC-9821 is a series of Japanese, 32-bit x86 computers popular in the 1990s in Japan. Many great games out of Japan either began on the PC-9821 or had a port done. It is an evolution of the PC-9801, which is equatable to the IBM-PC series. Some of these games released on the PC-9821 include Policenauts, Touhou 1-5, Snatcher and Battle Skin Panic. 

*Installation of xnp2*
You will need to go to the site of xnp2, located here: http://www.nonakap.org/np2/ and download the latest source. If you cannot read Japanese, like I myself, look for the link labeled xnp2-YYYYMMDD.tar.bz2 (as of March, 2014 the latest source is xnp2-20130727.tar.bz2)

Once downloaded, change to the download location and run the following commands:


```
$ tar xvjpf xnp2-20130727.tar.bz2
$ cd xnp2-20130727/x11
$ ./configure --enable-ia32
$ make && sudo make install clean
```
 
You can now launch xnp2 by typing `xnp2`

*Configuring*
Now, you will need to configure xnp2 to get it to play your games smoothly. Run `xnp2` and click File > Configure. Now select CPU and ensure it is set to 2.4576MHz, then select the rate and set it to 20, which gives you an effective clockrate of 49.152MHz, which is more than fast enough for all PC-9821 games. Set sound to 44KHz and buffer to 100ms for best sound (any lower and you start to hear stuttering), and uncheck Disable MMX. Click OK to save the changes.

You're done with the CPU configuration now. Select Device > Memory and set it to 13.6MB. Hit File > Reset now. You are now running xnp2 at max specifications, which on my AMD 8550 APU with 4GB ram has no lag whatsover.

Note: If the Japanese fonts are messed up, this is easily fixed. Download this file: http://www.zophar.net/download_file/2142 and click File > Font and point xnp2 to the file, and reset the emulator.

In order to show off that it works, here is a screenshot of me playing Touhou 5 - Mystic Square on FreeBSD 10 STABLE.


----------

