Jump to content
IGNORED

Stella debugger issue with bankswitched game


azure

Recommended Posts

I'm using F8 bankswitching, which is working fine, but I have an issue with Stella when it's in debug mode. It's not showing the right labels for the 1st bank nor is it showing consistent disassembled source code. For example: if you have these banks:

 

; bank 0

ORG $1000
RORG $d000
; bank 1
ORG $2000
RORG $f000
See attached images.
It works fine when running from the 2nd bank, but switching to the 1st bank shows labels from 2nd bank. This is hampering testing, so is there is there a way make Stella show the right labels and disassembled source when it's running on the 1st bank?

 

post-63102-0-26489000-1538530909.png

post-63102-0-80412900-1538530919.png

Link to comment
Share on other sites

First, are you using the very latest version? The most recent version(s) have improved debugger support for many different areas.

 

Second, I cannot speak definitively, since Thomas J handles a lot of the debugger stuff in Stella, but I can say that this is an area we need to work on improving. Much of our time over the past 2 years has been in perfecting the TIA video and audio emulation. Now that this is mostly complete and will be released with Stella 6, we hope to come back to working on the debugger a little more. And one of my first items is improving how the debugger uses DASM symbol and list files, and basically fixing the problems you're encountering.

Link to comment
Share on other sites

First, are you using the very latest version? The most recent version(s) have improved debugger support for many different areas.

 

I'm using the latest stable version.

 

Stella 5.1.3
  Features: Sound Joystick Debugger Cheats
  Build 4152, using SDL 2.0.5 [x86_64]

 

I get different results based on when and where I break into the code and whether or not the code gets stepped into. I wasn't seeing a pattern earlier, because some subroutines were disassembled and others weren't. It seems to work better if I let it step through the code and don't mess with manually changing the bank in the UI. Doing that gives weird results.

Edited by azure
Link to comment
Share on other sites

  • 7 months later...

 

I'm using the latest stable version.

 

Stella 5.1.3
  Features: Sound Joystick Debugger Cheats
  Build 4152, using SDL 2.0.5 [x86_64]

 

I get different results based on when and where I break into the code and whether or not the code gets stepped into. I wasn't seeing a pattern earlier, because some subroutines were disassembled and others weren't. It seems to work better if I let it step through the code and don't mess with manually changing the bank in the UI. Doing that gives weird results.

 

Hi, I have the same issues when debugging my F8 bankswitched game in Stella.

However I found a specific combination of settings that seems to solve the debugging issues for me:

  • In the Developer setting (assuming you're using these), uncheck "Random startup bank", or use Stella command line argument "-dev.bankrandom 0". This will make Stella always start in the second bank (@ $f000 - $ffff).

    Note: of course you should initially also test if starting your rom in the first bank works, as that can be tricky with initialization code. But once you verified that random-bank startup works, you should uncheck the "Random startup bank" option to get cross-bank debugging working correctly in Stella.

  • Also, start Stella in debug mode (use argument "-debug"). This will jump right into the debugger at launch. You can just press "Exit" to continue the game or set some breakpoints already if you like. I think that this - combined with forcing Stella to startup in the second bank - forces Stella to load/show the correct labels and symbols for the second bank.

  • Make sure that shared bankswitch code's label (a.k.a. trampoline) is in the range of the first bank (@ $d000 - $dfff), not in the second bank.

    Note: this can be achieved by setting the bankswitch label like this:

    BankSwitchRoutine = (. & $fff) | $d000

  • Make sure that the Reset vectors (at the end of each of the two banks) are within the range of their corresponding banks, so not pointing to an address in the other bank.

When you do this, you will see that Stella (I'm using the latest 6.0 version on Windows) will show the correct addresses and labels in the disassembly tab. Just set a breakpoint at the start of the shared bankswitch code and step through the code to verify this.

 

I'm not sure why F8 cross-bank debugging doesn't work in other cases; I guess it's a bug in Stella (see this thread).

 

Hope this helps!

Edited by Dionoid
  • Like 1
Link to comment
Share on other sites

  • 2 years later...

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...