When is a PC not a PC? The PC-98
I’ve covered PC compatibility in the past, and tried to clarify how simply having an x86 CPU and running DOS does not necessarily make your machine compatible with an IBM PC. On the time, this was primarily concerning the IBM PCjr (and its clone, the Tandy 1000), which continues to be comparatively near an everyday PC. As such you would create software program that will run on each IBM PCs and compatibles, and on the PCjr/Tandy, with customized code paths for particular performance, corresponding to sound and graphics.
However just about all different DOS/x86-based machines failed, as their {hardware} was too completely different, and their marketshare was too small for builders to trouble including assist. In reality, the principle cause that the Tandy 1000 existed in any respect, is as a result of the sooner Tandy 2000 was falling into the entice of not being suitable sufficient. The Tandy 1000 may very well not be an excellent instance, as Tandy tried to make it practically 100% suitable, fixing the principle cause why the IBM PCjr additionally failed. So later Tandy 1000 fashions have been kind of a ‘better of each worlds’: practically 100% suitable with IBM PC, but in addition providing the improved graphics and sound capabilities of the PCjr.
In the meantime, in Japan…
In Japan nevertheless, issues took a unique flip. The Japanese don’t simply use the Latin alphabet that’s used on all Western machines, together with the IBM PC. The Japanese language makes use of extra advanced glyphs. They’ve a number of programs, corresponding to kanji, katakana and hiragana. To show these in a comfortably readable kind, you want a high-resolution show. Additionally, the place Latin letters encode sounds, a kanji glyph encodes a phrase or a part of a phrase. Because of this your glyph alphabet comprises over 50000 characters, much more than the utmost of 256 characters in your regular 8-bit Western character set.
So the Japanese market had very particular necessities, that PCs couldn’t fulfill within the early DOS days. You couldn’t simply change the character ROM in your PC and make it show Japanese textual content (IBM did later develop the 5550 and the JX, a spinoff of the PCjr, particularly for the Japanese market, and later, they developed the DOS/V variant, which added assist for Japanese textual content to their PS/2 line, utilizing commonplace VGA {hardware}, which by now had caught up by way of decision).
As a substitute, Japanese firms jumped into the area of interest of creating enterprise machines for the house market. Most notably NEC. In 1981 they launched the PC-8800 series, an 8-bit residence pc primarily based on a Z80 CPU and BASIC. In 1982, the PC-9800 series adopted, a extra high-end 16-bit business-oriented private pc primarily based on an 8086 CPU and MS-DOS. These households of machines grew to become often known as PC-88 and PC-98 respectively (Be aware that the ‘PC’ title right here shouldn’t be a reference to IBM, as NEC had already launched the PC-8000 series in 1979).
On this article, I will probably be wanting on the PC-98 particularly. So let’s begin by doing that actually: listed below are some photos to present an impression of what these machines seemed like. They give the impression of being very very similar to IBM PC clones, don’t they?
For extra machines, specs and background information, I counsel this NEC Retro site.
How suitable is it?
It has an 8086 CPU, an NEC 765 floppy controller, an 8237 DMA controller, an 8253 programmable interval timer, and two 8259A programmable interrupt controllers. Sounds similar to a PC, doesn’t it (okay, two PICs sounds extra like an AT truly, so NEC was forward of its time right here)?
Effectively it will be, if it used the identical IO addresses for these gadgets. But it surely doesn’t. What makes it particularly bizarre is that because it has all the time been a system with a 16-bit bus (utilizing an 8086 versus the 8088 in early PCs), NEC selected to map any IO registers of 8-bit gadgets both on even addresses solely, or on odd addresses solely (so the 16-bit bus is seen as two 8-bit buses). For instance, the place the primary 8259A on a PC is mapped to ports 0x20 and 0x22, the PC-98 locations it at 0x00 and 0x02, leaving 0x01 as a ‘hole’ in between. The 8237 DMA controller is definitely mapped on tackle 0x01, 0x03 and so forth.
One other main distinction is that the bottom frequency of the PIT shouldn’t be 1.19 MHz like on the PC, however relying on the mannequin, it may be both 1.99 MHz or 2.46 MHz.
And just like the PCjr and the Tandy 1000EX/HX fashions, it has an enlargement bus, however it isn’t the ISA bus. The PC-98 makes use of the C-bus. So you can not use commonplace enlargement playing cards for IBM PCs on this machine.
Clearly the video system isn’t suitable with any PC commonplace both. It doesn’t even use int 10h because the video BIOS. Talking of BIOS, the PC-98 BIOS shouldn’t be suitable with the IBM PC BIOS both. However as mentioned, the video system was far superior to the IBM PC on the time. The primary model in 1982 already supported 640×400 with 8 colors, primarily based on NEC’s own uPD7220 video controller. In 1985 they prolonged this with a palette of 4096 colors to select from, and an optionally available 16 color mode if an additional RAM board was put in. In 1986 the additional RAM grew to become commonplace on new fashions, they usually additionally added a {hardware} blitter for block transfers, raster operations and bit shifting.
What’s additionally fascinating is that they selected to really use TWO uPD7220 chips in a single machine. One in all them is used for textual content mode, the opposite for bitmapped graphics mode. They every have their very own video reminiscence, and are utilized in parallel. So you possibly can truly overlay textual content and graphics on a single display screen.
However, however…
There are two issues that we are able to use to our benefit:
- It runs (an NEC PC-98 OEM model of) MS-DOS
- Quite a lot of the {hardware} is similar as on the PC
So because of this for primary performance corresponding to file and textual content I/O, reminiscence administration and such, we don’t want the BIOS. We will use MS-DOS for that, which abstracts the machine-specific BIOS stuff away. Additionally, if we write code that makes use of the 8237, 8253, 8259A or different comparable {hardware}, most often we solely want to alter the I/O-addresses they use, and regulate for the completely different PIT frequency (and different minor particulars, such because the completely different cascaded configuration of the 2 PICs and completely different IRQs for gadgets), and we are able to make it work on the PC-98.
So similar to with Tandy and PCjr, we are able to write DOS applications and make them work on PC-98. We will even write a single program that may run on each sorts of programs, despite the fact that it is a little more difficult than on Tandy/PCjr (on these you primarily needed to keep away from utilizing DMA, and try to be conscious that the keyboard is completely different, so it is best to solely entry it by way of BIOS, or have separate routines for the completely different machines).
Problem accepted
I made a decision to present this a attempt. I’ve made my very own little ‘SDK’ of headers and library features for ASM and C over time, which incorporates fairly a couple of constants for addressing I/O ports or reminiscence areas of all kinds of PC and Tandy/PCjr {hardware} (I modeled it after the Amiga NDK). I figured I’d attempt a PC-98 emulator and port my VGM player over to the PC-98, and replace the SDK with PC-98 assist within the course of.
A handy emulator is DOSBox-X. It’s a fork of DOSBox, which provides a PC-98 machine, amongst different options, and like DOSBox, the BIOS and DOS emulation is built-in, and you’ll simply mount host directories as drives, so that you don’t need to juggle all kinds of ROMs and disk photographs to get the system working. If you’d like a extra critical emulator although, Neko Project 21/W is likely one of the extra suitable/correct ones.
And certainly, you possibly can simply use OpenWatcom C to write down a DOS software, and it’ll work, as the fundamental runtime solely requires DOS interrupts, no BIOS or direct {hardware} entry. All of the BIOS and direct {hardware} entry is finished by way of my ‘SDK’ anyway, so so long as I write the proper code for PC-98 BIOS and addresses, I can use any {hardware} from C (or meeting in fact).
What’s extra, it seems to be comparatively easy to detect whether or not you’re working on an IBM PC-compatible or a PC-98 suitable machine. A trick that’s used is to name int 10h with AH=0Fh. On an IBM PC-compatible, this can return information about the current video mode, with AH containing the variety of columns. On the PC-98, this won’t be carried out, so after the decision, the worth of AH will probably be unaffected. Since there isn’t any video mode with 15 columns, you possibly can assume that if AH is 0Fh after the decision, that you’re working on a PC-98 machine.
Anyway, earlier than lengthy I had a primary model of my VGM participant engaged on each the IBM PC and the PC-98. It’s a fairly enjoyable and quirky platform to date. So I is perhaps wanting into the graphics chip within the close to future.
If you happen to additionally wish to mess around with DOS and x86, and wish to give the PC-98 a attempt, listed below are some good assets (you would possibly have to translate, as most documentation can solely be present in Japanese):