creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
HHS wrote:
It's also impossible to leave a room in the middle of something.
tasvideos guidelines wrote:
You are supposed to be the master of the game, not the slave of the game. Aim for the impossible. Think outside the box and do not give up if your ideas do not work right away. Just because you cannot get something to work right away does not mean that it is not possible.
NitroGenesis
He/Him
Editor, Experienced player (556)
Joined: 12/24/2009
Posts: 1873
I wonder why you added all of those italics. I also don't think that post was necessary because it is a fairly trivial thing.
YoungJ1997lol wrote:
Normally i would say Yes, but thennI thought "its not the same hack" so ill stick with meh.
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
Oh, I see what you're getting at. You can use the magic rope while the girl or sprite is in the lead and still be able to interact with things. That's interesting. You can't stop scripts from completing in this way, though. Possible uses would be: - Going through one of those vertical passageways that connect parts of a room in the wrong location - Jumping with the whip in the wrong location - Preventing something that normally happens when you enter the room that you teleport to - etc.
Joined: 4/1/2010
Posts: 90
Interesting... I didn't know having the Girl or Sprite in the lead would have different effects on losing control on events. You can for example activate the Mana Seeds while using the Magic Rope. The event will then simply occur at the entrance... I'm not sure that's useful. but certainly interesting. I can't think of a single application for the "slide-corridoors" or the Magic Rope + Rope Pole though. Flammie Drum seems to behave different though. You completely lose control. Is there a way to keep control even for just a moment? And... Edit before I even submit this: I just had a very...interesting incident. I went into the Pandora Castle, the bugged room just at before the main entrance to the left where you can use the Magic Rope (Normally you get permanently stuck there when using the Magic Rope in that room). However, when I used the Magic Rope and the immediately left the room, I got to this location: http://s14.postimg.org/hoh04bq01/Unbenannt.jpg What happened? o.o..
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
All controls are disabled when you call Flammie. Every time you go between rooms, it saves the current position so that an exit tile will take you to the previous room. It turns out this is what the $7ECD00 variables were for. When using the magic rope while stepping on an exit tile, the destination room will be saved. So you'll end up at the corresponding location in the room outside the next time you exit the room. If you could write to $7ECD08 with the trash glitch, you could exit to a different room. For example, you could warp from the turtle island shop to the elder's house in potos.
Joined: 4/1/2010
Posts: 90
Unfortunately, $7ECD08 seems like an impossibly high number to achieve within "normal space" for the Thrash glitch -> I assume we'd have to set it inside the room for it to work? It's possible with "special" maps that happen to not wrap around with the camera.. sort-of.. Hard to explain - like the Mushroom Castle-Entrance. To see what I mean: Go for noclip on that map and simply walk to the left. Eventually the camera will stop and after a while you'll come out on the right. That's how you can set the menu x-position outside the usual boundaries.. Would be interesting to know why that happens anyways. You simply disappear all of a sudden. Also, turtle island shop to potos doesn't seem to be that useful ^^.. Did you happen to post a list of room exits? I think I remember seeing something like that.. I really should keep a list of files in my Dropbox, so I can look it up on my laptop Optimally we want to land near the 2nd Machine Rider to get the Flammie Drum early/earlier. And another edit before I post: What is an "exit tile"? I'm not quite sure how it would work now.. Can you give an example on what we would have to do to warp from Turtle Island to Potos? Edit: I played around a bit with the vaue $7ECD08 - It seems like setting it to a specific number (via emulator cheat codes) does not affect anything in that bugged small room. It will still behaves like usual when I use the door to exit. The interesting part about this room (or more specifically: About that Room-Exit-Tile) is, that it does not set $7ECD08 unlike any other Exit-Tile I've tried out in the near vicinity. - When using the Rope inside that room it sets the value $7ECD08 to the one of the "Current Room" $7E00DC. Also, using the exit-Tile now uses the x and y coordinates to where I used the Rope before - When using the Rope inside that room and then exiting through that tile to the outside before the screen fades, using that exit-tile puts me now outside at the posted screenshot location. Basically it alters the x and y coordinates but keeps the "outside" room information in $7ECD08 as it is... Or my assumption is, it re-sets it to the one I just wanted to go to. So... My conclusion so far is: - That specific Exit-Tile does not have it's own x and y coordinates and room-to-go-to set and uses whatever the "last transition" was.. I'm reasonably sure we knew that already. But I really would like to know which values I have to alter to get to other locations. I have yet to warp to a different location playing around with setting various values. I'm currently trying out the find RAM number-tool on on the emulator. But I have no experience with it, so I have no idea whether I can even find what I'm looking for. Edit2: I think I got it. It seems to be $7ECE08. Altering it does.. Interesting things. Also, I'm not completely correct here. That Exit-Tile behaves still correctly when entering the room. however, using the rope seems like it uses $7ECE08. The remarkable thing is, that this is exactly $000100 above. However, the sad thing is, that this is an even more unlikely value to reach with equipment glitch :/ Edit 3: playing around with that value even though we don't have a way to use it yet - Value "0x80" seems to be right before the Flammie Drum. Unless we could directly warp to the credits or the Mana Fortress I guess that would be more or less optimal... Didn't think that one through yet though. Edit 4: interesting to note, if I warp to 256 (dec.. which is 0 actually..) it's the intro cutscene on the waterfall. it warps me, but it does not make my characters invisible. 0x00 = Intro Cutscene 0x01 = Elders House 0x02 = 0xC8 = nothing 0xDC = nothing 0xFE = nothing 0xFF = nothing etc..
Joined: 4/1/2010
Posts: 90
Updated my previous post and.. a quick question: What's the value that indicates whether we can use Flammie Drum/Magic Rope? Edit: Fun fact, if you go through the wall at Medusa towards the top you can simply get into the Geshtar battle 0x87 would be the cutscene just before the Machine Rider #2 Edit 2: Haha... This does not seem to be the only value to influence which room I get teleported to using the exit tile.. I just managed somehow to get to two different locations with two different savestates.. I wonder if it's simply more than 1 byte.. I think it is. Since it's different by 1.. I really wonder how I did that.. Edit 3: I'm dumb sometimes. That was when I didn't use the Rope in first place but still changed the value around. That's the difference.. hm
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
I see, when you change rooms, it saves the information in $7ECD00-$7ECDFF but also at $7ECE00-$7ECEFF, and it loads the information back from $7ECE00-$7ECEFF when stepping on an exit tile. Map data is at $7F0000 for BG1 and $7F4000 for BG2. Attributes for each tile are stored at $7FB800 for BG1 and $7FBC00 for BG2. By "exit" tile I mean one that has attribute bit 12 set, which takes you to the room you just came from. On the other hand, a tile whose index is greater than or equal to the byte at $7E004D triggers a script or a transition. Somroom.txt lists the scripts for each room in order. $0800-$0BFF stand for paths. For example, the door in room $0091 that leads to the guard room is tile $C2, which has the corresponding entry $08DF in the script list. Searching for "Ent 00DF" you'll see that it corresponds to room $0109. Most transitions between rooms work in this way, while only a few use "exit" tiles. $7E011F indicates whether you can use flammie drum (bit 7) and the magic rope (bit 6) and whether you're indoors (bit 5). Going from outdoors to indoors saves the last entrance at $7E0108, which is what the magic rope uses as the destination. The room number is a word, by the way, and the entrance is also a word. So 0100 is bridge, 0101 is elder's house, 0102 is various houses in potos, etc. 01C1 is the turtle island shop. Invisibility at the bridge is triggered by entrance number 0000, not the room number 0100.
Joined: 4/1/2010
Posts: 90
Very interesting - I'll have to read through that a few times to actually understand it though. Simply that I understand this correctly: - If I change $7E0108, the Magic Rope would take me to a different entrance. Ok, out of range sadly - As far as I can tell, a lot of siderooms in various dungeons use those exit tiles - Changing $7ECD00-$7ECDFF doesn't do a thing, it's simply information, right? - Changing $7ECE00-$7ECEFF however changes the thing an Exit-Tile does In any case, $7ECE00 seems incredibly high to reach with the Equipment glitch.. We would have for one, be able to clip out of the normal camera range and for two make the equipment menu usable without it getting stuck in the build-up loop Edit: Oh yeah.. is it even possible to change values outside of 0x7ECC00 to 0x7ECCFF with the equipment glitch? Because that's what touch-me wrote in his notes.
Joined: 4/1/2010
Posts: 90
I have three questions regarding what I encountered recently: - You can get back into Potos village by simply repeatedly switching characters (pressing Select) and pushing against the NPC blocking the path. Why does this not work on the Guards on Pandoras Ruins or the Guards in the Empires Castle blocking the left stairway when entering the first time? - I managed to hit a boss from half a screen away with an overcharged-"regular" attack (at least the animation was a normal slash). How does the overcharge glitch influence the attack range/attack hitbox? - When the Aagragopilon is on the very bottom of his arena, I can not seem to hit him with regular attacks. Is this because the "outside" is considered to be on a different height level? I'm currently back into reading your post on page 22, if you some of these things there already I'll find it. But if you happen to have a simple explanation to some things that would be appreciated :)
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
You can't go through NPCs when you're on stairs. When you are fighting a boss, your hitboxes are twice as large as it is normally. That's why you can hit bosses from far away. To hit a boss, the player must be on the same floor as the boss, and the height difference must be at most 64 pixels. There is also a bug here where you'll miss if the bit corresponding to the enemy slot is set in the byte at $7EE05A+($200*height difference in half pixels). If the boss is defending, this bit will become set if it was not. So, this could possibly be used to change a normal tile into a script tile, if you launched a charged attack against a boss part in slot 6 or 7 which was defending. And yeah, changing values above $7ECCFF seems possible, although I haven't tested it.
Joined: 4/1/2010
Posts: 90
Oh... So going through NPCs should technially work when not on stairs? I remember I couldnt go through the ones at Tasnica either... But I'll have to double check that - not sure. Do some bosses have modifier for height? I mean, when simply "standing", not jumping around. The boss in question is the Spring Beak or his fiery version in the pure lands. For values above $7ECCFF - I simply though it may be impossible because most things seem to be bound to a range of 0xFF when altering. But I don't know. I didn't figure out a way to test that yet. The problem I had so far was, that when trying to alter the x-position of the menu via emulator cheats it never stayed on the set value. Somehow the game seemed to override it every frame or something like that. So I never reached the values for exit-tile altering. Speaking of which - what happens when opening the menu/equipment menu when your character is off screen? It seems to continuously spin and search for the specific item to settle down. After a while you can navigate in the normal menu. However, as soon as you open the equipment menu it never settles down and softlocks the game. Hitboxes are twice as large in boss battles? Interesting - but it should still be way out of range from where I hit the Jabberwocky. http://www.twitch.tv/yagamoth/c/2265786 ~53:50 A rather random question: Why can't I sell any items when I don't have any armor items? Thanks a lot for your support ^^
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
I just tested it, and I am just barely able to hit Jabberwocky with the sword at that distance. Jabberwocky's hitbox is actually centered at his bottom and extends a bit below him, and your weapon's hitbox is quite large. You can watch them using my script here. (Functions operated with controller 4) Spring Beak has a height of 64 pixels when standing. You can monitor the height by watching offset $66 in the boss structure (i.e. $7EE666) which is in half pixels. The question of whether you can sell things depends on the last menu you were in. If you were in the Y-menu, it will check for armor. If you were in the selling menu, it will check for armor and items. You can actually lock up the game if you go into the shop in Potos at the beginning and sell your overalls as well as any items you have, then select Buy, leave, and select Sell again. The menu type is stored in $7E1847 where 0 is Y-menu, 1 is buy, 2 is sell, 3 is forge.
Joined: 4/1/2010
Posts: 90
Wow, that script is amazing.. Today at work I actually looked into the whole Lua scripting stuff to figure out how to display hitboxes - this makes it a ton easier, thank you :) The hitboxes of your weapon is really gigantic in boss battles... Interesting - but only for melee weapons as far as I can tell. The boss height seems to be a fixed number. Does that affect the hit rate in some way?.. Well it does, but I guess a better question would be - can you even out the height difference by standing on the stairs for example? Also, did you figure out why the menu freaks out when being off screen?
Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
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

