Tube Elite with hardware outputs

Got a programming project in mind? Tell everyone about it!
Post Reply
minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Tube Elite with hardware outputs

Post by minwah » Mon Mar 05, 2018 1:39 pm

I have been playing around with the Tube Elite source code, to add hardware output functionality for certain events. I am using a Deltronics Control It box as an interface, but it would also work with NCST I/O adaptor, or you could make your own board. It uses the parallel/printer port PA0-PA7 data pins to control 8 outputs.

I played around with the Control It software and the Deltronics BASIC examples, and quickly realised neither worked with Tube enabled. The following link helped me to understand why that was, and enabled me to write a small test program in assembly:

http://central.kaserver5.org/Kasoft/Typ ... /Ch44.html

EDIT: note the link is for the user port, I am using the parallel port for outputs which uses different addresses, but same principal.

With that done, I moved onto the Tube Elite source, and with a bit of help was able to build and run it:

viewtopic.php?f=2&t=14607

My plan was to add outputs for the following:

Code: Select all

#  val     description

1   1     Condition Green } RGB LED should make yellow when both outputs on
2   2     Condition Red   }
3   4     Cabin Temp High / Altitude Low
4   8     Laser Temp High
5  16     Energy Bank 1
6  32     Energy Bank 2
7  64     Energy Bank 3
8 128     Energy Bank 4	
...and I have just about achieved that. Poor quality but you might be able to make out what is happening here (output #1 is the bottom LED):

https://twitter.com/minsoftgames/status ... 9867265024

I need to get some parts to make a box to sit on top of the monitor housing the LEDs so they are easy to see.

Is anyone interested in this? I'm guessing very few people have a Deltronics or similar box, although it shouldn't be too hard to put together a DIY one...

EDIT:
In addition to the above, there are two other changes:

1) The cassette motor is turned on when docking computer are turned on, and off when the docking computer turns off (dust off your Blue Danube tape).
2) I have toned down the number of particles used in the ship explosions. The particles seem to really slow the game down, so this improves the framerate.

The attached download includes the altered source and compiled version. Just do *.$ELITE to run. To compile, see link above. NB this version of the source needs to be mounted to drives 0 & 2, and will build to drive 1.
Attachments
elite_mod_v1.zip
(327.61 KiB) Downloaded 12 times
Last edited by minwah on Sat May 12, 2018 4:07 pm, edited 3 times in total.
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

User avatar
Lardo Boffin
Posts: 1278
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Tube Elite with hardware outputs

Post by Lardo Boffin » Mon Mar 05, 2018 2:29 pm

That is deeply cool. 8)
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Viglen twin 40/80 5.25" discs, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master, Datacentre + HDD, pi co-proc

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Tube Elite with hardware outputs

Post by crj » Mon Mar 05, 2018 5:11 pm

Wow. This is a really neat idea!
minwah wrote:I'm guessing very few people have a Deltronics or similar box
Indeed. My instinct is that, with not much effort, this could be elaborated into something a little bigger using hardware that's a little more off-the-shelf. Especially if several people were interested.

What if, instead of just outputting 8 bits from the User Port, you strobed out 8-bit values? (i.e. you present the value then waggle one of the control lines so the receiver knows it's there. The 6522 can do this for you.) Each value could be a 4-bit address, and a 4-bit value, allowing you to give the actual level of energy banks, laser temperature, etc. rather than just a binary value.

With the ability to express sixteen 4-bit values, I can think of lots of other things it would be awesome to include:
  • Location: Witch space, galactic hyperspace, hyperspace, deep space, space station safe zone, docking computers, docked, dead
  • Missile status
  • Shields (more useful than energy banks, actually)
  • Fuel
  • Speed
  • ...
You could route those signals to an Arduino and drive a few metres of AdaFruit neopixels or similar for a full-on light show. (-8

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Tue Mar 06, 2018 11:30 am

crj wrote: What if, instead of just outputting 8 bits from the User Port, you strobed out 8-bit values? (i.e. you present the value then waggle one of the control lines so the receiver knows it's there. The 6522 can do this for you.) Each value could be a 4-bit address, and a 4-bit value, allowing you to give the actual level of energy banks, laser temperature, etc. rather than just a binary value.
I like this idea, although it's a bit more involved. The thing I'd be concerned with is the speed...would there need to be a handshake between the 6522 and Arduino? I don't know much about the control lines but presume there would be a slight delay. It might mean sending different info on different frames, which could mean slightly delayed outputs. I'm not sure without trying it how much of a delay/issue there might be. I wondered if it might be possible to monitor the outputs without use of the control lines, but I suspect there would be timing issues.

If you wanted to play around with your idea, I'd be interested to see what you come up with...especially how to use the control lines programmatically. I will have a play around with the 4bit/4bit method once I've finished my 'simple' implementation...
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

User avatar
vanpeebles
Posts: 469
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Tube Elite with hardware outputs

Post by vanpeebles » Tue Mar 06, 2018 2:22 pm

Will you be building a big enclosed cabin with lots of gauges? 8)

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Tube Elite with hardware outputs

Post by crj » Tue Mar 06, 2018 3:05 pm

minwah wrote:I like this idea, although it's a bit more involved. The thing I'd be concerned with is the speed...would there need to be a handshake between the 6522 and Arduino? I don't know much about the control lines but presume there would be a slight delay. It might mean sending different info on different frames, which could mean slightly delayed outputs. I'm not sure without trying it how much of a delay/issue there might be. I wondered if it might be possible to monitor the outputs without use of the control lines, but I suspect there would be timing issues.
Take a look at pages 403 onwards in the Advanced User Guide (which you can find online if you don't have a paper copy). Writing binary 101xxxxx to the 6522's Peripheral Control Register puts it into "pulse" mode. This means it automatically puts a pulse on CB2 each time you send a new value to PB0-7.

I'm not totally familiar with the Arduino family, but I'll just bet you could wire CB2 to a pin that caused an interrupt. Then, given you wouldn't be sending another value for several microseconds, there would be plenty of time for the Arduino to capture the value.

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Wed Mar 07, 2018 2:05 pm

vanpeebles wrote:Will you be building a big enclosed cabin with lots of gauges? 8)
I thought about something like that a few years ago, but talked myself out of it...although it would be great! An arcade driving cabinet has been on my 'to build' list for about 5 years but I'm struggling to find the time. One day!
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Wed Mar 07, 2018 2:06 pm

crj wrote: Take a look at pages 403 onwards in the Advanced User Guide (which you can find online if you don't have a paper copy). Writing binary 101xxxxx to the 6522's Peripheral Control Register puts it into "pulse" mode. This means it automatically puts a pulse on CB2 each time you send a new value to PB0-7.
Thanks. I had read some of that already but only down to where it starts sounding complicated. I will give it a proper read at some point...
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Tube Elite with hardware outputs

Post by crj » Wed Mar 07, 2018 2:21 pm

minwah wrote:
vanpeebles wrote:Will you be building a big enclosed cabin with lots of gauges? 8)
I thought about something like that a few years ago, but talked myself out of it...
I'd suggest repurposing a Space Harrier arcade machine. Except that would be sacrilege because Space Harrier is another masterpiece in its own right. Besides, the sit-on version ain't cheap!

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Wed Mar 07, 2018 5:25 pm

crj wrote: I'd suggest repurposing a Space Harrier arcade machine. Except that would be sacrilege because Space Harrier is another masterpiece in its own right. Besides, the sit-on version ain't cheap!
Yeah, I wouldn't do that to any dedicated arcade game. If I did scratch build one, it would be more in the style of the Star Wars cockpit which is more enclosed - more places to put lights & switches etc.
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Tube Elite with hardware outputs

Post by crj » Wed Mar 07, 2018 6:26 pm

Hohum.

It occurred to me that somebody somewhere must make an off-the-shelf system you could integrate into a custom Elite playing platform. So I Googled; they do.

Problem: a nice one like that with six degrees of freedom and the strength to move around an Elite cockpit costs 28 000 €. Ouch.

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Thu Mar 08, 2018 3:06 pm

crj wrote:Hohum.

It occurred to me that somebody somewhere must make an off-the-shelf system you could integrate into a custom Elite playing platform. So I Googled; they do.

Problem: a nice one like that with six degrees of freedom and the strength to move around an Elite cockpit costs 28 000 €. Ouch.
I've ordered two! :lol:
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Tue Apr 03, 2018 1:17 pm

Here's a pic of my breadboard test setup in action:
20180331_161546.jpg
From left to right are:

Energy banks (4x red LEDs)
Cabin temp / altitute warning (RGB LED)
Laser temp warning (RGB LED)
Condition (RGB LED)

I've got some LED-lit arcade buttons to play around with too...
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

User avatar
Lardo Boffin
Posts: 1278
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Tube Elite with hardware outputs

Post by Lardo Boffin » Tue Apr 03, 2018 1:35 pm

=D> =D> =D>
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Viglen twin 40/80 5.25" discs, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master, Datacentre + HDD, pi co-proc

User avatar
myelin
Posts: 441
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Tube Elite with hardware outputs

Post by myelin » Tue Apr 03, 2018 5:52 pm

Nice work!
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Sat May 12, 2018 3:54 pm

I don't have time to work on this for a while so I've decided to release what I've done, in case anyone wants to try it. I've added a download to the original post.

Also, there is a chap on twitter who has been making a breakout board for the user/parallel ports. If you don't have a Deltronics box that would be a good alternative: https://twitter.com/MrTomsWorld/status/ ... 2752462848
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

User avatar
Elminster
Posts: 3076
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Tube Elite with hardware outputs

Post by Elminster » Sat May 12, 2018 6:23 pm

Cool, I missed this topic before. I do actually have a deltronics box in the cupboard, always what I could actually do with it. Deltronics boxes come up reasonably regularly on eBay. This could actually create a demand for them. (Of course as mentioned above some other hardware could be used but this seems like a good project to make them relevant again).

User avatar
Lardo Boffin
Posts: 1278
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Tube Elite with hardware outputs

Post by Lardo Boffin » Sat May 12, 2018 8:14 pm

I have an interbeeb - is that in any way adaptable to this?
F7A54074-9CAF-4043-8492-1C6A97F11EC7.jpeg
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Viglen twin 40/80 5.25" discs, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master, Datacentre + HDD, pi co-proc

User avatar
Elminster
Posts: 3076
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Tube Elite with hardware outputs

Post by Elminster » Sat May 12, 2018 10:05 pm

I have some of them as well, and you could still by new old stock of these a couple of years ago from DCP. I think they are basically the same thing from memory. Will have to go find them.

User avatar
Lardo Boffin
Posts: 1278
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Tube Elite with hardware outputs

Post by Lardo Boffin » Sun May 13, 2018 6:23 am

Elminster wrote:I have some of them as well, and you could still by new old stock of these a couple of years ago from DCP. I think they are basically the same thing from memory. Will have to go find them.
Thanks. I got mine from the original suppliers a few years back but never got round to doing anything with it. This could be just the thing!
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Viglen twin 40/80 5.25" discs, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master, Datacentre + HDD, pi co-proc

User avatar
Lardo Boffin
Posts: 1278
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Tube Elite with hardware outputs

Post by Lardo Boffin » Sun May 13, 2018 6:24 am

Elminster wrote:I have some of them as well, and you could still by new old stock of these a couple of years ago from DCP. I think they are basically the same thing from memory. Will have to go find them.
Thanks. I got mine from the original suppliers a few years back but never got round to doing anything with it. This could be just the thing!
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Viglen twin 40/80 5.25" discs, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master, Datacentre + HDD, pi co-proc

User avatar
Elminster
Posts: 3076
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Tube Elite with hardware outputs

Post by Elminster » Sun May 13, 2018 8:27 am

De ja vu :)

I have one of each box and two masters, I could have an Elite tube off with special FX with the wife. (The later but it probably a pipe dream)

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Mon May 14, 2018 11:47 am

Elminster wrote:Cool, I missed this topic before. I do actually have a deltronics box in the cupboard, always what I could actually do with it.
I had this project in mind when I bought the Deltronics box. I had no idea if I could actually achieve what I had in mind but fortunately things worked out quite nicely.

Please do dig your Deltronics box out and give it a try!
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

minwah
Posts: 40
Joined: Tue Jul 21, 2015 12:12 pm
Contact:

Re: Tube Elite with hardware outputs

Post by minwah » Mon May 14, 2018 12:38 pm

Lardo Boffin wrote:I have an interbeeb - is that in any way adaptable to this?
I've not seen these before, but from what I could tell from searching it looks like it connects to the 1Mhz bus. The current implementation uses the parallel ports for outputs so it would need adapting. I suspect it would be possible to do, although I use the 1Mhz port for a DataCentre (don't have floppy drives).

If anyone wants to try it out I can point you to the code that would need changing. I don't know anything about programming the 1Mhz at the moment, but I suspect some documentation is available.

EDIT: A quick look indicates one change would be from OSBYTE &97 (wite to Sheila) to &93 (write to Fred) in ELITEA. There will probably be other changes required.
Last edited by minwah on Mon May 14, 2018 12:54 pm, edited 1 time in total.
BBC Master | IFEL Switchable MOS | Sundby PiTubeDirect (Pi 3) | RetroClinic DataCentre | Deltronics Control It

User avatar
Elminster
Posts: 3076
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Tube Elite with hardware outputs

Post by Elminster » Mon May 14, 2018 12:45 pm

Hmm. The interbeeb is about 2 Metres from me on the shelf, the Deltronics is boxed and in the storage area (aka the loft) somewhere. If I dindt have 16 othe rprojects on the go I would probably grab them now.

Post Reply