FPGAtom 64 colour

emulators, hardware and classic software for atom + system machines
User avatar
hoglet
Posts: 9376
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: FPGAtom 64 colour

Post by hoglet » Sat Dec 14, 2019 3:22 pm

roland wrote:
Sat Dec 14, 2019 3:13 pm
I agree, as I was struggling to find the right colours for my demo. Feel free to adjust and correct my code :)
OK, one more update pushed to the palette branch making these changes:
https://github.com/hoglet67/AtomFpga/commit/a79714ff

Also, I just remembered the GODIL has an 8-colour text mode (using the 6847 Semi-graphics 4 mode, which is normally inaccessible on the Atom).

If you load the COLOUR TEST 1 program from the archive and add:

Code: Select all

5 ?#BDE0=1
you should see a few more colours on the screen.

Dave

User avatar
oss003
Posts: 3322
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: FPGAtom 64 colour

Post by oss003 » Sat Dec 14, 2019 5:25 pm

Or Galaforce with a black background and Chuckie Egg in the right colours .....

galachuck.png

Greetings
Kees

User avatar
hoglet
Posts: 9376
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: FPGAtom 64 colour

Post by hoglet » Sat Dec 14, 2019 6:18 pm

oss003 wrote:
Sat Dec 14, 2019 5:25 pm
Or Galaforce with a black background and Chuckie Egg in the right colours .....
For Chuckie Egg you need:

Code: Select all

B=#B010;?B=#30;B?1=#30;B?6=#00;B?8=#CC
*MENU
And you get this:
IMG_1827.JPG
(The pink looks purple in real life!)

You could get the same effect on a real Atom with RGBtoHDMI, as that also allows the Palette to be redefined.

Dave

User avatar
oss003
Posts: 3322
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: FPGAtom 64 colour

Post by oss003 » Sat Dec 14, 2019 9:15 pm

Nice ....... =D>

Greetings
Kees

User avatar
roland
Posts: 3988
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: FPGAtom 64 colour

Post by roland » Sun Dec 15, 2019 2:02 pm

hoglet wrote:
Sat Dec 14, 2019 6:18 pm
For Chuckie Egg you need:
B=#B010;?B=#30;B?1=#30;B?6=#00;B?8=#CC
This looks really great :D
I only get a vertical green line on the left of my screen. I can remove it by shifting the screen two pixels to the left in my monitor settings :mrgreen:
hoglet wrote:
Sat Dec 14, 2019 6:18 pm
You could get the same effect on a real Atom with RGBtoHDMI, as that also allows the Palette to be redefined.
How do you set that up? Is that with the three buttons? I didn't build that board yet (I ran out of Pi Zero's :) )
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
hoglet
Posts: 9376
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: FPGAtom 64 colour

Post by hoglet » Sun Dec 15, 2019 2:20 pm

roland wrote:
Sun Dec 15, 2019 2:02 pm
How do you set that up? Is that with the three buttons? I didn't build that board yet (I ran out of Pi Zero's :) )
That's an interesting question....

There is a choice of built-in palettes, but these are hard-coded in the Pi software, so it requires some C tweaking and a recompile to add a new one.

IanB also added a "in-band palette" control channel to the Pi capture code, so in theory you can reprogram the palette by flashing up the right pixel pattern on the display for one frame.

I'm at a loose end this afternoon, so let me look into what's possible from the Atom.

Dave

User avatar
hoglet
Posts: 9376
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: FPGAtom 64 colour

Post by hoglet » Sun Dec 15, 2019 2:21 pm

Oh, and shall I merge the AtomFpga palette branch back into dev?

User avatar
roland
Posts: 3988
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: FPGAtom 64 colour

Post by roland » Tue Dec 17, 2019 4:15 pm

I think there is a small change in the colour palette to improve interoperability and compatibility with the normal Atom: changing the addresses of the registers.

I had picked #B01x because some other video controls are at #B00x so it seems logical to put the registers near that block. But writing to the palette registers will influence the settings of the 8255 on a normal Atom. So after all, #B01x is a bad idea. Moving the registers to an address range near the Godil address block (which is also logical) will not interfere with the Atom's addresses. Writing to a palette register is simply ignored (or useless) on a normal Atom but the programs will still work, albeit with a different colour set.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
roland
Posts: 3988
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: FPGAtom 64 colour

Post by roland » Sat Jan 04, 2020 9:00 pm

@Hoglet: did you already have a look to change the palette registers addresses ?

I also have another great idea: the Atom2k15 and other Godil based Atoms do not support 64 colours but the mapping of the four logical colours to four out of eight is still possible. That would make games like Chucky Egg and so to look more realistic. Also future games and programs can benefit from a configurable palette. For that purpose the registers will also have to be moved to another address space.

