while true do
Screen.waitVblankStart()
Screen.refresh()
Controls.init()
pad = Controls.read()
Screen.fillEmptyRect(60,260,50,82,selected_item,BOTTOM_SCREEN)
Screen.fillRect(61,259,51,81,menu_color,BOTTOM_SCREEN)
if (sm_index == 1) then
Screen.fillRect(61,259,51,66,selected_color,BOTTOM_SCREEN)
Screen.debugPrint(63,53,"Confirm",selected_item,BOTTOM_SCREEN)
Screen.debugPrint(63,68,"Cancel",Color.new(0,0,0),BOTTOM_SCREEN)
if (Controls.check(pad,KEY_DDOWN)) and not (Controls.check(oldpad,KEY_DDOWN)) then
sm_index = 2
elseif (Controls.check(pad,KEY_A)) and not (Controls.check(oldpad,KEY_A)) then
System.uninstallCIA(cia_table[p].access_id,cia_table[p].mediatype)
UpdateSpace()
break
end
else
Screen.fillRect(61,259,66,81,selected_color,BOTTOM_SCREEN)
Screen.debugPrint(63,53,"Confirm",Color.new(0,0,0),BOTTOM_SCREEN)
Screen.debugPrint(63,68,"Cancel",selected_item,BOTTOM_SCREEN)
if (Controls.check(pad,KEY_DUP)) and not (Controls.check(oldpad,KEY_DUP)) then
sm_index = 1
elseif (Controls.check(pad,KEY_A)) and not (Controls.check(oldpad,KEY_A)) then
break
end
end
Screen.flip()
oldpad = pad
end
cia_table = System.listCIA()
if p > #cia_table then
p = p - 1
end