Escape from Merlin 8
--------------------

"Buck Rodgers" was originally a game I saw on the TI-99/4A.
BUCK.COM is the "Tachyon Fighter" game I wrote based on this, for the Memotech.
merlin8.COM is "Escape from Merlin 8", for the Tatung Einstein.

"Escape from Merlin 8" is a rip-off of "Tachyon Fighter".
I never knew this had happened, and never saw a penny from it.
Quite a lot of Memotech games we're ripped-off and ended up having
equivelents on the Einstein, sometimes under similar or identical names.

merlin8.COM is the same code, patched to remove my Copyright statements,
to remove any reference to Continental Software who originally sold it
for the Memotech, to change the word "TIME" to "FUEL" on the screen
and to change the cheat-codes from QUARK0, MESON1, ... to MERLIN1, MERLIN2, ...

BUCK.COM is a Memotech CP/M file, ORG 100H.
merlin8.COM is a Tatung Xtal CP/M file, ORG 100H, extracted from merlin8.DSK
using EDIP 1.e.

merlin8.COM is not simply a patched version of BUCK.COM, because the
addresses of functions and variables aren't exactly the same.
It could be that merlin8.COM corresponds to a different (probably earlier)
version of BUCK.COM than the version I have (which is the latest).

Some of the patched routines are of different lengths to the originals they
replace (eg: "set sound volume" routine at 0x2a24 in BUCK.COM and 0x2b18 in
merlin8.COM, immediately followed by "set sound frequency" routine) so it seems
likely whoever did this had access to the source (I don't remember giving
anyone a copy) reconstructed source from the Memotech binary (more likely).

By looking at the two files side by side we can deduce things about the
Einstein hardware.

Both Memotech and Einstein have VDP chips.
The Memotech one is accessed via ports 0x01 and 0x02.
The Einstein one is accessed via ports 0x08 and 0x09.

Both Memotech and Einstein have Z80 CTC chips.
The Memotech one appears at ports 0x08, 0x09, 0x0a, 0x0b.
The Einstein one appears at ports 0x40, 0x41, 0x42, 0x43.
Both appear to use channel 0 for video interrupt.

There is very slightly different handling of the syncing to video retrace.
I do recall making changes in this area.
The Einstein code reflects an earlier implementation in which I simply looked
for changes in the VDP status register.
The Memotech code reflects a later approach in which I had the interrupt
service routine update a variable, and the code polls that.

The Memotech sound chip is controlled by writing port 0x06 and latching it
(making it take effect) by reading port 0x03.
In the Einstein code, it still calculates the values which would be written
to Memotech port 0x06 and calls a routine which emulates this accessing
Einstein ports 0x02 and 0x03.

The Memotech keyboard is accessed by writing select data to port 0x05 and then
reading sense data from ports 0x05 and possibly 0x06.
The Einstein keyboard reader writes port 0x38 and reads back from port 0x38.
It also has logic responding to port 0x20 and doing something to the sound. 

Whoever did this might also have started working from the cassette version,
which might explain the slight code differences.

They might also have started working from a MSX version.
The MSX also had the same VDP as the Memotech, but different sound chip.
It had ROM entrypoints you could use to read the keyboard etc.. 
I did port some of my games to MSX, but AFAIK, they were never sold.
So very few people indeed would have had access to the MSX files.
Interestingly, I used similar techniques to those noted above.
