Giter Site home page Giter Site logo

Comments (6)

andrew-davie avatar andrew-davie commented on May 20, 2024

Here is the macro from Boulder Dash/Sokoboo that does this for anyone wanting to do it before DASM is updated with this capability.

    MAC DEFINE_SUBROUTINE               ; name of subroutine`
BANK_{1}        = _CURRENT_BANK         ; bank in which this subroutine resides`
                SUBROUTINE              ; keep everything local`
{1}                                     ; entry point`
    ENDM

If DASM auto-generate the BANK_* as per the above. Then Stella could be modified to recognise banks. Instead of BANK_* though, perhaps something like __BANK_* to avoid clashing with names. Introduce a standard convention (say, double-underscore) to identify auto-generated DASM labels?

One gotcha, though - in the case where self-modifying code is copied to multiple RAM banks - then the __BANK_* is invalid, so we should be careful NOT to prevent Stella from having alternate banks attached to labels (including multiple banks to a single label).

from dasm.

thrust26 avatar thrust26 commented on May 20, 2024

The idea is to define a standard, which Stella can understand and use for its disassembly. Currently an address in a .sym file is just that, an address. Which can be used in multiple banks. Then Stella's debugger does not know which label to display. Adding pseudo ops would allow DASM to create better .sym files and allow the debugger to create better disassemblies.

The burden would be solely on the developer, so DASM does not be aware of any bankswitching methods.

BTW: The same would be helpful for constants and variables too. Currently we also have clashes in the Stella debugger for these. And I am sure the same can happen for other platforms too.

from dasm.

dionoid avatar dionoid commented on May 20, 2024

I'm confused: It looks like Stella already can detect different address-ranges for each bank, however it only uses labels for the first bank in the Disassembly tab. So it this a bug in Stella?

Example: I have a F8 game, for which I did RORG $1000 for the first bank, and RORG $3000 for the second bank.
Now the .sym file contains the labels with the correct addresses (either TIA/RIOT labels, or my own labels in the ranges $1000-$1ffff or $3000-$3fff).
When I open the Stella Debugger mode, it knows that this is an F8 cartridge, and even shows the correct address ranges $1000-$1ffff and $3000-$3fff:
image

However, when I go to the Disassembly tab, I only see labels from Bank 0. So also when I step into Bank 1, I see the (wrong) Bank 0 $1000-$1ffff labels, instead of the labels from Bank 1 $3000-$3ffff.

I have the feeling that I'm missing something :-)

from dasm.

thrust26 avatar thrust26 commented on May 20, 2024

Stella's disassembler (DiStella) is not well prepared for multi bank or multi segments ROMs. It "somehow" works, but is not 100% reliable.

from dasm.

thrust26 avatar thrust26 commented on May 20, 2024

Would it be easily possible to add an option to output symbols ordered by their definition appearance in the code?

from dasm.

thrust26 avatar thrust26 commented on May 20, 2024

I went for it and created a pull request (not sure why the MacOS build doesn't want to start).

from dasm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.