Using a Mac or PC for BBC games authoring

bbc micro/electron/atom/risc os coding queries and routines
User avatar
sa_scott
Posts: 154
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Using a Mac or PC for BBC games authoring

Post by sa_scott » Tue Sep 08, 2020 11:11 am

Hi all,

I'm slowly losing my mind.

I've been trying to edit my Androidz game to add various improvements to it (you may have seen this thread - viewtopic.php?f=54&t=20285), and I'm missing key information on how to edit code using my iMac.

I'm aware of various builds of BBC emulator (including b2 and BeebEm5), and have installed the SDL version of Richard Russell's SDL version of BBC Basic. However, I think I'm falling victim to tokenisation issues, as my code seems to fail to work.

Is there a high level overview of how best to edit, saved and build such code, and DFS images, to run straight off the bat, into the emulators?

I am also aware that the build tools are more stable on Windows, than on Mac (I'm using Catalina, which is 64 bit only). I can remote into my Windows machine at work (I did have Bootcamp on my Mac some years ago, but it started misbehaving, so I removed the partition - little did I know that my entire hard drive was slowly breaking down, I only got it replaced earlier this year, and haven't gone back to bootcamp again). However, remoting is a little slow, just slow enough to be a pain in the neck.

I'm sure there have been threads exploring this topic, but having it all under one roof would be a lot easier to digest. I've also seen reference to the Swift tool at Retro Software, which is Windows only, and is more aimed at assembly language, which I'm hopeless in.

So, what is the best tooling setup required for Windows and/or Mac?

Can anyone point me in the right direction, before I pull what's left of my hair out?!

Thanks in advance!

Stephen
--
Stephen Scott, Digital Media Professional
www.sassquad.net

User avatar
lurkio
Posts: 2907
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by lurkio » Tue Sep 08, 2020 12:06 pm

Catalina complicates things because it's 64-bit-only, and there isn't a working 64-bit Beeb emulator for Catalina that'll easily let you paste a whole load of plain text in (using Command-V or the Edit..Paste menu).*

That's one of the reasons I'm still on macOS Mojave -- so that I can use Mac BeebEm. What I usually do is keep the BASIC program-listing in BBEdit, and whenever I want to test it I simply copy and paste the whole listing into BeebEm.

:idea:

* EDIT: Does the B2 emulator let you do this? Can't quite remember.

VectorEyes
Posts: 376
Joined: Fri Apr 13, 2018 2:48 pm
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by VectorEyes » Tue Sep 08, 2020 12:22 pm

I'm running B2 on Catalina. I built it from source without too much difficulty.

I've just checked and it will let you paste text, there's an option in the 'Edit' menu.

VectorEyes
Posts: 376
Joined: Fri Apr 13, 2018 2:48 pm
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by VectorEyes » Tue Sep 08, 2020 12:30 pm

By the way, if what you want to do is create a BASIC program in a text editor and then run it under emulation, one way might be to use BeebAsm to create SSD files which contain the tokenised BASIC program and are already set up to auto-boot and run that program. You could then edit your BASIC files in Visual Studio Code (or your editor of choice!), and set it up to run a BeebAsm build which created the SSD, and launch the SSD in an emulator.

This was broadly my workflow when developing Evil Influences (although I was mostly coding 6502 assembly, not BASIC!). It meant I could test the demo in both B2 and JSBeeb (running locally) without too much difficulty, and I could build-and-run using one shortcut.

Happy to provide more information if you're interested.

User avatar
sa_scott
Posts: 154
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by sa_scott » Tue Sep 08, 2020 1:53 pm

Thanks for the suggestions. I do have b2 running on my machine, will need to check whether it's the latest build.

I have actually pasted all 3 parts of Androidz into one, and munged it together in the SDL version of BBC Basic. It kinda works, but am keen on the vanilla experience, so don't want to be seduced into extra memory when there isn't much left!

Will have to check BeebASM. What I'm keen to avoid is tokenization getting broken, resulting in Bad program. It's happened a few times, and it's very frustrating!
--
Stephen Scott, Digital Media Professional
www.sassquad.net

User avatar
sa_scott
Posts: 154
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by sa_scott » Tue Sep 08, 2020 3:22 pm

VectorEyes wrote:
Tue Sep 08, 2020 12:30 pm
By the way, if what you want to do is create a BASIC program in a text editor and then run it under emulation, one way might be to use BeebAsm to create SSD files which contain the tokenised BASIC program and are already set up to auto-boot and run that program. You could then edit your BASIC files in Visual Studio Code (or your editor of choice!), and set it up to run a BeebAsm build which created the SSD, and launch the SSD in an emulator.

This was broadly my workflow when developing Evil Influences (although I was mostly coding 6502 assembly, not BASIC!). It meant I could test the demo in both B2 and JSBeeb (running locally) without too much difficulty, and I could build-and-run using one shortcut.

Happy to provide more information if you're interested.
Ah, BeebAsm looks interesting, and there is a Mac version. Given that I get this installed, and that I have VS Code, how would I get this working together? I appear to be running the latest build of b2.
--
Stephen Scott, Digital Media Professional
www.sassquad.net

User avatar
tricky
Posts: 4672
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by tricky » Tue Sep 08, 2020 5:32 pm

put your code in basic.txt (extension doesn't matter) and edit.

Have another file like build.txt (extension doesn't matter).
build.txt

Code: Select all

PUTBASIC "program.txt","program"
run

Code: Select all

beebasm.exe -i build.txt -opt 3 -do disc.ssd -title "My Program"
(title is optional)

then run

Code: Select all

emulator disc.ssd
or whatever your emulator of choice needs.

PS Written on phone, so could be wrong!

PPS I think their might be a stand-a-lone version of the tokenizer and I'm not sure if beebasm might complain that you didn't "SAVE".
Actually, You might not want -opt 3 as I think there is a -boot option.

User avatar
sa_scott
Posts: 154
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by sa_scott » Tue Sep 08, 2020 5:49 pm

VectorEyes wrote:
Tue Sep 08, 2020 12:30 pm
By the way, if what you want to do is create a BASIC program in a text editor and then run it under emulation, one way might be to use BeebAsm to create SSD files which contain the tokenised BASIC program and are already set up to auto-boot and run that program. You could then edit your BASIC files in Visual Studio Code (or your editor of choice!), and set it up to run a BeebAsm build which created the SSD, and launch the SSD in an emulator.

This was broadly my workflow when developing Evil Influences (although I was mostly coding 6502 assembly, not BASIC!). It meant I could test the demo in both B2 and JSBeeb (running locally) without too much difficulty, and I could build-and-run using one shortcut.

Happy to provide more information if you're interested.
As an update, I've installed the following:
  • VS Code's BeebVSC extension
  • A Catalina compatible build of beebasm
  • BBC Basic SDL IDE editor
I used the following URLs to help me get the beebasm build to be catalina compatible:
https://mansfield-devine.com/speculatri ... toolchain/
https://github.com/markmoxon/elite-beebasm

Of course, the BeebVSC extension, and beebasm don't seem to like BASIC files, it's pro-assembler. Currently, attempting a build via F10 gives me the error message:

Command 'BeebVSC: Create new build target' resulted in an error (Running the contributed command: 'extension.target.create' failed.)

This error was referenced at viewtopic.php?f=2&t=11835&p=150202#p150202 but I don't know what the solution 'Open folder' refers to, I saw nothing in the workflow to suggest what that meant.

I have been able to build a disc image by following the chapter at https://github.com/stardot/beebasm#3-EXAMPLE - which I can confirm works in the B2 emulator. So I have some of the tools in place to get things working.

I feel I'm only about 10% of the way to getting a working toolchain! Any further help is appreciated!
--
Stephen Scott, Digital Media Professional
www.sassquad.net

VectorEyes
Posts: 376
Joined: Fri Apr 13, 2018 2:48 pm
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by VectorEyes » Wed Sep 09, 2020 12:09 am

Well done with building BeebAsm locally and creating SSDs!

BeebVSC is great (I have it installed) but yes, it's more for assembler than BASIC. In the end, I didn't use BeebVSC's 'build' and 'run' features. Instead I just used Visual Studio Code's 'tasks' feature.

I created some simple script files that could be called from the command line (e.g. from Terminal), one which did the build, and one which ran B2 and passed it the SSD.

File 'build.sh' contained a line that built the main SSD. In my case it was this line:

beebasm -i main.6502 -do EvilIn11.ssd -opt 3 -title EvilIn11

... but you will need to create your own version for your own needs! For reference, I usually go straight to the BeebAsm readme file here: https://github.com/stardot/beebasm/blob ... /README.md ... it usefully documents every command-line argument that beebasm will consume.

Then file 'testinb2.sh' contained this:

~/Code/B2/build/r.osx/src/b2/b2.app/Contents/MacOS/b2 -b -0 ./EvilIn11.ssd

(ie, it's just running the B2 executable, and passing some command line parameters that tell it which disc image to use).

I confirmed that those shell scripts worked when run from Terminal.

Then I made use of the 'tasks.json' file inside the .vscode folder of my project. (I had to wade through this: https://code.visualstudio.com/docs/editor/tasks#vscode ... but long story short, if in VSCode you do Terminal/Configure Tasks it should create a tasks.json file for you, I think).

The tasks.json file allows you to specify default 'build' and 'test' tasks, which will be executed when you use shift-command-R (run task) or shift-command-B (run build task) from VSCode.

My file looks like this:

Code: Select all

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "options":
        {
            "windows": {
                "shell":
                {
                    "args": ["/C"],
                    "executable": "cmd.exe"
                }
            }
        },
    "tasks": [
        {
            "label": "EvilIn11.ssd",
            "type": "shell",
            "command": "make",
            "osx": {
                "command": ". ./build.sh"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            },
            "problemMatcher": {
                "owner": "6502",
                "fileLocation": [
                    "relative",
                    "${workspaceRoot}"
                ],
                "pattern": {
                    "regexp": "^(.*):(\\d+):\\s+(warning|error):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "severity": 3,
                    "message": 4
                }
            }
        },
        {
            "label": "Test In Emulator",
            "type": "shell",
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "osx": {
                "command": ". ./testinb2.sh"
            },
            "windows": {
                "command": "C:/Code/b2/build/win64.vs2019/src/b2/RelWithDebInfo/B2.exe",
                "args": [
                    "-0",
                    "EvilIn11.ssd",
                    "-b"
                ]
            },
            "problemMatcher": []
        }
    ]
}

This may seem a bit confusing -- especially since it has a bunch of Windows-specific stuff you don't need ... but if you look at the two lines that start with ' "osx": ' you'll see that they're spawning the two shell scripts. Essentially, they say 'when running under MacOS, use the shell to run these shell scripts'.

I know this is a lot to take in... hope it's helpful. I've actually simplified this a bit because I didn't want to introduce the complication of the makefile-based build!

tom_seddon
Posts: 426
Joined: Tue Aug 30, 2005 12:42 am
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by tom_seddon » Wed Sep 09, 2020 1:00 am

This is the sort of workflow b2 is designed to (hopefully) work well with. The way I do this on Mac OS is to use the HTTP API, as documented (if perhaps a bit tersely...) here: https://github.com/tom-seddon/b2/blob/m ... d#http-api

The intended workflow here is to leave b2 permanently running. From the Makefile (or whatever), use curl to access the HTTP API to direct b2 to run the code - it's probably usual to autoboot the disk that the Makefile just created, but there are a few other options. Then get your text editor to run make (or whatever) on a keypress. Result: you press the key, the code builds, then the code loads and runs in the emulator straight away. Put the b2 window alongside your text editor and you don't even need to Alt+Tab away to see stuff happen.

There's an example of using this with BeebAsm output in the BeebNICCC repo: https://github.com/kieranhj/stnicc-beeb ... a/Makefile

Another in the Stunt Car Racer repo: https://github.com/kieranhj/scr-beeb/bl ... efile#L211

There's also a quick and dirty demo as part of the b2 repo, that takes a different approach, demonstrating b2's support for running Beeb code stored in a C64-style .prg file (as produced by 64tass): https://github.com/tom-seddon/b2/tree/m ... pi_example

--Tom

P.S. Booting disk image files is good for assembly language code, or BASIC that's been tokenized with BeebAsm - and that's covered 100% of the cases I've used it for myself. If you'd like to work with BBC BASIC as text directly, on the other hand, as a text file, say, that's probably also doable using the reset and paste API endpoints. Use reset to reset the emulator, then paste in your program, then paste in RUN, and... hopefully... off it goes. You're probably better off using BeebAsm for this, though, as then you'll get error reporting! - one issues with the pasting mechanism is that it will just press on regardless even if BBC BASIC reports an error.

You'd be a bit on your own if trying this but I'd be interested to hear how it works out.

User avatar
sa_scott
Posts: 154
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by sa_scott » Wed Sep 09, 2020 11:20 am

Thanks for all these pointers. I've updated my Terminal to use Oh-My-Zsh, but Catalina did switch to using zsh as the default terminal environment. I've also installed Homebrew and Node.js, which are all essential for web dev.

Ironically, I'm in the office the rest of the week, so am primarily on Windows platform now! I can foresee a blog post on having a proper toolchain for Windows and Mac OS to facilitate this kind of development workflow - it would fill in the blanks / join up the dots in getting this off the ground.

As an aside, it's been years since I messed with this sort of stuff, when my then workplace issued Linux based laptops for work purposes (this was the Home Office, their computer terminals were way too locked down for any form of web development based processes, which typically required command line access i.e. Node.js). That was when I did my blog on disk image creation - https://sascott.blogspot.com/2016/03/bu ... mages.html.

I'll keep you informed as to whether I make progress :D - but thanks again!
--
Stephen Scott, Digital Media Professional
www.sassquad.net

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Richard Russell » Wed Sep 09, 2020 12:32 pm

sa_scott wrote:
Tue Sep 08, 2020 11:11 am
I'm aware of various builds of BBC emulator (including b2 and BeebEm5), and have installed the SDL version of Richard Russell's SDL version of BBC Basic.
Do let me know if there's any way SDLIDE.bbc could be modified to make your life easier. It could relatively easily output an Acorn-format tokenised program for example, or it would even be possible to automate the steps needed to run the program in an emulator, making it a click-to-run exercise. SDLIDE is itself written in BBC BASIC, of course, so you could make the necessary modifications yourself, but I'm happy to help.

User avatar
lurkio
Posts: 2907
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by lurkio » Wed Sep 09, 2020 1:28 pm

Richard Russell wrote:
Wed Sep 09, 2020 12:32 pm
Do let me know if there's any way SDLIDE.bbc could be modified to make your life easier. It could relatively easily output an Acorn-format tokenised program for example, or it would even be possible to automate the steps needed to run the program in an emulator, making it a click-to-run exercise. SDLIDE is itself written in BBC BASIC, of course, so you could make the necessary modifications yourself, but I'm happy to help.
FWIW, I think it would generally be useful if SDLIDE could output Acorn-format tokenised BBC BASIC programs that are compatible with at least a BBC Micro Model B.

:idea:

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Richard Russell » Wed Sep 09, 2020 2:32 pm

lurkio wrote:
Wed Sep 09, 2020 1:28 pm
FWIW, I think it would generally be useful if SDLIDE could output Acorn-format tokenised BBC BASIC programs that are compatible with at least a BBC Micro Model B.
I don't think there's any technical difficulty with that, but having saved to an Acorn-format (pre-BASIC V) tokenised file what does one typically do with it? I do wonder whether it would be more generally useful to automate subsequent steps rather than just save a file.

User avatar
sa_scott
Posts: 154
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by sa_scott » Wed Sep 09, 2020 3:40 pm

Richard Russell wrote:
Wed Sep 09, 2020 2:32 pm
lurkio wrote:
Wed Sep 09, 2020 1:28 pm
FWIW, I think it would generally be useful if SDLIDE could output Acorn-format tokenised BBC BASIC programs that are compatible with at least a BBC Micro Model B.
I don't think there's any technical difficulty with that, but having saved to an Acorn-format (pre-BASIC V) tokenised file what does one typically do with it? I do wonder whether it would be more generally useful to automate subsequent steps rather than just save a file.
Thanks for your input Russell. FWIW, I was simply copy and pasting from the IDE into either B2 or Beebem. As the DROID2 listing is over 160 lines, that takes a fair amount of time to paste in. One thing I have to be careful of is the the use of the pound sign in BBC Basic, which I have used in game level data statement. These switch to backticks (`). I guess I should ensure the data encoding doesn't include the pound sign for portability reasons. I also have a BY% variable, which gets interpreted as the BY keyword.

I can't comment further on the exact experience, but ideally, being able to save code, then create the bootable disc image loaded into the emulator is the best case scenario.

One further comment - I did merge the 3 listings together in the IDE, to see how the game would fare. Had to get rid of the assembly language which is used to display the robots, but otherwise, it hangs together surprisingly well. Still a work in progress of course.
--
Stephen Scott, Digital Media Professional
www.sassquad.net

User avatar
lurkio
Posts: 2907
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by lurkio » Wed Sep 09, 2020 4:24 pm

Richard Russell wrote:
Wed Sep 09, 2020 2:32 pm
lurkio wrote:
Wed Sep 09, 2020 1:28 pm
FWIW, I think it would generally be useful if SDLIDE could output Acorn-format tokenised BBC BASIC programs that are compatible with at least a BBC Micro Model B.
I don't think there's any technical difficulty with that, but having saved to an Acorn-format (pre-BASIC V) tokenised file what does one typically do with it?
Well, I for one would simply use the Import menu command in BeebEm to import the tokenised BASIC file onto a disc-image.

:idea:

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Richard Russell » Wed Sep 09, 2020 4:32 pm

sa_scott wrote:
Wed Sep 09, 2020 3:40 pm
One thing I have to be careful of is the the use of the pound sign in BBC Basic, which I have used in game level data statement. These switch to backticks (`).
Even in 1981 the pound sign (£) posed a problem because it's not in the 7-bit ASCII character set yet the BBC Micro, being a British machine, needed to have it! We could have adopted the ISO7-UK character set rather than ASCII, but there the pound sign replaces the hash symbol (#) which is used in BASIC to indicate a file handle. So, as a rather uneasy compromise, we used ASCII but replaced what was considered to be the least-used character (`) with the pound sign.

It was probably the best solution available at the time, but resulted in a non-standard character set which inevitably gives rise to incompatibilities today. My 'modern' versions of BBC BASIC can be configured to use either the ANSI or UTF-8 character sets, both of which do of course include the pound sign but because they are not constrained to 7-bits it has a different code (&A3 in ANSI, &C2 &A3 in UTF-8).

julie_m
Posts: 232
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by julie_m » Wed Sep 09, 2020 10:33 pm

The most important tool you need for host-side development is a good text editor, because you will be using it. A lot. Ask six different people, and you will get twelve different answers. Try them all, and any more you can find; and whichever one you choose, be sure occasionally to have a play with the latest version of a different one, in case you prefer it. You will need to be able to switch quickly between several different files, as your project typically will be split into several sections. You will find keyboard shortcuts important; you won't want to leave the keyboard for the mouse if you can avoid it.

Macs are basically Unix boxes with a proprietary GUI layer. So you get all the usual Unix tools, Perl and Python, sed and awk, a Bourne-compatible shell, and it's easy to write simple scripts to do things like stripping out line numbers and adding them back in again. Install gcc if needs be and you can build the excellent BeebAsm. Its syntax is close enough to BBC BASIC's built-in assembler, you can easily make your project so it is still buildable on the target, if you so desire. BeebAsm also writes .ssd files that can be loaded directly into any emulator. You can even include files verbatim; they may be data, code or text (with suitably-altered line endings). So you can have a BASIC loader, a splash screen, a main machine code program and a boot file on the disc.

The pound sign/backquote issue can be resolved easily enough with

Code: Select all

$ sed -i 's/£/`/g' filename
which will replace every occurrence of a pound sign in the file with a backquote character, and the Beeb will render this as a pound sign.

If you plan to do graphics development host-side, you obviously will need a good image editor. There are command-line tools available for converting image files to BBC formats (and it's not a bad programming exercise to create your own, if you feel inclined.) If you are really into the "make your own tools" thing, you can create host-side equivalents for some of your existing target-side tools.

Coeus
Posts: 1821
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Coeus » Thu Sep 10, 2020 4:04 pm

Richard Russell wrote:
Wed Sep 09, 2020 12:32 pm
Do let me know if there's any way SDLIDE.bbc could be modified to make your life easier. It could relatively easily output an Acorn-format tokenised program for example, or it would even be possible to automate the steps needed to run the program in an emulator, making it a click-to-run exercise. SDLIDE is itself written in BBC BASIC, of course, so you could make the necessary modifications yourself, but I'm happy to help.
It might be a useful step just to be able to write a tokenised file. B-Em includes a filing system called VDFS which enables access to the filesystem of the host so simply saving the file to somewhere in the shared directory tree would then enable it to be LOADed or CHAINed from within the emulator. This could be speeded up by putting the command concerned on a softkey within the emulator. BeebEm also has VDFS and I think Chris may have merged it now. Of course, with a filesystem in common between the emulated machine and host one can also *EXEC a text version of the basic program.

For cases where it is necessary to insert the file into a disc image, command line tools exist to do that so simply running one of them could automate the last step. Tom's HTTP API can also be called from the command line via CURL.

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Richard Russell » Thu Sep 10, 2020 4:49 pm

Coeus wrote:
Thu Sep 10, 2020 4:04 pm
It might be a useful step just to be able to write a tokenised file.
I'll consider adding that in a future version (it won't be in the next release as that's due tomorrow!). Is there a preferred file extension for Acorn-format tokenised programs (I use .bbc for 'my' tokenised format and .bas for plain text)?

User avatar
sa_scott
Posts: 154
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by sa_scott » Fri Sep 11, 2020 3:47 pm

tricky wrote:
Tue Sep 08, 2020 5:32 pm
put your code in basic.txt (extension doesn't matter) and edit.

Have another file like build.txt (extension doesn't matter).
build.txt

Code: Select all

PUTBASIC "program.txt","program"
run

Code: Select all

beebasm.exe -i build.txt -opt 3 -do disc.ssd -title "My Program"
(title is optional)

then run

Code: Select all

emulator disc.ssd
or whatever your emulator of choice needs.

PS Written on phone, so could be wrong!

PPS I think their might be a stand-a-lone version of the tokenizer and I'm not sure if beebasm might complain that you didn't "SAVE".
Actually, You might not want -opt 3 as I think there is a -boot option.
Thanks for your assistance Tricky.

I've updated this now. I'm currently using Windows. I've used Notepad++ to create the files DROID1.txt, DROID2.txt and DROID3.txt, containing the code from my Github.

I then created a text file - called Androidz.asm, containing the following 3 lines:

PUTBASIC "DROID1.txt","DROID1"
PUTBASIC "DROID2.txt","DROID2"
PUTBASIC "DROID3.txt","DROID3"

I then invoked beebasm, thus:

beebasm.exe -i Androidz.asm -do Androidz.ssd

I now have a functioning disc.

The -boot option unfortunately defaults to performing a *RUN, which is no use for a Basic file. I did create a blank template SSD, containing a manually made !Boot file with the CHAIN"DROID1" in it. However, running the above command overwrites everything, which is a shame.
--
Stephen Scott, Digital Media Professional
www.sassquad.net

VectorEyes
Posts: 376
Joined: Fri Apr 13, 2018 2:48 pm
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by VectorEyes » Fri Sep 11, 2020 6:28 pm

sa_scott wrote:
Fri Sep 11, 2020 3:47 pm
The -boot option unfortunately defaults to performing a *RUN, which is no use for a Basic file. I did create a blank template SSD, containing a manually made !Boot file with the CHAIN"DROID1" in it. However, running the above command overwrites everything, which is a shame.
I think you can work around that by providing your own !Boot file (which contains CHAIN "<NameOfBasicFile>") and then use the BeebAsm '-opt' option to specify '3', which means "use *EXEC to execute the !Boot file".

User avatar
sa_scott
Posts: 154
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by sa_scott » Sat Sep 12, 2020 10:03 am

VectorEyes wrote:
Fri Sep 11, 2020 6:28 pm
sa_scott wrote:
Fri Sep 11, 2020 3:47 pm
The -boot option unfortunately defaults to performing a *RUN, which is no use for a Basic file. I did create a blank template SSD, containing a manually made !Boot file with the CHAIN"DROID1" in it. However, running the above command overwrites everything, which is a shame.
I think you can work around that by providing your own !Boot file (which contains CHAIN "<NameOfBasicFile>") and then use the BeebAsm '-opt' option to specify '3', which means "use *EXEC to execute the !Boot file".
Thanks, I'll try that sometime over the weekend.
--
Stephen Scott, Digital Media Professional
www.sassquad.net

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Richard Russell » Sat Sep 12, 2020 12:40 pm

Richard Russell wrote:
Thu Sep 10, 2020 4:49 pm
Is there a preferred file extension for Acorn-format tokenised programs?
Anybody? filext.org doesn't find anything.

User avatar
lurkio
Posts: 2907
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by lurkio » Sat Sep 12, 2020 12:46 pm

Richard Russell wrote:
Sat Sep 12, 2020 12:40 pm
Richard Russell wrote:
Thu Sep 10, 2020 4:49 pm
Is there a preferred file extension for Acorn-format tokenised programs?
Anybody?
".bbc" seems fine to me. Consistent with BBCSDL.

:idea:

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Richard Russell » Sat Sep 12, 2020 2:03 pm

lurkio wrote:
Sat Sep 12, 2020 12:46 pm
".bbc" seems fine to me. Consistent with BBCSDL.
It can't be that - the format is different and the extension is supposed to imply the format! Apart from the confusion it would cause (you'd have some .bbc files that can be CHAINed or INSTALLed or CALLed and other .bbc files that can't) if I'm to support saving a program in Acorn format there needs to be a way for the user to select that. There's no room in the dialogue box for a textual description, so the obvious alternative is to select the format by its extension (.bbc, .bas or... what?). .acorn has already been taken.

I'm surprised that an extension hasn't long since been standardised and registered (it's a bit like a domain name, you ideally want to claim it before anybody else does). What do (Acorn format) 'tokenising' utilities typically save their output file as?

User avatar
lurkio
Posts: 2907
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by lurkio » Sat Sep 12, 2020 2:25 pm

Richard Russell wrote:
Sat Sep 12, 2020 2:03 pm
lurkio wrote:
Sat Sep 12, 2020 12:46 pm
".bbc" seems fine to me. Consistent with BBCSDL.
It can't be that - the format is different and the extension is supposed to imply the format! Apart from the confusion it would cause (you'd have some .bbc files that can be CHAINed or INSTALLed or CALLed and other .bbc files that can't) if I'm to support saving a program in Acorn format there needs to be a way for the user to select that. There's no room in the dialogue box for a textual description, so the obvious alternative is to select the format by its extension
Oh.

Richard Russell wrote:
Sat Sep 12, 2020 2:03 pm
(.bbc, .bas or... what?). .acorn has already been taken.
Then I don't know what extension would be best for tokenised Acorn-format BBC BASIC program files. I don't really have any preference -- except that I'd avoid ".bas" because I've come across it being used in the filenames of files containing untokenised BASIC programs in plain text (usually non-BBC dialects of BASIC). EDIT: I just realised you probably weren't proposing ".bas" because you yourself already reserve ".bas" for plain-text BASIC files in BBCSDL!

:idea:

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Richard Russell » Sat Sep 12, 2020 3:14 pm

lurkio wrote:
Sat Sep 12, 2020 2:25 pm
I just realised you probably weren't proposing ".bas" because you yourself already reserve ".bas" for plain-text BASIC files in BBCSDL!
Indeed, .bas is well-established. My original question from earlier in this thread was: "Is there a preferred file extension for Acorn-format tokenised programs (I use .bbc for 'my' tokenised format and .bas for plain text)? (emphasis added).

It wouldn't be at all appropriate for me to choose an extension for Acorn-format files! If nobody has yet done so, there must have been remarkably little crossover between Acorn systems and CP/M, MS-DOS or Windows over the past 40-odd years.

What's the file type for tokenised BASIC programs used by RISC OS?

User avatar
lurkio
Posts: 2907
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by lurkio » Sat Sep 12, 2020 3:34 pm

Richard Russell wrote:
Sat Sep 12, 2020 3:14 pm
It wouldn't be at all appropriate for me to choose an extension for Acorn-format files!
There can't be too many people who are more qualified to do so if it comes right down to it.

Richard Russell wrote:
Sat Sep 12, 2020 3:14 pm
What's the file type for tokenised BASIC programs used by RISC OS?
https://en.m.wikipedia.org/wiki/List_o ... _filetypes

Code: Select all

FFB | BASIC | Tokenised BASIC program | Acorn | .bas
:lol: ](*,)

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Using a Mac or PC for BBC games authoring

Post by Richard Russell » Sat Sep 12, 2020 3:56 pm

lurkio wrote:
Sat Sep 12, 2020 3:34 pm
There can't be too many people who are more qualified to do so if it comes right down to it.
Not at all. I parted company with Acorn when they parted company with the BBC! I'm amazed that my presence at this forum is tolerated, frankly (it isn't at any RISC OS forum :().

Code: Select all

FFB | BASIC | Tokenised BASIC program | Acorn | .bas
I suppose .ffb would be too obscure (and it has already been used, although that's likely to be true of any 3-letter extension).

Post Reply

Return to “programming”