MAMEWorld >> News
View all threads Index   Threaded Mode Threaded  

Pages: 1

ClawGrip
Reged: 10/19/03
Posts: 132
Send PM


Haze WIP
#379058 - 10/20/18 11:06 AM


https://mamedev.emulab.it/haze/2018/10/19/expanding-the-emulated-mappyverse/



gregf
Ramtek's Trivia promoter
Reged: 09/21/03
Posts: 8603
Loc: southern CA, US
Send PM


Re: Haze WIP new [Re: ClawGrip]
#379063 - 10/20/18 12:11 PM




Haze going through all that Xavix hardware challenge for past several weeks is impressive since it was first mentioned in January 2018.



Asure
MAME Fan
Reged: 11/29/04
Posts: 40
Loc: Nederland
Send PM


Re: Haze WIP new [Re: ClawGrip]
#379065 - 10/20/18 12:52 PM


Dirt Rebel MX looks like a decent Enduro Race clone with that road effect and all. Nice work!

https://www.youtube.com/watch?v=eTlxGiKfN-Q



Foxhack
Furry guy
Reged: 01/30/04
Posts: 2409
Loc: Spicy Canada
Send PM


Re: Haze WIP new [Re: ClawGrip]
#379067 - 10/20/18 08:46 PM


> https://mamedev.emulab.it/haze/2018/10/19/expanding-the-emulated-mappyverse/

The screenshots look so fuzzy, they resemble TV signal captures. I can't imagine how much worse they would look on a TV.

I'm just so surprised the unfiltered graphics look like that.

I do wonder if the palette displays are wrong, though - like, were they adjusted for the specific region's NTSC variant? (Japan uses a different black level, which has to be changed on US TVs.) I'm not sure how MAME handles that stuff.

https://en.wikipedia.org/wiki/NTSC#NTSC-J



anikom15
Instigator/Local CRT Guru
Reged: 04/11/16
Posts: 287
Send PM


Re: Haze WIP new [Re: Foxhack]
#379068 - 10/20/18 09:02 PM


MAME doesn’t modify the RGB in any way, or at least it shouldn’t because that’s what HLSL is for.

YPbPr systems (like C64, NES) are a different story.

Also, if the black level was wrong, it wouldn’t look like that. It looks like the chroma is low, not the luminance.

Edited by anikom15 (10/20/18 09:08 PM)



Haze
Reged: 09/23/03
Posts: 5245
Send PM


Re: Haze WIP new [Re: anikom15]
#379072 - 10/20/18 09:57 PM


> MAME doesn’t modify the RGB in any way, or at least it shouldn’t because that’s what
> HLSL is for.
>
> YPbPr systems (like C64, NES) are a different story.
>
> Also, if the black level was wrong, it wouldn’t look like that. It looks like the
> chroma is low, not the luminance.

these use some kind of HSL / HSV colour scheme that I'm having to convert to RGB

my conversion algorithm is incorrect (even if all examples I can find seem to be the same basic code)

the actual devices output much better colour, but it's fairly low on my list of things to fix.



Foxhack
Furry guy
Reged: 01/30/04
Posts: 2409
Loc: Spicy Canada
Send PM


Re: Haze WIP new [Re: Haze]
#379073 - 10/20/18 10:07 PM


> > MAME doesn’t modify the RGB in any way, or at least it shouldn’t because that’s
> what
> > HLSL is for.
> >
> > YPbPr systems (like C64, NES) are a different story.
> >
> > Also, if the black level was wrong, it wouldn’t look like that. It looks like the
> > chroma is low, not the luminance.
>
> these use some kind of HSL / HSV colour scheme that I'm having to convert to RGB
>
> my conversion algorithm is incorrect (even if all examples I can find seem to be the
> same basic code)
>
> the actual devices output much better colour, but it's fairly low on my list of
> things to fix.

So that explains why the colors seem weird. Thanks for popping in and mentioning this.



anikom15
Instigator/Local CRT Guru
Reged: 04/11/16
Posts: 287
Send PM


Re: Haze WIP new [Re: Haze]
#379075 - 10/20/18 11:07 PM


What output ports are available on the devices?

Do you mind sharing your current toRGB algorithm?



Haze
Reged: 09/23/03
Posts: 5245
Send PM


Re: Haze WIP new [Re: anikom15]
#379076 - 10/20/18 11:38 PM


> What output ports are available on the devices?
>
> Do you mind sharing your current toRGB algorithm?

it hooks up with AV cables, usually single channel of audio (although some have two)

Algorithm is just one I found with a 'free to use anywhere' license.


Code:



double xavix_state::hue2rgb(double p, double q, double t)
{
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6.0f) return p + (q - p) * 6 * t;
if (t < 1 / 2.0f) return q;
if (t < 2 / 3.0f) return p + (q - p) * (2 / 3.0f - t) * 6;
return p;
}


void xavix_state::handle_palette(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// not verified
int offs = 0;
for (int index = 0; index < 257; index++)
{
uint16_t dat;

if (index < 256)
{
dat = m_palram_sh[offs];
dat |= m_palram_l[offs] << 8;
}
else
{
dat = m_colmix_sh[0];
dat |= m_colmix_l[0] << 8;
}

offs++;

int l_raw = (dat & 0x1f00) >> 8;
int sl_raw =(dat & 0x00e0) >> 5;
int h_raw = (dat & 0x001f) >> 0;

//if (h_raw > 24)
// logerror("hraw >24 (%02x)\n", h_raw);

//if (l_raw > 17)
// logerror("lraw >17 (%02x)\n", l_raw);

//if (sl_raw > 7)
// logerror("sl_raw >5 (%02x)\n", sl_raw);

double l = (double)l_raw / 17.0f;
double s = (double)sl_raw / 7.0f;
double h = (double)h_raw / 24.0f;

double r, g, b;

if (s == 0) {
r = g = b = l; // greyscale
}
else {
double q = l < 0.5f ? l * (1 + s) : l + s - l * s;
double p = 2 * l - q;
r = hue2rgb(p, q, h + 1 / 3.0f);
g = hue2rgb(p, q, h);
b = hue2rgb(p, q, h - 1 / 3.0f);
}

int r_real = r * 255.0f;
int g_real = g * 255.0f;
int b_real = b * 255.0f;

m_palette->set_pen_color(index, r_real, g_real, b_real);

}
}




anikom15
Instigator/Local CRT Guru
Reged: 04/11/16
Posts: 287
Send PM


Re: Haze WIP new [Re: Haze]
#379078 - 10/21/18 12:59 AM


Interesting, so it looks like most of the information is contained in the hue to provide for a compact color palette that can provide a wide variety of different hues, good for brightly-colored arcade-style games.

It's ironic that the problem is that the colors are too dull.


Pages: 1

MAMEWorld >> News
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  John IV, Robbbert, Tafoid 
2 registered and 260 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 919