TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.21k stars 385 forks source link

Maintain aspect ratio is a little longer on NES and SNES #4054

Open Yave-Yu opened 2 months ago

Yave-Yu commented 2 months ago

On NES and SNES emulation, enable Maintain aspect ratio follows 8:7 PAR, that would stretch horizontal pixel to perfect 2048 (256x8), but current BizHawk stretched it to 2051 instead, a little longer than 8:7 PAR expected size.

vadosnaprimer commented 2 months ago

PAR is not about 256x8. PAR means you leave height as is and stretch width by 8/7 ratio. 256*8/7 would be width, and height would remain the same. That way pixel dimensions (pixel aspect ratio) become correct, since pixels that NES sends to the TV are not square.

Yave-Yu commented 2 months ago

Ah, I forgot write window size. I mean, when I use 7x window size, it would have 2048x1680 with maintain aspect ratio, but no, it has 2051x1680, a little wider than (256x8)x(240x7).

Morilli commented 2 months ago

Which core are you testing this with? Also, how are you measuring the window size?

YoshiRulz commented 2 months ago

And what version is this? Presumably 2.10 RC1 since that added an option for 7x scale in the menubar.

Morilli commented 2 months ago

In any case I believe this is due to a shortcoming of the system: window size is only a multiplier of the (int) virtual width and height given by the core. In this case, this is most likely (256 * 8 / 7 = 292.5714...), rounded to 293. Multiplied by 7 = 2051 (source).

The correct way would be to have either a scaling factor which is then applied to the buffer size or make VirtualWidth and VirtualHeight return double instead of int.

vadosnaprimer commented 2 months ago

(256x8)x(240x7).

This is not how PAR works.

Yave-Yu commented 2 months ago

Which core are you testing this with? Also, how are you measuring the window size?

I tested NesHawk and BSNESv115+ core, I take screenshot then minus border to get game width. I now using 200% DPI, so border has 2 pixels width. The (7x) full width is 2055, I minus two border: 2055-2x2=2051.

Yave-Yu commented 2 months ago

And what version is this? Presumably 2.10 RC1 since that added an option for 7x scale in the menubar.

Just downloaded newer dev.

CasualPokePlayer commented 2 months ago

VirtualWidth and VirtualHeight return double instead of int. I think this would work out better, when they're used they could just be rounded out in the end (after any potential calculations).

Morilli commented 1 month ago

I've tried making virtual width and height float to see what would happen, and those virtual sizes are passed through so many layers that I've just given up for now.

Yave-Yu commented 1 month ago

Found a temporary solution: I just notice it now, enable integer scaling (see red box) then use 8x so I can see perfect 8:7 PAR scaling. BizHawk20241027_194546