Palettemate / enhanced video ULA with 4096 colours

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
SteveF
Posts: 426
Joined: Fri Aug 28, 2015 8:34 pm

Re: Palettemate / enhanced video ULA with 4096 colours

Postby SteveF » Sun Jul 23, 2017 3:18 pm

Thanks Rob. I wouldn't mind if there was a non-standard way of determining that the machine is in a VideoNULA mode, as long as it was a standard non-standard way, so to speak.

I'd be happy to peek at &3A3 if you were willing to document that as part of your API, but the problem is that on a machine not using the VideoNULA support ROM the value there could be some random junk at that address which happens to be a VideoNULA mode number.

If returning the new mode numbers from OSBYTE &87 could be made to work without breaking anything that would be great, but I think otherwise a pretty good option would be to support a new OSBYTE which my code could call first, and if that call fails I know VideoNULA isn't present (or at least the support ROM is missing, which I'd probably regard as the same thing) and fall back to OSBYTE &87.

dominicbeesley
Posts: 367
Joined: Tue Apr 30, 2013 11:16 am

Re: Palettemate / enhanced video ULA with 4096 colours

Postby dominicbeesley » Sun Jul 23, 2017 4:26 pm

I'm glad you pointed out the terminal emulator thing...I'd just started work on that now I can let you do it! I'll have to think of something else to do...

BBCB+64K
Posts: 221
Joined: Mon Mar 22, 2010 9:51 pm
Location: North Norfolk

Re: Palettemate / enhanced video ULA with 4096 colours

Postby BBCB+64K » Sun Jul 23, 2017 8:18 pm

I can erase and re-program EPROMs as well, so when a new ROM image is ready I can re-program it.

Steve
My current setup...

BBC B+ 128k with external DataCentre with 2GB CF Card, 64MB ARM7TDMI Co-Processor and BeebOPL.

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

Re: Palettemate / enhanced video ULA with 4096 colours

Postby Elminster » Sun Jul 23, 2017 8:53 pm

RobC wrote:&355 contains 0 and not 101 as you might expect. This is so that things expect the right screen mode size rather than doing 101 AND 7 and thinking that we're in mode 5! I could set it to the attribute mode number but I'm not exactly sure how many other calls I'd need to wrap. (It's probably easy enough to work out for OS1.2 but the disassemblies for 2.0, 3.20 etc. aren't as clear.)


I shall be badgering Steve for VideoNula support on STEM but as I use STEM for hardware that only runs on a Master then for me 3.2/3.5 is the most important. Just declaring my interest there :)

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

Re: Palettemate / enhanced video ULA with 4096 colours

Postby Elminster » Sun Jul 23, 2017 8:56 pm

dominicbeesley wrote:I'm glad you pointed out the terminal emulator thing...I'd just started work on that now I can let you do it! I'll have to think of something else to do...


Depends what you are doing, I am fairly sure for example that Steve's STEM wont work with a serial terminal program (I am sure I read that in one of the threads somewhere), but I could be wrong.

RobC
Posts: 1642
Joined: Sat Sep 01, 2007 9:41 pm

Re: Palettemate / enhanced video ULA with 4096 colours

Postby RobC » Mon Jul 24, 2017 4:40 pm

Here's the updated support disk image with the updated ROM (file 'VNULA', v1.01).

This adds:

- Support for OSBYTE &85 in attribute modes (so that HIMEM is set correctly)
- Support for OSBYTE &87 in attribute modes so that the character and correct mode number (in range 96-104) are returned
- Fixes the Palette utility so that it works under BASIC on a co-pro (no direct pokes to 0xFE23)
- Fixes the Palette utility so that keys work whether CAPS-lock is on or off
- Soft-Break correctly exits from attribute modes with and without co-pro turned on

I believe I've mailed everyone who was sent an EPROM containing v1.00 but, if I've inadvertently missed you and you need me to burn you an new EPROM, just let me know.
Attachments
VideoNuLA.zip
Updated VideoNuLA support disk image
(8.63 KiB) Downloaded 21 times

SteveF
Posts: 426
Joined: Fri Aug 28, 2015 8:34 pm

Re: Palettemate / enhanced video ULA with 4096 colours

Postby SteveF » Mon Jul 24, 2017 8:15 pm

Thanks Rob. I've downloaded that and had a poke around in BeebEm and there's an ultra-hacky prototype of a VideoNuLA-supporting STEM over in the relevant thread: viewtopic.php?f=2&t=10534&p=176062#p176062 I hope people don't mind me posting here in an attempt to get someone to test it for me. :-)

User avatar
tricky
Posts: 1774
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby tricky » Tue Jul 25, 2017 6:28 am

RobC, are you saying that if your ROM is present, &3A3 will *always* contain the last "legally" set mode?

RobC
Posts: 1642
Joined: Sat Sep 01, 2007 9:41 pm

Re: Palettemate / enhanced video ULA with 4096 colours

Postby RobC » Tue Jul 25, 2017 7:08 am

tricky wrote:RobC, are you saying that if your ROM is present, &3A3 will *always* contain the last "legally" set mode?

No - the VDU extensions are turned off by default so the ROM doesn't use this address on power-up.

When the VDU extensions have been turned on (*VNVDU ON), the ROM uses a few bytes of RAM to store some flags and old vectors. I've used the bytes listed as "unused" in the &39F-&3A6 range from JGH's "AllMem" document as I didn't want to have to increase PAGE:
http://mdfs.net/Docs/Comp/BBC/AllMem

My idea was to give some support for attribute modes (COLOUR, MODE, VDU 19, narrow font, cursor editing) for those who wanted to use them in BASIC rather than having to resort to writing to the registers directly.

Of course, if you want, there's nothing to stop you using attribute modes from your own code without relying on my extensions.

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

Re: Palettemate / enhanced video ULA with 4096 colours

Postby Elminster » Tue Jul 25, 2017 7:15 am

My one issue so far is fixed by new ROM (just srloaded currently)

boot_post.png
(27.57 KiB) Not downloaded yet

stem_nula_help.png

Nula_Palette_fixed_1.png

BBCB+64K
Posts: 221
Joined: Mon Mar 22, 2010 9:51 pm
Location: North Norfolk

Re: Palettemate / enhanced video ULA with 4096 colours

Postby BBCB+64K » Tue Jul 25, 2017 3:55 pm

Here's my B+128k...

WP_20170725_15_54_45_Pro.jpg


Looks like the VideoULA is soldered directly to the board, so I had to order some more tips for the Solder Station N78AR so my Brother can desolder the chip.

Steve
My current setup...

BBC B+ 128k with external DataCentre with 2GB CF Card, 64MB ARM7TDMI Co-Processor and BeebOPL.

User avatar
CharlesMouse
Posts: 115
Joined: Sat Jul 24, 2010 10:59 am
Location: Nowhere
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby CharlesMouse » Tue Jul 25, 2017 4:18 pm

Hello again.
So excited by this, my thanks again for all your hard work Rob.

Um, brace yourself for an utterly unreasonable request:
Any room to implement a hardware blitter / rasterizer? (hooked in to the relevant Plot commands would be nice too)

I know, I know...
Charlie.

Are you pondering what I'm pondering? The Qube RiscOS Server

User avatar
Rich Talbot-Watkins
Posts: 1049
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: Palettemate / enhanced video ULA with 4096 colours

Postby Rich Talbot-Watkins » Tue Jul 25, 2017 4:53 pm

We went over that idea a while back. There are two main problems:

1) we don't have the VSync/HSync signals, nor any of the CRTC register values, so we can't really a get a sense of whereabouts in the screen we're rasterising.

2) the CRTC model doesn't really work well with hardware sprites / blitter. It generates the addresses for the video hardware to fetch. In order for this to work, we'd need to replace both the CRTC and the Video ULA with one piece of combined hardware (like the CPC+ did for its hardware sprite support). In addition, to support masked sprites would require video data reads at 4MHz (to combine screen data and sprite data) which isn't feasible with the hardware, or a block of private video memory on its own bus, which sounds complicated!

User avatar
CharlesMouse
Posts: 115
Joined: Sat Jul 24, 2010 10:59 am
Location: Nowhere
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby CharlesMouse » Wed Jul 26, 2017 11:34 am

:) Thanks for that. I should have read the thread more carefully.

Um, if I may ask one more (probably stupid) question?
I think I see from your explanation why 'proper' blitting/sprites isn't going to fly. I have to admit what I had in mind was less ambitious:
Plot 85 (I think), fills an area of screen (memory) with a triangle, later versions of Basic can do a simple flood-fill...
...if that task could be handled by an upgraded Video ULA rather than the CPU you'd have an essentially free polygon fill, bandwidth allowing. If that hardware capability could do a pattern-copy from another part of memory there would be the option to do more than simple blocks of colour.
Of course I've probably missed an essential 'gotcha' or two.

Elite with filled (textured) polys..? Just thinking aloud, I promise not to fill this thread with any more nonsense.

*Edit*
Best not to clog the thread up with any more daft questions... Many thanks for the patient replies.
Just to restate I think this project is utterly fantastic, and my sincere thanks to Rob and other contributors.
I do hope my questions won't be taken for anything other than over-excitement.
Last edited by CharlesMouse on Thu Jul 27, 2017 9:01 am, edited 1 time in total.
Charlie.

Are you pondering what I'm pondering? The Qube RiscOS Server

User avatar
1024MAK
Posts: 6587
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Palettemate / enhanced video ULA with 4096 colours

Postby 1024MAK » Wed Jul 26, 2017 1:11 pm

The video ULA / video processor has no direct address access to the RAM where the display data is stored. If you look at the circuit diagram (schematic) you can see that it only has a singe address line. Normally it just receives data from the RAM, as it is the 6845 that handles all the address and timing functions needed to generate a display. The video ULA / video processor then acts on data that is sent to it via it's data bus connections. It then uses it's internal palette memory to look up and convert the data to RGB values, which it outputs to the outside world.

So unless it copies all the data for the screen in a new separate frame buffer, it cannot do what you wish it to do. And even then, because it knows nothing about timing, it would not have any idea of where the top left of the display is, let alone anything else that is timing related.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
BigEd
Posts: 1348
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby BigEd » Wed Jul 26, 2017 1:15 pm

What does the ULA see by way of pixel values when the beam is outside the visible display? I'm wondering if a fancy digital PLL could find its way to the vertical blank by watching the video.

User avatar
1024MAK
Posts: 6587
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Palettemate / enhanced video ULA with 4096 colours

Postby 1024MAK » Wed Jul 26, 2017 1:24 pm

BigEd wrote:What does the ULA see by way of pixel values when the beam is outside the visible display? I'm wondering if a fancy digital PLL could find its way to the vertical blank by watching the video.

It sees every data byte to/from the RAM. But it does not have any context on which address this data relates to, or even if it is a read or a write. It generates the clock for the 6845 and receives the display enable signal from the 6845. This is how it knows when to sample the data bus for screen data. But during the non-visible part of the display, display enable is not active...

Rob may know more, or may be able to explain it better..

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
tricky
Posts: 1774
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby tricky » Wed Jul 26, 2017 1:54 pm

I'm pretty sure we concluded many pages back that you could do sprites inside the ula with their coordinates specified in display disable->enable count since the last big disable and clicks since the last disable->enable.
The problems were, that no software would currently support it and that you would need a device more like the Matchbox copro to store and process the data.
All sprite data would have to be uploaded. A similar method could be used to do what you are suggesting, but you would have a similar problem with support and the CPU could not get at the data if it wanted to.
Thinking about it, a quick easy to upload would be to put your data on screen and tell the ula to "capture" it. But it still wouldn't be a beeb.

User avatar
tricky
Posts: 1774
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby tricky » Wed Jul 26, 2017 1:58 pm

PS if you wanted to do sprites, you could do something similar to of arcade games, but instead of stealing two character rows, you could tell the ula that it was in sprite mode and it could steal the first scan line and read it as data.

User avatar
Rich Talbot-Watkins
Posts: 1049
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: Palettemate / enhanced video ULA with 4096 colours

Postby Rich Talbot-Watkins » Wed Jul 26, 2017 5:38 pm

BigEd wrote:What does the ULA see by way of pixel values when the beam is outside the visible display? I'm wondering if a fancy digital PLL could find its way to the vertical blank by watching the video.

The CRTC keeps generating valid addresses even during display blanking, so I assume that's what the ULA will get on the data bus. In this case, I believe the CRTC stops auto-incrementing MA0...MA7, so it'll just hold the address of the character to the right of the last displayed one (i.e. the first character it would display on the next row). Nothing there you could use to analyse the video signal, unfortunately. The only cue VideoNuLA has is the DISEN signal (which doesn't necessarily even define the screen area, as it can be controlled by CRTC R8 at any point in the screen refresh, plus also gives rise to the gaps in the 'gap modes').

User avatar
kieranhj
Posts: 452
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK

Re: Palettemate / enhanced video ULA with 4096 colours

Postby kieranhj » Wed Jul 26, 2017 10:27 pm

I'd still love a proper character mapped display but I guess that would mean uploading the e.g. 256 character definitions (256 x 8b = 2kb) to be stored on board the NULA. We could then use the MODE 7 style linear addressing to have a 1kb mode that doesn't just repeat the same bit pattern on each scanline as these could be fed from the internal NULA character cache, cf. how SAA5050 does for Teletext. There's still the question of attributes per character cell as well, of course, which is what the VIC chip has I believe.

User avatar
tricky
Posts: 1774
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby tricky » Thu Jul 27, 2017 5:04 am

If your adding more space to the NuLA, you could run in any mode and have the character definitions, character screen and attribute screen all just displayed for the NuLA+ to scrape each frame.

RobC
Posts: 1642
Joined: Sat Sep 01, 2007 9:41 pm

Re: Palettemate / enhanced video ULA with 4096 colours

Postby RobC » Thu Jul 27, 2017 9:17 am

tricky wrote:If your adding more space to the NuLA, you could run in any mode and have the character definitions, character screen and attribute screen all just displayed for the NuLA+ to scrape each frame.

There's not really enough space in the current device for any other significant features (apart from possibly an extra attribute mode). I initially sized it just to do the enhanced palette and 16 colours - the scrolling and attribute modes fit because I allowed some headroom.

I do have another dev board that might be a good candidate to use for a NULA+ but it's really not something I'm looking to do at the moment. (When I suggested using a bigger device and adding various extra features at one of the shows, the consensus seemed to be that such a device would be going to far and would make the machine un-Beeb like.)

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

Re: Palettemate / enhanced video ULA with 4096 colours

Postby Elminster » Thu Jul 27, 2017 9:23 am

As you get a million requests for new features, and some duplicates, would it be worth putting a table somewhere with all the features requested. How practical they are i.e. easy, need bigger CPLD, impossible etc. People could then vote on certain features so you knew what was the next most desirable feature for inclusion in VideoNULA 2 (+1 Electron support with Mode 7 built in ...........)

User avatar
tricky
Posts: 1774
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby tricky » Thu Jul 27, 2017 9:50 am

Mine wasn't a request, just more non-beeb stuff that could be done.
If you are making a table ;) did anyone mention hdmi, not beeb like, but at least it wouldn't require any changes in the beeb software.
And in fact, anything that can just scrape is data from the screen without having to know if there was a write, just what the data is.

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

Re: Palettemate / enhanced video ULA with 4096 colours

Postby Elminster » Thu Jul 27, 2017 9:55 am

I volunteer Rob or at least someone who understand what you are all talking about :)

User avatar
1024MAK
Posts: 6587
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Palettemate / enhanced video ULA with 4096 colours

Postby 1024MAK » Thu Jul 27, 2017 11:53 am

RobC wrote:When I suggested using a bigger device and adding various extra features at one of the shows, the consensus seemed to be that such a device would be going to far and would make the machine un-Beeb like.
I agree with this :D
It's all very well everyone jumping in with suggestions, but Rob had to decide where to draw the line. I think he got it right.
If you want HDMI, use a SCART to HDMI converter. I tested one with a Beeb and a Master, and it works fine 8)

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
tricky
Posts: 1774
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Palettemate / enhanced video ULA with 4096 colours

Postby tricky » Thu Jul 27, 2017 1:00 pm

hdmi wasn't a request either.
I agree, what we have is great, new colours for everything and an attribute mode that is well integrated and seems easy to use.
The scrolling is a bonus, and may even lead to new software.
I don't think I have said this enough: Well done Rob.

RobC
Posts: 1642
Joined: Sat Sep 01, 2007 9:41 pm

Re: Palettemate / enhanced video ULA with 4096 colours

Postby RobC » Thu Jul 27, 2017 1:28 pm

tricky wrote:I don't think I have said this enough: Well done Rob.

Thanks. And I wouldn't want anyone to think I'm in any way offended by suggestions of additions. I just wanted to explain why I chose the device I did. As I've said before, I am incredibly grateful for all the encouragement and help I've been given by forum members.

I am happy to keep a list of feature requests but I can't promise I'll do anything with them (at least not in the near future). I've got too many other projects that I need to finish before I start another one!

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

Re: Palettemate / enhanced video ULA with 4096 colours

Postby Elminster » Thu Jul 27, 2017 1:43 pm

RobC wrote:
tricky wrote:I don't think I have said this enough: Well done Rob.

I am happy to keep a list of feature requests but I can't promise I'll do anything with them (at least not in the near future). I've got too many other projects that I need to finish before I start another one!


Hear, hear.

You need one of those sleep machines from Judge Dredd. Although they potentially have a slight side effect

To maximise a Judges' effectiveness sleep machines are used to reduce the amount of time spent sleeping. In recent years concern has been expressed about their use. Regulations require judges to get natural sleep periodically to prevent psychosis.


Return to “hardware”

Who is online

Users browsing this forum: No registered users and 6 guests