I'm porting Bas32 to Linux (or I guess Windows or MacOS - anything with a C compiler) by creating a replacement interface layer for 32016 SVC calls (Tiny Kernel/Pandora) which is linked in to the new bas32 executable along with the 32016 executable code itself, so that it looks like a native program on whichever system you're building it. (This is the first step in a larger project but I'll make it a goal in itself and put up the code on github when it's ready).
Meanwhile as a tease, ... I've just now added simple file I/O - at least enough to load and save Basic programs - and while doing so, came up with a way to save file attributes on Linux in a rather clean way - no more "$FILE" or "FILE.inf" companion files needed, which were problematic to keep in place with the actual data files. This is done by using 'extended attributes', which are available on most linuxes. Anyone porting to Windows could add code to use 'Alternative data streams' instead, and I guess the old ".inf" files or ",f00" naming convention could still be used as a fallback for systems that don't support forks. (I haven't implemented these alternatives - just the linux version).
Code: Select all
NS32016$ ./bas32
BBC Basic IV for 32000 (c) Acorn 1986
>10 REM test of saving load/exec address on saving basic file
>20 PRINT PI
>SAVE"testbas"
>QUIT
NS32016$ getfattr -d testbas2
# file: testbas2
user.acorn_exec="0x000021b0"
user.acorn_load="0x00006c91"
If you saw the earlier threads, you'll know this is based on the 32016 emulator from Hoglet's PiTubeDirect project ( https://github.com/hoglet67/PiTubeDirec ... rc/NS32016 ).
I wonder if there is any existing code for simulating MOS functionality that also doesn't emulate a complete BBC Micro? Maybe in some of the modern replacement Basic ports? I did find some code in the 'go' language ( https://github.com/ivanizag/bbz ), but I couldn't use any of its actual implementation - I just borrowed some of its structure as a hint to create the skeleton for where new code is to be placed.
(Btw it occurs to me that a similar program could be written to port ARM applications for Brazil/Arthur, with a lot of the MOS simulation code being shared.)
Graham