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

Recent versions of ca65 fail to assemble ebsrc without the long_jsr_jmp_rts feature enabled #17

Open
charasyn opened this issue Oct 11, 2023 · 2 comments · May be fixed by #18
Open

Recent versions of ca65 fail to assemble ebsrc without the long_jsr_jmp_rts feature enabled #17

charasyn opened this issue Oct 11, 2023 · 2 comments · May be fixed by #18

Comments

@charasyn
Copy link
Contributor

See title. When assembling with ca65 V2.19 - Git 494bf10 I get the following errors:

E:\temp\ebsrc-main>ca65 --version
ca65 V2.19 - Git 494bf10

E:\temp\ebsrc-main>make
ca65 -t none --cpu 65816 --bin-include-dir src --include-dir src --include-dir include -D USA -o "src/bankconfig/US/bank00.o" "src/bankconfig/US/bank00.asm"
src/system/reset.asm:117: Error: Illegal addressing mode
src/system/reset_vector.asm:7: Error: Illegal addressing mode
src/system/nmi_vector.asm:3: Error: Illegal addressing mode
src/system/irq_vector.asm:3: Error: Illegal addressing mode
src/overworld/actionscript/run_actionscript_frame.asm:7: Error: Illegal addressing mode
src/overworld/actionscript/fade_in.asm:10: Error: Illegal addressing mode
src/overworld/actionscript/fade_out.asm:10: Error: Illegal addressing mode
src/system/check_hardware.asm:18: Error: Illegal addressing mode
src/system/check_hardware.asm:29: Error: Illegal addressing mode
make: *** [src/bankconfig/US/bank00.o] Error 1

I can edit the Makefile and add --feature long_jsr_jmp_rts to CA65FLAGS to fix the issue.

E:\temp\ebsrc-main>ca65 --version
ca65 V2.19 - Git 494bf10

E:\temp\ebsrc-main>make
ca65 -t none --cpu 65816 --feature long_jsr_jmp_rts --bin-include-dir src --include-dir src --include-dir include -D USA -o "src/bankconfig/US/bank00.o" "src/bankconfig/US/bank00.asm"
ca65 -t none --cpu 65816 --feature long_jsr_jmp_rts --bin-include-dir src --include-dir src --include-dir include -D USA -o "src/bankconfig/US/bank01.o" "src/bankconfig/US/bank01.asm"
ca65 -t none --cpu 65816 --feature long_jsr_jmp_rts --bin-include-dir src --include-dir src --include-dir include -D USA -o "src/bankconfig/US/bank02.o" "src/bankconfig/US/bank02.asm"
[[ ... ]]
ca65 -t none --cpu 65816 --feature long_jsr_jmp_rts --bin-include-dir src --include-dir src --include-dir include -D USA -o "src/bankconfig/US/bank2f.o" "src/bankconfig/US/bank2f.asm"
ca65 -t none --cpu 65816 --feature long_jsr_jmp_rts --bin-include-dir src --include-dir src --include-dir include -D USA -o "src/bankconfig/US/ram.o" "src/bankconfig/US/ram.asm"
ca65 -t none --cpu 65816 --feature long_jsr_jmp_rts --bin-include-dir src --include-dir src --include-dir include -D USA -o "src/bankconfig/US/sram.o" "src/bankconfig/US/sram.asm"
ld65 -C snes.cfg --mapfile "earthbound.map" -o "earthbound.sfc" src/bankconfig/US/bank00.o src/bankconfig/US/bank01.o src/bankconfig/US/bank02.o src/bankconfig/US/bank03.o src/bankconfig/US/bank04.o src/bankconfig/US/bank05.o src/bankconfig/US/bank06.o src/bankconfig/US/bank07.o src/bankconfig/US/bank08.o src/bankconfig/US/bank09.o src/bankconfig/US/bank0a.o src/bankconfig/US/bank0b.o src/bankconfig/US/bank0c.o src/bankconfig/US/bank0d.o src/bankconfig/US/bank0e.o src/bankconfig/US/bank0f.o src/bankconfig/US/bank10.o src/bankconfig/US/bank11.o src/bankconfig/US/bank12.o src/bankconfig/US/bank13.o src/bankconfig/US/bank14.o src/bankconfig/US/bank15.o src/bankconfig/US/bank16.o src/bankconfig/US/bank17.o src/bankconfig/US/bank18.o src/bankconfig/US/bank19.o src/bankconfig/US/bank1a.o src/bankconfig/US/bank1b.o src/bankconfig/US/bank1c.o src/bankconfig/US/bank1d.o src/bankconfig/US/bank1e.o src/bankconfig/US/bank1f.o src/bankconfig/US/bank20.o src/bankconfig/US/bank21.o src/bankconfig/US/bank22.o src/bankconfig/US/bank23.o src/bankconfig/US/bank24.o src/bankconfig/US/bank25.o src/bankconfig/US/bank26.o src/bankconfig/US/bank27.o src/bankconfig/US/bank28.o src/bankconfig/US/bank29.o src/bankconfig/US/bank2a.o src/bankconfig/US/bank2b.o src/bankconfig/US/bank2c.o src/bankconfig/US/bank2d.o src/bankconfig/US/bank2e.o src/bankconfig/US/bank2f.o src/bankconfig/US/ram.o src/bankconfig/US/sram.o

I've confirmed that the two ROMs built with this feature both match the source ROMs:

$ sha256sum *.sfc
a8fe2226728002786d68c27ddddf0b90a894db52e4dfe268fdf72a68cae5f02e  clean-eb.sfc
1f8cfd13177d86b0eb2c8adcf9e1a4f0ec8966fa1583072b65a1b1c0e7961a5d  clean-m2.sfc
a8fe2226728002786d68c27ddddf0b90a894db52e4dfe268fdf72a68cae5f02e  earthbound.sfc
1f8cfd13177d86b0eb2c8adcf9e1a4f0ec8966fa1583072b65a1b1c0e7961a5d  mother2.sfc

It looks like this behaviour may have been modified here: cc65/cc65@ccf3994

I think we should add this flag to the Makefile. I'll open a PR.

@charasyn charasyn linked a pull request Oct 11, 2023 that will close this issue
@Herringway
Copy link
Owner

I've been aware of this for a few months, but this change has not been included in a stable release yet, and unfortunately, ca65 does not just ignore options it doesn't recognize. I won't be merging a fix until the next version of ca65 is released.

As for the PR itself, I would prefer the feature being enabled via .FEATURE in include/common.asm.

@charasyn
Copy link
Contributor Author

charasyn commented Oct 11, 2023

unfortunately, ca65 does not just ignore options it doesn't recognize

Dumb.

I'll update the PR to move the FEATURE.

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

Successfully merging a pull request may close this issue.

2 participants