I know it is possible but I have no idea how to modify the VHDL of the Godil in a way it is still compatible with the FPGA based Atoms. Can you have a look at this when you have a bit spare time? As usual, no hurry.... :wink:
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
hoglet
Posts: 9376
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: FPGAtom 64 colour

Post by hoglet » Sun Jan 12, 2020 7:45 pm

roland wrote:
Sat Jan 04, 2020 9:00 pm
@Hoglet: did you already have a look to change the palette registers addresses ?
Sorry Roland, I overlooked this request.

Anyway, it's done now.

I chose #BD00 -#BD0F, as this is at the start of the 256b "GODIL" address space.

I've also just merged all the palette work back to the master branch.
roland wrote:
Sat Jan 04, 2020 9:00 pm
I also have another great idea: the Atom2k15 and other Godil based Atoms do not support 64 colours but the mapping of the four logical colours to four out of eight is still possible. That would make games like Chucky Egg and so to look more realistic. Also future games and programs can benefit from a configurable palette. For that purpose the registers will also have to be moved to another address space.

I know it is possible but I have no idea how to modify the VHDL of the Godil in a way it is still compatible with the FPGA based Atoms. Can you have a look at this when you have a bit spare time? As usual, no hurry.... :wink:
That is a nice idea :D

Just like AtomFpga_Atom2K18.vhd is specific to Atom 2K18 (and not used in any other builds), the same is true of TopRoland.vhd in AtomGodilVideo. i.e. this is only used on Atom2K15.

So this would be a sensible place to implement a similar palette. It could even use the same address range, and a compatible data format (just ignoring the output bits for R0 and B0). The implementation could probably just be borrowed from AtomFpga_Atom2K18.vhd.

In fact, I just had to have a go at this.

It really was mostly just cut-and-paste with a few signal names changed:
https://github.com/hoglet67/AtomGodilVi ... d0eeea?w=1

There's a new .bit file checked in to the root directory (TopRoland.bit)
https://github.com/hoglet67/AtomGodilVi ... Roland.bit

It seems to work, though I have not extensively tested it.

Dave

P.S. After having done this, I did wonder whether we should have implemented the palette in AtomGodilVideo all along. Then it would be available to all of the derivative works.

User avatar
roland
Posts: 3988
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: FPGAtom 64 colour

Post by roland » Sun Jan 12, 2020 8:00 pm

hoglet wrote:
Sun Jan 12, 2020 7:45 pm
Anyway, it's done now.
I chose #BD00 -#BD0F, as this is at the start of the 256b "GODIL" address space.
Thank you. I will update my FPGA next weekend .... I'm quite busy this week.
hoglet wrote:
Sun Jan 12, 2020 7:45 pm
There's a new .bit file checked in to the root directory (TopRoland.bit)
https://github.com/hoglet67/AtomGodilVi ... Roland.bit
It seems to work, though I have not extensively tested it.
I will update my Atom2k15 and test it also.
hoglet wrote:
Sun Jan 12, 2020 7:45 pm
P.S. After having done this, I did wonder whether we should have implemented the palette in AtomGodilVideo all along. Then it would be available to all of the derivative works.
I think that is because Kees came up with the idea when I started to design the Atom 2k18. He asked to add a few extra outputs so we could use 4-out-of-64 colours. Anyway ... I have something to look forward this week :lol:
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
fordp
Posts: 1097
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: FPGAtom 64 colour

Post by fordp » Mon Jan 13, 2020 1:46 pm

roland wrote:
Sun Jan 12, 2020 8:00 pm
I think that is because Kees came up with the idea when I started to design the Atom 2k18. He asked to add a few extra outputs so we could use 4-out-of-64 colours. Anyway ... I have something to look forward this week :lol:
I have a recollection that two bits per colour was my idea. I must admit is was more intended for BBC B and Master running on this board!
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

User avatar
roland
Posts: 3988
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: FPGAtom 64 colour

Post by roland » Mon Jan 13, 2020 2:31 pm

I don't really know who came up first with the idea .... I only saw it here: viewtopic.php?f=44&t=15197&start=60#p229031
However, perhaps Kees based this post on your idea. When did you post it ... then an independent Judge (Beeb) can give a verdict who was the first one with this idea and get all the credits :lol:
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
hoglet
Posts: 9376
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: FPGAtom 64 colour

Post by hoglet » Mon Jan 13, 2020 3:37 pm

A little bit of history...

The current version of Atom FPGA was started by Alan Daly in 2009. It used an Olimex Mod VGA board:
https://www.olimex.com/Products/Modules ... e-hardware

The Olimex board was designed as an open source implementation of the GameDuino FPGA-based graphics card. It uses a standard VGA connector, and allows 3-bits of Red, Green and Blue (so 9 bits in total).

