Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inject.lua with OoT on BizHawk 2.3.0 #1

Open
dragonbane0 opened this issue Nov 26, 2018 · 4 comments
Open

inject.lua with OoT on BizHawk 2.3.0 #1

dragonbane0 opened this issue Nov 26, 2018 · 4 comments

Comments

@dragonbane0
Copy link

Hey there. I would really like to get the actor spawn assembly inject to work on OoT NTSC 1.0, but I'm running into various issues. Using the scripts as is, I'm getting a:
NLua.Exceptions.LuaScriptException: ./lib/lips\Expression.lua:229: cannot assign undeclared global 'err'

while trying to load the inject.lua on the newest BizHawk release. I fixed that one by declaring the err variable locally instead. In the newest BizHawk release you can choose between 2 Lua cores, Lua and NLua. The NLua one produces an additional error, complaining about this pattern in line 158 in the Expression.lua file:
'$[0-9A-Fa-f]+'

I had to use the Lua core to get around it. Afterwards I hit an error from the Preproc.lua file complaining about the comment in line 28 in the spawn oot.asm. After removing that one it will finally execute. However in every BizHawk release post 1.13.1 (so starting with 2.0) this either only produces a garbled display where it normally shows the actor id or an immediate crash, which leads me to assume that the injection goes very wrong. On 1.13.1 and prior it works as expected.

I would love to use your actor spawn functionality in one of my projects where I don't wanna patch the ROM itself and using the newest BizHawk release for it would come in handy. I should note that the cheat menu.lua seems to work everywhere.

Thanks in advance if you look into it and have a good week :D

@notwa
Copy link
Owner

notwa commented Nov 28, 2018

ah, good catch on the err variable. I'm not sure why that wasn't picked up before.

the comment error is due to a hack for parsing integer divisions… I think? I've neglected lips so long that I can't even remember how it works anymore. lately I've been a heretic and using byuu's/arm9's bass instead.

anyway, I just pushed a fix for the Expression.lua errors. the spawn code for 1.0 is still broken for some reason (I'm not sure it ever worked?), but I at least know it works on the debug ROM on console since I ran that a few months back. I'll try to get it working tonight.

notwa added a commit that referenced this issue Nov 28, 2018
notwa added a commit that referenced this issue Nov 28, 2018
@notwa
Copy link
Owner

notwa commented Nov 28, 2018

it wound up being pretty simple. it seems that the place I was dumping my code and data wound up being used after all (probably a framebuffer), so I just changed the address to my next best choice. let me know if it works for you.

@dragonbane0
Copy link
Author

Interestingly it worked pretty fine on BizHawk 1.13.1 with the fixes I made. Only on more recent versions it would crash. But if you really wrote the injection to an unsafe region than it working on an older, more inaccurate BizHawk version might not be a good thing. Will try the fixes asap!

@dragonbane0
Copy link
Author

Okay all the BizHawk and lua related errors have been fixed! Sadly the new injection region is still kinda unstable it seems. It will inject fine and work at first, but if you load a save in Link's house at the very start it will softlock on the black loading screen. This doesn't happen if you start a new game curious enough. Same thing for me loading an adult save in ToT and leaving. Inside ToT I can use the injection fine, but leaving softlocks on black screen.

So it seems loads are unstable with this for some reason, but the rest works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants