Video streaming from ROM

Got a programming project in mind? Tell everyone about it!
hexwab
Posts: 23
Joined: Wed Jul 08, 2015 8:27 pm

Video streaming from ROM

Postby hexwab » Wed Mar 29, 2017 9:05 am

Having seen the recent Teletext Bad Apple (https://bitshifters.github.io/posts/prods/bs-badapple.html) I got to thinking about what the actual highest streaming video bandwidth that could be achieved on a Beeb is. Answer: frickin' huge bank-switched ROM gets 2MBytes/sec of incoming data. Since the 6845 can't be pointed into ROM, the question is how fast data can be copied into RAM. I figured 128*312=39936 cycles per frame. 4 cycles per STA abs, and 512 cycles for 256 LDA #imm's gives 9600*4+512=38912 cycles for writing an arbitrary 1bpp 320x240 picture, with a bit spare for bank switching, double buffering (essential as data isn't written sequentially), and vsync. So 320x240@50fps video is perfectly doable. This is much faster than is possible over, say, the Tube interface.

I knocked up a proof-of-concept encoder for (what else?) Bad Apple!! Since BA is particularly easy to encode, I decided to up the resolution to 600x216. The limit is fitting 2 frames into 32K, assuming a model B, and it turns out 600x216 is better than 584x224 for 4:3 video because the Beeb's "square" pixels aren't square but slightly skinny, around 0.95:1. There's even plenty of cycles left for audio, but I haven't attempted that yet.

As this requires a custom emulator (or custom hardware, which is hopefully a discussion for later this thread :) here's a jsbeeb link: https://sphere.chronosempire.org.uk/~HEx/jsbeeb-bigrom/. Run with *FX142,4.

The bank-switching scheme I came up with was hooking A13 to the clock of a 4040 12-bit counter (via some kind of transparent latch gated by the chip select lines to avoid being thrown off by different devices being addressed?). This gives 26 address bits or 64Mbytes, which seems just about manageable for 3.5 minutes of video (currently using about half that), and an extremely simple bank switching procedure (read from an address in &8000-&9FFF, after having previously read from &A000-&BFFF). I'm not a hardware guy so I don't know whether this will work in the real world.

More links:
B-em diff: https://sphere.chronosempire.org.uk/~HEx/b-em-bigrom.diff
jsbeeb diff: https://sphere.chronosempire.org.uk/~HEx/jsbeeb-bigrom.diff
The ROM itself: https://sphere.chronosempire.org.uk/~HEx/jsbeeb-bigrom/roms/bigrom

I have lots of questions about various parts of this, but I'll see what people think of the idea first.

Tom.

User avatar
SimonSideburns
Posts: 251
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Video streaming from ROM

Postby SimonSideburns » Wed Mar 29, 2017 11:12 am

Neat. You might want to mention the emulator takes a few seconds to start up. (Well, I just did so that should be enough :-) )
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

hexwab
Posts: 23
Joined: Wed Jul 08, 2015 8:27 pm

Re: Video streaming from ROM

Postby hexwab » Wed Mar 29, 2017 11:55 am

SimonSideburns wrote:Neat. You might want to mention the emulator takes a few seconds to start up. (Well, I just did so that should be enough :-) )

It does. It has about 20 megabytes of data to fetch.


Return to “projects”

Who is online

Users browsing this forum: No registered users and 1 guest