******************** WHAT IT IS

DOS-J version 1.5, by Shiragatakehirokunioshiwakayamatoneko
(shiragata@hotmail.com)


******************** WHAT IT DOES

This utility is for anyone who's tried to run graphical DOS/V software,
particularly games, on a non-Japanese machine.  If you're like me, you've
found that a lot of it works, except that in place of the Japanese text,
there's nothing but blank space.  This makes using the software a tricky
proposition, to say the least.

The only solutions I found on the Net were two DOS/V patches.  They worked,
but unfortunately, the only way to install them or remove them was to reboot.
What's more, they ate lots of memory, they wouldn't run most of my regular
MS-DOS software and one of them was prone to crashing.

Wouldn't it be nice, I thought, to have a DOS/V emulation TSR?  One that
could be loaded and unloaded on the fly, so I could run DOS/V games without
wasting memory the rest of the time?

Enter DOS-J.

Don't get me wrong: DOS-J is far from a fully functional replacement for
DOS/V.  It provides only a few simple interrupt services.  But it turns out
that they are all that most graphical games need in order to display their
text.

DOS-J does *not* support:

- Japanese Windows programs.  You will need a program like TwinBridge or
  UnionWay to read the text in these.

- Text-mode programs.

- character sizes other than 8x16 and 16x16.

- pre-386s and other machines without XMS.


******************** NEW IN VERSION 1.5

* Added support for DOS/V's video mode 72h by mapping it to 12h.

* Fixed a bug which caused DOS-J to copy 32 bytes instead of 16 for an
  8x16 character.  Oops.

* Added support for another font file, KIJIS16.FNT, which JDIC and
  other programs can use instead of K16JIS1.FNT and K16JIS2.FNT.

* Added a new utility, DOSJAUX, which provides additional support which
  is needed for a few games.  See the section on DOSJAUX below for more
  information.


******************** WHAT YOU NEED

To use DOS-J, you will need two things.  The first is XMS support.  If you
have a 386+ and some sort of memory manager, then you have XMS.  The second
is a 16x16 bitmapped kanji font.

Actually, you might need two fonts.  This is because the JIS standard for
Japanese character encoding defines both "level 1" and "level 2" kanji.
Level 1 includes the most frequently used kanji; the level 2 kanji are the
rarely used ones.  Some JIS font files do not include level 2 characters.
In this case you must either use a second font file (which might come with
the first) or do without level 2.

Right now, DOS-J supports these seven fonts for level-1 and non-kanji
characters:

+ K16JIS1.FNT from Jim Breen's JDIC program (and various other sources);
+ KIJIS16.FNT, also from JDIC and friends;
+ K16X16.F00 from Stephen Chung's JWP;
+ JLIB16.BFT from TwinBridge;
+ UWSJIS.BMP from UnionWay;
+ KANJI16.FNT from DOS/V; and
+ JKF[234].DAT from the game "Angel".

It supports these five fonts for level-2 characters:

+ K16JIS2.FNT from JDIC;
+ KIJIS16.FNT from JDIC;
+ K16X16.F00 from JWP;
+ UWSJIS.BMP from Unionway; and
+ KANJI16.FNT from DOS/V.

If your favorite font isn't on this list, it's probably because I don't have
it.  The only two 16x16 kanji fonts I have that DOS-J doesn't support are the
font from the other DOS/V package that I've found and the font that comes
with the SD/SM2 games.  They're both compressed in some way, and I haven't
taken the time to figure out how.  The SD/SM2 font is the same as the JDIC
and JWP font anyway.  And if anyone likes the other DOS/V font, I have it in
a format which DOS-J can read.  I would have included it with DOS-J, but it
would have made the archive about 20 times larger.

One thing I learned while writing DOS-J is that not all kanji fonts are
created equal.  The JDIC font is very plain, for example, while the UnionWay
font is quite ornate, with the Japanese equivalent of serifs.  Some of the
fonts are confined to a 15x16 or 15x15 pixel box so that adjacent characters
don't run together, while others use the full 16x16 space.  The Angel font
defines relatively few characters, while the TwinBridge font includes a huge
number of glyphs that aren't even in the DOS/V set.  My suggestion is to try
all the fonts you have and use the one you like best.

If you have no compatible fonts at all, you can fetch a zip-compressed
archive (about 140K) containing KIJIS16.FNT from any of the following
locations:

	ftp://ftp.cdrom.com/pub/japanese/monash/kijis16.zip
	ftp://ftp.sedl.org/pub/mirrors/nihongo/kijis16.zip
	ftp://kuso.shef.ac.uk/pub/japanese/monu6/kijis16.zip
	ftp://enterprise.ic.gc.ca/pub/nihongo/kijis16.zip
	ftp://ftp.monash.edu.au/pub/nihongo/kijis16.zip

DOS-J also supports 8x16 characters, including ASCII and half-width katakana.
These characters are stored internally in the DOS-J executable and are
enabled automatically--you don't have to do anything special.  Just thought
I'd mention they were there.


******************** HOW TO ACTUALLY USE DOS-J (finally)

