Genesis Core Interpolation Between Frames?

n0p
Posts: 12
Joined: Sun Oct 29, 2023 4:50 pm
Location: Kyiv, Ukraine
Has thanked: 5 times
Been thanked: 6 times
Contact:

Genesis Core Interpolation Between Frames?

Unread post by n0p »

(I'm using Genesis core only, as my addons for DE10-Nano are still on the way)
To start, i'm quite impressed with the quality of the emulation. Everything works like it should.
I never had a chance to play Samurai Shodown on real hardware, so i don't really know how it should look like.
But every emulation has in-game shadows blinking.
Long time ago i was working on Genesis Plus and made a frame-interpolation scaler, that basically draws interpolated picture from previous and current frame.
Code is very simple - we take previous pixel, p_old, current - p_current, do (p_old+p_current)>>1, store p_current to p_old.
Here's what it looks like: https://www.youtube.com/watch?v=2e2vff28jyU&t=74s
Can this kind of scaler be implemented (even potentionally)?

User avatar
LamerDeluxe
Top Contributor
Posts: 1181
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 828 times
Been thanked: 266 times

Re: Genesis Core Interpolation Between Frames?

Unread post by LamerDeluxe »

I know that the Gameboy Advance and Lynx cores have it (I requested three frame blending for the latter one and Robert kindly added it). I would expect it to be possible, unless it is somehow tricky for CRT display oriented systems.

User avatar
Armakuni
Posts: 189
Joined: Fri Jan 13, 2023 10:37 am
Has thanked: 35 times
Been thanked: 27 times

Re: Genesis Core Interpolation Between Frames?

Unread post by Armakuni »

The shadows blink on the Nuked-MD Megadrive core too which is based on the original chip decaps, So possibly is the same on original hardware too

n0p
Posts: 12
Joined: Sun Oct 29, 2023 4:50 pm
Location: Kyiv, Ukraine
Has thanked: 5 times
Been thanked: 6 times
Contact:

Re: Genesis Core Interpolation Between Frames?

Unread post by n0p »

Armakuni wrote: Sun Feb 11, 2024 11:10 am

The shadows blink on the Nuked-MD Megadrive core too which is based on the original chip decaps, So possibly is the same on original hardware too

True, but i might suggest that blinking shadows implementation expects some postglowing from CRT luminophore thus appearing as grayed area.

User avatar
Armakuni
Posts: 189
Joined: Fri Jan 13, 2023 10:37 am
Has thanked: 35 times
Been thanked: 27 times

Re: Genesis Core Interpolation Between Frames?

Unread post by Armakuni »

n0p wrote: Sun Feb 11, 2024 12:19 pm
Armakuni wrote: Sun Feb 11, 2024 11:10 am

The shadows blink on the Nuked-MD Megadrive core too which is based on the original chip decaps, So possibly is the same on original hardware too

True, but i might suggest that blinking shadows implementation expects some postglowing from CRT luminophore thus appearing as grayed area.

I just tried it a CRT and the result is the same, so it is just the game (i would even say the flicker looks worse on a CRT)

User avatar
LamerDeluxe
Top Contributor
Posts: 1181
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 828 times
Been thanked: 266 times

Re: Genesis Core Interpolation Between Frames?

Unread post by LamerDeluxe »

Armakuni wrote: Sun Feb 11, 2024 1:55 pm
n0p wrote: Sun Feb 11, 2024 12:19 pm
Armakuni wrote: Sun Feb 11, 2024 11:10 am

The shadows blink on the Nuked-MD Megadrive core too which is based on the original chip decaps, So possibly is the same on original hardware too

True, but i might suggest that blinking shadows implementation expects some postglowing from CRT luminophore thus appearing as grayed area.

I just tried it a CRT and the result is the same, so it is just the game (i would even say the flicker looks worse on a CRT)

Confirmed on my 1084 monitor, pretty annoying blinking effect. They should have alternated the dithering effect on the shadow, that would have looked a lot better.

n0p
Posts: 12
Joined: Sun Oct 29, 2023 4:50 pm
Location: Kyiv, Ukraine
Has thanked: 5 times
Been thanked: 6 times
Contact:

Re: Genesis Core Interpolation Between Frames?

Unread post by n0p »

Thanks guys!
Just connected to old EIZO LCD display via DVI-HDMI convertor and it looks much better than on new TV.
https://youtu.be/0oMJRhOtaTU

User avatar
LamerDeluxe
Top Contributor
Posts: 1181
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 828 times
Been thanked: 266 times

Re: Genesis Core Interpolation Between Frames?

Unread post by LamerDeluxe »

Wow, odd how that looks better than on a CRT.

n0p
Posts: 12
Joined: Sun Oct 29, 2023 4:50 pm
Location: Kyiv, Ukraine
Has thanked: 5 times
Been thanked: 6 times
Contact:

Re: Genesis Core Interpolation Between Frames?

Unread post by n0p »

40ms response time (from specs for Eizo L985EX) does that magic :)
I couldn't find any reliable info on old phosphors, except it looks like correct name of the effect is "afterglow".
So correct algo should be somewhat like: if new pixel is brighter, apply it immediately, if brightness is lower - apply some afterglow formula.
I wish i remember better - could old TV have the bigger afterglow effect, and computer monitor less, using a better phosphor composition?

