Going beyond 256 colours

38 views
Skip to first unread message

Daniel England

unread,
Feb 7, 2018, 1:58:06 PM2/7/18
to MEGA65 Development
Heyas!

I've finally sorted out the problems I was having with palette banks (thanks again to Paul for his help) and so I'm able to release another demo.

This time, I'm loading multiple images into memory, using only the first for screen RAM and colour RAM and the others for tile data and palette data.  The palette data is being loaded into different banks for each image.

Once loaded, I'm using a raster interrupt to change the palette banks.  Doing this allows for up to 1024 colours on the screen but could easily be changed, as Paul has suggested, to do more by actually modifying the palette data on the fly and overlaying with sprites.

This particular test only shows some 384 colours on the screen because it is rather simple.  It also has a few issues...  

Firstly, the first image block (red through green at the top) looks a bit strange probably because of the settings I used to convert it.  Sorry about that.

Secondly, the third image block (cyan through blue below the centre of the screen) shows three black pixels.  I'm unsure why that is at the moment.

Anyhow, I hope you like it.  You will need a recent bitstream for this one.

I still can't quite release the source code for it all because there is one more outstanding issue.  I'm trying to squeeze out as much memory as possible for the tile data.  I'm trying to get another 16kB or so for the tiles (another 256 tiles) by using a relocation section and allowing the C65 ROM area ($020000-$030000) to be overwritten (you'd need to take certain precautions when doing this).  It isn't working at the moment and Paul is helping me with it.

Once this works, I will be free to share the source code.


Daniel.
IMGMULTI.zip

Daniel England

unread,
Feb 7, 2018, 5:21:37 PM2/7/18
to MEGA65 Development
Heyas again!

Well, I must confess that I was quite disappointed with the overall result of the last demo so I put some more effort in and produced something better.  It came a lot easier this time because I knew how to put it together after the last one.

This one does 1021 unique colours on screen (as far as I know, I should double check).

There is a bit of a problem with this one though which must have been there in the last one too...  It seems that the palette is not actually changed until the end of the raster line (or possibly the very beginning which I'm unable to capture).  I think this is because there is some buffering done in the VIC-IV.  At least, that's what I assume after what I've read and been able to understand of the VHDL.

I will need to confer with Paul about how best to work around this.  I tried simply changing the palette on the raster before but that didn't work.  I'm betting that I'll need to wait until in the right hand border of the raster line before the change because I doubt he will be able to alter the way the palette is updated.  I'm just a little uncertain as to how I will do this at the moment.

I've also added some music...  A piece called "Bubble" by Michael Kugel.

Please enjoy!


Daniel.
GRADIENT.zip

Paul Gardner-Stephen

unread,
Feb 7, 2018, 5:52:11 PM2/7/18
to Daniel England, MEGA65 Development
Hello,

Which palette is used is set when the raster line buffer is populated, which happens one raster line before the raster line is output.  That is, which palette to use is locked in as the raster buffer is populated.  I might change that to make the decision happen later in the video pipeline. 

Also, I am in the process of making the screen RAM lists slightly programmable, which would allow for selection of the palette to use for each 8x8 tile among other things.  This will give a much more flexible result, and save having to have raster splits to get >256 colours per screen, i.e. each 8x8 tile will be able to have 64 different colours from one palette bank of 256 colours.

Paul.


--
You received this message because you are subscribed to the Google Groups "MEGA65 Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-development+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Daniel England

unread,
Feb 7, 2018, 6:10:31 PM2/7/18
to MEGA65 Development
Yes, that would fit with what I'm seeing.

In any case, I have it working now.  It took a bit of effort to get the timing right but it was fun.


Daniel.
GRADIENT.zip

adtbm

unread,
Feb 7, 2018, 6:42:23 PM2/7/18
to MEGA65 Development
Hi Daniel,

the demo looks cool in on my Nexys4. even in 12 bit, it is amazing to see the crsip colors !

Nice job !
Reply all
Reply to author
Forward
0 new messages