tosemu and gen.ttp

This being a long weekend in Sweden, I decided to see if I could make some progress with the tosemu project.

First a quick recap. Tosemu is what Wine is for Windows, but for TOS from the Atari ST series of computers. I.e. not an emulator, but rather, a translation layer re-implementing the OS APIs. There is of course a bit of emulation going on, as the binaries are made for the glorius Motorola 680×0 series of CPUs, but I digress.

So, I decided to take the let’s make something work approach, so pulled out good old DevPac 3.1 and tried the command line interface to the assembler called gen.ttp. After having implemented Keytbl, Cconrs, Crawcin and Crawio, I got this far:

e8johan@xps13iv:~/projects/atari/tosemu$ make && ./bin/tosemu ../inst/devpac31/bin/gen.ttp
make: Nothing to be done for 'all'.
Enter command line:
demo

Gen Macro Assembler Copyright � HiSoft 1985-93
All Rights Reserved - version 3.10

Error: invalid pre-assembled file in assembly options

1 error found
65535 lines assembled into 0 bytes, Atari executable position-independent code
42 bytes used out of 16273361, took 0.0 seconds

This is where it turns interesting. I did a small fix to the Fseek function, treating the offset as a signed 32 bit integer instead of an unsigned one, but that didn’t get me much further. This is where the work becomes interesting, as the next step is to start following the machine code of the program being run, to figure out what is going wrong. Let’s see when I dare to dive down that rabbit hole.