Mesen-S - SNES Emulator

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
byuu
Posts: 1540
Joined: Mon Mar 27, 2006 5:23 pm
Contact:

Re: Mesen-S - SNES Emulator

Post by byuu » Mon Apr 08, 2019 11:18 am

Is this your first time releasing this demo? I don't see any posts with images of what it's supposed to look like.

I see both images stationary in higan, but the colors are wrong on the right. This one sets mode 3 in hblank, and runs that for half the frame, then switches to mode 5.

Image

The right looks the same even if I force the PPU to always use mode 5, so ... if the colors are wrong, then I have no idea why.

Molive
Posts: 50
Joined: Sat Apr 07, 2018 7:39 pm
Location: EN

Re: Mesen-S - SNES Emulator

Post by Molive » Mon Apr 08, 2019 12:23 pm

Ah, I don't believe I released this one. Sorry.
The colours on the right are supposed to be like that, because they're corrupted by the ones on the left. I haven't worked out how to not make that happen, but It's probably more to do with just my bad palette organisation than anything.
I've attached screenshots from the Bsnes-plus tilemap viewer - they look like that on hardware. Altthough Higan is stationary, it still has a jagged edge, for some reason.
Attachments
Hi Colour
Hi Colour
Hi res
Hi res
SNES demos are great

Molive
Posts: 50
Joined: Sat Apr 07, 2018 7:39 pm
Location: EN

Re: Mesen-S - SNES Emulator

Post by Molive » Mon Apr 08, 2019 12:24 pm

I can move this into a different thread if you want
SNES demos are great

byuu
Posts: 1540
Joined: Mon Mar 27, 2006 5:23 pm
Contact:

Re: Mesen-S - SNES Emulator

Post by byuu » Mon Apr 08, 2019 12:50 pm

Oh, I see. Basically your BGMODE writes are landing at different spots each frame, which is resulting in the change happening immediately in higan, so when you're in the middle of a tile, it ends up misaligning the tiledata shifter.

So, either the BGMODE change only happens every 8 pixels at a tile fetch edge, or the tile shifter logic has to be smarter about mode changes to different bit depths.

https://i.imgur.com/S0r7k8R.png (larger image, so not inlined.)

I think for now, I probably won't emulate this, since I don't know which behavior is actually correct. But it does reveal an interesting detail, so thank you for the second test ROM!

User avatar
koitsu
Posts: 4216
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Mesen-S - SNES Emulator

Post by koitsu » Mon Apr 08, 2019 3:43 pm

Is this not the exact thing that Pan of Anthrox's old mode7.smc demo did? Subject discussed here? Or is this something different?

(Apologies for not having those recordings any more, BTW. I can re-do them easily though the same hardware (SNES + SD2SNES) and using OBS Studio + USB3HDCAP, since I just this weekend got my SNES hooked up to my USB3HDCAP for doing 60fps recordings. If needed, just ask.)

byuu
Posts: 1540
Joined: Mon Mar 27, 2006 5:23 pm
Contact:

Re: Mesen-S - SNES Emulator

Post by byuu » Mon Apr 08, 2019 7:08 pm

Yes, it's the same idea, but instead of mode 0->7, it's mode 3->5. Given the nature of the Anthrox plasma effect, both sides being lowres, and both sides being the same color depth for tiles, there's no obvious misalignment there.

The combination of all of that gets in the way here. It's an easy fix, once we know which behavior is the correct one, in any case. But guessing fixes just results in breaking other games and making it harder to find the real fix later on.

I suspect BGMODE changes only take effect on tile edges, but there's likely a lot more to it than that, as evidenced by both of these demos needing something in the middle of the screen to hide all the corrupted data.

User avatar
Banshaku
Posts: 2328
Joined: Tue Jun 24, 2008 8:38 pm
Location: Fukuoka, Japan
Contact:

Re: Mesen-S - SNES Emulator

Post by Banshaku » Mon Apr 08, 2019 8:05 pm

@sour

I was sure that mesen meant "line of sight", from the Japanese 目線 since the icon shows a eye with lines. Maybe I guessed wrong then.

lidnariq
Posts: 8902
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Mesen-S - SNES Emulator

Post by lidnariq » Mon Apr 08, 2019 8:24 pm

Why not a multilingual pun?

User avatar
Gilbert
Posts: 363
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Mesen-S - SNES Emulator

Post by Gilbert » Mon Apr 08, 2019 9:01 pm

Banshaku wrote: 目線
Actually I remembered this was written verbatim in the original web site, but seems that it's not mentioned anymore.
I just didn't get it being NESEM spelt backwards until now, so I used to think it's a strange random name for an emulator.
(And that it makes sense now why its descendant is called MESEN-S, not SMESEN...)

User avatar
koitsu
Posts: 4216
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Mesen-S - SNES Emulator

Post by koitsu » Mon Apr 08, 2019 9:19 pm

Ah, mode 3 to 5... yikes. Do we need this tested on actual hardware, or...?

User avatar
Banshaku
Posts: 2328
Joined: Tue Jun 24, 2008 8:38 pm
Location: Fukuoka, Japan
Contact:

Re: Mesen-S - SNES Emulator

Post by Banshaku » Mon Apr 08, 2019 9:46 pm

I may not have guessed and it just my memory playing tricks on me after reading the meaning a long time ago on the site then :lol:

byuu
Posts: 1540
Joined: Mon Mar 27, 2006 5:23 pm
Contact:

Re: Mesen-S - SNES Emulator

Post by byuu » Tue Apr 09, 2019 1:45 am

Ah, mode 3 to 5... yikes. Do we need this tested on actual hardware, or...?
It certainly wouldn't hurt to have, but I'd be very surprised if the right-hand image ends up jagged on a real TV.

If anyone can think of a good secondary test ROM to rule out what the underlying behavior is, I'll fix it. But again, I'd rather we wait for some PPU LA logs before spending too much time on these kinds of tests. It's a bit like the DSPs: people spent nearly a decade bit-perfecting those, and then LLE (with much respect and reverence to the past hard work) undid all that work in a week. The PPU is going to be the same.

User avatar
koitsu
Posts: 4216
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Mesen-S - SNES Emulator

Post by koitsu » Tue Apr 09, 2019 3:32 am

Happy to do a recording of this on an actual SNES + put up a YT link of the result tomorrow.

Sour
Posts: 744
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen-S - SNES Emulator

Post by Sour » Tue Apr 09, 2019 6:29 am

Yay for 17+ hours of power outage (still ongoing..)

I fixed the SplitScreen test yesterday, was caused by a small issue when turning hires modes on or off in the middle of a scanline. As far as I can tell, it looks like the bsnes-plus screenshots you posted.

The hblank test is broken by my "fix" for megalomania, the sprites are loaded 1 ppu cycle after rendering is enabled. Like byuu said, fixing these kinds of things would require knowing the exact way the ppu loads/evaluates the sprites. I'm not too worried about this right now as I have a lot more pressing issues to fix :p

Megalomania, Allen vs predator and the krusty issues should be fixed, too.

Also finished the SPC debugger window, which is essentially the same as the regular debugger, but for the SPC. It supports stepping, watch expressions, breakpoints, etc.

Re: the name, it is both Nesem backwards and 目線, that's why the icon is an eye!

Sour
Posts: 744
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen-S - SNES Emulator

Post by Sour » Wed Apr 10, 2019 8:00 pm

Finally was able to get some more fixes done (Thank you freezing rain for that sweet 43 hours straight of power outage!).

-F1 Grand Prix & Sink or Swim are both fixed (was caused by the same IRQ problem)
-Fixed V+H IRQs set for scanline 240, cycle 0 were never triggered (which was breaking Full Throttle)
-Improved the PPU timing logic to remove the 341th cycle hack and the like, which seems to have fixed the small graphical glitch in Daikaijuu, too.

Which I think leaves Circuit USA, Jumbo Ozaki & NHL 94 with known graphical bugs (mosaic issues aside). Then I still have to figure out why Illusion of Gaia and ActRaiser 2 refuse to boot (almost certain this is SPC-related).

Also added frame skipping whenever the speed is set higher than 150% (unless video footage is being recorded), which gave a ~100-150 FPS boost in most games, as far as I can tell, and should have no impact on emulation accuracy.

Post Reply