MEGA65 Links

Friday, January 31, 2014

256-colour modes now mostly working

The past few days I have been fixing some bugs in the VIC-IV character generator that were causing various glitches. Today I got the last of the important ones fixed, and so now when the C65GS boots, it looks just like a real C64:

I also had time to finish implementing the palette. The palette is mostly like on the Commodore 65, with $D1xx holding the red component, $D2xx the green and $D3xx the blue components. These are 8-bit registers, in principle allowing for 24-bit colour, but for now the simple VGA output I am using is limited to 12-bit colour. I have plans to make an HDMI out that would have 24 colour digitally. Here is what happens when you run: LDA $D012; STA $D020; JMP *-6, you get nice beautiful solid raster bars with the default palette (which is 128 colours repeated twice).

$D012 is the VIC-II compatibility raster counter, so it is counting every 5th raster. If we use $D052 instead, we get the physical raster counter, which means the raster bars get much, much finer:

You really need to see a zoomed detail to see just how fine they are:

With these various other bugs and problems fixed, I was also able to test fullcolour character mode. This tells the VIC-IV to use 64 bytes for each character instead of 8, and each byte is the colour value for a single pixel of the character. Just flip bit 1 in $D054 on and it is engaged for all characters. The display then changed to the following, showing the 1970s carpet stripe pattern from the default contents of RAM, as well as some horizontal gradient I POKEd in, just because I could.

Here is the same thing with the resolution increased from 320x200 to 800x500 using the hardware scale registers ($D042, $D043). It is really 960x600 resolution if you used the border area, which is easy to do.

What is not apparent in the above is that I have also implemented four palette banks, so there is really a 1,024 colour palette available. I will most likely make it possible to use a different palette bank for background and sprites at the same time.

Finally, here is the hardware and the monitor together, before the FPGA board gets put inside a C64 case and uses a real C64 keyboard for interaction. There will still be plenty more to do before the FPGA design is complete, including of course sound and sprites.

No comments:

Post a Comment

About Me

Dr.
Paul Gardner-Stephen has had an interest in making computers do things
hey weren't designed to do reaching back to his school years, including helping to write LUnix, a UNIX-like preemptively multi-tasking operating system for the Commodore 64 computer.

At age
17 he had written software in assembly code to control a 30' industrial roll-former for export to Brazil before moving on create software to use PCs as hard-drives for 8-bit
computers. This software was sold on three continents and resulted in
Paul's first experience with mobile telecommunications in the form of
an NEC P3 analog cell phone in 1995.

Soon
after obtaining his doctoral degree Paul created the world's first
working and wearable shoe phone, and then made the necessary
arrangements to wear it aboard a commercial flight into US air space in
the post 9-11 era to demonstrate the increasing ubiquity of wearable
computers, with a particular focus on wireless health applications.

Along
the way Paul has remained deeply involved with his local church and
supporting development and disaster response activities in a variety of
locations.

No longer content to participate remotely, he is passionate
about creating technology that can save and transform the lives of
millions.

This passion has expressed itself in founding The Serval Project, a not-for-profit organisation that has created the first practical mesh mobile telephony system. It uses off-the-shelf cell phones, and even lets you keep your existing phone number while making free calls on the mesh. The Serval Project has reached the prototype stage and is expected to be trialled in various locations from late 2011.