n0p
Posts: 12
Joined: Sun Oct 29, 2023 4:50 pm
Location: Kyiv, Ukraine
Has thanked: 5 times
Been thanked: 6 times
Contact:

Re: Genesis Core Interpolation Between Frames?

Unread post by n0p »

LamerDeluxe wrote: Sun Feb 11, 2024 10:18 am

I know that the Gameboy Advance and Lynx cores have it (I requested three frame blending for the latter one and Robert kindly added it). I would expect it to be possible, unless it is somehow tricky for CRT display oriented systems.

Found the commit, feature is called flickerblend there
https://github.com/MiSTer-devel/AtariLy ... 8e80ec6da1

User avatar
LamerDeluxe
Top Contributor
Posts: 1181
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 828 times
Been thanked: 266 times

Re: Genesis Core Interpolation Between Frames?

Unread post by LamerDeluxe »

n0p wrote: Tue Feb 13, 2024 9:08 am
LamerDeluxe wrote: Sun Feb 11, 2024 10:18 am

I know that the Gameboy Advance and Lynx cores have it (I requested three frame blending for the latter one and Robert kindly added it). I would expect it to be possible, unless it is somehow tricky for CRT display oriented systems.

Found the commit, feature is called flickerblend there
https://github.com/MiSTer-devel/AtariLy ... 8e80ec6da1

It is mostly just done by averaging frames, so each pixel color is an average of current and previous colors.

n0p
Posts: 12
Joined: Sun Oct 29, 2023 4:50 pm
Location: Kyiv, Ukraine
Has thanked: 5 times
Been thanked: 6 times
Contact:

Re: Genesis Core Interpolation Between Frames?

Unread post by n0p »

Yes, 2 frame flickerblend is exactly what's needed (for a start :))
I wrote this code for Genesis Plus, but that's C. It will take some time to understand and study Verilog.

Code: Select all

void RenderLine_X1S2_Buffer (uint8 *src, int line, int offset, uint32 *table, int length)
{
PRE_X1_32_BUF;
	do {
		uint32 p1 = table[*src++];
		uint32 p2 = *inCache;
		*inCache++ = p1;
		p1 = (p1+p2)>>1;
		*outWrite++ = p1;
	} while (--length);
}
User avatar
Chris23235
Top Contributor
Posts: 868
Joined: Sun May 24, 2020 8:45 pm
Has thanked: 114 times
Been thanked: 180 times

Re: Genesis Core Interpolation Between Frames?

Unread post by Chris23235 »

n0p wrote: Sun Feb 11, 2024 9:02 pm

I wish i remember better - could old TV have the bigger afterglow effect, and computer monitor less, using a better phosphor composition?

In general the afterglow effect on a consumer TV and an 1980s RGB monitor was more of less similar. But in the 1990s when VGA monitors with higher refresh rates became the norm the afterglow was weaker due to improved materials (it became necessary because 120Hz with the afterglow strength of a 60Hz consumer TV would have looked terrible).

Post Reply