Customizing the system

Before we go any further, here's an IMPORTANT NOTE: drive letters don't work like in IBM compatible systems. They don't have a fixed order. The device you boot from (FDD or HDD, doesn't matter) is always A:, other devices of the same type are the following letters, and other devices of other types come after that (except CD drives, as we will see later). So if you boot from an HDD with two partitions:

- A: would be the first HDD partition
- B: would be the second HDD partition
- C: would be the first floppy drive
- D: would be the second floppy drive

And in the emulated system we have built, we have A: as the HDD and B: and C: as the floppy drives... as long as we boot from HDD, of course.

You will see how super fun this is when we get to the part where we install floppy + CD games and need to tell them how to find their files.

-----

As I mentioned before, it seems at some point NEC realized that configuring DOS systems can be a bit arcane, so they included an utility (CUSTOM) that at least tries to do some basic stuff for you. Just run CUSTOM on the command line, and you will see this screen:

[Linked Image]

For now we only need the first option, Create/Update the Environment Configuration Files (環境設定ファイルの作成/更新). It will show two options at the bottom, 新規作成 (create new) and 更新 (update). Choose the latter.

[Linked Image]

In this screen, items can be enabled (使用する) or disabled (使用しない). You can also see another page of items with the 次画面 option but I don't recommend changing anything there. For a standard MAME setup, I'd disable at least the following so they don't take up memory:

- Japanese input (日本語入力), if you're not planning on typing Japanese text.
- Printer support (プリンタ).
- DOS Shell (DOSシェル).

You *could* also, on a real PC-98 system with a supported CD-ROM drive, enable CD-ROM support here, but this doesn't work on emulation (and it doesn't even work on some real PC-98 computers), so leave that disabled for now and choose 設定終了 (Finish Settings).

[Linked Image]

You will see a preview of your CONFIG.SYS file, and three options: 次画面 (next screen), メニュー選択を戻る (return to selection menu) and 内容を編集する (edit the contents). Choose the first one.

[Linked Image]

Another preview, this time of AUTOEXEC.BAT. Choose the 作成を終了する (finish creation) to end the process, and exit the tool with 終了.

Reboot, and you will finally be free of the tyranny of DOS Shell.



Bigger and better hardware

MAME by default emulates a NEC PC-9801-26K sound card. This card is based on the Yamaha YM2203 (OPN) FM synth, which sounds good enough and is compatible with pretty much anything, but you also have two other choices:

- The PC-9801-86 upgrades the FM chip to a YM2608 (OPNA), which sounds *fantastic* on the games that support it, and adds a 16-bit stereo PCM DAC on top of it. The 86 is fully backwards compatible with the 26, so there is no reason not to choose it, outside of the higher system requirements for emulation, or the rare compatibility quirk.

- The PC-9801-118 is a later model mainly found on PC-9821 computers (it's also known as "CanBe sound source" because that was one of many commercial names that NEC used for the PC-9821 line). It further upgrades the FM chip to a YMF297-F (which is still compatible with both the OPN and the OPNA), but replaces the 86 PCM sound with a Crystal CS4232 codec (a.k.a. "Windows Sound System"). It is *not* directly compatible with the 86 PCM, so it works better with later games that support the 118 explictly.

To use one of the alternatives, simply plug it into the emulated C-Bus slot with "-cbus0 pc9801_86" or "-cbus0 pc9801_118".

Also, all PC-98 drivers have 1664 KB (640 + 1024) of RAM as a default, which might not be enough for later software. You can add more RAM with the "-ramsize" option. At the time of writing this guide, the supported options are 640K, 1664K, 3712K, 7808K, and 14M.



The CD-ROM conundrum

If you're familiar with how CD drives work in IBM compatibles, you will know that we have to load a CD driver and the MSCDEX program so DOS can access the drive. But there's a problem: none of the CD drivers included with DOS work with MAME, at least at the time of writing this. The only one that works (NECCDM.SYS) was distributed separately. You can download a disk image that contains it here:

http://r-09.net/neccdm.zip

So to make this work, you need to:

- Mount the floppy image (do this after you boot from the HDD).
- Copy NECCDM.SYS to the DOS directory, renaming it to NECCD.SYS (if you've followed my instructions, that would be COPY B:¥NECCDM.SYS A:¥DOS¥NECCD.SYS). The renaming part is important because a lot of installers expect it to have that name.
- Edit the CONFIG.SYS file so it loads the driver.

That last part needs some explanation. The classic MS-DOS Editor (EDIT.COM) is not included with NEC's version of DOS, instead they opted to include their own editor (SEDIT). Run SEDIT A:¥CONFIG.SYS and you will see the contents of the file:

[Linked Image]

Just add two lines at the end:

LASTDRIVE=Q
DEVICE=A:¥DOS¥NECCD.SYS /D:CD_101

(if you're having trouble with the keyboard, take a look at the keyboard mappings in the TAB menu)

The CD_101 part is just a device name and can be anything, but it's kind of a standard name so I recommend keeping it like that.

After that, press F1 and choose the ファイルのセーブと編集終了 (finish editing and save the file) option.

[Linked Image]

Now do the same for AUTOEXEC.BAT. You should be getting the hang of this already. Edit it and add this line:

A:¥DOS¥MSCDEX.EXE /D:CD_101 /L:Q

(NOTE: if you're wondering "why Q: and not another letter?", it is sort of a de-facto standard for CD-ROM drives in Japanese computers. It probably started with the FM Towns, which has it hardcoded; maybe they were Star Trek fans or something.)

Reboot, and if everything is OK you should be able to access the CD as drive Q. You can mount CDs from the MAME command line with the "-cdrom" option.

[Linked Image]

(continued on the next post...)