[ scummvm-Patches-2974509 ] PSP: refactoring and 16 bit support

SourceForge.net noreply at sourceforge.net
Mon Mar 22 13:28:33 CET 2010

Patches item #2974509, was opened at 2010-03-22 12:28
Message generated for change (Tracker Item Submitted) made by bluddy
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bluddy (bluddy)
Assigned to: Nobody/Anonymous (nobody)
Summary: PSP: refactoring and 16 bit support

Initial Comment:
I broke the OsystemPSP class apart into several classes, refactoring it and cleaning up the code. 

Practical enhancements to the port:
- 16 bit support. I had to implement memcopy to enable swapping red an blue channels for some 16 bit games such as HE.
- Blurriness is gone in the main menu (unscaled and scaled images need to be handled differently when rendering)
- Cursor looks cleaner with blending than with alpha masking.
- Dirty implementation for all DisplayClients makes code more efficient -- we only draw if there's been a change on the screen.
- Went back to storing the Overlay and Screen in hardware memory, but did it properly: I removed the depth buffer, did proper allocation, and have backup allocation in main memory in case we run out of hardware memory.
- I think there's also some other speed improvement compared to the old code, but I'm not sure why.

Layout of the new code: 
- OsystemPSP now contains very little of the logic.
- GuRenderer class and MasterGuRenderer contain all calls to the graphics hardware.
- All surfaces (Screen, Overlay, Cursor, PSPKeyboard) were rebuilt to inherit the DisplayClient class. DisplayClients use one or more Buffers, Palettes and GuRenderers.
- Trace system has been refined and added to almost all PSP files. We can now fully trace almost all function calls  (and localize it to individual functions/classes). Tracing can be done to shell, to a file, or both.
- Virtual functions have been avoided to keep performance high. (we still get them at the entrance to OsystemPSP obviously)
- PSPKeyboard code was factored out (especially the complex state machine)


You can respond by visiting: 

More information about the Scummvm-tracker mailing list