Guides

Version:
1.0
Author:
Geco
Coding
Advanced
Download Guide Files

Porting Double Dragon to the Tatung Einstein

This guide explains how to adapt Double Dragon – Zemina (1989) from the MSX to the Tatung Einstein, focusing on the technical process, challenges, and solutions used to make the game run correctly on Einstein hardware.

The Tatung Einstein is a Z80-based computer with strong technical capabilities that never saw the gaming spotlight it deserved. Porting a complex MSX title to it is both a preservation effort and a way to explore what the system can still achieve.

Preparing the Files and Workflow

Before modifying the ROM, collect the essential source and batch files used in the conversion process:

After disassembling the ROM, review any MSX-specific IN/OUT instructions and paging routines that will not run on the Einstein. Double Dragon relies on ROM calls for memory paging, so those must be neutralized before the game can boot properly.

The above files and more are attached to this guide and can be downloaded.

Step 1: Removing Memory Paging and IM 1

The first step is to strip out the MSX memory paging system and interrupt mode 1 setup. The Einstein doesn’t handle IM 1 the same way, and MSX-style paging will cause lockups.

To remove memory paging, insert this block:

; remove memory paging from ROM
ld      hl,4016h        ; source address
ld      de,4017h        ; destination address
ld      bc,4037h-4016h-1  
ld      (hl),00h        ; write 00h byte to starting address (401BH)
ldir                    ; load, increment, repeat

Then disable IM 1 setup:

ld      hl,0000h
ld      (4011h),hl      ; remove IM 1

With these two changes, the Einstein can boot the modified game without locking up on unsupported routines. This marks the first major milestone in the conversion process.

Step 2: Patching AY Register Values

The sound patch was straightforward, but AY register 7 required special care.
If the value wasn’t changed from bits 01 to 10, the keyboard could no longer be read correctly.

Both the MSX and the Einstein use AY sound chips, but they access them through different ports. The MSX code writes to ports 0A0h and 0A1h, while the Einstein requires its own register values. Without these fixes, the game runs silently — and loses keyboard input as well.

Here’s the patch that resolves it:

ld      a,02h           ; patch AY register value 02h instead of MSX AY register 0A0h
ld      (06c2ch+01h),a
ld      (06c34h+01h),a
ld      (06c37h+01h),a

                       ; patch AY register value 03h instead of MSX AY register 0A1h
ld      a,0cdh          ; call
ld      hl,AYwrite_C     ; custom subroutine added to ROM
ld      (6c2fh),a
ld      (6c30h),hl

By redirecting the sound chip access and using a custom AYwrite_C routine, the music and effects play correctly. This is also where the Einstein begins to sound unmistakably like Double Dragon.

Step 3: Redirecting the Video Interrupt Routine

Interrupt handling caused one of the most stubborn bugs.
At one point, a call at address 0FD9Fh (from the MSX ROM) was removed, assuming it was unnecessary — but this was the video interrupt routine. Without it, the visuals looked fine, but the sound stopped working.

Additionally, Double Dragon’s video interrupt ended with a RET instruction instead of RETI. On the Einstein, that meant only one interrupt would trigger, breaking continuous music playback.

The fix is to redirect the call to a valid return inside the ROM:

ld      a,0c3h
ld      hl,dragret      ; points into the ROM
ld      (824eh),a
ld      (824fh),hl      ; patch pop hl, ei, ret to jump to pop hl, ei, reti in ROM

This restores proper interrupt handling, ensuring consistent video refresh and uninterrupted sound.

Step 4: Removing Game Protection

While testing gameplay, enemies would suddenly freeze after a few seconds. The cause turned out to be Double Dragon’s anti-piracy routine: if the game detected it was running from RAM instead of ROM, it deliberately halted enemy movement.

Removing this check restores normal behaviour:

ld      a,3eh
ld      (50cbh),a       ; remove game protection

Once this is applied, enemies move and attack as they should — a simple but essential fix.

Step 5: Clearing the Music Work Area

Even with sound restored, occasional glitches appeared — stray noise and looping notes. These came from leftover data in the game’s music work area. Clearing this memory block manually solved it:

ld      hl,0fa00h
ld      de,0fa01h
ld      bc,00ffh
ld      (hl),l
ldir                    ; clear music work area

With this in place, the game’s music plays cleanly and consistently from start to finish.

Final Results and Reflections

After applying all the patches, Double Dragon runs smoothly on the Tatung Einstein — full sound, responsive controls, and authentic gameplay. The conversion preserves the feel of the original while showcasing the Einstein’s latent potential.

This project is more than a technical exercise; it’s a piece of digital preservation.
Reviving Double Dragon on the Einstein gives this nearly forty-year-old machine a new moment in the spotlight. Each byte adjusted, each patch tested, is proof that even forgotten hardware can still come alive when given the chance.

When Billy and Jimmy Lee finally appeared on the Einstein’s screen with working sound, it wasn’t just a port — it was a revival of history, and a reminder that even the most overlooked systems still have stories left to tell.