NESRevPlus

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Post by oRBIT2002 »

I've uploaded v0.3b that supports 32K NROM's. Link is in my first post.
3gengames
Formerly 65024U
Posts: 2281
Joined: Sat Mar 27, 2010 12:57 pm

Post by 3gengames »

Tried new version on my NROM-128 game. It seperated a lot of the data and stuff well, but it just missed some arrays badly and combined 2 seperate arrays that were used in the same subroutine or someting but used in completely different rays. One of them was at the very beginning of my data file, and it combined these arrays:

Code: Select all

RLEPointersHigh:
  .db HIGH(MainNametable)
  .db HIGH(TitleNametable)
  .db HIGH(OpeningNametable)

RLEPointersLow:
  .db LOW(MainNametable)
  .db LOW(TitleNametable)
  .db LOW(OpeningNametable)

MainNametable: .incbin "Screens/RLECompressedMainScreen.bin"
TitleNametable: .incbin "Screens/RLECompressedTitleScreen.bin"
OpeningNametable: .incbin "Screens/RLECompressedOpeningScreen.bin"
and the call for those two beginning arrays is this, away from other data completely:

DecompressToPPU:
LDA RLEPointersLow,X
STA <DecompressDataPointer
LDA RLEPointersHigh,X
STA <DecompressDataPointer+1

And in the data for the disassembly, it produces:

Code: Select all

LC000:
.DB $C0,$C2,$C4
LC003:
    ;1606 bytes
.DB $06,$BE,$C2,$01,$01,$25,$02,$09,$01,$14,$05,$08,$01,$0A,$02
(All other .db statements here.)
So it combines the one array with the files it points to for some reason, which I think may be a mistake because the array access shouldn't affect it. I think a key to making this work well would be having a cal register value range from an emulator being included to help separate those arrays while playing the game. But honestly, it works damn well, I think it's a great tool to reverse engineer games and I'm sure the person that will be studying the games code when released will be able to figure it out so it may hurt, but I don't believe it will cripple it at all. Good luck improving it! :)
Last edited by 3gengames on Wed Jun 06, 2012 11:30 am, edited 2 times in total.
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Post by Kasumi »

I have pretty much the exact same impression.

This:

Code: Select all

	.org $C000
met16header:
	.dw met16sets_bank00
met32header:
	.dw met32sets_bank00
metscreenheader:
	.dw metscreensets_bank00
metlevelheader:
	.dw metlevelsets_bank00

ended up as:

Code: Select all

LC000:
	DC.B $08,$C0,$12,$C0
LC004:
	DC.B $1A,$C0
LC006:
    ;3102 bytes
	DC.B $1E,$C0,$22,$C0,$50,$C0,$7E,$C0,$AC,$C0,$DA,$C0,$08,$C1,$45
	DC.B $C1,$82,$C1,$BF,$C1,$FC,$C1,$4C,$C2,$75,$CB,$79,$CB,$00,$FE
	DC.B $80,$84,$87,$FE,$84,$FE,$FE,$87,$00,$89,$8A,$FE,$8D,$00,$FE
(Removed for brevity)
I'm puzzled by the how the header labels ended up being divided. Absolutely everything past that is read through at least one layer of indirect indexed, so I didn't expect it to be picked up and separated.

Relevant code to the header labels.

Code: Select all

;"reserved" variables are zero page temp RAM.
	lda met16header
	sta reservedE
	lda met16header+1
	sta reservedF
In another location:

Code: Select all

	lda met16header
	sta reserved0
	lda met16header+1
	sta reserved1

Code: Select all

	lda met32header
	sta reservedE
	lda met32header+1
	sta reservedF

Code: Select all

	lda metscreenheader
	sta reserved0
	lda metscreenheader+1
	sta reserved1

Code: Select all

	lda metlevelheader
	sta reserved0
	lda metlevelheader+1
	sta reserved1
After each I read indirectly, but some of them set y in various ways before the read. I could imagine if the whole thing was one giant block, or if it was each header's two bytes, then a solid block, or if it was single a label per each byte of the header. How it is now with the first two headers together, then one more, then the last in the block totally puzzles me.

I haven't really dived in to see how close it got with the rest of my data in this game, but I'm pretty impressed.

I never posted, but I tried the old version with a smaller game (since then it didn't support this one's size) and read through a lot more than this one and it did extremely well with what I checked.

Last note: I get an unhandled exception every time I minimize the program with a disassembly open. It minimizes fine before it opens a rom, though.
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: NESRevPlus

Post by oRBIT2002 »

I'm thinking about a new feature for NESRevPlus.. Some sort of graphical view that separates all subroutines and visually displays how they relate to eachother. Similar to a database-diagram.
However, the problem I'm having is how to do this visually. Anyone has any ideas how to solve this?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: NESRevPlus

Post by tepples »

Do you want me to dig out the Python code that I used to make the call graph of Thwaite?
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: NESRevPlus

Post by oRBIT2002 »

I have no experience of Python sadly..
Post Reply