1, 2, 3, 4, 5  Next
Hi-res Mosaic issue? and more! 
Author Message
User avatar

Joined: 2015-01-17 08:36
Posts: 14
 Hi-res Mosaic issue? and more!
i found a difference in how higan handles hi-res mosaic and how hardware handles it. not sure if it counts as a bug or something (or if you guys already know) but i just wanted to point it out

here's a test rom i had lying around, i dont have bass source but i have asar source (dont kill me) here (however i was told asar works on bsd so here)

the demo is mode 5, with interlace enabled. the girl is layer 1 and the background is layer 2
when you press Y, full mosaic is toggled on layer 1 (meaning it is disabled initially). by full mosaic i mean 16x16 blocks (aka the largest pixel size, im not sure what the correct way to describe it is but you get what i mean). on the latest higan (v104), you get this:

Image

notice how the large pixels are halved horizontally, presumably due to mode 5. also notice how some of the large pixels have alternating color scanlines

however, on hardware, the pixels are not halved; the image looks... normal, i guess?:

Image

any idea? snes9x displays it like hardware, though it has a different issue when the pixel size is normal (1x1)


2017-09-03 22:25
User avatar

Joined: 2014-09-25 13:52
Posts: 8294
 Re: Hi-res Mosaic issue?
Yeah, it's a known issue, I'm afraid.

AWJ talked about it long ago, but unfortunately didn't get to it, and I really haven't had the time because I decided it was a good idea to emulate a dozen systems instead of just one.

Maybe someone with time can take a look at it thanks to your test ROM. Let's be hopeful :D

The horizontal thing is probably easier, bet I'm incrementing the counter on both main+sub pixels in hires mode errantly. The interlace line issue looks to be harder. Probably performing the *2+1 row adjust after mosaic instead of before.

_________________
What the hell's going on? Can someone tell me please?
Why I'm switching faster than the channels on TV.
I'm black, then I'm white. No, something isn't right.
My enemy's invisible, I don't know how to fight.


2017-09-03 23:36
User avatar

Joined: 2014-09-25 13:52
Posts: 8294
 Re: Hi-res Mosaic issue?
Many thanks to Cydrak for looking into this, and confirming it on hardware.

Lores/progressive:
Code:
mosaic 0 => 1x1
mosaic 1 => 2x2
mosaic 2 => 3x3
mosaic 15 = 16x16


I was wrongly using lores/progressive for hires/interlace as well.

Hires/interlace:
Code:
mosaic 0 = 2x2
mosaic 1 = 4x4
mosaic 2 = 6x6
mosaic 15 = 32x32


Another fun detail, I tried to treat the cases of mosaic disabled and mosaic enabled + mosaic 0 as the same. But it's not. In hires/interlace, mosaic disabled = 1x1.

So basically this totally breaks the way I do mosaic and I'll have to completely refactor everything.

So, this is going to take a while.

In the meantime, when can we expect your mode 6 offset-per-tile + EXTBG demo? :)

_________________
What the hell's going on? Can someone tell me please?
Why I'm switching faster than the channels on TV.
I'm black, then I'm white. No, something isn't right.
My enemy's invisible, I don't know how to fight.


2017-09-04 04:08
User avatar

Joined: 2015-01-17 08:36
Posts: 14
 Re: Hi-res Mosaic issue?
byuu wrote:
In the meantime, when can we expect your mode 6 offset-per-tile + EXTBG demo? :)

about that......

the latest higans wont display this file at all (its an older file, the source is a bit messy so id like to clean it up first if you guys need it)

it consists of a background (consisting of the character 女) scrolling towards the bottom right. an offset-per-tile effect is also occuring, and its moving towards the left (opposite the background). its honestly hard to explain; its better if you see it in motion. its mode 6 with both interlace and offset-per-tile enabled

the latest higan version that can display it (that i have) is v094, and it displays it like this (looks better in motion):

Image

bsnes-plus v073+3a also shows something similar

on hardware (also on snes9x sorta), it looks like this (again, looks better in motion):

Image

as you can see, unlike the previous pic, the offset-per-tile portion is sized the same as the non offset-per-tile portions


any idea why higan will not display the file? apparently its running (the fps counter seems to indicate that), just nothing is onscreen


2017-09-04 05:18
User avatar

Joined: 2014-09-25 13:52
Posts: 8294
 Re: Hi-res Mosaic issue? and more!
If you mean it doesn't run at all after v094, then you'll want to look into your power-on register initialization routines.

If you can get it displaying, and get a hardware video capture (anyone can do this), then we can go from there.

_________________
What the hell's going on? Can someone tell me please?
Why I'm switching faster than the channels on TV.
I'm black, then I'm white. No, something isn't right.
My enemy's invisible, I don't know how to fight.


2017-09-04 05:43
User avatar

Joined: 2015-01-17 08:36
Posts: 14
 Re: Hi-res Mosaic issue? and more!
ok, got it displaying on higan. it has the same result as the first pic i posted (aka the older bsnes versions)

download

and here's a hardware video


2017-09-04 06:20
User avatar

Joined: 2014-09-27 10:04
Posts: 88
Location: Right behind you. >..>
 Re: Hi-res Mosaic issue? and more!
https://gitlab.com/higan/higan/blob/mas ... nd.cpp#L73

Well, t'was fun, turns out offset per tile was more broken than we thought.

Having had a quick look at the code last night, I soon became suspicious of the two lines
uint16 offsetX = (x + (hscroll & 7));
and
voffset = y + hval;
which use the raw (x, y) coordinates before hires, interlace and mosaic. And this despite appropriate values having already been calculated for the non-offset per tile case.

I asked byuu about good mosaic examples, and he brought up Contra 3's stage 1 boss... pop it in and sure enough, the alien is borked with a 2x1 mosaic:

Image

It's a more subtle effect in practice, so for comparison, the console output:

Image

Guessing these have been around for quite awhile, yikes! Thanks for reporting this. ^..^


2017-09-04 17:44
User avatar

Joined: 2014-09-25 13:52
Posts: 8294
 Re: Hi-res Mosaic issue? and more!
All done. Thank you Ladida for the test ROMs, but boy did I end up under a lot of stress today fixing the mosaic portion >_>

And thank you as well Cydrak! You were right on with the offset-per-tile issue. Should be using px/py, not x/y.

Image

Image

Image

_________________
What the hell's going on? Can someone tell me please?
Why I'm switching faster than the channels on TV.
I'm black, then I'm white. No, something isn't right.
My enemy's invisible, I don't know how to fight.


2017-09-05 01:51
User avatar

Joined: 2015-01-17 08:36
Posts: 14
 Re: Hi-res Mosaic issue? and more!
just here to help Image


2017-09-05 02:21
User avatar

Joined: 2014-09-27 09:22
Posts: 5157
Location: A chair.
 Re: Hi-res Mosaic issue? and more!
Once again a bug that affects commercial software is found and crushed in a single day. v104 is no longer 100% accurate, but we'll see you next mission.

_________________
Just in case you thought something could EVER be straightforward, and needed someone to dash your hopes across the rocky shoals of harsh reality.

; write !!!


2017-09-05 08:58
1, 2, 3, 4, 5  Next