Reposting that script, only because I'd hate to see it get eaten by mediafire evetually:
chrsel=0
col=0
bcnt=0
infomode=1
dbgsel=0
mdmp={}
tgenb=false
jp4={}
function rb(x)
return memory.readbyte(x)
end
function rw(x)
return memory.readword(x)
end
function rcb(x)
return rb(j+x)
end
function rcw(x)
return rw(j+x)
end
stnames="HurtHBadSlowTangSlepFrezPetrConfStopMiniBarrXforMoglPosnBurnDead"
elnames="EartAir WatrFireDarkLigtMoonMana"
cnames={nil,"Young lady1","Boy1","Girl1","Old man1","Moogle kid","Pot","Man",
"Woman","Sprite","Man2","Woman2","Sprite2","Gnome","Undine","Salamando",
"Sylphid","Lumina","Shade","Luna","Dryad","Moogle","Neko","Dwarf","Old dwarf",
"Watts","Grandpa","Truffle","Walrus","Jema","Luka","Joch","Jehk","Sheex",
"Scorpion","Phanna","Krissie","Sergo","Slave","Picard","Spinning man",
"Dyluck","Rudolph","Santa Claus","Matango","Emperor","Geshtar","Fanha",
"Burka woman","Sheex","Flammie head","Soldier","Guard","Meria","Morie",
"Elinee","Elder","Lady","King","Mana fort","Thanatos","Elliott","Timothy","R. Man",
"R. Girl","Hippie","Old lady","Young lady","Boy","Girl","Old man","Old woman",
"Mara","Dragon","Flammie body","Cannon bro","Clerk",nil,nil,
"Orb1","Spring","Fuse","Bubbles 1","Bubbles 2","Ghost","Sword","Cannon TL","Cannon L","Splash",
"Cannon BL","Cannon TR","Cannon BR","Seed",
"Mini man","Mini woman","Mini sprite",nil,"Dead man","Dead woman","Dead sprite",nil,nil,nil,
"Enemy chest","Chest","Statue","Mini statue","Snowman","Mini snowman","Moogle1"}
tim1={0x1b4,0x1b2,0x1b3,0x1b5,0x1b6}
tim2={0x1b7,0x1ba,0x1bb,0x1bc,0x1b8,0x1ed,0x1bd}
mask1={3,0x7e,0x180,0x1800,0x6000}
mask2={192,48,12,3,16384,0,4096}
scstn={"Exec","Gather","Text","Delay","Wait",nil,"Complete","Center"}
-- cvst : convert string to ascii
function cvst(addr)
local st,x
st=""
while true do
x=rb(addr)
if x<128>=30) then endline() end
end
-- dispnbr : display letter and a number
function dispnbr(x,text)
if x~=0 then
disp4(string.format("%s%3d",text,x))
end
end
-- dispstat : display flags
function dispstat(x,text)
if x~=0 then
for b=0,15 do
if AND(x,BIT(b))~=0 then
disp4(string.sub(text,b*4+1,b*4+4))
end
end
end
end
-- disptimr : display timers
function disptimr(nbr,bits,mask,vars,chrs)
for l=1,nbr do
m=mask[l]
if m==0 or AND(m,bits)~=0 then
dispnbr(rcb(vars[l]),string.sub(chrs,l,l))
end
end
end
-- chrname : get the name for a character type
function chrname(x)
if(x<128) then addr=0xca0000+rw(0xca099e+x*2)
elseif(x<131>=128 then
if j==0x7ee200 then a=a+5 end
a=a+5
end
return a
end
-- rdsg : read signed byte from character
function rdsg(x)
a=rcb(x)
if a>=128 then return a-256 end
return a
end
-- rdabs : get absolute value of character byte
function rdabs(x)
a=rcb(x)
if a>=128 then return 256-a end
return a
end
-- dbox : draw a box at cx,cy
function dbox(w,h,color)
left=cx-w
top=cy-h
right=cx+w
bottom=cy+h
if left>=0 and right<255>=0 and bottom<238>=0 and a<256>=0 and b<239>=0 and c<256>=0 and d<239 then
gui.drawline(a,b,c,d,color)
end
end
-- dtxt : output a line of text
function dtxt(x,...)
if k<224 then
gui.text(x,k,string.format(...))
end
end
-- dcr : draw character bounding box
function dcr(x,color)
if cchr==chrsel and bcnt<4 then color=0xffff end
if rcb(x+2)~=0 then
cx=px+rdsg(x)
cy=py+rdsg(x+1)
right=rdabs(x+2)
bottom=rdabs(x+3)
if nb then
right=right/2
bottom=bottom/2
end
dbox(right,bottom,color)
end
end
-- updjp : handle input
btns={"start","select","up","down","left","right","A","B","X","Y","L","R"}
function updjp(x)
bcnt=(bcnt+1)%8
jp3=jp2
jp2=joypad.read(x)
for i=1,12 do
x=btns[i]
jp4[i]=jp2[x] and not jp3[x]
end
x=0
if jp4[3] then x=-1 end
if jp4[4] then x=1 end
if jp4[5] then dbgsel=(dbgsel+7)%8 end
if jp4[6] then dbgsel=(dbgsel+1)%8 end
for i=0,11 do
chrsel=chrsel+x
if chrsel<0>11 then chrsel=0 end
if rb(0x7ee000+chrsel*512)==1 then break end
if i==11 then chrsel=0 end
if x==0 then x=1 end
end
if jp4[9] then infomode=(infomode+1)%3 end
if jp4[10] then tgenb=not tgenb end
end
-- ldchr : set character
function ldchr()
j=0x7ee000+cchr*512
cnb=cchr<3>=128 then return cvst(0xc00000+rw(0xc05cfb+x*2)).."'s orb" end
return cvst(0xca0000+rw(0xca08f4+x*2))
end
-- dispweak : display weaknesses
function dispweak()
dispstat(rcw(0x1a1),elnames)
end
-- dispcst : display character stats
function dispcst()
if rcb(0x1b1)<128>=3 and flt then return end
cchr=i
ldchr()
if rb(j)==1 and (i<3 or nb or rb(i+0xe5d)~=0) then
if nt or i<3 then x=0x1e7 else x=0x180 end
id=rcb(x)
-- show character name
if i<6>=3 and nb and rcb(0x32)==0 then dtxt(232,"%d",rcw(0x34)/16) end
tp=rcb(0x1fb)
if cnb then
-- show action, animtimer, script address, script vars
ac=rcb(17)
if(rcb(28)==0) then ac=ac+128 end
dtxt(96,"%02X %02X %04X %04X",ac,rcb(18),rcw(0x144)+0x4f15,rcw(0x146))
else
-- boss: show AIRoutine, MoveRoutine, 7A, Mode, AttackTimer
dtxt(96,"%04X %04X %02X %02X %02X",rcw(0x8e),rcw(0x90),rcb(0x7a),rcb(0x94),rcb(0x96))
if(i==chrsel) then
-- show flags, animation, animoffset, animtimer, B0, B2
k=k+8
dtxt(0,"%04X %04X %02X %02X %04X %04X",rcw(0x98),rcw(0x9a),rcw(0x9c),rcw(0x9e),rcw(0xb0),rcw(0xb2))
end
end
k=k+8
if i<6 and rcb(0x180)<131>=3 then
-- enemy: show experience, gold
dtxt(152,"%5d %5d",rcw(0x18d),rcw(0x1c8))
else
-- player: show experience needed for next level, current weapon level and sublevel
dtxt(152,"%5d %d:%2d",AND(rcw(0x17d)-rcw(0x18d),65535),rcb(0x19c),rcb(0x1d0+rcb(0x1e4)))
end
k=k+8
end
-- show character stats when B is pressed
if(cchr==chrsel and jp2.B==1) then dispcst() end
st=""
stat1=rcw(0x190)
stat2=AND(rcw(0x1b0),0xfdff)
-- show status
dispstat(stat1,stnames)
dispstat(stat2,"Def+Def-Eva+Eva-Hit+Hit-Atk+Atk-SlepNThrRecvDTgtShldJumpWallChst")
if i==chrsel then dispweak() end
-- show timers (hurt, sleep, silence, transform, poison)
disptimr(5,stat1,mask1,tim1,"HSCXP")
-- (attack+-, hit+-, evade+-, defense+-, wall, recover, barrel)
disptimr(7,stat2,mask2,tim2,"ahedWRB")
-- show saber and mana magic
x=rcb(0x1ae)
y=x%15
if y~=0 then disp4("+1/"..string.format("%d",10-y)) end
dispnbr(rcb(0x19d),"w")
dispnbr(math.floor(x/16),"M")
dispstat(rcb(0x195),"SSabTSabISabFSabDSabLSabMSabMMag")
endline()
end
end
rt={}
rcnt=0
rcnt2=0
memory.registerexec(0xb64c,function()
print(string.format("Script tile %02X",memory.getregister("a")))
end)
--memory.register(0x7ee00e,function()
-- print(string.format("dispflag written at pc=%06X and --sc=%02X%04X",memory.getregister("pbpc"),
-- rb(0xd3),rw(0xd1)))
--end)
memory.registerexec(0x1e77b,function()
a=memory.getregister("a")
sp=memory.getregister("s")
ra=rw(sp+1)
if ra==0xe778 then ra=AND(memory.readdword(sp+4),0xffffff) else ra=ra+0xc10000 end
print(string.format(a>=0x800 and "Path %04X from %06X" or "Script %04X from %06X",a,ra))
end)
-- get values from random generator
memory.register(0x7e033d,function() if rb(0x33d)~=55 then
rcnt2=rcnt2+1 end end)
memory.register(0x7e03f0,function()
if rb(0x3f0)==15 then return end
if rcnt==dbgsel then
for i=0,63 do
mdmp[i]=rb(0x1c0+i)
end
for i=64,127 do
mdmp[i]=rb(0x340+i)
end
end
rcnt=rcnt+1
end)
while true do
scp=rw(0xd4)
scj=rb(0x7ee02c+scp)
if(scj==0) then scj=1 end
if(scj==4) then scj=3 end
scs=rb(0xd0)
-- auto skip dialogue
if(scj<4>=128
nb=rb(0x5c)<128>maxc then maxc=a end
end
end
b=0
rt2={}
for i=0,127 do
x=AND(rt[rof%15]+rt[(rof+14)%15],255)
rt[(rof+14)%15]=x
rof=rof+1
if i<24 then gui.text(AND(i,7)*24,32+(AND(i,24)/8)*8,string.format('%02X',x)) end
rt2[i]=x
if x<maxc and b<80>99 then x=99 end
rcv=rcb(0x1ed)
agl=rcb(0x189)
if rcv>0 then x=math.floor(x/2) end
z=3
cra=ccr()
if rt2[1]*101<x>999 then power=999 end
for l=3,5 do
cchr=l
ldchr()
if rcb(0)==1 and (nb and updc==l-3 or not nb and updc==AND(rcb(0x99),3)) then
x=rcb(0x1a4)
y=rcb(0x1b0)
def=rcw(0x1a5)
if AND(y,4)~=0 then x=x+math.floor(x/4) elseif AND(y,8)~=0 then x=x-math.floor(x/4) end
if AND(y,1)~=0 then def=def+math.floor(def/4) elseif AND(y,2)~=0 then def=def-math.floor(def/4) end
y=z
if rt2[z-1]*100<x>0 then
x=math.floor((99-agl)/2)+80
power=math.floor((x-rcv)*math.floor(power/2)/x)
elseif rt2[y]<cra>dpower and i==mainchr then
gui.text(l*48-84,59,string.format("%d:%3d",l-2,power-dpower))
end
end
end
end
end
end
gui.text(2,59,string.format("%04X",rcnt))
end
nmi=rw(0x101)
flt=nmi==0x88cf or nmi==0xa64a or nmi==0xac26
if nt and not flt then
for i=0,11 do
cchr=i
ldchr()
if rb(j)==1 and (cnb or AND(rcb(0x99),32)==0) then
px,py,pz,pz2=chrpos()
dlin(px,py-pz,px,py,0x3f)
if not cnb then py=py-pz pz=0 end
if i<3>=128 then
cx=cx-rw(0xac)
cy=cy-rw(0xae)
else
cx=cx-rw(0xa8)
cy=cy-rw(0xaa)
end
if cx<0 then cx=cx+rw(0xc0) end
if cy<0 then cy=cy+rw(0xc2) end
if x==2 then x=16 else x=8 end
if(i<3) then dbox(x,x,0xfff4) else dbox(x,x,0xfce0) end
end
l=l+16
end
end
if tgenb and not flt then
cchr=rcb(0x1ac)
if(cchr~=255) then
ldchr()
tx,ty,tz,tz2=chrpos()
ty=ty-tz-tz2
dlin(px,py-pz-pz2,tx,ty,0xffff)
cx=tx
cy=ty
dbox(2,2,0xffff)
end
end
end
end
end
if jp2.B and jp2.A then
-- show random numbers
st=""
for i=0,127 do
st=st..string.format("%02X",mdmp[i])
if i%16==15 then gui.text(0,80+AND(i,112)/2,st) st="" end
end
elseif infomode==0 then
for i=0,11 do
dispchar(i)
end
elseif infomode==1 then dispchar(chrsel) end
if(scs~=0) then
-- show script state
y=scs
if(scs<128) then scs=1 else scs=scs-126 end
x=scstn[scs]
if not x then x=string.format("%02X",y) end
dtxt(0,"%02X%04X %s",rb(0xd3),rw(0xd1),x)
if scs==4 then dtxt(128,"%02X",rb(0x4f)) end
end
if rb(0x1826)==1 or AND(rb(0x1803),32)~=0 then
-- show information about menu items
y=rb(0x1803)
k=32
if(AND(y,32)==32) then
z=rw(rw(0x1822))
if(z~=0xffff) then
-- characters
j=0x7e0000+z
dispcst()
st="Weak:"
col=5
dispweak()
endline()
end
else
x=rb(0x19d3)
y=rb(0x19d2)
cchr=rb(0x1808)
ldchr()
if y==85 then
if x<72 then
-- weapons
if x%9<8 and jp2.A then x=x+1 end
y=math.floor(x/9)
z=rcb(0x1c0+math.floor(y/2))
if(AND(y,1)==0) then z=z/16 else z=AND(z,15) end
a=x*12+0xd01000
dtxt(0,"L%d/%d %d:%2d C%2d H%2d A%2d S%2d",x%9+1,rb(0x7ecfb8+y)+1,z,
rcb(0x1d0+y),rb(a+6),rb(a+7),rb(a+8),rb(a+11))
k=k+8
st="Infl:"
col=5
dispstat(rcw(9),stnames)
endline()
elseif x<135>=42 then y=x-42 else y=math.floor(x/6) end
z=rcb(0x1c4+math.floor(y/2))
if(AND(y,1)==0) then z=z/16 else z=AND(z,15) end
dtxt(0,"L%d:%2d",z,rcb(0x1d8+y))
if x<42 then
j=x*64+0xd02ad8
dtxt(128,"S %2d H %2d",rcb(2),rcb(3))
k=k+8
st="Elem:"
col=5
dispstat(rcb(4),elnames)
endline()
st="Infl:"
col=5
dispstat(rcw(5),stnames)
endline()
end
end
end
end
rcnt=0
rcnt2=0
snes9x.frameadvance()
end