#181  
Old 18th June 2013, 04:06 AM
angrylion angrylion is offline
Member
 
Join Date: Oct 2008
Location: Moscow, Russia
Posts: 36
Default

Quote:
Originally Posted by suanyuan View Post
the mess rdp didn't apply dither if the pixel format of color frame buffer is 16 bits.
Obvious speedhack that has nothing to do with the real hardware. When MooglyGuy first backported my changes into MESS around 2010, he also ported my VI filters, but later he left them out for reasons unknown, but I guess for speed.

Quote:
Originally Posted by suanyuan
I guess argrylion rewrote mess rdp, replaced c++ classes with c functions and plus some modifications.
Take a look at my file CREDITS.txt, then download a copy of MESS 0.128 sources from November 2008, compare them with my code and stop spreading fantasies.
Reply With Quote
  #182  
Old 18th June 2013, 04:15 AM
shunyuan's Avatar
shunyuan shunyuan is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2013
Posts: 491
Default

Quote:
Originally Posted by angrylion View Post
Obvious speedhack that has nothing to do with the real hardware. When MooglyGuy first backported my changes into MESS around 2010, he also ported my VI filters, but later he left them out for reasons unknown, but I guess for speed.



Take a look at my file CREDITS.txt, then download a copy of MESS 0.128 sources from November 2008, compare them with my code and stop spreading fantasies.
Thanks for your corrections.

But the mess rdp did color dither on 32 bit color frame buffer, just for your reference:

Code:
void n64_rdp::VideoUpdate32(n64_periphs *n64, bitmap_rgb32 &bitmap)
{
	int gamma = (n64->vi_control >> 3) & 1;
	int gamma_dither = (n64->vi_control >> 2) & 1;
	//int vibuffering = ((n64->vi_control & 2) && fsaa && divot);

	UINT32 *frame_buffer32 = (UINT32*)&rdram[(n64->vi_origin & 0xffffff) >> 2];

	const INT32 hdiff = (n64->vi_hstart & 0x3ff) - ((n64->vi_hstart >> 16) & 0x3ff);
	const float hcoeff = ((float)(n64->vi_xscale & 0xfff) / (1 << 10));
	UINT32 hres = ((float)hdiff * hcoeff);
	INT32 invisiblewidth = n64->vi_width - hres;

	const INT32 vdiff = ((n64->vi_vstart & 0x3ff) - ((n64->vi_vstart >> 16) & 0x3ff)) >> 1;
	const float vcoeff = ((float)(n64->vi_yscale & 0xfff) / (1 << 10));
	const UINT32 vres = ((float)vdiff * vcoeff);

	if (vdiff <= 0 || hdiff <= 0)
	{
		return;
	}

	if (hres > 640) // Needed by Top Gear Overdrive (E)
	{
		invisiblewidth += (hres - 640);
		hres = 640;
	}

	if (frame_buffer32)
	{
		for (int j = 0; j < vres; j++)
		{
			UINT32 *d = &bitmap.pix32(j);
			for (int i = 0; i < hres; i++)
			{
				UINT32 pix = *frame_buffer32++;
				if (gamma || gamma_dither)
				{
					int r = (pix >> 24) & 0xff;
					int g = (pix >> 16) & 0xff;
					int b = (pix >> 8) & 0xff;
					int dith = 0;
					if (gamma_dither)
					{
						dith = GetRandom() & 0x3f;
					}
					if (gamma)
					{
						if (gamma_dither)
						{
							r = m_gamma_dither_table[(r << 6)| dith];
							g = m_gamma_dither_table[(g << 6)| dith];
							b = m_gamma_dither_table[(b << 6)| dith];
						}
						else
						{
							r = m_gamma_table[r];
							g = m_gamma_table[g];
							b = m_gamma_table[b];
						}
					}
					else if (gamma_dither)
					{
						if (r < 255)
							r += (dith & 1);
						if (g < 255)
							g += (dith & 1);
						if (b < 255)
							b += (dith & 1);
					}
					pix = (r << 24) | (g << 16) | (b << 8);
				}


				d[i] = (pix >> 8);
			}
			frame_buffer32 += invisiblewidth;
		}
	}
}
__________________
---------------------
CPU: Intel U7300 1.3 GHz
GPU: Mobile Intel 4 Series (on board)
AUDIO: Realtek HD Audio (on board)
RAM: 4 GB
OS: Windows 7 - 32 bit

