Skip to content
All patches

Patches · TO-KY-O

TO-KY-O · PC-98

Makes the two-floppy D88 dump of Starcraft's TO-KY-O start: on the PC98-486 core, in NP2kai and in other emulators that take D88 images.

Patch files only. This site does not provide the game or its floppy images.

Release 07

Boot fix for Disk A

Without the patch the game stops on a black screen after it loads from Disk A: in NP2kai with a beep that never ends, on the core without one. The loader on Disk A has two problems: a copy-protection check that no D88 image can pass, and a start-up jump that only works by accident on older machines. The 36-byte IPS changes 13 bytes of that loader. Disk B and the game itself are not changed.

Easiest

Patch in your browser

Drop TO-KY-O (Disk A) [nfd r1].d88 in the online patcher. It checks the exact hash, patches the disk and gives it back. Nothing is uploaded.

Patch in your browser
IPS tool

Disk A IPS

For the 693,728-byte D88 of Disk A, with any IPS tool. Check the hashes below before and after.

Download Disk A IPS

36 bytes · SHA-256 d0d935c5be5a66963a7eeeec311ea29a08641aacf3af9bea803bc9efbc1bb9ae

What goes wrong without the patch

1. A copy-protection check that the image cannot pass. Before it loads the game, the loader reads cylinder 79, side 1, sector 1 with the floppy controller's read diagnostic command and asks for 1024 bytes, although that sector holds only 512. The controller then keeps reading past the end of the sector, into what follows it on the track. That area is normally a plain filler pattern. On the original floppy it holds a special mark, and the loader wants to find it: from byte 518 on, the same two different bytes six times in a row. A D88 image stores the 512 bytes of every sector and nothing between the sectors, so the mark is not there. The loader then switches the beeper on and stops for good. That is the black screen with the endless beep in NP2kai.

2. A start-up jump that relies on the old CPU. When the game is in memory, the loader jumps into it through two instructions (XLAT, RET). The RET takes the game's start address from the stack, which the loader put at the very end of the 768 KB main memory. So half of that address comes from the last byte of RAM and half from the first byte above it, where there is no memory. On the core that byte reads FFh, and the CPU lands in empty memory at the end of the game's segment. A V30, the CPU of the older PC-98 models, runs through those zero bytes, wraps around from the end of the segment to its start and reaches the game anyway; in NP2kai the game starts too. The 486 CPU of the core does not wrap around there, so it kept running through empty memory: a black screen without a beep.

What the patch changes

All three changes are in the loader on Disk A, cylinder 0, side 1, sectors 1 and 2 (D88 file offsets 13D8h, 1405h and 1510h):

  • Protection check (1 byte): the conditional jump after the check (JNZ) becomes an unconditional one (JMP), so the loader always goes on to load the game and never reaches the beep-and-stop code.
  • Start-up jump (3 bytes): the far jump to XLAT/RET (JMP 0200:02F9) becomes a near jump to a small routine.
  • The routine (9 bytes), in unused filler at the end of sector 2: XLAT, ADD SP,2, JMP 0200:0000. It does what the original code does on a V30 (same registers, same stack) and starts the game at the address it reaches there, without reading the byte above main memory and without relying on the wrap-around.

How to play

  1. Keep a backup of both disks.
  2. Patch Disk A in the patcher, or apply the IPS with Floating IPS (Flips) or Rom Patcher JS and compare the result with the after hash. Leave Disk B as it is.
  3. On the MiSTer, mount the patched Disk A in floppy drive 1 and Disk B in floppy drive 2, then reset. The core boots from Disk A; no hard disk is needed.

Can the disk converter fix floppies like this?

No. The converter changes the file format; it cannot add data the image never had. The protection mark sits between the sectors, and a D88 image has no place for it, so any D88 of this disk lacks it. Every protected game also checks something different, so each one needs its own small patch like this one. If your Disk A has another hash, the patcher refuses it and leaves the file unchanged.

Exact D88 hashes
Disk A · before · 693,728 bytes
SHA-256 598076da0d9a3ccc2130c7093f19a7d9962c4dc6dc4fcd0c51d11fd91a4825bf
CRC32 6949885f · MD5 1abc085c286f3d79875c498e14e51dd8
Disk A · after
SHA-256 ac9b13e2723bf96fb9d54351103e75d7fb15374c09808f3e7b34ef302d2a88d9
CRC32 c7545f0f · MD5 4966709b1cdc2ab8e8ba11e74b5b4a60
Disk B · not changed · 697,008 bytes
SHA-256 1761a78161ff808a965b6b231f006605e6f19ca797ea405d4dc06efcd81b258c
CRC32 4b0c7232 · MD5 fb20dae8cbb7faf4eb6f95b42946f897

Tested on the PC98-486 core (B280 and B281) and in NP2kai: title screen, name and gender, and the in-game map. Found while testing games for the core.