Okay, so let's assume you have XMS and a kanji font (or two).  Ordinarily,
DOS-J takes a single parameter, namely the directory in which to look for
the kanji font(s).  It just wants the directory, NOT the file name.  It
will look in that directory for all the fonts it supports.

For example, if you have UnionWay installed in d:\uwdbm and want DOS-J to
use its font, the command is

	dosj d:\uwdbm

DOS-J will first look for D:\UWDBM\K16JIS1.FNT, then for
D:\UWDBM\K16X16.F00, and so on, until it finds D:\UWDBM\UWSJIS.BMP.  It will
load the level-1 kanji, hiragana, katakana, roman characters, and various
sundries into XMS, and install itself in memory.  When a program requests a
Japanese character, it will either fetch it from XMS or (if it's a level-2
kanji) load it from disk.

Now suppose you want to use the font from "Angel" instead.  This font doesn't
include the level 2 characters.  But you do want to use level 2 characters,
and you happen to have JWP installed too.  Then you can type something like:

	dosj c:\games\angel d:\jwp

and DOS-J will look in C:\GAMES\ANGEL, find JKF2.DAT, JKF3.DAT and JKF4.DAT,
load them all, and use D:\JWP\K16X16.F00 for the level 2 characters.  Cool,
ne?

Now suppose that you want to use the UnionWay font, which includes level 2
characters, but you DON'T want DOS-J to support level 2.  Then you can type

	dosj d:\uwdbm -

The dash instructs DOS-J not to look for a level 2 font.  Specifying a
second directory that doesn't have any level 2 fonts in it would have the
same effect, except that you'd get an annoying warning message.

I can think of very few reasons to disable level 2 support.  If you don't
have any level-2 fonts and want to avoid the warning, or if you're REALLY
short on memory (DOS-J occupies only 192 bytes of conventional memory
without level 2), then go right ahead.  If level 2 support is bombing your
computer, then disable it *and* send me a bug report. ^_^

There is one final way to invoke DOS-J:

	dosj /u

This, of course, uninstalls it.  (This will not work if you loaded another
TSR after DOS-J that also hooks interrupt 10h, such as DOSJAUX.  You'll have
to unload any such TSR first.)


******************** ERRORS AND OTHER MESSAGES

Most messages should be self-explanatory.  If DOS-J says it can't find a
font, you either gave it an invalid directory or there weren't any fonts in
the directory.  If you get an XMS error, you don't have the 144K of XMS that
DOS-J needs.  If you get an "error allocating memory", DOS-J is probably
broken.

The resident portion of DOS-J can't print messages on the screen, of
course.  But it will return one of two special characters in case of an
error.  If a program requests a character size other than 16x16 or 8x16, or
if it requests a character number that's out of range, DOS-J will fill the
character cell with a pattern of upward-diagonal lines.  If a program
requests a character that's in range, but wasn't defined in the level 1 font
you used, DOS-J will return a shaded square occupying the middle of the
character cell.

If you get garbage, then, it means DOS-J is broken.  With one exception:
K16JIS2.FNT and K16X16.F00 don't include the last two level 2 characters,
for some reason.  If a program requests one of these, it'll get garbage.  Is
this ever going to happen?  I doubt it.


******************** DOSJAUX

DOSJAUX is an add-on to DOS-J which provides some additional rarely-used
interrupt services.  I have found only a handful of programs which use
these.  The additional services are:

* A subset of the EGA Register Interface Library (int 10h ah=f0h..f3h).
  DOSJAUX supports group indices 08h and 10h only.

* A subset of the "font subsystem access" call (int 15h ah=50h).  DOSJAUX
  supports retrieving 8x16, 8x19 and 16x16 characters.  For all other
  requests it returns a pointer to a do-nothing function.


Using DOSJAUX is very simple.  To install it, type

	dosjaux

To uninstall it, type

	dosjaux /u

Note that you must install DOS-J before you install DOSJAUX, and you must
uninstall DOSJAUX before you uninstall DOS-J, or it won't work.

Here's an example of a batch file (AKIKO.BAT) modified to load DOS-J and
DOSJAUX:

	dosj \kanji
	dosjaux
	id_dv /j1
	sd_dv
	gold
	sd_dv -r
	id_dv -r
	dosjaux/u
	dosj/u

In general, you shouldn't need DOSJAUX.  Don't bother to use it unless DOS-J
alone doesn't work.  If you find a program that needs it and that isn't
mentioned below, let me know.


The following games need DOSJAUX to run:

	Akiko/Gold
	Kairaku no Okite
	Tosin-toshi 2


******************** TERMS AND CONDITIONS

I hereby release DOS-J into the public domain.  This means (a) you can do
whatever you want with it, and (b) you can't hold me liable if it blows up
in your face when you do.  Please upload DOS-J wherever you think it might
be useful.  Although I can't force you to, I ask that you keep DOSJ.COM,
DOSJAUX.COM, and DOSJ.DOC as-is.  (Good luck modifying my spaghetti code,
anyway. ^_^)


******************** HOME PAGE

The latest information on DOS-J will always be available at its home page:

	http://www.geocities.com/Tokyo/Gulf/6349/index.html
