Views: 932,822,308
14 users online: AllexGG,  Anorakun, AttentionDeficitDad, chickaDEE Magazine, gui, KaidenThelens, ModernKiwi, morisot, Paithus, PastaNoSauce, RavenBeak46,  RussianMan, Splat3r, syogayaki - Guests: 113 - Bots: 228 Users: 52,067 (2,106 active)
Latest: Graul
Tip: There's a fine line between difficult and unfair - avoid the latter.
Not logged in.
Need help with SPC700 disassembly
Forum Index - Non-SMW Hacking - Misc. ROM Hacking - Need help with SPC700 disassembly
Pages: « 1 » Link
Any SPC700 experts out there want to help me make sense of this code that I've disassembled (using my own tools, so keep that in mind :)) ?

Below is a snippet of code that I've disassembled, and I've double-checked that the instructions are correct, according to the SuperFamicom wiki. If my pseudo-code is correct, it looks like the middle two cases will never be hit. If this was the only instance of this happening, I'd just assume that it was a bug, but this happens in multiple critical locations where the code is handling sequenced events, so I find it hard to believe. I think it's more likely that the documentation is wrong, but I wanted to see what you guys thought about this.


	D5 A0 03	MOV 03A0+X, A	; Table3A0[X] = A
	68 0B		CMP A, #0B	; If (A >= 11)
	90 0F		BCC 29EB	; 	Goto 29EB
	68 0E		CMP A, #0E	; Else If (A >= 14)
	90 08		BCC 29E8	; 	3E87()
	68 15		CMP A, #15	; Else If (A >= 21)
	90 07		BCC 29EB	; 	Goto 29EB
	68 18		CMP A, #18	; Else If (A < 24)
	B0 03		BCS 29EB	; 	Goto 29EB

Edit: Okay, my carry flag logic was backwards. I forgot that for SUB/CMP instructions, the CF has the opposite effect as it does with ADD instructions. I went digging through the Higan source code, and realized where I had went wrong.

Sorry for the distraction.. I'd delete the thread if I could :)
Pages: « 1 » Link
Forum Index - Non-SMW Hacking - Misc. ROM Hacking - Need help with SPC700 disassembly

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Super Mario Bros. X Community
  • Mario Fan Games Galaxy
  • sm64romhacks