Post subject: Crash Handling (SNES)
Player (53)
Joined: 11/20/2013
Posts: 103
I just wanted to ask about this... The TAS I'm working on requires me to run Bizhawk into a crash literally thousands of times. While knowing about the existence of Autoload and some recent patches has sped this process up considerably, I just have to ask about the one remaining obstacle. Is it possible to make Bizhawk handle a program-induced crash, rather than crash itself? I understand that there exist invalid opcodes that would cause the 65c812 to come to a halt, among other conditions that could cause such a thing. This isn't nagging you to fix anything but rather just a question: Can this handling be done, somehow informing the user of the crash and then allowing them to carry on? Or is the core problem (ha, pun) that accurate emulation also includes accurate crashing, and Bizhawk is required to crash with it?
Post subject: Re: Crash Handling (SNES)
Masterjun
He/Him
Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Khaz wrote:
invalid opcodes
I'd like to know about those invalid opcodes you are talking about!
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Player (53)
Joined: 11/20/2013
Posts: 103
I am more familiar with NES hardware to be honest, I was referring to I guess "undocumented" opcodes such as the "KIL" ones that will cause the processor to stop. I was under the impression that some of those existed for the SNES processor too but I am probably mistaken. I find good information on the 65812/65c812 and the SNES in general to be irritatingly hard to come by.
Masterjun
He/Him
Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Which then means that the bsnes core that runs in BizHawk emulates every opcode correctly and shouldn't crash at all. If you are uncertain then try recreating the crash in bsnes instead of in BizHawk. Crashing games should never lead to crashing the emulator! That would be a bug in the emulator or the emulation core.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Player (53)
Joined: 11/20/2013
Posts: 103
Okay, I'm trying to test it in higan_v094 right now. It doesn't seem to have movie support and I can't figure out where it saves its savestates. Does anyone know if they're compatible with BizHawk savestates? It would be nice not to have to manually play the whole run all over again just to test it... EDIT: It appears to save it in C:\Users\[username]\Emulation\Super Famicom\Game #. Nnnnnnnghhhh I hate that the "Users" directory exists. And I guess bizhawk savestates and higan savestates are incompatible. Alright, doing it manually....
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
you need to elaborate what you want. bizhawk and bsnes shouldnt be crashing. the only other kind of crash is the game program 'crashing' by which you must mean freezing. theres nothing for bizhawk to do, in that case. it will faithfully freeze. if you have the bizhawk or bsnes process actually crashing, then we'll debug that.
Player (53)
Joined: 11/20/2013
Posts: 103
Alright, in that case... Here's a savestate from right before the ending of Dragon View (U). To see what I mean, walk through the door to the left then press something to try to advance the text. Bizhawk should crash after a few seconds. (small chance it'll get stuck in a loop instead, if so just retry) If there's something more I can do to help debug this I'd be glad to try. EDIT: What I mean by "crashing" is that the program is frozen. So I guess what I'm asking is if there's any way to force Bizhawk to recover from that scenario, because it doesn't respond to any input.
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
What's happening is bsnes is going apeshit and never exiting. Bsnes is known to be prone to this. Bizhawk is waiting for bsnes to return, and so it never stops waiting. Odds are low we'll be able to fix bsnes. I dont think I'll even try. I'll consider whether we can add a 'watchdog timer'. So, for example, when bsnes doesnt return from emulating a frame within 1 second, bizhawk will consider it crashed and sort of suspend it until a core reboot or loadstate etc. happens. Does that make sense and sound like it will help?
Player (53)
Joined: 11/20/2013
Posts: 103
That does sound like exactly what I'm looking for, yes. It would save a lot of time and effort on this. Thanks for looking into it! If there's any way I could help out let me know.