I think.....therefore I am not Barry Burton
Joined: 4/1/2010
Posts: 90
Just encountered something curious - I died, soft reset, and then started a new game. In the intro, the camera did not move, in the cutscene where the boy falls he does not fall all the way down and then I somehow do not control over him. What is happening there?
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
Height does not affect the hit rate, it just affects whether you can reach him or not. Damage calculations work the same way as for normal enemies. Standing on stairs does not affect your height, but executing a jumping attack does. It seems that when no icons are on the screen, the menu advances to its next phase. Therefore it won't work properly when it is off screen. Don't know what happened when you reset, though. Maybe not all character fields are initialized properly.
Joined: 4/1/2010
Posts: 90
A jump attack? Something along the lines as the Sword level 1 Charge? Also, if I understand this correctly, it's perfectly predictable whether my attack would hit the Spring Beak or not. I'll simply have to find a reliable attack/position to do it then. Thank you for your answer :) edit: For the cutscene thing - Simply soft resetting anywhere seems to do the trick. ALSO, if you press "B" you suddenly activate the first cutscene of the area, and then the screen scrolls to the top left indefinitely... Really weird.
Joined: 4/1/2010
Posts: 90
Found something interesting: http://www.twitch.tv/khovastis/b/408238207 1:38:20 - Two characters at the same time running into a cutscene crashes the game. What exactly happens there? Is that potentially useful? oô
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
The cart was probably loose and someone bumped the SNES.
Joined: 4/1/2010
Posts: 90
Just tried it out - it actually wasn't that. The game does really crash if you walk into the cutscene with two characters at once o_o
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
Hm, you're right. When two characters simultaneously activate a "Near", "Face" or "BothFace" trigger, the game will go to $C1D017 with M cleared. From there it soon reaches a COP instruction at $C1D02D or $C1D050. COP goes to $00FFFF which contains a $FF byte (sbc al,x). The next instruction is at $000003. At this point, we have: $03 = FF if the last displayed character's size is 0, otherwise 0 $04 = 10 if in a town, otherwise 10 + character size*4 $05 = 0 $06 = $80 if NPC is to the right of the player, otherwise 0 $07 = $80 is NPC is below player, otherwise 0 $08 = X distance - the value in $04, clamped to 0-128 $09 = Y distance - 8, clamped to 0-128 $0A = X distance low byte $0B = Y distance low byte The last displayed character size must be 0 and the NPC must be below the second player to avoid a BRK loop. Then your adjusted X distance is the operand of a BRA instruction. Then there are a bunch of RAM locations we could execute from. If we managed to place a jump to C0009B, C00075 or C10018 somewhere in low RAM, we'd be done. Or, by jumping to C18000 we could start the script given in A.
Joined: 4/1/2010
Posts: 90
I recently had an interesting occurrence: - I was fighting the 2 wolves before you get the Girl - During the fight I think the Sprite died, I revived him - He got smashed some more, and lied on the floor - The wolves obviously hit him, but meanwhile I realized, I forgot to equip him with his armor - So I equipped him with the armor, strangely enough the wolves did no damage when the Sprite got up - I killed the wolves and talked with the Girl, got her in the party - When equipping her I suddenly had 3 Kung Fu suits in the equipment inventory I'm not sure the event with the Sprite happened exactly like that, but something along those lines... Does it have any effect on the damage calculation or action taken, when equipping Armor while a character is on the floor and another "damage number" is queued up? Another oddity on that: When opening the Equipment menu with the Girl, the cursor is set to a Suit, which is the one she has equipped, but the Head-symbol (which usually indicates who has what equipped) is set to another Kung Fu Suit
Joined: 4/1/2010
Posts: 90
Question: How is the RNG determined? Is that simply a value that counts up to a point and then resets?
HHS
Active player (286)
Joined: 10/8/2006
Posts: 356
There are 2 RNGs. One is defined by an = an-24 ^ an-55 and is used for bosses. The other, which is used for everything else, is defined by an = an-1 + an-15. Boss RNG buffer is at 7E0306 and the other one is at 7E03F1. By the way, I found a small hidden textbox by setting 7ECF66 to 02 and going to turtle island. Enter the top right house and some kind of diary entry will pop up. If 7ECF66 is set to 03 or higher, the field music will play and the houses will be empty. I am guessing that something was planned for this area, but never got finished.