Opened 13 months ago

Closed 10 months ago

Last modified 10 months ago

#10239 closed defect (fixed)

PSP port incorrect 4:3 aspect radio

Reported by: damsoftPL Owned by: rsn8887
Priority: normal Component: Ports
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 (5)

comment:1 Changed 12 months ago by csnover

Keywords: PSP aspect ratio 4x3 removed

comment:2 Changed 10 months ago by damsoftPL

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 Changed 10 months ago by digitall

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

comment:4 Changed 10 months ago by rsn8887

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 10 months ago by rsn8887 (previous) (diff)

comment:5 Changed 10 months ago by rsn8887

Owner: set to rsn8887
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.