Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#10239 closed defect (fixed)

PSP port incorrect 4:3 aspect radio

Reported by: damsoftPL Owned by: rsn8887
Priority: normal Component: Port: PSP
Version: Keywords:
Cc: Game:

Description

PSP ScummVM port has incorrect 4:3 aspect radio. Screen is actually displayed in 1:1 aspect radio even when "aspect ratio" option is chosen (I'm testing PSP ScummVM 1.9.0).

Below screenshot shows how aspect ratio works on current version of PSP port (upper image) and how it should work (lower image):
https://image.ibb.co/eW0ng5/Indiana_Jones4_4x3.png

Change History (6)

comment:1 by csnover, 6 years ago

Keywords: PSP aspect ratio 4x3 removed

comment:2 by damsoftPL, 6 years ago

To make 4x3 aspect ratio work properly on PSP one minor change in source code needs to be applied.
I've already recompile ScummVM for PSP with that change and it works great.
The change is needed in backends\platform\psp\display_manager.cpp in the calculateScaleParams() method.
Below the original code and modified by me (I added one condition and one assignment)

Original code:

case KEEP_ASPECT_RATIO:	{ // maximize the height while keeping aspect ratio
		float aspectRatio = (float)_displayParams.screenSource.width / (float)_displayParams.screenSource.height;

		_displayParams.screenOutput.height = PSP_SCREEN_HEIGHT;	// always full height
		_displayParams.screenOutput.width = (uint32)(PSP_SCREEN_HEIGHT * aspectRatio);

		if (_displayParams.screenOutput.width > PSP_SCREEN_WIDTH) // we can't have wider than the screen
			_displayParams.screenOutput.width = PSP_SCREEN_WIDTH;
	}
	break; 

Modified code:

case KEEP_ASPECT_RATIO:	{ // maximize the height while keeping aspect ratio
		float aspectRatio = (float)_displayParams.screenSource.width / (float)_displayParams.screenSource.height;

		if ((float)_displayParams.screenSource.height==200)
			aspectRatio = (float)_displayParams.screenSource.width / (float)240; 

		_displayParams.screenOutput.height = PSP_SCREEN_HEIGHT;	// always full height
		_displayParams.screenOutput.width = (uint32)(PSP_SCREEN_HEIGHT * aspectRatio);

		if (_displayParams.screenOutput.width > PSP_SCREEN_WIDTH) // we can't have wider than the screen
			_displayParams.screenOutput.width = PSP_SCREEN_WIDTH;
	}
	break;

comment:3 by digitall, 6 years ago

Have opened a Pull Request for this patch as https://github.com/scummvm/scummvm/pull/1096

comment:4 by rsn8887, 6 years ago

Fixed by the following commit:
https://github.com/scummvm/scummvm/commit/a3d2c5268768bff0bed06aff00d97704c88bb337

Now the user has the choice on PSP between the old graphics mode "Keep Aspect Ratio," good for 16:10 games like Dreamweb, and a new mode "4:3 Aspect Ratio," good for 4:3 games like Full Throttle.

PSP development builds are currently crashing when loading any game. That is a different issue which will be fixed once a new buildbot is implemented. In the meantime, you can try out the change using the working development build here:
https://github.com/rsn8887/scummvm/releases/tag/2.1.0git-rsn8887.1

Last edited 6 years ago by rsn8887 (previous) (diff)

comment:5 by rsn8887, 6 years ago

Owner: set to rsn8887
Resolution: fixed
Status: newclosed

comment:6 by digitall, 5 years ago

Component: PortsPort: PSP
Note: See TracTickets for help on using tickets.