@echo off
title=AutoDowngrade Generator v1.01
echo Welcome to AutoDowngrade Generator, Version 1.01.
echo.
echo I would like to thank: 
echo Dark_AleX {http://dax.st/} for: 
echo 3.10 OEA Custom Firmware (Thanks man!)
echo 2.71 Generic Downgrader
echo Homebrew Enabler for 2.71 (Used by Noobz for downgrader and Hen for 2.80)
echo.
echo Noobz {http://noobz.eu/} for:
echo 2.80 Hen
echo 2.80 Downgrader (Dudes, you rock)
echo 3.03 Downgrader (O.O Dang, MAN you rock)
echo.
echo Testers
echo jsf12487 (Tested 3.03 Downgrading, 3.03 OEC upgrading)
echo Masked Stranger (Tested 2.80 upgrading, downgrading, etc)
echo Me (tested custom firmware downgrading, upgrading, etc)
echo.
echo Also, you must have at least 75% battery, and preferably plugged in as well.
echo.
echo Are we clear? Ok, let's get started.
pause

:menu
if exist 150.pbp move 150.pbp CoreData\150.pbp
if exist 280.pbp move 280.pbp CoreData\280.pbp
if exist 303.pbp move 303.pbp CoreData\303.pbp
if exist 310.pbp move 310.pbp CoreData\310.pbp
if not exist CoreData\150.pbp (
echo CoreData\150.pbp could not be found.
goto fail
)
if not exist CoreData\280.pbp (
echo CoreData\280.pbp could not be found.
goto fail
)
if not exist CoreData\303.pbp (
echo CoreData\303.pbp could not be found.
goto fail
)
if not exist CoreData\310.pbp (
echo CoreData\310.pbp could not be found.
goto fail
)
if exist Result rd /Q /S Result
if not exist Result mkdir Result
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ~~~~~~***What firmware are you on?***~~~~~~
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 0) I don't care, I just wanna upgrade to 3.10 OEA.
echo 1) 1.00
echo 2) 1.50
echo 3) 1.51 ~ 2.71
echo 4) 2.80
echo 5) 2.81 ~ 3.02
echo 6) 3.03
echo 7) 3.10 ~ ?.??
echo 8) Custom Firmware
echo 9) Quit
echo.
set answer=
set /p answer=My current firmware is number [1~9]=
if (%answer%)==(0) goto f150
if (%answer%)==(1) goto below150
if (%answer%)==(2) goto f150
if (%answer%)==(3) goto below280
if (%answer%)==(4) goto f280
if (%answer%)==(5) goto below303
if (%answer%)==(6) goto f303
if (%answer%)==(7) goto above303
if (%answer%)==(8) goto custom
if (%answer%)==(9) goto end
goto menu

:f150
xcopy /Y /E /V CoreData\310OEA\* Result\psp\game\*
copy CoreData\150.pbp Result\psp\game\oeupdmaker\*
copy CoreData\310.pbp Result\psp\game\oeupdmaker\*
goto Uwin

:f280
xcopy /Y /E /V CoreData\280HenDown\* Result\*
copy CoreData\150.pbp Result\psp\game\update\update.pbp
cls
echo All files prepared for downgrade to [1.50] from 2.80.
echo.
echo 1) Start Hen by going to "Photo", and opening the folder "HEND 2.80".
echo  ) You should see a flash of blue if it works.
echo  ) {If you don't see blue, and the psp shuts off, try the following:}
echo  ) Set up a custom wallpaper to fill memory.
echo  ) Open the HEND folder with "Triangle", choose "Slide Show".
echo  ) {If all else fails, turn off your psp and remove battery for a bit.}
echo.
echo Showing image of TA motherboards:
start CoreData\SpotTA.jpg
echo If you have a TA-082 or TA-086 motherboard, do the next step:
echo TA) Open "TA082 IdStorage Changer" by going to "Game", 
echo   ) Open "Memory Stick".
echo.
echo 2) Run "Update X.YZ" from your "Game","Memory Stick". Follow instructions.
echo.
echo 3) Done! You will see a blue screen, and need to put in your settings again.
echo  ) You now have 1.50, and if you 'had' a TA motherboard, you are in the clear.
echo.
echo Add in the files to upgrade to Dark_AleX's custom firmware, 3.10 OEA?
set answer=
set /p answer=Enter [`y` for yes, `n` for no]=
cls
if (%answer%)==(y) goto f150
goto win

