Lockdown v3.0
Author: Torch

Lockdown allows you to password protect your PSP from prying eyes.
It also protects the Recovery Menu so that the protection can't be disabled without considerable effort (or by unbricking).

Features:
* Completely customizable GUI
* Uses PSP keys like Square, Cross, Circle etc as password, instead of fumbling with an on screen keyboard
* Fully configurable from the PSP
* Protects Recovery Menu as well
* Supports 2 modes of operation: 1st mode will only ask for password when the PSP is rebooted or powered on. 2nd mode will ask for password every time the XMB is launched, such as after quitting a game etc.
* Application errors (Game could not be started, etc) will be displayed normally in the XMB unlike other password programs which won't display these messages. So you know why you were sent back to the XMB.

Installation:

**WARNING: Messing with flash0: can brick your PSP if you screw up**

1. Open flash0 via USB. Paste the lockdown.thm file here (in the drive root).

1. Go to the /vsh/module folder. Make sure you have enough free space to install the files.

2. Rename the vshmain.prx to vshmain_real.prx

3. Paste the vshmain.prx from the archive into this folder.

3. Reboot PSP. You will see the password screen asking you to set a new password. You can use the PSP face buttons, the D-Pad and L-Trigger & R-Trigger. You can enter a maximum of 10 buttons. Press Start after you are done. It will ask you to re-type the password for confirmation. Then choose the mode you want (ask password only on reboot, or ask password everytime XMB is started). After that the XMB will launch.

4. If the above worked out correctly, then you can now proceed to protect the recovery menu. If it didn't work then use recovery mode to restore your original vshmain.prx. To protect recovery mode, open flash0 via USB and go to the flash0:/vsh/module folder. Rename the recovery.prx to recovery_real.prx

5. Paste the recovery.prx from the archive into this folder.

Ensure that you have renamed the files correctly or you might brick your PSP.
If you have problems getting it to work, you can try using the debug versions from the "debug" folder in the archive. They will display any errors that occur.

Uninstallation:
Delete the vshmain.prx and recovery.prx and rename the vshmain_real.prx and recovery_real.prx back to the original names.
Also delete the buttons.ini and lockdown.thm from flash0:

Installing Themes:
Themes should be named "lockdown.thm" and placed in the root of flash0:
As a safety precaution, Lockdown will first look for lockdown.thm in the Memory Stick root and load that if present. This will allow you to recover your PSP in case you install a non-working theme in flash0:

Creating Themes:
The mktheme folder in the archive contains the necessary files to make custom themes.

You can use PNG images with alpha channel transparency.

The coords.txt file contains the x & y coordinates to draw each image at, and the width and height of the image.
The x & y coordinates represent the top left corner of the image.

e.g.
background.png	0 0 480 272

This will draw background.png at 0,0 (the top left corner of the screen) and it will be 480 pixels wide and 272 pixels in height. (The width and height specified for the image in coords.txt can be less than the actual dimensions of the PNG file. The image will only be drawn upto the size specified.)

Do not change the names of the PNG files. Do not change the image names in coords.txt. You only need to change the coordinates and width/height of in coords.txt.

To generate the .thm file, open a command prompt in the mktheme folder (the PNG files and coords.txt must be in the same folder as mktheme.exe) and type:
mktheme coords.txt
This will generate a file called "lockdown.thm".

You can also specify the name of the output file:
mktheme coords.txt mytheme.thm

However, you must rename the file to lockdown.thm in order to install it.

Due to insufficient memory on the Phat PSP, the usable memory by Lockdown has been limited to 2MB. So if your images are too large it might cause Lockdown to crash.

v3.0 Changelog
------------------------------------------
Added support to customize the GUI.
Optimized memory usage.

v2.1 Changelog
------------------------------------------
Removed a bunch of object files that were accidently linked into the debug version. It shouldn't affect the functionality in anyway though.

v2.0 Changelog
------------------------------------------
Now fully supports PSP Phat and PSP Slim. Uses less RAM as well, so it shouldn't conflict with other plugins. If you have too many plugins enabled for VSH mode it may not work.

v1.5 Changelog
------------------------------------------
Completely unloads module after launching XMB resulting in more free memory for other applications. This should allow the debug version to work on a Phat.
Full Phat compatibility for the graphical version to be added shortly.

v1.4 Changelog
------------------------------------------
Reduced stack memory.

v1.3 Changelog
------------------------------------------
Added debug versions that use text output.

v1.2 Changelog
------------------------------------------
Fixed sleep mode from not working in some situations.

v1.1 Changelog
------------------------------------------
Reduced heap size, and freed some allocated memory on quit.
