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

Using spcblock messes up pc #322

Open
Domkeykong opened this issue Jun 17, 2024 · 1 comment
Open

Using spcblock messes up pc #322

Domkeykong opened this issue Jun 17, 2024 · 1 comment

Comments

@Domkeykong
Copy link

Assembling the following code reproduces the error.

org $808000

print "pc: $",hex(pc())

spcblock $6000 nspc
endspcblock

print "pc: $",hex(pc())

prints:

pc: $808000
pc: $6000
@hellow554
Copy link

Same behavoir for me. As a workaround I do this:

!PREVIOUS_PC #= pc()
spcblock $400 nspc
incsrc "spc/default.spc700.asm"
endspcblock execute spc_entry

base !PREVIOUS_PC+pc()-$400+4 ; $400 is the entry of the spc code
org pc()|$400000
undef "PREVIOUS_PC"

I have a hirom code, therefore I do the org pc()|400000 to set the address correctly

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