Co-processor Menu

bbc/electron apps, languages, utils, educational progs, demos + more
Post Reply
User avatar
dudleysoft71
Posts: 298
Joined: Tue May 26, 2020 6:56 pm
Contact:

Co-processor Menu

Post by dudleysoft71 »

I recently added a PiTubeDirect co-processor to my Model B, I've been working on another project using the co-processor, and while playing with the different processors I keep forgetting which core is which (not difficult with 16 to choose from), so I wrote a little menu to allow me to change between them. I thought other people might find it useful, and the best bit about it is it runs entirely on the host so it can be run from any core that allows the execution of Star commands including DOS, CPM and Panos (and presumable Flex but I haven't been able to test that yet). I put it on an SSD image so on MMFS you can do:

Code: Select all

*DIN COPROMENU
*CPMENU
Or you can Shift-Break boot the disk image, on ADFS if you put the file in $.Library you can call *CPMENU from anywhere, and since it runs on the host it has normal access to the BBC's memory and IO. There seems to be an issue, it's supposed to reset the machine once you select a core, but it's buggy and doesn't always work, you get a blank screen with a flashing cursor, but pressing Ctrl-Break (or just break) will switch you into the new processor core.
This is what the menu looks like:
cpmenu.png
The processor cores are in order, however I deliberately put Disable at the end so you can simply press UP once and RETURN to disable the processor.
At the moment the menu is very hardcoded, I created the layout using tt-edit, which is copied directly into screen memory, the control codes for the backgrounds are hardcoded into the image, like this:
tt-edit-ss.png
I just replace the space to the left of the G symbol with CHR$(157) to turn the highlight on.
Here's the first release, if anyone can help with the reboot issue I'm calling

Code: Select all

JMP (&FFFC)
on the host, but it only seems to work with no co-processor active.

*Updated 16/06/2020 - New version with working reset.
copromenu.ssd
(2.25 KiB) Downloaded 89 times
Hopefully some more of you will find this useful.

James Watson
Last edited by dudleysoft71 on Tue Jun 16, 2020 9:32 am, edited 1 time in total.
James Watson - DudleySoft

BBC Model B 32K - PiTubeDirect, Pi1Mhz, Smally Mouse, Gotek, DFS/ADFS, 4xSWRAM.
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: Co-processor Menu

Post by sydney »

This is a great idea! I will definitely be using this to replace the printed list sellotaped to thetop of my beeb.
User avatar
LordVaderUK
Posts: 208
Joined: Thu Jan 31, 2019 12:26 am
Location: Hampshire
Contact:

Re: Co-processor Menu

Post by LordVaderUK »

This is excellent, and I too have a ropey bit of paper with all the *FX230,152,... codes. Can you please humour an idiot (me) and post an idiot’s guide to installing and using this? I don’t know for example what a $.Library file is :oops:
Loving my BBC Master 128
User avatar
dudleysoft71
Posts: 298
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Co-processor Menu

Post by dudleysoft71 »

LordVaderUK wrote: Fri Jun 12, 2020 5:32 pm This is excellent, and I too have a ropey bit of paper with all the *FX230,152,... codes. Can you please humour an idiot (me) and post an idiot’s guide to installing and using this? I don’t know for example what a $.Library file is :oops:
$.Library is a Directory on an ADFS harddisk, if you copy files into it (I use Beeb Image to copy into the directory, you can open both the HDD image and the floppy at the same time making copying simple), any program stored in the directory can be run from anywhere no matter what directory you're currently in (kind of like a simple version of PATH in other operating systems)

Otherwise you can mount the SSD image (using *DIN on MMFS or Turbo MMC) I don't know how you do the same on a Gotek since I don't have one.

I have my own tool to manage my BEEB.MMB file, I wrote it a long time ago when I didn't have access to a windows desktop, it's just a command line tool, but it's useful because I can include it in my build process and it will update the image on my MMB file everytime I build, otherwise you can use MMBImager to add the SSD file to your MMB file, I believe the disk is title COPROMENU so you can use *DIN COPROMENU to insert the correct disk rather than remembering which number it is.

The SSD image is self booting, just shift break and it will load and run the menu.
James Watson - DudleySoft

BBC Model B 32K - PiTubeDirect, Pi1Mhz, Smally Mouse, Gotek, DFS/ADFS, 4xSWRAM.
User avatar
dv8
Posts: 397
Joined: Mon Jun 22, 2009 10:07 pm
Contact:

Re: Co-processor Menu

Post by dv8 »

dudleysoft71 wrote: Fri Jun 12, 2020 3:56 pm Here's the first release, if anyone can help with the reboot issue I'm calling JMP (&FFFC) on the host, but it only seems to work with no co-processor active.
You need to reset both the parasite and the host.

The following code will reset the parasite and then do a fake power-on reset of the host:

Code: Select all

SEI
LDA #&A0:STA &FEE0
LDA #&20:STA &FEE0
LDA #&7F:STA &FE4E
JMP (&FFFC)
Or you could just print a message asking the user to press Ctrl+Break.
User avatar
dudleysoft71
Posts: 298
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Co-processor Menu

Post by dudleysoft71 »

dv8 wrote: Fri Jun 12, 2020 7:26 pm
dudleysoft71 wrote: Fri Jun 12, 2020 3:56 pm Here's the first release, if anyone can help with the reboot issue I'm calling JMP (&FFFC) on the host, but it only seems to work with no co-processor active.
You need to reset both the parasite and the host.

The following code will reset the parasite and then do a fake power-on reset of the host:

Code: Select all

SEI
LDA #&A0:STA &FEE0
LDA #&20:STA &FEE0
LDA #&7F:STA &FE4E
JMP (&FFFC)
Or you could just print a message asking the user to press Ctrl+Break.
Thanks, couldn't find any info about that, looks simple enough. I'll give it a test. I was hoping to avoid having to press break, I'll keep that option as a last resort.
James Watson - DudleySoft

BBC Model B 32K - PiTubeDirect, Pi1Mhz, Smally Mouse, Gotek, DFS/ADFS, 4xSWRAM.
User avatar
dudleysoft71
Posts: 298
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Co-processor Menu

Post by dudleysoft71 »

Okay, I've added the suggested code to the menu, it now resets properly, so it should now be much more suitable for it's original purpose.

Here's the latest download version:
copromenu.ssd
(2.25 KiB) Downloaded 96 times
James Watson - DudleySoft

BBC Model B 32K - PiTubeDirect, Pi1Mhz, Smally Mouse, Gotek, DFS/ADFS, 4xSWRAM.
mph1708
Posts: 47
Joined: Thu Jun 28, 2012 7:17 pm
Location: Manchester
Contact:

Re: Co-processor Menu

Post by mph1708 »

When I first saw this program, I thought that that sounds like a great idea.
I too have a problem remembering the codes for each co-processor.

Initially, I was disappointed that I could not get this program to work properly on my BBC Master.
The program runs, and the menu displays etc. - but it wasn't changing to the selected co-processor.

However, I eventually worked out that for the program needs the EXTERNAL TUBE option to be selected on a BBC Master for it to run correctly.
And of course, I intially had my machine set to the INTERNAL TUBE setting.

Mike
User avatar
dudleysoft71
Posts: 298
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Co-processor Menu

Post by dudleysoft71 »

Hadn't even thought about that, I only have a Model B socthat isn't an issue. If I can find out how it differs from the external I can modify it to work with it.
James Watson - DudleySoft

BBC Model B 32K - PiTubeDirect, Pi1Mhz, Smally Mouse, Gotek, DFS/ADFS, 4xSWRAM.
User avatar
Mince
Posts: 524
Joined: Thu Sep 05, 2019 11:25 pm
Location: Cambridge, UK
Contact:

Re: Co-processor Menu

Post by Mince »

As an aside to this, I submitted a pull request to PiTubeDirect recently to add a program in the 6502 memory space that tells you the *FX command needed and lists all the processor codes. You just type "CALL &2000" to run it, after boot up (or later, although it has to have not been overwritten by something else, but changing to another 6502 processor type will re-install it):
PiTube CoPro list.png
It's not as fancy as a menu and could be expanded to one (although it would need to work on the Electron, too, so no MODE 7) but it gets the processor names from the PiTubeDirect code.

https://github.com/hoglet67/PiTubeDirect/pull/71
BBC Master— PiTube 3A+ PiVDU, PicoTube, Pi1MHz, MMFS, ANFS, MultiOS
BBC B — Integra ß, PiTube Zero 2W, Pi1MHz, MMFS, DFS, ADFS, ANFS
Electron — Plus 1 w/ AP6 2V2, AP5, PiTube 3A+, Pi1MHz, PRES AP3+4, Elkeconet or ATI/ABR, ElkSD 64/Plus 1
shifters74
Posts: 433
Joined: Mon Mar 04, 2019 9:44 am
Contact:

Re: Co-processor Menu

Post by shifters74 »

dudleysoft71 wrote: Tue Jun 16, 2020 9:30 am Okay, I've added the suggested code to the menu, it now resets properly, so it should now be much more suitable for it's original purpose.

Here's the latest download version: copromenu.ssd
Hi Dudley,

do you intend to update this for the gecko supported options?

Its a nice user friendly tool to select the processor, thanks for effort to develop it

cheers

shifters
User avatar
dudleysoft71
Posts: 298
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Co-processor Menu

Post by dudleysoft71 »

I was thinking about it, I originally wrote it as a quick hack, it uses a prebuilt screen layout, to make it more useful it'll need a rewrite, the plan is to read a file with the co-processors in so it can be customised based on the ones you want to use. I guess because it does what I need I forget about updating it.
James Watson - DudleySoft

BBC Model B 32K - PiTubeDirect, Pi1Mhz, Smally Mouse, Gotek, DFS/ADFS, 4xSWRAM.
User avatar
BigEd
Posts: 6261
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Co-processor Menu

Post by BigEd »

(In a freshly started 6502 co-pro, the actual list of copros must now be lurking somewhere near &2000.)
User avatar
dudleysoft71
Posts: 298
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Co-processor Menu

Post by dudleysoft71 »

BigEd wrote: Sun Jan 17, 2021 3:01 pm (In a freshly started 6502 co-pro, the actual list of copros must now be lurking somewhere near &2000.)
Which would be useful if it was running on the 6502 co-processor, however the menu runs on the host in 6502 assembly. This was a conscious decision, it allows it to run under any coprocessor that supports executing OSCLI commands, since it doesn't rely on any particular architecture or language being available on the processor, whereas we can always guarantee that the host's capabilities.
James Watson - DudleySoft

BBC Model B 32K - PiTubeDirect, Pi1Mhz, Smally Mouse, Gotek, DFS/ADFS, 4xSWRAM.
User avatar
BigEd
Posts: 6261
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Co-processor Menu

Post by BigEd »

Oh, interesting tactic!
User avatar
Mince
Posts: 524
Joined: Thu Sep 05, 2019 11:25 pm
Location: Cambridge, UK
Contact:

Re: Co-processor Menu

Post by Mince »

I was thinking, when I added the CALL &2000 code, that there might be some way to trigger a dump of the list data to a specified location — perhaps in the parasite processor and a caller could transfer it across to the I/O processor to use as data using a Tube memory transfer.

It would have to be agnostic of the coprocessor environment and I'm not sure what calls are available to do that: I think there's really only a few OSBYTEs available, so it would all have to go through there, but I haven't thought it out more as I'm not an expert on that.
BBC Master— PiTube 3A+ PiVDU, PicoTube, Pi1MHz, MMFS, ANFS, MultiOS
BBC B — Integra ß, PiTube Zero 2W, Pi1MHz, MMFS, DFS, ADFS, ANFS
Electron — Plus 1 w/ AP6 2V2, AP5, PiTube 3A+, Pi1MHz, PRES AP3+4, Elkeconet or ATI/ABR, ElkSD 64/Plus 1
mbernardi
Posts: 19
Joined: Wed Sep 20, 2017 11:14 pm
Contact:

Re: Co-processor Menu

Post by mbernardi »

How difficult would it be, to have a toggleable option, to load the appropriate BBC Basic into sideways RAM/ROM prior to selecting the CoPro and resetting?
User avatar
jgharston
Posts: 5319
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Co-processor Menu

Post by jgharston »

dv8 wrote: Fri Jun 12, 2020 7:26 pm You need to reset both the parasite and the host.
The following code will reset the parasite and then do a fake power-on reset of the host:

Code: Select all

SEI
LDA #&A0:STA &FEE0
LDA #&20:STA &FEE0
LDA #&7F:STA &FE4E
JMP (&FFFC)
You need to do more than that as the reset code expects the hardware to have been reset, so you're liable to discover that the firmware finds the hardware is not in the expected reset state, and decides that means the hardware is not present, and disables itself. Plus, the Tube registers aren't at that address on an Electron. You need to do Reset_from_software.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
Post Reply

Return to “8-bit acorn software: other”