CRAM color palette dots option

Peredonov
Posts: 10
Joined: Wed May 27, 2020 4:04 pm
Has thanked: 2 times
Been thanked: 1 time

CRAM color palette dots option

Unread post by Peredonov »

Apologies if this has been discussed and settled already, but I was wondering if devs have considered enabling to display the CRAM color dots, which usually appear on the lower overscan area during some game scenes.

An example: https://i.redd.it/ym39kqd6v8d01.jpg

This is probably the only thing the Genesis core is missing to really make you feel like you are really playing a Genesis/MD :D . Would really like to see it as a user selectable option. The Mega Sg for instance had it added as an option in a firmware update.
retrorepair
Posts: 247
Joined: Sun May 24, 2020 9:06 pm
Has thanked: 47 times
Been thanked: 11 times

Re: CRAM color palette dots option

Unread post by retrorepair »

I'd like to see this too. Aren't these manipulated by certain demos for drawing to the screen without using sprites?
retrorepair
Posts: 247
Joined: Sun May 24, 2020 9:06 pm
Has thanked: 47 times
Been thanked: 11 times

Re: CRAM color palette dots option

Unread post by retrorepair »

I'm interested actually how the core doesn't do this currently.

From my understanding they are the result of DMA access from the 68k which lots of games use. Are they masked at the moment?
paulbnl
Posts: 75
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 6 times
Been thanked: 16 times

Re: CRAM color palette dots option

Unread post by paulbnl »

The dots are caused by writing to CRAM while the VDP is reading from it. Most likely a real console uses a single data bus for reading and writing so it will read the value being written instead of the value in CRAM. The core uses dual port ram so it can read and write simultaneously.

It is a minor change to add CRAM dots: https://github.com/MiSTer-devel/Genesis ... cdba4d6379

As far as I know demos would write to the background color so it would work even if CRAM dots are not visible. CRAM dots appear only every other pixel so by writing to the background color you get CRAM dot->BG->CRAM dot->BG. This results in double sized pixels horizontally.
Shaneus
Posts: 19
Joined: Mon May 25, 2020 6:56 am

Re: CRAM color palette dots option

Unread post by Shaneus »

Very cool, to be honest I'm surprised it was so simple!
retrorepair
Posts: 247
Joined: Sun May 24, 2020 9:06 pm
Has thanked: 47 times
Been thanked: 11 times

Re: CRAM color palette dots option

Unread post by retrorepair »

Awesome!

I think the only thing really left to add would be the debug register (really I think only for Titan 2, though I think the boarder thing sort of works anyway?) and the TMSS BIOS loading.
retrorepair
Posts: 247
Joined: Sun May 24, 2020 9:06 pm
Has thanked: 47 times
Been thanked: 11 times

Re: CRAM color palette dots option

Unread post by retrorepair »

paulbnl wrote: Fri Dec 18, 2020 11:50 am The dots are caused by writing to CRAM while the VDP is reading from it. Most likely a real console uses a single data bus for reading and writing so it will read the value being written instead of the value in CRAM. The core uses dual port ram so it can read and write simultaneously.

It is a minor change to add CRAM dots: https://github.com/MiSTer-devel/Genesis ... cdba4d6379

As far as I know demos would write to the background color so it would work even if CRAM dots are not visible. CRAM dots appear only every other pixel so by writing to the background color you get CRAM dot->BG->CRAM dot->BG. This results in double sized pixels horizontally.
Hmm, the dots are present but they aren't in the border/overscan area. Is the border generated differently in MiSTer?
retrorepair
Posts: 247
Joined: Sun May 24, 2020 9:06 pm
Has thanked: 47 times
Been thanked: 11 times

Re: CRAM color palette dots option

Unread post by retrorepair »

Actually, it seems another time they are displayed (probably what I'm thinking of) is when the pallet changes in VBL:

https://segaretro.org/Sega_Mega_Drive/P ... #CRAM_dots
paulbnl
Posts: 75
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 6 times
Been thanked: 16 times

Re: CRAM color palette dots option

Unread post by paulbnl »

Did you forget to enable the border? Because here there's a disco party in the Sonic border. :P
retrorepair
Posts: 247
Joined: Sun May 24, 2020 9:06 pm
Has thanked: 47 times
Been thanked: 11 times

Re: CRAM color palette dots option

Unread post by retrorepair »

paulbnl wrote: Fri Dec 18, 2020 8:46 pm Did you forget to enable the border? Because here there's a disco party in the Sonic border. :P
That's what I get for building a source I've been messing with, works now :)

I think if the TMSS BIOS was an option this would be the most accurate megadrive reproduction around!
Attachments
IMG_20201218_222937_HDR.jpg
IMG_20201218_222937_HDR.jpg (2.96 MiB) Viewed 1553 times
Peredonov
Posts: 10
Joined: Wed May 27, 2020 4:04 pm
Has thanked: 2 times
Been thanked: 1 time

Re: CRAM color palette dots option

