mamedev / mame

MAME
https://www.mamedev.org/
Other
7.94k stars 1.98k forks source link

amstrad/amstrad: wrong default screen resolution #12271

Open malespiaut opened 4 months ago

malespiaut commented 4 months ago

MAME version

0.264 (unknown)

System information

OS: Arch Linux, 64-bit, kernel 6.8.5-zen1-1-zen
Locale: en_US.UTF-8
RAM: 16GB
CPU: 11th Gen Intel i7-1165G7 (8) @ 4.700GHz
GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics]

INI configuration details

No response

Emulated system/software

Amstrad CPC6128 (cpc6128)

Incorrect behaviour

MAME reports a screen resolution of 704×144 while the Amstrad CPC 6128 normally have a resolution of 768×272.

While this doesn't impact gameplay, it does impact video recording via the -aviwrite option, and may be the source of some emulation bugs.

Expected behaviour

MAME should report a video resolution of 768×272 when launching the cpc6128, as it is the Full-Screen Mode 2 resolution (see: https://www.cpcwiki.eu/index.php/Video_modes).

Steps to reproduce

Launch MAME for the cpc6128 machine, and see the MAME boot message.

For video recording, launch MAME for the cpc6128 machine with the -aviwrite test.avi option, and view the test.avi result.

Additional details

No response

angelosa commented 4 months ago

https://github.com/mamedev/mame/blob/fbaf6548eeee3f2ad55b9fb7df593e3d062dc7cb/src/mame/amstrad/amstrad.cpp#L920

  1. The math is wrong here for a default, where -aviwrite blindly adheres and has no provision for in-flight resolution changes;
  2. -aviwrite should be put in the air and destroyed like in skeet shooting. I seriously doubt you get much out of a CPC before it starts doing resolution changes and breaks your capture, consider using app alternatives such as OBS Studio for grabbing MAME video output instead.
holub commented 4 months ago

MAME else adds extra resolution beyond standard border in spectrum-based drivers. But output screen can be cutted to the lower values. As far as I remeber @ICEknigh7 knows how.

ICEknigh7 commented 4 months ago

I don't know how MAME does it here, but I think that any cropping should be left to the views and shaders, instead of having it hardcoded to the assumed but sometimes incorrect values.

Using a real monitor with a V-hold knob indeed allows us to see parts of the screen which MAME won't be able to display due to not having an uncropped view available, including some initial and trailing partial scanlines which I'm not sure can be emulated yet: partial scanlines

(Image taken from a ZX Spectrum +2A, just for illustrative purposes)

malespiaut commented 4 months ago
  1. -aviwrite should be put in the air and destroyed like in skeet shooting. I seriously doubt you get much out of a CPC before it starts doing resolution changes and breaks your capture, consider using app alternatives such as OBS Studio for grabbing MAME video output instead.

Hello @angelosa,

I was planning to use OBS / ffmpeg x11grab at first. But the advantage of an integrated video recording option is to have pixel-perfect and frame perfect recording, and without having to worry about video compression (which will be taking care of later, during post-processing).

I do understand that it is a burden for developpers, and it would be justified to remove it from MAME; but I also think that this is, in my humble opinion, a killer feature if it's being kept in and taken care of.

angelosa commented 4 months ago

I was planning to use OBS / ffmpeg x11grab at first. But the advantage of an integrated video recording option is to have pixel-perfect and frame perfect recording, and without having to worry about video compression (which will be taking care of later, during post-processing).

Very unconvinced by this statement:

  1. -aviwrite by itself creates this big and giant "unfiltered" output that first and beforemost depends on HDD space and speed throughput;
  2. it will silently fail on prolonged sessions last time I bothered with it (a long time ago);
  3. it's running in pixel aspect unfiltered, it doesn't do anything like 4:3 and it's straight unusable by anything non-canonical (cfr. pce for a laugh)
  4. Above must also imply that is doing SOFTWARE grabbing under the hood, something that was outdated 10 years ago.
  5. People don't even use the CLI option but rather the "Record AVI" hotkey where it matters (-> games that goes sub-100% performance), which I guess it's perfectly controllable thru LUA script too.
  6. OR -mngwrite/-wavwrite combo.
  7. OR (again) OBS/FFmpeg/GStreamer/v4l2loopback
ICEknigh7 commented 4 months ago

Yeah, OBS is the way to go for recording MAME in the proper aspect ratio. If you need a "crisp pixel" look, just use the default bgfx shader and set prescale to 3 in mame.ini.