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

Integer divide by zero #68

Closed
LeviLovie opened this issue Jul 26, 2023 · 3 comments
Closed

Integer divide by zero #68

LeviLovie opened this issue Jul 26, 2023 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@LeviLovie
Copy link

I have tried to Disassemble The Legend of Zelda 1. And got an panic: runtime error: integer divide by zero error

I had download v0.2.1 release source code and compile it and ran it for the .nes file:
sudo ./nesgodisasm/nesgodisasm -a ca65 -o tloz.asm tloz.nes
And got this output:

[------------------------------------]
[ nesgodisasm - NES ROM disassembler ]
[------------------------------------]

2023-07-26 19:19:35  INFO    Build info {"version":"dev built with: go1.20.6"}
2023-07-26 19:19:35  INFO    Processing ROM {"file":"tloz.nes"}
panic: runtime error: integer divide by zero

goroutine 1 [running]:
github.com/retroenv/nesgodisasm/internal.(*Disasm).addressToIndex(...)
	tloz_1_decompile/nesgodisasm/internal/disasm.go:261
github.com/retroenv/nesgodisasm/internal.(*Disasm).readMemory(0x1012b85?, 0xf9a6?)
	tloz_1_decompile/nesgodisasm/internal/memory.go:18 +0x85
github.com/retroenv/nesgodisasm/internal.(*Disasm).readMemoryWord(0xc00010c1b8?, 0xfffa)
	tloz_1_decompile/nesgodisasm/internal/memory.go:28 +0x25
github.com/retroenv/nesgodisasm/internal.(*Disasm).initializeIrqHandlers(0xc0016ac000)
	tloz_1_decompile/nesgodisasm/internal/disasm.go:157 +0x3b
github.com/retroenv/nesgodisasm/internal.New(0xc000054390, 0xc000128070, 0xc000024300)
	tloz_1_decompile/nesgodisasm/internal/disasm.go:103 +0x3f5
main.disasmFile(0xc000054390, 0xc000014300, 0xc000024300)
	tloz_1_decompile/nesgodisasm/main.go:155 +0x305
main.main()
	tloz_1_decompile/nesgodisasm/main.go:45 +0x125
  • OS: Mac os 12.6.7
  • Version / Commit: 0.2.1 source code

I use this application for the first time, and maybe didn't understand how to use that.

@LeviLovie LeviLovie added the bug Something isn't working label Jul 26, 2023
@cornelk cornelk added this to the 0.3.0 milestone Jul 26, 2023
@cornelk
Copy link
Member

cornelk commented Jul 26, 2023

You are using the tool right (beside the sudo - that should never be needed for this tool) but it lacks support for any mapper beside NROM. I will add a warning to the output if the ROM uses any other mapper.

I started the work for adding multi bank support so please check back in the future for an update that should make it work with Zelda (which uses MMC1)!

@LeviLovie
Copy link
Author

Thanks for the reply, I'll wait for the next release :)

@cornelk
Copy link
Member

cornelk commented Nov 6, 2024

The crash has been fixed in the latest version, multi bank support is still WIP and tracked in #6

@cornelk cornelk closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants