Co-processor Menu

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

Co-processor Menu

Post by dudleysoft71 » Fri Jun 12, 2020 3:56 pm

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 19 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.

User avatar
sydney
Posts: 2722
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: Co-processor Menu

Post by sydney » Fri Jun 12, 2020 4:06 pm

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 » 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:
Loving my BBC Master 128

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

Re: Co-processor Menu

Post by dudleysoft71 » Fri Jun 12, 2020 5:56 pm

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.

User avatar
dv8
Posts: 333
Joined: Mon Jun 22, 2009 10:07 pm
Contact:

Re: Co-processor Menu

Post by dv8 » 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.

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

Re: Co-processor Menu

Post by dudleysoft71 » Fri Jun 12, 2020 8:02 pm

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.

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

Re: Co-processor Menu

Post by dudleysoft71 » 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
(2.25 KiB) Downloaded 31 times

mph1708
Posts: 34
Joined: Thu Jun 28, 2012 7:17 pm
Location: Manchester
Contact:

Re: Co-processor Menu

Post by mph1708 » Wed Jun 17, 2020 10:03 pm

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: 113
Joined: Tue May 26, 2020 6:56 pm
Contact:

Re: Co-processor Menu

Post by dudleysoft71 » Wed Jun 17, 2020 11:56 pm

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.

User avatar
Mince
Posts: 50
Joined: Thu Sep 05, 2019 11:25 pm
Location: Cambridge, UK
Contact:

Re: Co-processor Menu

Post by Mince » Mon Jun 22, 2020 10:09 am

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

Post Reply

Return to “8-bit acorn software: other”