Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: A couple of things can be added so when outputed asm is compiled in asar it can auto remap all pointers and jumps after adding or removing asm and auto add empty data #103

Open
slidelljohn opened this issue May 24, 2024 · 1 comment

Comments

@slidelljohn
Copy link

Here is a modification that I have to make to the outputted disassembly in order for all pointers and jumps to auto remap in asar after adding or removing asm:

I have to manually add this label "LDX.W #CODE_0081C9" that points to where high score data is in Gradius 3:
manually add label

There is a few modifications that I have to make for empty space to automatically be calculated:

  1. Manually remove empty space "0xff..............". Last empty byte removed = $00FFBF
  2. Add starting point for data/asm after manually remove empty space = ORG $00FFC0
  3. Add fill byte code to beginning of asm file so all empty space is 0xFF.
    empty space

I have seen some roms have set patterns for empty space that can be multiple bytes but Im not sure what the limitations of "fillbyte" is in asar.

Having DiztinGUIsh set that label is the most important issue. Having the empty space to automatically be calculated/added might or might not be something that can be useful. I would like to hear others opinions on the empty space part.

@binary1230
Copy link
Collaborator

sorry this reply is months later,

  1. on the label, I see what's going on, I think.

It's loading literally the number "#$81C9" as a constant.
Diz currently doesn't have a good way to infer that the number 81C9 really means the same as the label at address 0081C9.
This is something I've been wanting to add but, getting it right in all possible cases is tricky.
We need a way to manually override things with labels where a human can tell Diz, hey this is what this really means, just type it in there for me.

vaguely same kind of thing going on with #101 and #100

  1. on the other stuff, what I like to do is,

export all the stuff from Diz in a directory called export/

make a new main.asm file in your root dir that is only hand edited (never genrated), then do something like:

; include everything from Diz first so you start with the original ROM
incsrc "export/main.asm"

; now, do things that override / modify the original rom:
org $008000
fillbyte $FF
fill $8000

use a commandline like:

asar.exe main.asm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants