--Menu action

section=nil
currentOne=1
black = Color.new(0,0,0)
white = Color.new(255,255,2500)
red=Color.new(0,0,255)
oldpad=Controls.read()

while true do
pad=Controls.read()
screen:clear(black)
screen:print(10,10,"Pick one: menu by xpack.", white)
screen:print(10,20,"Flash0",white)
screen:print(10,30,"Flash1",white)
screen:print(10,40,"ms0",white)

if currentOne ==1 then
screen:print(10,20,"Flash0",red)
elseif currentOne ==2 then
screen:print(10,30,"Flash1",red)
elseif currentOne ==3 then
screen:print(10,40,"ms0",red)
end

if currentOne ==4 then
currentOne = 1
elseif currentOne ==0 then
currentOne = 3
end

if pad:cross() and oldpad:cross()~= pad:cross() and currentOne == 1 then
section = "flash0:/"
dofile("System/functions/menu.lua")
elseif pad:cross() and oldpad:cross() ~= pad:cross() and currentOne == 2 then
section = "flash1:/"
dofile("System/functions/menu.lua")
elseif pad:cross() and oldpad:cross() ~= pad:cross() and currentOne == 3 then
section = "ms0:/"
dofile("System/functions/menu.lua")
end

if pad:down() and oldpad:down() ~= pad:down() then
currentOne = currentOne + 1
end
if pad:up() and oldpad:up() ~= pad:up() then
currentOne = currentOne - 1
end
screen.flip()
screen.waitVblankStart()
end