:f303
xcopy /Y /E /V CoreData\303HenDown\* Result\*
copy CoreData\150.pbp Result\psp\game\update\update.pbp
cls
echo All files prepared for downgrade to [1.50]. (Including TA-082 and TA-086)
echo.
echo You need "Grand Theft Auto:Liberty City Stories", unpatched.
echo GTA:LCS is unpatched if it contains a 2.00 upgrade instead of a 2.60 upgrade.
echo Opening image of Unpatched GTA:LCS for next step.
start CoreData\UnpatchedGTA.jpg
echo.
echo 1) Start GTA:LCS. It should get to "loading savegame", screen clears to black,
echo  ) and then it fills with a light blue color, then the PSP will reset itself.
echo 2)Check that HEN is running by going to:
echo  )"Settings", "System Settings", and "System Information". 
echo  )It should now be "303 HEN". If not, go back to Step 1.
echo 3) Run "Update X.YZ" from your "Game", "Memory Stick". Follow instructions.
echo 4) Done! You will see a blue screen, and need to put in your settings again.
echo  ) You now have 1.50, and if you had a TA motherboard, you are in the clear.
echo  {If you have problems, make sure you have an unpatched GTA LCS,}
echo  {Back up any saved GTA games you have before moving files over,}
echo  {Delete all GTA saved games from the psp, try this again.}
echo.
echo Add in the files to upgrade to Dark_AleX's custom firmware, 3.10 OEA?
set answer=
set /p answer=Enter [`y` for yes, `n` for no]=
cls
if (%answer%)==(y) goto f150
goto win

:custom
xcopy /Y /E /V CoreData\280HenDown\psp\game\UPDATE\* Result\psp\game\RECOVERY\*
copy CoreData\150.pbp Result\psp\game\RECOVERY\UPDATE.PBP
cls
echo All files prepared for downgrade to [1.50].
echo.
echo To Downgrade:
echo 1) Turn your PSP completely off, and hold down the `R` button as it boots.
echo 2) Choose "Run program at /psp/game/recovery/eboot.pbp"
echo 3) Follow on screen instructions.
echo.
echo Add in the files to upgrade to Dark_AleX's custom firmware, 3.10 OEA?
set answer=
set /p answer=Enter [`y` for yes, `n` for no]=
cls
if (%answer%)==(y) goto f150
goto win

:below150
if not exist Result\psp\game\update mkdir Result\psp\game\update
copy CoreData\150.pbp Result\psp\game\update\eboot.pbp
cls
echo You need to upgrade to firmware 1.50.
echo Files prepared to upgrade to 1.50
echo.
goto win

:below280
echo.
if not exist Result\psp\game\update mkdir Result\psp\game\update
copy CoreData\280.pbp Result\psp\game\update\eboot.pbp
cls
echo You need to upgrade to firmware 2.80.
echo Files prepared to upgrade to 2.80
echo.
goto win

:below303
echo.
if not exist Result\psp\game\update mkdir Result\psp\game\update
copy CoreData\303.pbp Result\psp\game\update\eboot.pbp
cls
echo You need to upgrade to firmware 3.03.
echo Files prepared to upgrade to 3.03.
echo.
echo You need "Grand Theft Auto:Liberty City Stories", unpatched.
echo GTA:LCS is unpatched if it contains a 2.00 upgrade instead of a 2.60 upgrade.
echo.
echo Showing image of Unpatched GTA:LCS for next step:
start CoreData\UnpatchedGTA.jpg
echo.
echo If you do not have this game, you might as well wait until you do.
goto win

:above303
cls
echo Sorry, this firmware has not been cracked yet. >Result\Sorry.txt
echo Sorry, This has not been cracked yet.
echo.
echo Please do not upgrade until we have.
echo.
goto fail

:Uwin
cls
echo.
echo All files prepared for upgrade to 3.10 OEA by Dark_AleX.
echo.
echo To run:
echo 1) Run OE update maker to make Data.dxar.
echo 2) Move \psp\game\oeupdmaker\data.dxar to \psp\game\303oeflasher.
echo 3) Run the 3.10 OEA flash program, follow on screen instructions.
echo.
echo {Please have battery at 80%~100% with power cord plugged in}
echo.
goto win

:win
start Result
echo Please move all folders and files here to the root of your memory stick.>Result\AutoDowngraderReadme.txt
echo So if your psp is on drive F:\, move all folders here to F:\>>Result\AutoDowngraderReadme.txt
echo.
echo Copy all files inside of Result to the root of your memory stick. 
echo {Not MS_ROOT, the same folder that contains psp.}
echo.
echo {Example: E:\, F:\, etc.}
goto last

:fail
echo AutoDowngrade Generator has failed.

:last
echo.
set answer=
set /p answer=Enter anything to exit=