New BBC Master dual processor demo - Twinhead
- SarahWalker
- Posts: 1598
- Joined: Fri Jan 14, 2005 3:56 pm
- Contact:
New BBC Master dual processor demo - Twinhead
Just released at Revision 2021, a new BBC Master demo by myself and some of the guys at Desire - Twinhead. This is I believe the first full dual processor demo, requiring a 6502 copro.
Note that this _probably_ requires a real Acorn copro, at least in the current version - it's been tested on both external 3 MHz and 4 MHz Acorn copros, but I've been told it will hang roughly halfway through on PiTubeDirect. I need to buy the latter and figure out what's going on... It's totally untested on anything else, and in particular absolutely requires the 24-byte FIFO to be present, which I gather isn't the case on all modern Tube ULA replacements.
It will run on both B-em and BeebEm, though the latter makes an absolute hash of the music so is not recommended!
Youtube link for those without the hardware : https://youtu.be/AvUCeJ6SEUI
Note that this _probably_ requires a real Acorn copro, at least in the current version - it's been tested on both external 3 MHz and 4 MHz Acorn copros, but I've been told it will hang roughly halfway through on PiTubeDirect. I need to buy the latter and figure out what's going on... It's totally untested on anything else, and in particular absolutely requires the 24-byte FIFO to be present, which I gather isn't the case on all modern Tube ULA replacements.
It will run on both B-em and BeebEm, though the latter makes an absolute hash of the music so is not recommended!
Youtube link for those without the hardware : https://youtu.be/AvUCeJ6SEUI
- Attachments
-
- Progen_and_Desire_-_Twinhead_V2.zip
- (83.18 KiB) Downloaded 121 times
-
- Twinhead.gif (7.86 KiB) Viewed 6589 times
Last edited by SarahWalker on Mon Apr 12, 2021 7:46 pm, edited 1 time in total.
- marcusjambler
- Posts: 1147
- Joined: Mon May 22, 2017 12:20 pm
- Location: Bradford
- Contact:
Re: New BBC Master dual processor demo - Twinhead
Wow this is great
Confirmed working on a Master with a Kortink Reco6502mini copro
Confirmed working on a Master with a Kortink Reco6502mini copro
Re: New BBC Master dual processor demo - Twinhead
That has a short FIFO IIRC?marcusjambler wrote: ↑Sun Apr 04, 2021 11:21 am Wow this is great
Confirmed working on a Master with a Kortink Reco6502mini copro
Re: New BBC Master dual processor demo - Twinhead
Looks and sounds great, nice one Sarah
Re: New BBC Master dual processor demo - Twinhead
Excellent demo Sarah.
I've run tried the following second processors:
- 3MHz Acorn cheese-wedge - works
- PiTubeDirect Co Pro 0 (279MHz) - hangs
- PiTubeDirect Co Pro 1 (3MHz) - hangs
- PiTubeDirect Co Pro 2 (279MHz) - hangs
- PiTubeDirect Co Pro 3 (4MHz) - hangs
- PiTubeDirect Co Pro 16 (69MHz lib6502) - works
- Matchbox Co Pro 0 - 20171007_0719 Firmware (3MHz - Arlet's 65C02 Core) - hangs
- Matchbox Co Pro 1 - 20171007_0719 Firmware (4MHz - Arlet's 65C02 Core) - hangs
- Matchbox Co Pro 2 - 20171007_0719 Firmware (16MHz - Arlet's 65C02 Core) - hangs
- Matchbox Co Pro 3 - 20171007_0719 Firmware (64MHz - Arlet's 65C02 Core) - hangs
- Matchbox Co Pro 0 - 20160228_1555 Firmware (4MHz - AlanD's 65C02 Core) - works
- Matchbox Co Pro 1 - 20160228_1555 Firmware (8MHz - AlanD's 65C02 Core) - works
- Matchbox Co Pro 2 - 20160228_1555 Firmware (16MHz - AlanD's 65C02 Core) - hangs
- Matchbox Co Pro 3 - 20160228_1555 Firmware (32MHz - AlanD's 65C02 Core) - hangs
The PiTubeDirect hangs all happen at 2 min 1 seconds on this screen: The Matchbox 20171007_0719 hangs all happen at 2 mins 42 seconds on this screen: The preceeding sequence is corrupt: The Matchbox 20160228_1555 hang happens much earlier: I've also tried BeebFPGA and it runs to completion, but sadly there are lots of 6845 issues, which is rather a shame, since I worked hard to get all the BitShifter's demos running.
So it looks like this is a great test for discovering 65C02 emulation issues!
Are you planning to release the source at some point? That would make debugging these emulation issues much easier.
Dave
I've run tried the following second processors:
- 3MHz Acorn cheese-wedge - works
- PiTubeDirect Co Pro 0 (279MHz) - hangs
- PiTubeDirect Co Pro 1 (3MHz) - hangs
- PiTubeDirect Co Pro 2 (279MHz) - hangs
- PiTubeDirect Co Pro 3 (4MHz) - hangs
- PiTubeDirect Co Pro 16 (69MHz lib6502) - works
- Matchbox Co Pro 0 - 20171007_0719 Firmware (3MHz - Arlet's 65C02 Core) - hangs
- Matchbox Co Pro 1 - 20171007_0719 Firmware (4MHz - Arlet's 65C02 Core) - hangs
- Matchbox Co Pro 2 - 20171007_0719 Firmware (16MHz - Arlet's 65C02 Core) - hangs
- Matchbox Co Pro 3 - 20171007_0719 Firmware (64MHz - Arlet's 65C02 Core) - hangs
- Matchbox Co Pro 0 - 20160228_1555 Firmware (4MHz - AlanD's 65C02 Core) - works
- Matchbox Co Pro 1 - 20160228_1555 Firmware (8MHz - AlanD's 65C02 Core) - works
- Matchbox Co Pro 2 - 20160228_1555 Firmware (16MHz - AlanD's 65C02 Core) - hangs
- Matchbox Co Pro 3 - 20160228_1555 Firmware (32MHz - AlanD's 65C02 Core) - hangs
The PiTubeDirect hangs all happen at 2 min 1 seconds on this screen: The Matchbox 20171007_0719 hangs all happen at 2 mins 42 seconds on this screen: The preceeding sequence is corrupt: The Matchbox 20160228_1555 hang happens much earlier: I've also tried BeebFPGA and it runs to completion, but sadly there are lots of 6845 issues, which is rather a shame, since I worked hard to get all the BitShifter's demos running.
So it looks like this is a great test for discovering 65C02 emulation issues!
Are you planning to release the source at some point? That would make debugging these emulation issues much easier.
Dave
Re: New BBC Master dual processor demo - Twinhead
Sarah,
I've started looking into the emulation issues and found something a bit unexepected.
This is from running the PiTubeDirect debugger on Co Pro 16 (the one that works).
On the Co Processor, I'm seeing writes to &FEE3 in this section: Here's the code with the write:
It looks like possibly this section of code is incorrectly using the host address for a tube register, rather than the parasite address?
This was one of the sequences that crashes on the Matchbox. The address range &FEE0-&FEE7 on the Matchbox is used for bank switching. So writing there may cause a section of code to vanish.
Dave
I've started looking into the emulation issues and found something a bit unexepected.
This is from running the PiTubeDirect debugger on Co Pro 16 (the one that works).
On the Co Processor, I'm seeing writes to &FEE3 in this section: Here's the code with the write:
Code: Select all
1a50 4c df 19 jmp 19DF
1a53 a9 00 lda #00
1a55 8d e3 fe sta FEE3
1a58 20 cd 19 jsr 19CD
1a5b 85 7e sta 7E
1a5d 85 6b sta 6B
1a5f 20 cd 19 jsr 19CD
This was one of the sequences that crashes on the Matchbox. The address range &FEE0-&FEE7 on the Matchbox is used for bank switching. So writing there may cause a section of code to vanish.
Dave
- SarahWalker
- Posts: 1598
- Joined: Fri Jan 14, 2005 3:56 pm
- Contact:
Re: New BBC Master dual processor demo - Twinhead
Whoops! Pretty certain I started out with the correct host/parasite addresses, but probably started getting them confused at some point; on Acorn hardware they're all partially decoded so it works by accident. Shouldn't be too difficult to fix...
Re: New BBC Master dual processor demo - Twinhead
That's true on the host side, but on the parasite they are fully decoded: That's from the external 6502 Co Pro schematic; I believe the internal one is the same.SarahWalker wrote: ↑Sun Apr 04, 2021 2:05 pm on Acorn hardware they're all partially decoded so it works by accident.
So I'm not sure what's going on here.
Dave
Re: New BBC Master dual processor demo - Twinhead
So fluid, fast and smooth - what a great achievement having a dedicated demo for the Master Turbo.
Is there a possibility of all collaborators doing a talk at either a Saturday or Thursday ABug event do you think?
Is there a possibility of all collaborators doing a talk at either a Saturday or Thursday ABug event do you think?
Please subscribe to the ABug YouTube channel!
- marcusjambler
- Posts: 1147
- Joined: Mon May 22, 2017 12:20 pm
- Location: Bradford
- Contact:
Re: New BBC Master dual processor demo - Twinhead
I think that could be the case because running it side by side with an actual Master turbo shows up some corruption in a few sections on the kortink copro run through.That has a short FIFO IIRC?
Re: New BBC Master dual processor demo - Twinhead
This is fantastic, super smooth.
Electron (+1, +3, AP5)
Electron (RH +1, Pegasus)
BBC B 1770, boobip, Acorn Speech,Econet)
BBC B+ 128k (Acorn Speech)
Master 512 (ARA III, VideoNuLA, Econet)
PiTubeDirect, RGBtoHDMI, Pi1MHZ
Master Compact (Econet)
Econet: RiscPC 700 / A3020 / A3000
Electron (RH +1, Pegasus)
BBC B 1770, boobip, Acorn Speech,Econet)
BBC B+ 128k (Acorn Speech)
Master 512 (ARA III, VideoNuLA, Econet)
PiTubeDirect, RGBtoHDMI, Pi1MHZ
Master Compact (Econet)
Econet: RiscPC 700 / A3020 / A3000
- Multiwizard
- Posts: 2668
- Joined: Wed Jan 11, 2012 9:03 pm
- Contact:
Re: New BBC Master dual processor demo - Twinhead
Sarah,
I've been looking into why the 3D Pyramid sequence (after the two-headed dog) hangs in PiTubeDirect on CoPros 0..3.
Debugging is hard-going, because that particular Co Pro doesn't include a debugger. However, I'm about 95% sure that during that sequence, the stack becomes unbalanced and wraps. There is evidence of this if you inspect the stack after a crash:
PiTubeDirect CoPro 0..3 definitely mis-handles the case where JSR or RTS causes the stack to wrap. The stack pointer ends up at the right address, but the data is read/written incorrectly.
The lib6502 Co Processor handles stack wrapping correctly, which is why I think it works.
I've also tried the 65816 Co Processor, and this also fails in an identical way. That has a debugger, and the stack is definitely wrapping during that sequence.
Do you deliberately rely on stack wrapping at this point, or is that accidental?
I'm going to work with Dominic and see if we can fix this in PiTubeDirect....
Dave
BTW, if it's any help, now I know what's going on, I can run a real Acorn 6502 Co Processor and capture an instruction trace with a logic analyzer. But you could probably do the same in b-em.
I've been looking into why the 3D Pyramid sequence (after the two-headed dog) hangs in PiTubeDirect on CoPros 0..3.
Debugging is hard-going, because that particular Co Pro doesn't include a debugger. However, I'm about 95% sure that during that sequence, the stack becomes unbalanced and wraps. There is evidence of this if you inspect the stack after a crash:
Code: Select all
0100 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
0110 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
0120 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
0130 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
0140 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
0150 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
0160 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
0170 c2 71 43 1a 64 7d 64 7d 6a 7d 64 7d 6a 7d 64 7d .qC.d}d}j}d}j}d}
0180 6a 7d 64 7d 6a 7d 6a 7d 7c 8a ba 7e c2 71 43 1a j}d}j}j}|..~.qC.
0190 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
01a0 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
01b0 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
01c0 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
01d0 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
01e0 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
01f0 c2 71 43 1a c2 71 43 1a c2 71 43 1a c2 71 43 1a .qC..qC..qC..qC.
The lib6502 Co Processor handles stack wrapping correctly, which is why I think it works.
I've also tried the 65816 Co Processor, and this also fails in an identical way. That has a debugger, and the stack is definitely wrapping during that sequence.
Do you deliberately rely on stack wrapping at this point, or is that accidental?
I'm going to work with Dominic and see if we can fix this in PiTubeDirect....
Dave
BTW, if it's any help, now I know what's going on, I can run a real Acorn 6502 Co Processor and capture an instruction trace with a logic analyzer. But you could probably do the same in b-em.
Last edited by hoglet on Wed Apr 07, 2021 9:31 am, edited 1 time in total.
- SarahWalker
- Posts: 1598
- Joined: Fri Jan 14, 2005 3:56 pm
- Contact:
Re: New BBC Master dual processor demo - Twinhead
Totally accidental. Looks to be the result of two effects sharing the same code (triangle sorting + plotting) with different ideas of how the stack should be managed. Shouldn't be too difficult to fix, but PiTubeDirect should really handle this!
Re: New BBC Master dual processor demo - Twinhead
I think it is more the stack wraps around ie overflows. PiTubeDirect fast core does handle this except in the case where a JSR/RTS is used and the stack pointer is at an odd address.
Re: New BBC Master dual processor demo - Twinhead
It's slightly worse than this: there are three cases where it behaves incorrectly:
- SP=0x100: JSR writes 0xFF and 0x100
- SP=0x1FE: RTS reads 0x1FF and 0x200
- SP=0x1FF: RTS reads 0x200 and 0x201
I've quicky hacked a correct (but slow) implementation and that fixes the issue with this section of the demo.
So at least that confirms there's nothing else going on.
I tend to agree with this...SarahWalker wrote: ↑Tue Apr 06, 2021 7:51 pm Shouldn't be too difficult to fix, but PiTubeDirect should really handle this!
I'll work with Dominic to fix this as efficiently as is possible.
Dave
- BeebMaster
- Posts: 7380
- Joined: Sun Aug 02, 2009 5:59 pm
- Location: Lost in the BeebVault!
- Contact:
Re: New BBC Master dual processor demo - Twinhead
I thought it would be a good test for "PyClock" if it could transfer a 100K+ disc image file from my NFS share into the Native ARM RAM so I could write it to a floppy disc with my DFS writer without anything going on fire, and it worked fine. It looks superb on the Sony Trinitron, much better than the Dell flat-screen, and runs all the way through no problem with real Turbo co-processor on Station 114. It must do a *TV0 somewhere, as I have Station 114 set to TV255, so the top line was cut off.
Also the screen is a quite a bit left-aligned on the Sony TV, but seems just a tiny bit right-aligned on the Dell monitor (with PiRGBtoHDMI).
It also works from a real 5.25" floppy disc, which probably nobody else is using.
And thank you for putting all the files in one directory, it means I could easily transfer it to Econet and run it from there no problem.
On PiTube co-pro 0, it crashes at the point shown in Hoglet's first picture on Station 201 and Station 114 (although not exactly the same frame, and the music continues.)
Also the screen is a quite a bit left-aligned on the Sony TV, but seems just a tiny bit right-aligned on the Dell monitor (with PiRGBtoHDMI).
It also works from a real 5.25" floppy disc, which probably nobody else is using.
And thank you for putting all the files in one directory, it means I could easily transfer it to Econet and run it from there no problem.
On PiTube co-pro 0, it crashes at the point shown in Hoglet's first picture on Station 201 and Station 114 (although not exactly the same frame, and the music continues.)
- BeebMaster
- Posts: 7380
- Joined: Sun Aug 02, 2009 5:59 pm
- Location: Lost in the BeebVault!
- Contact:
Re: New BBC Master dual processor demo - Twinhead
I'm not sure if it helps to diagnose what's happening but it doesn't seem to play all the way through when run from Econet on 65C102 Turbo co-processor, or PiTube. Sometimes it breaks down during the "Progen" sequence (Hoglet's third picture) but most often when the two dog-heads are on screen, and there is a file access (07 or 08).
Re: New BBC Master dual processor demo - Twinhead
Just a quick note to say this now runs on BeebFPGA.
The issue turned out to be the default VDU FIFO depth in BeebFPGA was only 1-byte.
This has now been fixed.
The issue turned out to be the default VDU FIFO depth in BeebFPGA was only 1-byte.
This has now been fixed.
Re: New BBC Master dual processor demo - Twinhead
Highly impressive. I would be interested to know how it actually works.
Chris.
Chris.
- Dave Footitt
- Posts: 998
- Joined: Thu Jun 22, 2006 10:31 am
- Location: Abandoned Uranium Workings
- Contact:
Re: New BBC Master dual processor demo - Twinhead
Nice work Sarah, very impressive
Re: New BBC Master dual processor demo - Twinhead
I went to set up my Master this afternoon to try it wondering what copro I should use... my home built 65C02 one or the Pi (following the diagnostics from Hoglet) and then I realised... I own a Master Turbo!
So one *co.intube and a shift-BREAK later... wow! Great demo. I am really impressed. It definitely makes the Master stand up to be counted against the 16bit machines with their fancy blitters and bitplanes.
So one *co.intube and a shift-BREAK later... wow! Great demo. I am really impressed. It definitely makes the Master stand up to be counted against the 16bit machines with their fancy blitters and bitplanes.
- SarahWalker
- Posts: 1598
- Joined: Fri Jan 14, 2005 3:56 pm
- Contact:
Re: New BBC Master dual processor demo - Twinhead
Updated the first post with v2, which should now work on PiTubeDirect and Matchbox. Many thanks to hoglet for tracking down what was going wrong!
Re: New BBC Master dual processor demo - Twinhead
Having finally managed to run this on proper hardware, it is excellent - very elegantly done!
d.
d.
Re: New BBC Master dual processor demo - Twinhead
Just set my master up to test something else and ran this for the first time on hardware, and damn it's even better.
Amazing.
Amazing.
Electron (+1, +3, AP5)
Electron (RH +1, Pegasus)
BBC B 1770, boobip, Acorn Speech,Econet)
BBC B+ 128k (Acorn Speech)
Master 512 (ARA III, VideoNuLA, Econet)
PiTubeDirect, RGBtoHDMI, Pi1MHZ
Master Compact (Econet)
Econet: RiscPC 700 / A3020 / A3000
Electron (RH +1, Pegasus)
BBC B 1770, boobip, Acorn Speech,Econet)
BBC B+ 128k (Acorn Speech)
Master 512 (ARA III, VideoNuLA, Econet)
PiTubeDirect, RGBtoHDMI, Pi1MHZ
Master Compact (Econet)
Econet: RiscPC 700 / A3020 / A3000