When apemaster (aka Kemal aka Yoda) released the 25 years "Techo Ninja" edition
a lot of people had trouble starting the program in emulators. The reason behind that was that when Yoda wrote the program 25 year ago, he was faced with the problem that a compiled Turbo Basic program cannot load another part that is also compiled. Back then he came up with a clever trick to circumvent this problem:
If the RUNTIME.COM is loaded, (for example by renaming it to AUTORUN.SYS), it tried to automatically load the program "D:AUTORUN.CTB". So what Yoda did was, that he had the TITLE and the MAIN program on disk and depending on which was to be started, he renamed it to "AUTORUN.CTB" and restarts to runtime. Because the default for mounting files as disk images in Altirra is "Read/Only" exactly this renaming failed and the pogram was stuck was a DOS error message (you could not see, because a dedicated display list is active).
When he told me amout the issue I thought is was an interesting problem. So after only 8 months of tracing and debugging from time to time, here is the solution. Pitty it won't help TecnoNinja itself because the sources are long lost, but maybe it will be useful for other Turbo Basic fans.
The solution is a relcoatable inline machine language routine to which you can pass the name of the file (with ".TUR" extension!).
- If the routine is called from within regular Turbo Basic,it will return without doing something and you can load the uncompiled program using RUN "D:....TUR".
- If the routine is called from within the compiled runtime, it will load the compiled program with the ".CTB" extension instead of the ".TUR" extensions.
This way you can have a single source that transparently works with uncompiled and compiled programs.
The archive contains and ATR and also the MADS source for the routine.