function selectMenuY(selectY,maxNum){if(key[38]===1||key[73]===1){key[38]=2;key[73]=2;timer=0;if(backScene===BS_FREE&&gameScene===SCENE_EQUIPMENT){selectY++;if(selectY>maxNum-1){selectY=0}}else{selectY--;if(selectY<0){selectY=maxNum-1}} playSE(Sounds.SE_SELECT)}else if(key[38]>2||key[73]>2){if(timer>=KEY_WAIT){timer=0;if(backScene===BS_FREE&&gameScene===SCENE_EQUIPMENT){selectY++;if(selectY>maxNum-1){selectY=0}}else{selectY--;if(selectY<0){selectY=maxNum-1}} playSE(Sounds.SE_SELECT)}}else{key[38]=0;key[73]=0} if(key[40]===1||key[75]===1){key[40]=2;key[75]=2;timer=0;if(backScene===BS_FREE&&gameScene===SCENE_EQUIPMENT){selectY--;if(selectY<0){selectY=maxNum-1}}else{selectY++;if(selectY>maxNum-1){selectY=0}} playSE(Sounds.SE_SELECT)}else if(key[40]>2||key[75]>2){if(timer>=KEY_WAIT){timer=0;if(backScene===BS_FREE&&gameScene===SCENE_EQUIPMENT){selectY--;if(selectY<0){selectY=maxNum-1}}else{selectY++;if(selectY>maxNum-1){selectY=0}} playSE(Sounds.SE_SELECT)}}else{key[40]=0;key[75]=0} return selectY} function selectMenuX(selectX,maxNum){if(key[37]===1||key[74]===1){key[37]=2;key[74]=2;timer=0;selectX--;if(selectX<0){selectX=maxNum-1} playSE(Sounds.SE_SELECT)}else if(key[37]>2||key[74]>2){if(timer>=KEY_WAIT){timer=0;selectX--;if(selectX<0){selectX=maxNum-1} playSE(Sounds.SE_SELECT)}}else{key[37]=0;key[74]=0} if(key[39]===1||key[76]===1){key[39]=2;key[76]=2;timer=0;selectX++;if(selectX>maxNum-1){selectX=0} playSE(Sounds.SE_SELECT)}else if(key[39]>2||key[76]>2){if(timer>=KEY_WAIT){timer=0;selectX++;if(selectX>maxNum-1){selectX=0} playSE(Sounds.SE_SELECT)}}else{key[39]=0;key[76]=0} return selectX}