Comments (6)
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.
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.
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:
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.
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.
Would it be easily possible to add an option to output symbols ordered by their definition appearance in the code?
from dasm.
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)
- invalid (?) "#" usage HOT 1
- Allow expressions access to generated code
- dasm not open on my windows HOT 1
- Error (?) with dynamic labels HOT 2
- Feature request: ability to specify exit code with ERR directive HOT 3
- Macros detects parameters in the false portion of #if/#else/#endif and IF/ELSE/ENDIF directives
- Hide LIST ON HOT 1
- Undefined values cause no errors
- Assembled output padded with 00 bytes HOT 2
- Support for 'mul' instructions on for 68HC705 HOT 5
- SEGV in error handling of command line parameters
- atari 2600 "macro.h": SLEEP macro causes unwanted bankswitching with some cartridge types (e.g. 3F) HOT 1
- 6502 addressing modes (indirect),Y and absolute,Y should support space between comma and Y
- Support for #elif directive
- [REQUEST] Add ".PROCESSOR 65C02" Mode and Opcodes HOT 2
- Dynamic labels are not working in an expression HOT 3
- Installation via Scoop HOT 1
- Apple ARM Support HOT 3
- vcs.h redistribution HOT 3
- Do you support custom opcodes? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dasm.