Jump to content
IGNORED

Thumb ARM emulation errors


Grebnedlog

Recommended Posts

Does anyone here know enough about how ARM emulation works in Stella to explain what this recurring crash message means (attached JPEG), and how one might go about troubleshooting it in a program? Are there instructions or methods that other programmers have found to generally cause these kinds of errors?

post-33796-0-12908400-1350076689_thumb.jpg

Link to comment
Share on other sites

I can't say for sure, but I'm betting it's the MAMCR functionality of the ARM emulation. This was addressed in version 3.5, which contained the following release notes:

  • Added MAMCR handling to the Thumb ARM emulation code. Note that MAMCR isn't actually emulated, it is just ignored for now. This fixes a bug whereby accessing MAMCR would crash the ARM emulation.
  • Added 'thumb.trapfatal' commandline argument, which causes the Thumb ARM emulation to either trap on a fatal error (throw an exception to the debugger and exit emulation) or simply log the error and continue. This should normally always be enabled, but can be disabled by developers for testing reasons.

Stella version 3.4.1 is very old. The current release is now at version 3.7.2, with 3.8 coming out within the month (or so). I would suggest always upgrading to the latest version before reporting bugs.

Link to comment
Share on other sites

I can't say for sure, but I'm betting it's the MAMCR functionality of the ARM emulation. This was addressed in version 3.5, which contained the following release notes:

  • Added MAMCR handling to the Thumb ARM emulation code. Note that MAMCR isn't actually emulated, it is just ignored for now. This fixes a bug whereby accessing MAMCR would crash the ARM emulation.
  • Added 'thumb.trapfatal' commandline argument, which causes the Thumb ARM emulation to either trap on a fatal error (throw an exception to the debugger and exit emulation) or simply log the error and continue. This should normally always be enabled, but can be disabled by developers for testing reasons.

Stella version 3.4.1 is very old. The current release is now at version 3.7.2, with 3.8 coming out within the month (or so). I would suggest always upgrading to the latest version before reporting bugs.

 

Ah, sorry. I actually did have 3.7.2 installed, but the for some reason the Visual bB devkit program I was using was mapped to an archived version when I took the screenshot.

 

In any case, the ARM error still seems to occur when I run it with Stella 3.7.2 (see attached JPEG).

 

Also, sorry to be a pest, but what would the syntax be to turn off the trap? Thanks.

post-33796-0-34534400-1350149659_thumb.jpg

Edited by Grebnedlog
Link to comment
Share on other sites

Ah, sorry. I actually did have 3.7.2 installed, but the for some reason the Visual bB devkit program I was using was mapped to an archived version when I took the screenshot.

 

In any case, the ARM error still seems to occur when I run it with Stella 3.7.2 (see attached JPEG).

 

Also, sorry to be a pest, but what would the syntax be to turn off the trap? Thanks.

 

This is the commandline argument mentioned above: thumb.trapfatal. For now, you'll have to modify the INI file directly, or launch Stella from the commandline (it isn't accessible from the UI yet). Open Windows Explorer and type '%APPDATA%/Stella'. Then edit stella.ini and change 'thumb.trapfatal = true' to 'thumb.trapfatal = false'.

 

Also, this probably indicates an issue in the bB ARM code somewhere. As the comment above mentions, using this commandline argument is meant for developers to work around specific issues. The fact that a fatal error is being triggered at all should obviously be fixed at some point. All the commandline argument does is disable notification of the fatal error.

Link to comment
Share on other sites

After examining the message in more detail, I see it isn't related to the MAMCR bug at all. It looks like you're trying to read from address $E6DA. The following code is from the read16 method in the Stella ARM emulation:

 

 if((addr>0x40001fff)&&(addr<0x50000000))
   fatalError("read16", addr, "abort - out of range");
 else if((addr>0x7fff)&&(addr<0x10000000))
   fatalError("read16", addr, "abort - out of range");
 if(addr&1)
   fatalError("read16", addr, "abort - misaligned");

 

So it seems that the read is indeed invalid, and in this case out of range. So maybe something in the bB suff is causing this? Or maybe the read16 method in Stella isn't supposed to restrict to a certain range??

 

If it's the former, then I remind you that turning off warnings in Stella won't fix the actual problem, and may cause a crash on real hardware. And if it's the latter, then it's a bug in Stella that needs to be fixed (and I'd lilke to see documentation on how the read should behave).

 

In any event, perhaps posting a test ROM would be helpful.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...