Some questions about bsnes, for bsnes-hd development

Post Reply
DerKoun
Posts: 3
Joined: 2019-09-19 12:18:33
Contact:

Some questions about bsnes, for bsnes-hd development

Post by DerKoun » 2019-10-20 18:50:35

@byuu, I hope this is the right place. I have a few questions about bsnes that would help me planing and designing for bsnes-hd:
  • I'm looking into automatic AR for widescreen. Is there a simple way to get the screen and/or window resolution from within the PPU code?
  • Depending on the game, the Mode 7 image, excluding the transforms, stays the same for some time. So it could be pre-decoded, as an optimization for both CPU and GPU based approaches to HD Mode 7. The question is: Can the emulated memory writes be monitored to know that since the previous frame the images can not have changed?
  • You mentioned that HD Mode 7 could benefit from temporal averaging for stabilization. Now that there is run-ahead, could it be used to get the transform values from 1 frame "in the future" to average them with those stored from 1 frame in the past?
  • I usually have overscan set to crop. But I wonder which games actually use that area. Is there a list in any wiki or are there just some spacial cases?
  • For a "side-quest" in the mid-term I want to look into the HyperZone stereoscopic functionality ( https://tcrf.net/HyperZone#3D_Effect ). Whether a frame is left or right is signaled via the "I/O pin on both controller ports". Can I get that information from the PPU code?
Thanks

User avatar
byuu
Posts: 14
Joined: 2019-09-18 17:30:45

Re: Some questions about bsnes, for bsnes-hd development

Post by byuu » 2019-10-21 11:56:09

This place is just fine, thank you.

>I'm looking into automatic AR for widescreen. Is there a simple way to get the screen and/or window resolution from within the PPU code?

What do you mean? Like the 256 vs 512 width, 224 vs 240 vs 448 vs 480 heights? There's hires() and interlace() const bool functions for those. It can change in the middle of a frame though, eg Seiken Densetsu 3 text boxes.

>The question is: Can the emulated memory writes be monitored to know that since the previous frame the images can not have changed?

It can be, but in general I'm weary of performance improvements that hurt -every- case (tracking writes) and especially hurt the worst cases more than they were originally (eg a constantly moving background from every frame.) Simplicity is king, I feel. I just removed a tile cache that ended up only hurting run-ahead and not really benefiting performance even with run-ahead off, for example.

>You mentioned that HD Mode 7 could benefit from temporal averaging for stabilization. Now that there is run-ahead, could it be used to get the transform values from 1 frame "in the future" to average them with those stored from 1 frame in the past?

We show the -final- frame, so it would be the current rendered frame plus the previous N frames of data we'd have.

So it wouldn't be any different than not using run-ahead and just tracking old frames to smooth out the coordinates.

I think what you want is run-behind, where we show a frame and then emulate a few frames ahead, which is doable and subject to the same limitations as run-ahead (can't exceed internal processing delays.)

>I usually have overscan set to crop. But I wonder which games actually use that area. Is there a list in any wiki or are there just some spacial cases?

Only some PAL games. Try Super Mario All-Stars, SMB1 level 1-1 PAL.

>For a "side-quest" in the mid-term I want to look into the HyperZone stereoscopic functionality ( https://tcrf.net/HyperZone#3D_Effect ). Whether a frame is left or right is signaled via the "I/O pin on both controller ports". Can I get that information from the PPU code?

Yes. https://github.com/byuu/bsnes/blob/mast ... er.hpp#L18

It's too bad true 3D completely fell off a cliff in the PC gaming space. They were making stereoscopic 3D monitors and then they just stopped.
Bad news for shutter emulation.

Still, I'm very interested to see what you can come up with here!

DerKoun
Posts: 3
Joined: 2019-09-19 12:18:33
Contact:

Re: Some questions about bsnes, for bsnes-hd development

Post by DerKoun » 2019-10-22 20:26:08

Thanks.

Seems like I forgot a crucial piece of information about the "screen": I mean the host resolution, so I can automatically adapt to the display AR / system resolution. Most people have 16:9 displays I assume, but there are others and I want to provide automatic widescreen AR to fill the screen. Automatic scale factor would also be possible. (This is even more important for the libretro core, with varying phone display sizes, ARs, resolutions and so on. But I'd like to have it in all versions if possible.)

I'm looking into how easy it would be to add a side-by-side 3D mode for HyperZone. Having the left/right side bit is the first requirement for stable results, so things look good. But it's of course a low priority excursion. (And, yeah, I really hoped 3D was here to stay this time. Well, maybe next time.)

Post Reply