nero = Color.new(0,0,0)
rosso = Color.new(255,0,0)
pic = Image.load("SYSTEM/resources/other/options3.png")

Selected = 20
timer1 = 0
timer2 = 0

timer3 = 0

while true do
pad = Controls.read()

if 1==1 then System.setcpuspeed(333) end

screen:blit(0,0,pic)
screen:print(7,7,"OPTIONS MENU :",rosso)
screen:print(7,8,"OPTIONS MENU :",rosso)

screen:print(10,240,"Press X to CONFIRM",rosso)


Mp3me.play()
if Mp3me.gettime() == Mp3me.songTime() then
Mp3me.stop()
Mp3me.load("SYSTEM/resources/music/SND1.mp3")
Mp3me.play()
end

if 1==1 then timer3 = timer3 + 1 end

if pad:up() then timer1 = timer1 + 1 end
if not pad:up() then timer1 = 0 end
if timer1 == 1 then Selected = Selected - 10 end

if pad:down() then timer2 = timer2 + 1 end
if not pad:down() then timer2 = 0 end 
if timer2 == 1 then Selected = Selected + 10 end


screen:print(10,25,"Balls Options",nero)
screen:print(10,35,"Background Options",nero)
screen:print(10,45,"Menu Layout Selection",nero)
screen:print(10,55,"CPU Setting",nero)


if Selected==20 then screen:print(10,25,"Balls Options",rosso) end
if Selected==30 then screen:print(10,35,"Background Options",rosso) end
if Selected==40 then screen:print(10,45,"Menu Layout Selection",rosso) end
if Selected==50 then screen:print(10,55,"CPU Setting",rosso) end

if Selected==20 and pad:cross() then dofile("SYSTEM/resources/options/optionsBalls.lua") end
if Selected==30 and pad:cross() then dofile("SYSTEM/resources/options/optionsBackground.lua") end
if Selected==40 and pad:cross() then dofile("SYSTEM/resources/options/optionsmenu.lua") end
if Selected==50 and pad:cross() then dofile("SYSTEM/resources/options/CPUoptions.lua") end

if Selected==60 then Selected=50 end
if Selected==10 then Selected=20 end

if Selected==50 then screen:print(25,158,"__________________________________",nero) end
if Selected==50 then screen:print(30,170,"If the CPU speed doesn't change,",nero) end
if Selected==50 then screen:print(30,180,"you have to set in the VSH MENU,",nero) end
if Selected==50 then screen:print(30,190,"CPU CLOCK GAME to default",nero) end
if Selected==50 then screen:print(25,195,"__________________________________",nero) end

screen:print(10,250,"Press O to return to the MAIN MENU",rosso)
if pad:circle() and timer3>20 then dofile("SYSTEM/resources/menu/menu.lua") end


screen.waitVblankStart()
screen.flip()
screen:clear()
end










