IntraFont.init()
IntraFont.load("flash0:/font/ltn8.pgf",2)
red = IntraFont.color(255,0,0,255)
yellow = IntraFont.color(0,255,255,255)
choice = true
a = 255
updown = 1
while choice == true do
	screen:clear()
	Gu.start3d()
	IntraFont.print(1,35,"WARNING",3,yellow,red)
	IntraFont.print(1,70,"This will flash the MyWindows Drivers to flash1:/",1,red,0)
	IntraFont.print(1,81,"Flashing is dangerous and MyWindows's Team take",1,red,0)
	IntraFont.print(1,92,"no responcibility for what happens to your psp.",1,red,0)
	IntraFont.print(1,103,"The drivers are nessary for ISO and some System functions",1,red,0)
	IntraFont.print(1,114,"if you do not flash the drivers then these functions will",1,red,0)
	IntraFont.print(1,125,"not be available. The choice is yours. Please make a ",1,red,0)
	IntraFont.print(1,136,"JigKick battery and a magic memory stick just incase.",1,red,0)
	IntraFont.print(1,147,"If you don't have one press START TO EXIT then make one.",1,red,0)
	IntraFont.print(1,158,"If you are ready in install the MyWindows Drivers. ",1,red,0)
	IntraFont.print(1,180,"Regards",1,red,0)
	IntraFont.print(1,191,"LordVisaris",1,red,0)
	IntraFont.print(1,169,"PRESS TRIANGLE NOW TO INSTALL or START TO EXIT.",1,IntraFont.color(0,0,255,a),0)
	Gu.end3d()
	screen.flip()
	if updown == 1 then
		a = a - 5
		if a == 10 then
			updown = 2
		end
	end
	if updown == 2 then
		a = a + 5
		if a == 255 then
			updown = 1
		end
	end
	pad = Controls.read()
	if pad:start() then
		System.Quit()
	end
	if pad:triangle() then
		choice = false
	end
end

screen:clear()
screen.flip()
screen:clear()
screen.flip()
screen:clear()
	Gu.start3d()
	IntraFont.print(1,10,"Reassigning flash1:/",1,yellow,red)
	Gu.end3d()
	screen.flip()
	Gu.start3d()
	IntraFont.print(1,10,"Reassigning flash1:/",1,yellow,red)
	Gu.end3d()
	screen.flip()
		System.unassign("flash1:")
		System.sleep(800)
		System.assign("flash1:","lflash0:0,1","flashfat1:")
		System.sleep(800)
	Gu.start3d()
	IntraFont.print(1,21,"Checking if flash1:/LPHMDRIVER Exsists",1,yellow,red)
	Gu.end3d()
	screen.flip()
	Gu.start3d()
	IntraFont.print(1,21,"Checking if flash1:/LPHMDRIVER Exsists",1,yellow,red)
	Gu.end3d()
	screen.flip()
		direxsist = System.doesDirExist("flash1:/LPHMDRIVER")
		if direxsist == 1 then
		else
			System.createDirectory("flash1:/LPHMDRIVER")
		end
	curdir = System.currentDirectory()
		System.sleep(1000)
	--System
	Gu.start3d()
	IntraFont.print(1,32,"Copying /LPHMDRIVER/syslib.prx to flash1:/LPHMDRIVER/syslib.prx",1,yellow,red)
	Gu.end3d()
	screen.flip()
	Gu.start3d()
	IntraFont.print(1,32,"Copying /LPHMDRIVER/syslib.prx to flash1:/LPHMDRIVER/syslib.prx",1,yellow,red)
	Gu.end3d()
	screen.flip()
		filexist = System.doesFileExist("flash1:/LPHMDRIVER/syslib.prx")
		if filexist == 1 then
			System.removeFile("flash1:/LPHMDRIVER/syslib.prx")
		end
		System.copyFile(curdir.."/LPHMDRIVER/syslib.prx","flash1:/LPHMDRIVER/syslib.prx",0)
		System.sleep(1000)
	--ISO
	Gu.start3d()
	IntraFont.print(1,43,"Copying /LPHMDRIVER/rdriver.prx to flash1:/LPHMDRIVER/rdriver.prx",1,yellow,red)
	Gu.end3d()
	screen.flip()
	Gu.start3d()
	IntraFont.print(1,43,"Copying /LPHMDRIVER/rdriver.prx to flash1:/LPHMDRIVER/rdriver.prx",1,yellow,red)
	Gu.end3d()
	screen.flip()
		filexist = System.doesFileExist("flash1:/LPHMDRIVER/rdriver.prx")
		if filexist == 1 then
			System.removeFile("flash1:/LPHMDRIVER/rdriver.prx")
		end
		System.copyFile(curdir.."/LPHMDRIVER/rdriver.prx","flash1:/LPHMDRIVER/rdriver.prx",0)
		System.sleep(1000)
	--hook
	Gu.start3d()
	IntraFont.print(1,54,"Copying /LPHMDRIVER/hook.prx to flash1:/LPHMDRIVER/hook.prx",1,yellow,red)
	Gu.end3d()
	screen.flip()
	Gu.start3d()
	IntraFont.print(1,54,"Copying /LPHMDRIVER/hook.prx to flash1:/LPHMDRIVER/hook.prx",1,yellow,red)
	Gu.end3d()
	screen.flip()
		filexist = System.doesFileExist("flash1:/LPHMDRIVER/hook.prx")
		if filexist == 1 then
			System.removeFile("flash1:/LPHMDRIVER/hook.prx")
		end
		System.copyFile(curdir.."/LPHMDRIVER/hook.prx","flash1:/LPHMDRIVER/hook.prx",0)
		System.sleep(1000)
	--hook eboot
	Gu.start3d()
	IntraFont.print(1,65,"Copying /LPHMDRIVER/load.pbp to ms0:/seplugins/load.pbp",1,yellow,red)
	Gu.end3d()
	screen.flip()
	Gu.start3d()
	IntraFont.print(1,65,"Copying /LPHMDRIVER/load.pbp to ms0:/seplugins/load.pbp",1,yellow,red)
	Gu.end3d()
	screen.flip()
		filexist = System.doesFileExist("ms0:/seplugins/load.pbp")
		if filexist == 1 then
			System.removeFile("ms0:/seplugins/load.pbp")
		end
		System.copyFile(curdir.."/LPHMDRIVER/load.pbp","ms0:/seplugins/load.pbp",0)
		System.sleep(1000)
	Gu.start3d()
	IntraFont.print(1,76,"Checking that all is well....Please Wait",1,yellow,red)
	Gu.end3d()
	screen.flip()
	Gu.start3d()
	IntraFont.print(1,76,"Checking that all is well....Please Wait",1,yellow,red)
	Gu.end3d()
	screen.flip()
		filexist = System.doesFileExist("flash1:/LPHMDRIVER/hook.prx")
		if filexist == 0 then
			Gu.start3d()
			IntraFont.print(1,87,"Error hook.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
			Gu.start3d()
			IntraFont.print(1,87,"Error hook.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
		else
			Gu.start3d()
			IntraFont.print(1,87,"OK hook.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
			Gu.start3d()
			IntraFont.print(1,87,"OK hook.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
		end
		filexist = System.doesFileExist("flash1:/LPHMDRIVER/rdriver.prx")
		if filexist == 0 then
			Gu.start3d()
			IntraFont.print(100,78,"Error rdriver.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
			Gu.start3d()
			IntraFont.print(100,87,"Error rdriver.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
		else
			Gu.start3d()
			IntraFont.print(100,87,"OK rdriver.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
			Gu.start3d()
			IntraFont.print(100,87,"OK rdriver.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
		end
		filexist = System.doesFileExist("flash1:/LPHMDRIVER/syslib.prx")
		if filexist == 0 then
			Gu.start3d()
			IntraFont.print(200,87,"Error syslib.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
			Gu.start3d()
			IntraFont.print(200,87,"Error syslib.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
		else
			Gu.start3d()
			IntraFont.print(200,87,"OK syslib.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
			Gu.start3d()
			IntraFont.print(200,87,"OK syslib.prx",1,yellow,red)
			Gu.end3d()
			screen.flip()
		end
		filexist = System.doesFileExist("ms0:/seplugins/load.pbp")
		if filexist == 0 then
			Gu.start3d()
			IntraFont.print(300,87,"Error load.pbp",1,yellow,red)
			Gu.end3d()
			screen.flip()
			Gu.start3d()
			IntraFont.print(300,87,"Error load.pbp",1,yellow,red)
			Gu.end3d()
			screen.flip()
		else
			Gu.start3d()
			IntraFont.print(300,87,"OK load.pbp",1,yellow,red)
			Gu.end3d()
			screen.flip()
			Gu.start3d()
			IntraFont.print(300,87,"OK load.pbp",1,yellow,red)
			Gu.end3d()
			screen.flip()
		end
		System.sleep(1000)
	Gu.start3d()
	IntraFont.print(1,98,"Exiting",1,yellow,red)
	Gu.end3d()
	screen.flip()
	Gu.start3d()
	IntraFont.print(1,98,"Exiting",1,yellow,red)
	Gu.end3d()
	screen.flip()
		System.sleep(1000)
	System.Quit()