Last edited by shunyuan; 18th June 2013 at 04:34 AM.
Reply With Quote
  #183  
Old 18th June 2013, 04:17 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

Indeed. MAME 0.128 was around when I *started* to see discussions of introducing C++ only code by MooglyGuy, but at the time it was mostly pure C.

I was merging in my commits analytically using file diff comparisons manually and copy/paste just like I'm doing right now with angrylion's updates and OHHH MY ********** the work I am doing now to merge RDP updates, is nothing compared to the work I had to do for colossal MAME source rewrites. It is still tedious but a little easier now.

Before I knew about this plugin, I tried to merge as far ahead into the latest MAME/MESS commits as I could, but eventually there was too much C++ code that I had to stop. Plus there was no clear information on how to port it into a zilmar-spec plugin and take advantage of the timer-event-driven message system that zilmar's plugin spec relies on.

So suanyuan you're welcome to take the opposite stance of what I'm doing or what angrylion is doing as diversity in approach always helps, but at the same time if I were you I would really trust information on the RDP questions to angrylion as he primarily helped MooglyGuy to implement it.
Reply With Quote
  #184  
Old 18th June 2013, 04:18 AM
shunyuan's Avatar
shunyuan shunyuan is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2013
Posts: 491
Default

Quote:
Originally Posted by angrylion View Post
If you are talking about black spikes, they are present on the real console. There are literally dozens of youtube videos recorded from capture cards confirming this, just search youtube. For Star Fox 64, see this video /watch?v=_DNhvjWjQI0 (stupid forum doesn't allow me to post links), it is most evident at 1:05. For Snowboard Kids, see this video: /watch?v=6ru21VEK1IY , black spikes are abundant there.
I think the problem GPDP point out is not some black spikes, but the gray dots in black background as pictures below:

__________________
---------------------
CPU: Intel U7300 1.3 GHz
GPU: Mobile Intel 4 Series (on board)
AUDIO: Realtek HD Audio (on board)
RAM: 4 GB
OS: Windows 7 - 32 bit

Last edited by shunyuan; 18th June 2013 at 04:29 AM.
Reply With Quote
  #185  
Old 18th June 2013, 04:25 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

The thing GPDP posted was exactly what I was showing in my screenshot with the gray brightness pixels mixed into the black background (in the case of his screen, the boundary borders).

I call it dithering, but only for a lack of a better term.
Strictly speaking I suppose it's not fully purpose dithering, but the fact remains that different pixel colors are interleaved.
Reply With Quote
  #186  
Old 18th June 2013, 04:27 AM
shunyuan's Avatar
shunyuan shunyuan is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2013
Posts: 491
Default

Quote:
Originally Posted by FatCat View Post
Indeed. MAME 0.128 was around when I *started* to see discussions of introducing C++ only code by MooglyGuy, but at the time it was mostly pure C.

I was merging in my commits analytically using file diff comparisons manually and copy/paste just like I'm doing right now with angrylion's updates and OHHH MY ********** the work I am doing now to merge RDP updates, is nothing compared to the work I had to do for colossal MAME source rewrites. It is still tedious but a little easier now.

Before I knew about this plugin, I tried to merge as far ahead into the latest MAME/MESS commits as I could, but eventually there was too much C++ code that I had to stop. Plus there was no clear information on how to port it into a zilmar-spec plugin and take advantage of the timer-event-driven message system that zilmar's plugin spec relies on.

So suanyuan you're welcome to take the opposite stance of what I'm doing or what angrylion is doing as diversity in approach always helps, but at the same time if I were you I would really trust information on the RDP questions to angrylion as he primarily helped MooglyGuy to implement it.
Yes, I agree with you. But don't forget Ziggy, he is the first one tries to port mess rdp to Zilmar's spec for other n64 emulators, and he also implemented the hardware acceleration version with OpenGL.
__________________
---------------------
CPU: Intel U7300 1.3 GHz
GPU: Mobile Intel 4 Series (on board)
AUDIO: Realtek HD Audio (on board)
RAM: 4 GB
OS: Windows 7 - 32 bit

Last edited by shunyuan; 18th June 2013 at 04:41 AM.
Reply With Quote
  #187  
Old 18th June 2013, 04:48 AM
GPDP GPDP is offline
Senior Member
 
Join Date: May 2013
Posts: 146
Default

Quote:
Originally Posted by suanyuan View Post
I think the problem GPDP point out is not some black spikes, but the gray dots in black background as pictures below:

Yes, that is what I am talking about. Of course, what that picture does not convey is that the "dots" move around much like TV static, which is what I found was most odd.
Reply With Quote
  #188  
Old 18th June 2013, 05:23 AM
angrylion angrylion is offline
Member
 
Join Date: Oct 2008
Location: Moscow, Russia
Posts: 36
Default

OK, GPDP, I misunderstood what you referred to, but without images taken from a capture card I cannot determine if there's a problem or not. My CRT TV crops the picture, so I can't see what's outside the black borders. The youtube Star Fox video I linked to is of bad quality, but I think I can vaguely notice the static, at least below the lower black border.
Also, I maximized brightness on my CRT TV, and it is 100% obvious that Virtual Chess 64 does dithering on the black background. So dsx! should bump up brightness when recording or something, because the statement that Virtual Chess 64 does not dither the background is false.
Reply With Quote
  #189  
Old 18th June 2013, 05:35 AM
dsx_ dsx_ is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2010
Location: Australia
Posts: 1,105
Default

Quote:
Originally Posted by angrylion View Post
OK, GPDP, I misunderstood what you referred to, but without images taken from a capture card I cannot determine if there's a problem or not. My CRT TV crops the picture, so I can't see what's outside the black borders. The youtube Star Fox video I linked to is of bad quality, but I think I can vaguely notice the static, at least below the lower black border.
Also, I maximized brightness on my CRT TV, and it is 100% obvious that Virtual Chess 64 does dithering on the black background. So dsx! should bump up brightness when recording or something, because the statement that Virtual Chess 64 does not dither the background is false.
Yeah I did turn the brightness up and could see it, but I didn't know if it was dithering or interference in the video output, so I made no conclusion. I will try to get a hold of an N64 with RGB output which will be clearer and more valid to compare. (What were the developers thinking anyway, dithering a black background. Surely the N64 can display pure black.)
Reply With Quote
  #190  
Old 18th June 2013, 06:06 AM
GPDP GPDP is offline
Senior Member
 
Join Date: May 2013
Posts: 146
Default

Alright, unfortunately I do not have any way to prove this, but I just checked on my real N64 and TV, and it turns out, yet again, the plugin's behavior is accurate. That "static" on Star Fox 64's overscan area is there in the real console. Moreover, it's there on the title screen and main menu as well, and this is also shown in SoftGraphic. Conker's BFD, meanwhile, does not show static anywhere on both my N64 setup or using SoftGraphic.

So yeah, this is basically just some weird filter they decided to put on Star Fox 64 and some other games for some reason. It does not appear to be a glitch in the plugin after all.

Edit: in case you all are wondering, my setup is a real N64 console hooked up to a Sony WEGA CRT through S-video. I am able to get into the service menu of my TV and thus peer into the overscan area of the game that way. I then turned the brightness up to insane levels, which fully revealed the static effect. I then put on Conker to check if on its overscan area or during black screens it would also show static, but it didn't. Thus I conclude it's something that just happens to be a part of Star Fox 64's image, which SoftGraphic (and the code it's based on by extension) accurately replicates.

Last edited by GPDP; 18th June 2013 at 06:15 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 11:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.