Unread post by Peredonov »

Thank you so much paulbnl for answering my prayers!

Could you (or retrorepair) please attach a build with this option incorporated? Not sure when a public release will be updated next. Or if you can point me to instructions on compiling the .rbf myself I can try to do so.

Again, thank you!!
paulbnl
Posts: 75
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 6 times
Been thanked: 16 times

Re: CRAM color palette dots option

Unread post by paulbnl »

Howto build:

https://fpgasoftware.intel.com/17.0/?ed ... rm=windows
1. Download Quartus Prime Lite 17.0 -> Individual Files -> Quartus Prime Lite + Cyclone V device support
2. Download Gameboy Github repo zip. Code -> Download Zip
3. Quartus -> File-> Open Project-> Open Gameboy.qpf.
4. Processing -> Start compilation.
5. The rbf will appear in the output_files folder
Peredonov
Posts: 10
Joined: Wed May 27, 2020 4:04 pm
Has thanked: 2 times
Been thanked: 1 time

Re: CRAM color palette dots option

Unread post by Peredonov »

Thank you for the instructions, although it took over 3.5 hours to compile on my old Windows laptop, it works as expected!

I also realized this should also be added to the MegaCD core, I imagine you simply would need to copy the same commit to it.

Thanks again for all you do!
Lisko
Posts: 88
Joined: Sun May 24, 2020 10:45 pm
Has thanked: 15 times

Re: CRAM color palette dots option

Unread post by Lisko »

This is a very appreciated option. I don't have a mega drive anymore for comparison but I think that mister displays more dots than the mega drive, isn't it? For example in sonic 3 with cram dots enabled I see dots in the right area of the water in the first stage. Wasn't sonic 3 only displaying cram dots in overscan area in mid frame palette changes?
User avatar
aberu
Posts: 308
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 35 times
Been thanked: 42 times

Re: CRAM color palette dots option

Unread post by aberu »

retrorepair wrote: Fri Dec 18, 2020 10:49 pm
paulbnl wrote: Fri Dec 18, 2020 8:46 pm Did you forget to enable the border? Because here there's a disco party in the Sonic border. :P
That's what I get for building a source I've been messing with, works now :)

I think if the TMSS BIOS was an option this would be the most accurate megadrive reproduction around!
There's still quite a few things to keep people busy in the Genesis core. All roms that had eeprom-based saves listed here --> https://github.com/ekeeke/Genesis-Plus- ... prom_i2c.c - likely are not saving. That's a pretty big task. Only some of them have SRAM hacks. But most of them are mediocre games, however NBA Jam and NBA Jam TE aren't ;)

Also there was a discovery by Artemio Urbina that the timing is off in multiple instances, so the bus arbiter is being rewritten now.

There's also little things here and there which keep coming up, edge cases, like homebrew and some prototypes not behaving the same as original hardware.

As far as to the end user though, everything is super super accurate, which I love, I use the Genesis core the most. :D
paulbnl
Posts: 75
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 6 times
Been thanked: 16 times

Re: CRAM color palette dots option

Unread post by paulbnl »

Lisko wrote: Fri Jan 15, 2021 10:56 pm This is a very appreciated option. I don't have a mega drive anymore for comparison but I think that mister displays more dots than the mega drive, isn't it? For example in sonic 3 with cram dots enabled I see dots in the right area of the water in the first stage. Wasn't sonic 3 only displaying cram dots in overscan area in mid frame palette changes?
The palette writes in Sonic 3 in that water are happening at the wrong place. It indicates a timing issue with the core.
User avatar
TLPD-AVW
Posts: 7
Joined: Sat Jul 11, 2020 9:59 am
Been thanked: 2 times

Re: CRAM color palette dots option

Unread post by TLPD-AVW »

Now that we have had CRAM option for the Genesis core for some time, shouldn't it be eventually ported to the MegaCD core as well? Or did the Sega Mega CD somehow alter the video generation for the entire system, eliminating CRAM dots on the combined unit?
retrorepair
Posts: 247
Joined: Sun May 24, 2020 9:06 pm
Has thanked: 47 times
Been thanked: 11 times

Re: CRAM color palette dots option

Unread post by retrorepair »

TLPD-AVW wrote: Sat Feb 20, 2021 2:05 pm Now that we have had CRAM option for the Genesis core for some time, shouldn't it be eventually ported to the MegaCD core as well? Or did the Sega Mega CD somehow alter the video generation for the entire system, eliminating CRAM dots on the combined unit?
The Mega CD definitely still exhibited this. It does on my MCD2 anyway.
the_muteKi
Posts: 8
Joined: Tue May 26, 2020 2:14 am
Has thanked: 1 time
Been thanked: 2 times

Re: CRAM color palette dots option

Unread post by the_muteKi »

Cram dots are artifact of Genesis VDP (short answer: interrupts). Sega cd graphics hardware blits to Genesis VDP, not overlaid. Cram dots should be visible in same cases where they show up on Genesis.
Post Reply