Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Chrono Trigger Infoscope for Snes9x(1.51-rr)
- -- 2015/10/30 Redslash
- -- I'm always open to suggestions/questions on this script! =)
- --Hitbox Viewer (under construction)
- --Input Display distinguishes tap/hold/turbo (compatible with SMVs);
- --RNG Display emphasizes windows in pairs;
- --(crit display removed)
- local inputs = joypad.get()
- local button = {'R','L','X','A','right','left','down','up','start','select','Y','B'}
- local xcoords = { 8.6, 0.4, 9,10, 2, 0, 1, 1, 6, 4, 8, 9}
- local ycoords = { 1, 1, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4}
- local press= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
- local unpress = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
- local turbo = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
- local selectheld = 0
- local dispbox = 1 -- press Select to toggle
- local dispboxID = 0 -- CHANGE THIS TO 1 TO SEE NPC IDs!
- local dispy = 191
- local yoffset = 182
- local xoffset = 70 -- 89 = button display centered
- local regcolor = {"#CCCCCC","#00CCCC","#CCCCCC"}
- local regshade = {"#444444","#004444","#444444"}
- local nocolor = "#00000000"
- local charname = {"C","M","L","R","F","A","J"}
- local charcolor = {"#CCCC00","#0000FF","#CC0000","#808080","#00CC00","#CC4400","#808080","#808080","#808080"}
- local charshade = {"#444400","#000044","#440000","#444400","#004400","#441100","#404040"}
- local BATTLE_FLAG = 0x7e0117
- local battleflag = 0
- local battlecopy = 0
- local FACING = 0x7e1600
- local MOVING = 0x7e1680
- local facing = {}
- local moving = {}
- local faceoffset = 5 -- experimental
- local MAP_X = 0x7e1800
- local MAP_Y = 0x7e1880
- local mapx = {}
- local mapy = {}
- local mapoffsetx = 0
- local mapoffsety = 0
- local SCREEN_X = 0x7e0A00
- local SCREEN_Y = 0x7e0A80
- local mainsprite = 0
- local farsprite = 0
- local xsign,ysign = "",""
- local xcolor,ycolor = 0,0
- local LOCATION = 0x7e0100
- local loc = memory.readword(LOCATION)
- local redbox = {}
- redbox[0x70] = {0x14,0x2e,0x30,0x32}
- redbox[0x77] = {0x32,0x34,0x3c,0x3e,0x28,0x2a,0x46,0x1c,0x1e}
- redbox[0x91] = {0x14,0x16,0x20}
- redbox[0x8c] = {0x20,0x22,0x24,0x2e,0x30,0x1e,0x1a} --3 frogs are friendly
- redbox[0x1d5] = {0x1c,0x26}
- redbox[0xb0] = {0x20,0x22}
- --redbox[0xa8] = {0x14,0x16,0x18,0x1a,0x1c,0x1e} --ozzie pits
- redbox[0x8e] = {0x24}
- redbox[0x92] = {0x10,0x18}
- redbox[0x93] = {0x10,0x18,0x1a}
- redbox[0x96] = {0x10}
- redbox[0x90] = {0x10,0x12,0x1a}
- redbox[0x94] = {0x10,0x12}
- redbox[0x8f] = {0x28,0x2a,0x1c,0x2c}
- redbox[0x82] = {0x3c,0x44,0x40,0x26,0x28,0X32,0x38,0x24,0x30,0x34,0x36,0x10,0x16,0x18}
- redbox[0x83] = {0x66,0x68,0x5e,0x1c,0x2c,0x32,0x40,0x4c,0x4e,0x50}
- redbox[0x84] = {0x1a,0x1c,0x1e,0x20,0x22,0x24,}
- redbox[0x7a] = {0x30,0x32,0x34}
- redbox[0x78] = {0x16}
- redbox[0x13] = {0x1c,0x24,0x26,0x28,0x2a,0x2c,0x2e,0x30,0x3c,0x3e,0x40}
- redbox[0x1C] = {0x4}
- redbox[0x15] = {0x22}
- redbox[0xd4] = {0x24,0x26,0x28,0x2a,0x3a,0x3c,0x3e,0x40,0x42,0x12,0x14,0x16,0x18,0x1a,0x1c}
- redbox[0xd7] = {0x10,0x12,0x14,0x16,0x18,0x1a,0x1c}
- redbox[0xd9] = {0x20,0x22,0x24,0x26,0x18,0x1a,0x1c,0x1e,0x14,0x16}
- redbox[0xe4] = {0x16,0x18,0x1a}
- redbox[0x1d1] = {0x20,0x22,0x24,0x26,0x28}
- redbox[0x112] = {0x12,0x14,0x16,0x18,0x1c,0x1e,0x22,0x24,0x26,0x28,0x2a,0x2c}
- redbox[0x11a] = {0x2a,0x2c,0x2e,0x30,0x32,0x34,0x36,0x38}
- redbox[0x11d] = {0x20,0x22}
- redbox[0x11e] = {0x10}
- redbox[0x11f] = {0x1a,0x1c,0x1e,0x20,0x22,0x24}
- redbox[0x120] = {0x14,0x16,0x18}
- redbox[0x11c] = {0x12,0x14,0x16,0x18}
- redbox[0xa4] = {0x16,0x18,0x1a}
- redbox[0x7d] = {0x12,0x22,0x1e}
- redbox[0x1be] = {0x24,0x26,0x28,0x2a,0x2c,0x2e}
- redbox[0x1bf] = {0x30,0x32,0x34,0x36,0x38,0x3a}
- redbox[0x125] = {0x18,0x1a,0x1c,0x1e,0x22,0x24,0x28,0x2c,0x26,0x30}
- redbox[0x126] = {0x16,0x1a,0x1c,0x28}
- redbox[0x12a] = {0x24,0x26,0x28,0x2c,0x2e,0x30,0x3e,0x42,0x40,0x5c,0x5e,0x60,0x62,0x6e,0x70,0x72}
- redbox[0x12b] = {0x14,0x12,0x16,0x18}
- redbox[0x131] = {0x10,0x12,0x14,0x1c,0x24,0x20}
- redbox[0x130] = {0x12,0x14}
- redbox[0x12f] = {0x1a,0x18}
- redbox[0xdb] = {0x10,0x12}
- redbox[0xa0] = {0x02,0x04,0x06,0x08,0x0a}
- redbox[0xa1] = {0x20}
- local trigger = {}
- trigger[0xc6] = {0x010d,0x020d,0x030d,0x040d,0x050d,0x060d,0x070d,0x080d,0x090d,0x0a0d,0x0b0d,0x0c0d,0x0d0d}
- trigger[0x70] = {0x0d09,0x0c09,0x0b09,0x0e09,0x0712,0x0912,0x0812,0x0b0d,0x0c0d}
- trigger[0xd4] = {0x0c34,0x0d34,0x0e34,0x0f34,0x1034,
- 0x0c33,0x0d33,0x0e33,0x0f33,0x1033,
- 0x0c32,0x0d32,0x0e32,0x0f32,0x1032,
- 0x0c31,0x0d31,0x0e31,0x0f31,0x1031,
- 0x0c30,0x0d30,0x0e30,0x0f30,0x1030, 0x1727,0x1827,0x1927,
- 0x0714,0x0715,0x0716,0x0717,0x0718,0x0719,0x071a,0x071b}
- trigger[0xd5] = {0x2622,0x2623,0x2624,0x2625,0x2626,
- 0x2d37,0x2d38,0x2d39,0x2d3a,0x2d3b,
- 0x2e31,
- 0x3925,0x3a25,0x3b25,0x3c25,0x3d25,
- 0x3437,0x3438,0x3439,0x343a,0x343b}
- trigger[0xda] = {0x352a,0x362a,0x372a,0x382a,0x392a,0x3a2a}
- trigger[0xe2] = {0x3424,0x3524,0x3624,0x3724,0x3824,0x3924,0x3a24,
- 0x3423,0x3523,0x3623,0x3723,0x3823,0x3923,0x3a23,0x3b23,
- 0x3422,0x3522,0x3622,0x3722,0x3822,0x3922,0x3a22,0x3b22,
- 0x3421,0x3521,0x3621,0x3721,0x3821,0x3921,0x3a21}
- trigger[0xe6] = {0x1323,0x1324,0x1325,0x1326,
- 0x0d23,0x0d24,0x0d25,0x0d26,0x0431,0x0d3d,0x0d3c}
- trigger[0x30] = {0x0914,0x0915,0x0916,0x0917,0x0918,0x0919,0x091a}
- trigger[0x31] = {0x1f2e,0x202e,0x212e,0x222e,0x232e,0x242e,0x252e,0x262e,0x272e,
- 0x1f2f,0x1f30,0x1f31,0x1f32,0x1f33,0x1f34,
- 0x122b,0x122c,0x122d,0x122e,0x122f}
- trigger[0x2f] = {0x3235,0x3335,0x3435,0x3535,0x3635,0x3735,0x3835,0x3935,0x3a35,0x3b35,0x3c35,
- 0x2932,0x2931,
- 0x102c,0x0f2c,0x0e2c,0x0d2c,0x0c2c,0x0b2c,
- 0x301e,0x311e,0x321e,0x331e,0x341e,0x351e,0x361e,0x371e,0x381e,0x391e}
- trigger[0x87] = {0x3308,0x3309,0x330a,0x2a07,0x2a08,0x2a09,0x2a0a}
- trigger[0x91] = {0x0e02,0x0e03,0x0e04,0x0d04,0x0c04,0x0b04,0x0a04,0x0904}
- trigger[0x8e] = {0x0517,0x0617,0x0417,0x0317,0x0217,
- 0x1235,0x0f35,0x0e35,0x0d35,
- 0x1234,0x1134,0x1034,0x0f34,0x0d34}
- trigger[0x92] = {0x081b}
- trigger[0x48] = {0x1211,0x1212,0x1213,0x1207,0x1208,0x1209}
- trigger[0x2a] = {0x0712,0x0612,0x0512,0x0812,0x1012,0x0912}
- trigger[0xa8] = {0x320a,0x3310,0x390f,0x390c,0x3a08,0x3c0b}
- trigger[0x124] = {0x080e,0x090e,0x0a0e,0x0b0e,0x070e,0x060e,0x050e,0x030e,0x020e,0x010e,0x000e,0x0d0e,0x0e0e}
- trigger[0x12e] = {0x0f0d,0x0f0e,0x0f0f,0x0f10,0x0f11}
- trigger[0xa0] = {0x0e10,0x0d10,0x0c10,0x0b10,0x0a10,0x0910,0x0f10,0x1010,0x1110,0x1210,0x1310,0x1410,0x1510,
- 0x0909,0x090a,0x090b,0x090c,0x090d,0x090e,0x090f}
- function displayHitbox()
- for i = 1,64 do
- mapx[i] = math.floor(memory.readword(MAP_X + 2*(i-1))/16)
- mapy[i] = math.floor(memory.readword(MAP_Y + 2*(i-1))/16)
- facing[i] = memory.readbyte(FACING + 2*(i-1))
- if memory.readbyte(MOVING + 2*(i-1)) > 0 then
- moving[i] = 1
- else moving[i] = 0 end
- end
- spritex = {}
- spritey = {}
- mainsprite = 0
- farsprite = 0
- for i = 1,16 do -- get one sprite to compare
- spritex[i] = memory.readword(SCREEN_X + 2*(i-1))
- spritey[i] = memory.readword(SCREEN_Y + 2*(i-1))
- if loc == 0xa0 then mainsprite = 7
- elseif loc == 0xa1 then mainsprite = 8
- elseif mainsprite == 0 and spritex[i] > 0 and spritey[i] > 0 and mapx[i] ~= 0xFF0 and
- (mapy[i] ~= 0xff0 and mapx[i] ~= 0x178) and
- (mapy[i] ~= 0xff0 and mapx[i] ~= 0x088) and
- (mapy[i] ~= 0xff0 and mapx[i] ~= 0x298) and
- (mapy[i] ~= 0xff0 and mapx[i] ~= 0x368) and
- (mapy[i] ~= 0xff0 and mapx[i] ~= 0x268) and
- (mapy[i] ~= 0xff0 and mapx[i] ~= 0x2b8) and
- (mapy[i] ~= 0xff0 and mapx[i] ~= 0x0c8) and
- (mapy[i] ~= 0xff0 and mapx[i] ~= 0xff8) then
- mainsprite = i
- end
- end
- if mainsprite ~= 0 then
- mapoffsetx = mapx[mainsprite] - spritex[mainsprite]
- mapoffsety = mapy[mainsprite] - spritey[mainsprite]
- end
- if trigger[loc] ~= nil then
- special = 0
- if loc == 0xa8 then special = 8 end
- if table.getn(trigger[loc]) ~= nil then
- for j = 1,table.getn(trigger[loc]) do
- screenx = math.floor(trigger[loc][j] / 0x100)*0x10 - mapoffsetx + special
- screeny = (trigger[loc][j] % 0x100)*0x10 - mapoffsety
- gui.box(screenx,screeny,screenx+15,screeny+15,"#ffff0000")
- end
- end
- end
- boxlimit = 64
- if loc == 0xa8 then boxlimit = 8 end
- for i = 1,boxlimit do
- screenx = mapx[i] - mapoffsetx - 8
- screeny = mapy[i] - mapoffsety - 16
- if screenx < 256 and screeny < 208 then
- if i < 9 then color = "#0000ff00" else color = "#00ff0000" end
- if redbox[loc] ~= nil then
- if table.getn(redbox[loc]) ~= nil then
- for j = 1,table.getn(redbox[loc]) do
- if i == redbox[loc][j]/2+1 then color = "#ff000000" end
- end
- end
- end
- if facing[i] == 0 then
- gui.box(screenx+0, screeny-faceoffset*moving[i], screenx+15, screeny+15-faceoffset, color) --up
- elseif facing[i] == 1 then
- gui.box(screenx+0, screeny+faceoffset, screenx+15, screeny+15+faceoffset*moving[i], color) --down
- elseif facing[i] == 2 then
- gui.box(screenx-faceoffset*moving[i], screeny+0, screenx+15-faceoffset, screeny+15, color) --left
- elseif facing[i] == 3 then
- gui.box(screenx+faceoffset, screeny+0, screenx+15+faceoffset*moving[i], screeny+15, color) --right
- else
- gui.box(screenx+0, screeny+0, screenx+15, screeny+15, color) end
- if (dispbox == 1 and dispboxID == 1) then
- gui.text(screenx+faceoffset, screeny+faceoffset, string.format("%x",2*(i-1)),"#FFFFFF","#00000000")
- end
- end
- end
- gui.box(0,211,256,224,"#000000")
- end
- local BATTLE_VALUE = 0x7e0026
- local BATTLE_STORE = 0x7e29AD
- local CRIT_VALUE = 0x7eB3E6
- local MENU_TIME = 0x7e0D00
- local menutime = 0
- local menuopen = 0
- local CHAR_ID = 0x7e2980 -- 3 in-party, 6 reserve
- local chars = {}
- local ATB = 0x7eAFAB
- local atb = {}
- for i = 0,10 do atb[i] = memory.readbyte(ATB+i) end
- local windowname = {}
- windowname[0] = {"00","01","02","05","07","09","11","14","18","23","26","28","33","36","39","41"}
- windowname[1] = {"00","01","02","05","09","12","15","16","19","22","25","28","31","35","39","42"}
- windowname[2] = {"00","02","03","05","07","11","15","16","18","20","24","28","32","35","39","41"}
- local battlewindow = {} --set of windows for 0, 1, and 2 empty characters
- battlewindow[0] = { 0,0x09,0x0d,0x1d,0x2e,0x37,0x3e,0x58,0x61,0x88,0x98,0xab,0xb9,0xdc,0xe3,0xfb,256}
- battlewindow[1] = { 0,0x0d,0x12,0x17,0x35,0x40,0x5c,0x67,0x6a,0x88,0x8f,0xad,0xb3,0xd0,0xe4,0xfd,256}
- battlewindow[2] = { 0,0x0b,0x18,0x1d,0x2c,0x33,0x64,0x66,0x6d,0x79,0x85,0xa7,0xb6,0xd3,0xe6,0xf7,256}
- local bvrec = {}
- local bvsave = 0
- function Reload()
- bvrec = {}
- end
- savestate.registerload(Reload)
- bvreccolor = {}
- for i = 0,255 do bvreccolor[i] = 8 end
- secrange = {"0",".5","1","1.5","2","2.5","3","3.5","4"}
- rulecolors={"#A00000","#FF0000",
- "#008000","#00FF00",
- "#0000FF","#2020FF",
- "#A0A0A0","#FFFFFF",
- "#A000A0","#FF00FF",
- "#808000","#FFFF00",
- "#008080","#00FFFF",
- "#404040","#808080"}
- function getValues()
- battleflag = memory.readbyte(BATTLE_FLAG) % 2
- --Catch the BV copy
- if battlecopy == 0 and battleflag == 1 and memory.readbyte(BATTLE_VALUE) == memory.readbyte(BATTLE_STORE) then
- battlecopy = 1
- elseif battleflag == 0 then
- battlecopy = 0
- end
- --Get the active PCs
- mtchars = 0
- for i = 1,3 do
- chars[i] = memory.readbyte(CHAR_ID+i-1)
- if chars[i] >= 0x07 then mtchars = mtchars + 1 end
- end
- --Value is at different address for in-battle, out-of-battle, & load menu:
- if battlecopy == 1 then
- bv = memory.readbyte(BATTLE_VALUE)
- cv = memory.readbyte(CRIT_VALUE)
- else
- if (memory.readbyte(MENU_TIME) > 0 and memory.readbyte(BATTLE_STORE) == 0 and mtchars == 0) then
- --menutime is for ALL menus, BV is 0 for entire beginning... but load menu has "3 Crono's" (000000)
- bv = memory.readbyte(MENU_TIME)
- bvrec = {}
- else bv = memory.readbyte(BATTLE_STORE) end
- cv = bv
- end
- if bv > bvsave then
- for i = bvsave+1,bv-1 do bvrec[i] = 0 end
- bvrec[bv] = 1
- bvsave = bv
- bvreccolor[bv] = 8
- elseif bv < bvsave then
- for i = bvsave+1,255 do bvrec[i] = 0 end
- for i = 0,bv-1 do bvrec[i] = 0 end
- bvrec[bv] = 1
- bvsave = bv
- bvreccolor[bv] = 8
- end
- --catch ATB reset
- newatb = {}
- for i = 0,10 do
- newatb[i] = memory.readbyte(ATB+i)
- if atb[i] == 0 and newatb[i] ~= 0 and newatb[i] ~= 0x80 then
- if bvreccolor[bv] == 8 then
- if i < 3 then
- bvreccolor[bv] = chars[i+1]
- else
- bvreccolor[bv] = 7
- end
- end
- end
- atb[i] = newatb[i]
- end
- end
- function displayValues()
- rulecolor = 1
- for j = 1,16 do
- if bv >= battlewindow[mtchars][j] and bv < battlewindow[mtchars][j+1] then
- rulecolor = j
- end
- end
- gui.text(bv,dispy+26,string.format("%x",bv),rulecolors[rulecolor],"#00000000")
- for i = 0,255 do
- for j = 1,16 do
- if i >= battlewindow[mtchars][j] and i < battlewindow[mtchars][j+1] then
- rulecolor = j
- end
- end
- gui.pixel(i,dispy+24,rulecolors[rulecolor])
- if i%4 == 0 then gui.pixel(i,dispy+25,rulecolors[rulecolor]) end
- if i%16 == 0 then
- gui.pixel(i,dispy+26,rulecolors[rulecolor])
- gui.pixel(i,dispy+27,rulecolors[rulecolor]) end
- if bvrec[i] == 1 then
- gui.pixel(i,dispy+23,charcolor[bvreccolor[i]+1])
- if bvreccolor[i] < 7 then
- gui.pixel(i,dispy+22,charcolor[bvreccolor[i]+1])
- end
- end
- end
- gui.pixel(bv,dispy+21,charcolor[bvreccolor[bv]+1])
- gui.pixel(bv,dispy+22,charcolor[bvreccolor[bv]+1])
- gui.pixel(bv,dispy+23,charcolor[bvreccolor[bv]+1])
- end
- local CHAR_ID = 0x7e2980 -- 3 in-party then 6 reserve (e.g. for 1-on-1 bosses)
- local CHAR_WEAP = 0x7e2629
- local CHAR_ACC = 0x7e262A
- local crits = "0737062067712743017053012106621026206760245002737143667207070014"..
- "1101674231747620560305126422403270125313166113731602620666773021"..
- "1714114244363074011420427072702021156152710015037100071773030063"..
- "3110560024303132144471071671003163600200333701061633241110004006"..
- "0737062067" --wrap-around
- function displayCrits()
- --Get equipment and their crit chance
- chance = {}
- crittext = ""
- for i = 1,3 do
- if chars[i] < 0x07 then
- weap = memory.readbyte(CHAR_WEAP + 0x50*(chars[i]))
- acc = memory.readbyte(CHAR_ACC + 0x50*(chars[i]))
- if weap == 0x55 then -- rainbow
- chance[i] = 1
- elseif acc == 0xB3 and (weap == 0x42 or weap == 0x3D) then -- masamune+heromedal
- chance[i] = 2
- elseif weap == 0x40 or weap == 0x19 or weap == 0x1A then -- wonder, siren, valkerye
- chance[i] = 3
- elseif weap == 0x53 then -- swallow
- chance[i] = 4
- elseif weap == 0x54 or chars[i] == 4 then -- slasher2 (22)
- chance[i] = 5
- elseif weap == 0x0D or chars[i] == 1 or chars[i] == 2 or chars[i] == 5 then -- kaliblade
- chance[i] = 6
- elseif chars[i] == 0 or chars[i] == 3 or chars[i] == 6 then
- chance[i] = 7 end
- else chance[i] = 8 end
- end
- for i = 1,6 do
- cc = 7
- critconf = 0
- cv = cv + 1
- for j = 1,3 do
- if chance[j] <= tonumber(crits:sub(cv,cv)) then
- critconf = critconf + 1
- if critconf == 1 then
- cc = chars[j] + 1
- elseif critconf > 1 then
- end
- end
- end
- writeDigit(tonumber(crits:sub(cv,cv)),184+i*10,charcolor[cc],charshade[cc])
- end
- end
- local emuframe = 0
- local moviedata = {}
- local movieoffset = 0
- function displayJoypad()
- emuframe = emu.framecount()
- --Read in movie file:
- if movie.mode() == "playback" and movieoffset == 0 then
- f = io.open(movie.name(), "rb")
- byte = f:read(1)
- while byte ~= nil do
- byte = string.byte(byte)
- table.insert(moviedata, byte)
- byte = f:read(1)
- end
- f:close()
- for i = 0,3 do
- movieoffset = movieoffset + moviedata[0x1C+1+i]*(0x100^i)
- end
- end
- --Get inputs either from movie or user:
- if movie.mode() == "playback" then
- word = moviedata[movieoffset + emuframe*2 + 1] + moviedata[movieoffset + emuframe*2]*0x100
- word = math.floor(word / 16) --discard 4 lowest bits; Lua uses all doubles (floating point)
- for i = 1, 12 do
- if word % 2 == 1 then
- inputs[ button[i] ] = true
- else inputs[ button[i] ] = nil end
- word = math.floor(word / 2)
- end
- else inputs = joypad.get() end
- --Draw each button (color it based on hold duration):
- for i = 1, 12 do
- if inputs[button[i]] then
- if unpress[i] > 0 then
- press[i] = 0
- if unpress[i] == 4 then
- turbo[i] = 1
- else
- turbo[i] = 0
- end
- unpress[i] = 0
- end
- if press[i] < 250 then
- press[i] = press[i] + 4
- end
- else
- if unpress[i] ~= 0 then -- i.e. was pressed in previous frame
- turbo[i] = 0
- end
- if unpress[i] < 250 then
- unpress[i] = unpress[i] + 4
- end
- end
- shoulder = 0
- if i == 1 or i == 2 then shoulder = 1 end
- buttoncolor = ""
- if inputs[button[i]] then
- if turbo[i] == 1 then
- buttoncolor = "#ff0000ff"
- else
- buttoncolor = "#"..string.format("%02x",0xFF-press[i]).."ff00".."ff"
- end
- elseif turbo[i] == 1 then
- buttoncolor = "#ff0000ff"
- elseif press[i] > 0 then
- darken = string.rep(string.format("%02x",0xFF-press[i]),3)
- buttoncolor = "#"..string.format("%02x",press[i]).."00"..string.format("%02x",0xff-press[i])..string.format("%02x",0xff-unpress[i])
- else buttoncolor = "#00000000"
- end
- bx = 10
- by = 8
- gui.box(
- xoffset+xcoords[i]*bx, yoffset+ycoords[i]*by,
- xoffset+xcoords[i]*bx+bx +shoulder*bx, yoffset+ycoords[i]*by+by -shoulder*3, buttoncolor, "#FFFFFFFF")
- gui.pixel(xoffset+xcoords[i]*bx,yoffset+ycoords[i]*by,"#808080ff")
- gui.pixel(xoffset+xcoords[i]*bx,yoffset+ycoords[i]*by+by-shoulder*3,"#808080ff")
- gui.pixel(xoffset+xcoords[i]*bx+bx+shoulder*bx,yoffset+ycoords[i]*by,"#808080ff")
- gui.pixel(xoffset+xcoords[i]*bx+bx+shoulder*bx,yoffset+ycoords[i]*by+by-shoulder*3,"#808080ff")
- if turbo[i] == 1 then
- gui.text(xoffset+xcoords[i]*bx+4, yoffset+ycoords[i]*by+1,"T","#ffffff","#00000000")
- end
- end
- gui.text(xoffset+44,206,"-",regcolor[1],"#00000000") --attn: select button
- end
- while true do
- inputs = joypad.get()
- getValues()
- --Catch <select> pressed
- if inputs[ button[10] ] then
- if selectheld == 0 then
- selectheld = 1
- if dispbox == 4 then
- dispbox = 1
- else dispbox = dispbox + 1 end
- end
- else selectheld = 0 end
- loc = memory.readword(LOCATION)
- if menutime ~= memory.readbyte(MENU_TIME) then
- if menuopen == 0 then
- menuopen = 1 end
- else menuopen = 0 end
- menutime = memory.readbyte(MENU_TIME)
- --Display all
- if (dispbox > 2) and loc < 0x1F0 and menuopen == 0 and battleflag == 0 then
- displayHitbox()
- end
- if dispbox == 1 or dispbox == 3 then
- displayJoypad()
- end
- if dispbox == 2 or dispbox == 4 and mtchars < 3 then
- displayValues()
- -- displayCrits()
- end
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement