Jump to content
Sign in to follow this  
Grebnedlog

Thumb ARM emulation errors

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

Share this post


Link to post
Share on other sites

batari Basic may produce some ARM code for DPC+ support. Not sure though. Never had to use more than the built-in over CPU cycle limit detection in the batari Basic kernel. I believe Stephena does frequent the forum. Maybe message the master himself?

Edited by theloon

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

It's likely some bB code that's out of range, causing DPC+ arm calls to go out of range.

 

bB source would also help.

  • Like 1

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...