Because of this, Alan's design used three bit colours.
https://github.com/hoglet67/AtomFpga/bl ... ic_top.vhd

The current AtomFpga_Core is a direct descendent of this, and has carried forward the idea of using 3-bit colour values internally:
https://github.com/hoglet67/AtomFpga/bl ... a_Core.vhd

Each FPGA Board wrapper then maps these 3-bit colour values to whatever the FPGA Board actually supports.

So I would say the idea of an Atom with multi-bit RGB at least dates back to Alan's work.

In fact, it likely goes back even further than this.

The earliest Atom FPGA implementation I'm aware of was created by Keith Howell, who is no longer active in the retro scene (as far as I'm aware). He called this "the PolyMorph" because the same hardware could imlement several machines.

His Atom design was never published, but it did exist, and it's well documented here:
http://members.casema.nl/hhaydn/howel/l ... roject.htm

This actually had a programmable palette (in the FPGA) and used three TDA8702 8-bit video DACs.

Keith did this in ~2003

Archive.org has some captures of his original website:
https://web.archive.org/web/*/http://ww ... roject.htm

So the earliest mention of a Atom with a programmable palette is Feb 3rd 2004.

Edit: Or is it....
Here's an article from 1994 written by Roland:
http://www.acornatom.nl/atom_nieuws/199 ... 942035.htm

As far as I can see, this this is giving an Atom (in PC) a palette with 2-bit RGB (64 colour) using PC's the EGA/VGA card.

Dave

User avatar
roland
Posts: 3988
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: FPGAtom 64 colour

Post by roland » Mon Jan 13, 2020 4:47 pm

hoglet wrote:
Mon Jan 13, 2020 3:37 pm
A little bit of history...
Here's an article from 1994 written by Roland:
http://www.acornatom.nl/atom_nieuws/199 ... 942035.htm
As far as I can see, this this is giving an Atom (in PC) a palette with 2-bit RGB (64 colour) using PC's the EGA/VGA card.
Cool that you have found this article :lol: It's good that you teach us a lesson in history. The Judge can use this in his judgement :mrgreen:
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
roland
Posts: 3988
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: FPGAtom 64 colour

Post by roland » Mon Jan 13, 2020 10:25 pm

roland wrote:
Sun Jan 12, 2020 8:00 pm
Thank you. I will update my FPGA next weekend .... I'm quite busy this week.
I will update my Atom2k15 and test it also.
I couldn't wait until next weekend and this evening I had a little spare time so I updated my three Atoms. It works fine; I could not find any errors or misbehaviour.

Can you and Kees work out a way to start Chuckie Egg, and maybe other games, in another colour setting? That can be achieved in the sources (so Kees has to modify them a little bit) or by adding a pre-loader that sets the correct colour before starting the game, which requires a change in the menu.

A very versatile way is to add a small colour.cfg file in each directory where you want to change the colours and the menu should look for this file. If it exists it loads those data directly into #BD00 and then starts the game. That way everybody can assign a favourite colour set to every game.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
hoglet
Posts: 9376
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: FPGAtom 64 colour

Post by hoglet » Mon Jan 13, 2020 10:40 pm

Glad it's all working for you - I didn't actually do much testing.
roland wrote:
Mon Jan 13, 2020 10:25 pm
Can you and Kees work out a way to start Chuckie Egg, and maybe other games, in another colour setting? That can be achieved in the sources (so Kees has to modify them a little bit) or by adding a pre-loader that sets the correct colour before starting the game, which requires a change in the menu.
People may not have the same definition of "Correct"..

Instead of modifying each game, a simpler way might be to just write a "Palette Manager" program that supports:
- loading of palettes
- editing of palettes
- saving of palettes
- re-loading the menu without pressing break

BTW, the Chuckie Egg palette is:

Code: Select all

P=#BD00;?P=#30;P?1=#30;P?6=#00;P?8=#CC
*MENU
Dave

User avatar
roland
Posts: 3988
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: FPGAtom 64 colour

Post by roland » Tue Jan 14, 2020 10:04 pm

hoglet wrote:
Mon Jan 13, 2020 10:40 pm
People may not have the same definition of "Correct"..
Maybe "Correct" is not the correct word; preferred or favourite might be better.
hoglet wrote:
Mon Jan 13, 2020 10:40 pm
Instead of modifying each game, a simpler way might be to just write a "Palette Manager" program that supports:
- loading of palettes
- editing of palettes
- saving of palettes
- re-loading the menu without pressing break
I don't understand the last feature. Does that mean you have to reload the palette every time before you run a game? IMHO it is easier to write the colours to colour.cfg in the game's directory and load that before loading and starting the game. That way you don't need to modify the game itself and switching colours is automatically executed.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

Post Reply

Return to “acorn atom and acorn system series”