Page 1 of 1

All Colors

Posted: Fri Jul 12, 2013 3:18 am
by fripperama
I developed, to train in the Genesis system, a program that shows all 512 Genesis colors, 64 simultaneously. After working for quite some time, I'm publishing it for the genny comunnity.

Built in the SGDK with the code for further studying, it is a good example to understand how to work with colors and palettes in Genesis.

Here is the zipped file:

Posted: Fri Jul 12, 2013 7:55 pm
by eteream

Posted: Sat Jul 13, 2013 2:17 pm
by fripperama
Thanks for the hint! :D

Yes, I've seen here and there that there are many ways to show more than 64 colors at the same time, but my aim here was:
- to understand how to work with colors
- to make a didactic example when working with the SGDK

Now, I can deep my knowledge working with other techniques to explore the capacities of the hardware.

Posted: Sun Jul 14, 2013 9:06 am
by Xynxyn
Highlight/shadow mode, ok you are right.
But there are 64/61*3=192/183 colors on MD with this mode. ;)

Posted: Sun Jul 14, 2013 3:08 pm
by TmEE co.(TM)
Shadow/Highlight has duplicate colors, so it won't be that high.

Posted: Sun Jul 14, 2013 9:39 pm
by Xynxyn
You're right. I always forget about that. Probably closer value is fripperama's one. (but fripperama said only about highlight, only lightening in the Higlight/Shadow mode will have less colors than 121 ;) )

Correction,... IT IS possible to make a 192/183 colors on MD. It's a very rare combintation of colors on palette, but it's possible to do it without repeating colors.

Posted: Mon Jul 15, 2013 4:38 am
by Chilly Willy
If you use DMA mode, you can show 512 colors. :D

Posted: Tue Jul 16, 2013 10:17 am
by LocalH
And if you use Charles MacDonald's test ROM (or the same method he used) you can show all "1536" colors including dupes :P

Don't guess it's possible with the direct color DMA "mode" to finagle in a way to work with S/H? I know that you can make S/H apply to backdrop pixels, but doesn't direct color disable the display so that you can spew the backdrop CRAM entry through DMA? Since disabling the display essentially extends the border to fill the whole screen, my guess is that S/H will never be possible with direct color unless one does it with the display on, which of course would very severely hamper horizontal resolution.

I wish it was possible to use DMA to spam the backdrop register (VDP$07 by the old nomenclature I used to use) itself, then one could get full 64-color bitmaps with sprites and tiles on top. I'm pretty sure that's impossible, though, since you can only have VDP RAM as the target of DMA, and VDP$07 is of course outside of VDP RAM, rather in the VDP itself. I know for a fact that VDP$07 is not privy to the same restrictions as VDP RAM access, from an unstable "raster split" proof-of-concept I coded years ago and subsequently lost in a drive crash. I explicitly left the display enabled and cleared all of VRAM, fed a palette into CRAM, waited until a scanline in the middle of the screen that I chose arbitrarily, and then simply wrote a tight loop that basically loaded the starting address in RAM of my color table as a byte value, wrote it to VDP$07, incremented the source address, and then looped until vblank. While it was indeed jittery as all hell since I wasn't synced to the beam, it was fairly obviously writing to VDP$07 outside of the slots.

Speaking of that, since it's been a while since I've paid attention to the techniques that have been developed, anyone care to share with me the basic method of beam synchronization, and whether or not it could be used to sync the 68k itself or just DMA? Since the invention of the direct color mode, I'd be interested to experiment and see if that same synch method could allow stable raster splits C64-style, with tiles and sprites on top (which is much more difficult to do on the C64 as sprites eat cycles from the CPU when they're merely present on a scanline, but this is not so on the Genesis for the most part from what I understand). I'm a bit rusty but wanting to get back into coding. Can't easily run code on a Genesis right now, still got my SMD setup but don't have a functional PC with LPT. Of course there's Exodus, but it doesn't run full frame rate on my PC.

Posted: Tue Jul 16, 2013 12:29 pm
by eteream