I figured out why all the #'s periodically go dark in HHS' script - as written, the first row of values (0x81-0x8D) is cut off the top of the screen. That explains a lot!
I reformatted and commented his script in an attempt to understand it better, with some minor modifications that are in progress.
Language: lua
target = 0xae
lengths={
2,2,2,2,
2,2,2,2,
1,2,1,2,
3,3,3,3,
2,2,0,2,
2,2,2,2,
1,3,1,3,
3,3,3,3
}
while true do
startAddress=0x81
displayCol=0
displayRow=0
jumpFlag=false
postJump=false
message = 'Fail';
branchMsg = 'No Branches';
while displayRow<16 do
op=memory.readbyte(startAddress)
opLength=lengths[AND(op,31)+1]
color='#ffffff'
if startAddress==target and not jumpFlag then
color='#00ff00'
message='Success'
end
if op==0x20 or op==0x4c or op==0x6c then
color='#ff0000'
opLength=3
jumpFlag=true
elseif opLength==0 or AND(op,0x8f)==2 or op==0x40 or op==0x60 then
color='#ff0000'
opLength=1
jumpFlag=true
elseif AND(op,31)==0x10 then
color='#880000'
branchMsg = "May Branch"
end
for i=0,opLength-1 do
x=memory.readbyte(startAddress)
if postJump then
color='#502020'
end
gui.text(displayCol*16,8+displayRow*8,string.format('%02X',x),color)
startAddress=startAddress+1
color='#0000ff'
displayCol=displayCol+1
if displayCol==16 then
displayCol=0
displayRow=displayRow+1
end
if jumpFlag then
postJump = true
end
end
if startAddress>target+2 or startAddress<0x80 then
gui.text(10*18,(displayRow+1)*8,message,'#ffffff');
gui.text(10*18,(displayRow+2)*8,branchMsg,'#ffffff');
break
end
end
FCEU.frameadvance();
end