Help removing iNes header of rom?
Moderator: Moderators
Help removing iNes header of rom?
Hi there,
I'm still relatively new to this whole thing, but I am in the process of doing a repro of an SMB2J cart. There has been a ton of info on here for doing so and I think I have everything figured out except one little detail.
I'm attempting to remove the header of the iNes file. I understand that this step is necessary before burning the EPROM chips.
My problem is that I'm not sure at what point to remove the iNes header. Do you remove it before you split the NES file into CHR and PRG? If so, then what happens is ucon64 nor readnes will even open the file, saying that it has a bad header.
Do I just strip the first 16 bytes from the final PRG file in the end? This is pretty confusing, so any help would be greatly appreciated.
Using readnes to duplicate the CHR and PRG, I ended up with the following file sizes:
SMB2J.PRG - 129 KB (132,218 bytes)
SMB2J.CHR - 128 KB (131,312 bytes)
The problem is in the .PRG file right? That is perhaps where the header should be removed. I'm really not sure.
Thanks alot,
Brian
I'm still relatively new to this whole thing, but I am in the process of doing a repro of an SMB2J cart. There has been a ton of info on here for doing so and I think I have everything figured out except one little detail.
I'm attempting to remove the header of the iNes file. I understand that this step is necessary before burning the EPROM chips.
My problem is that I'm not sure at what point to remove the iNes header. Do you remove it before you split the NES file into CHR and PRG? If so, then what happens is ucon64 nor readnes will even open the file, saying that it has a bad header.
Do I just strip the first 16 bytes from the final PRG file in the end? This is pretty confusing, so any help would be greatly appreciated.
Using readnes to duplicate the CHR and PRG, I ended up with the following file sizes:
SMB2J.PRG - 129 KB (132,218 bytes)
SMB2J.CHR - 128 KB (131,312 bytes)
The problem is in the .PRG file right? That is perhaps where the header should be removed. I'm really not sure.
Thanks alot,
Brian
I want through this too, but it was a little easier for me because I was only using PRG data.
What hex editor do you use?
There's a thread from about February where I was helped with this stuff. In my case I only had to remove the first 16 bytes right off of the very top line of my hex code.
(I was only working with sound, no video. So there was no CHR code in my case.)
See this thread: http://nesdev.com/bbs/viewtopic.php?t=3 ... highlight=
Then I just had to concatenate the edited code (copy and paste it X number of times to fill the capacity of the particular chip I was using. There's another thread about this too, should be located in Feb, around where the above thread is.
See this thread:
http://nesdev.com/bbs/viewtopic.php?t=3 ... highlight=
I use HXD Hex editor, and in the editor the first line of hex code looks like this:
4E 45 53 1A 01 00 01 00 00 00 00 00 00 00 00 00 NES.............
I just cut that whole line out, then copy and paste the edited code to accommodate the capacity of the chip I'm using.
Hope that helps a little.
Tony
What hex editor do you use?
There's a thread from about February where I was helped with this stuff. In my case I only had to remove the first 16 bytes right off of the very top line of my hex code.
(I was only working with sound, no video. So there was no CHR code in my case.)
See this thread: http://nesdev.com/bbs/viewtopic.php?t=3 ... highlight=
Then I just had to concatenate the edited code (copy and paste it X number of times to fill the capacity of the particular chip I was using. There's another thread about this too, should be located in Feb, around where the above thread is.
See this thread:
http://nesdev.com/bbs/viewtopic.php?t=3 ... highlight=
I use HXD Hex editor, and in the editor the first line of hex code looks like this:
4E 45 53 1A 01 00 01 00 00 00 00 00 00 00 00 00 NES.............
I just cut that whole line out, then copy and paste the edited code to accommodate the capacity of the chip I'm using.
Hope that helps a little.
Tony
Hex
thanks for the responses.
I actually read through that thread yesterday to try and figure out what I was trying to get.
However, I'm using HXD to edit my files. I'm not having any troubles with the copying and pasting, however, I'm just not sure why my file sizes are off.
As tepples mentioned, the file sizes should be exactly 131,072. This is definitely off from the numbers I'm getting. Mainly because I did NOT remove the iNES header from the actual .NES rom before splitting.
Did you remove your header from the PRG file AFTER splitting them?
This is what I find really confusing. When to actually remove the iNES header.
I actually read through that thread yesterday to try and figure out what I was trying to get.
However, I'm using HXD to edit my files. I'm not having any troubles with the copying and pasting, however, I'm just not sure why my file sizes are off.
As tepples mentioned, the file sizes should be exactly 131,072. This is definitely off from the numbers I'm getting. Mainly because I did NOT remove the iNES header from the actual .NES rom before splitting.
Did you remove your header from the PRG file AFTER splitting them?
This is what I find really confusing. When to actually remove the iNES header.
I didn't have to "split" anything because I was not using any video in my code, only audio.
I don't really know, but it would seem logical that you should remove the header first, before doing any other editing such as splitting or copy/paste?
Hopefully someone with more experience will chime in on this because I'n not sure.
I don't really know, but it would seem logical that you should remove the header first, before doing any other editing such as splitting or copy/paste?
Hopefully someone with more experience will chime in on this because I'n not sure.
It was explained a little more on this thread in another forum:
http://www.nesworld.com/cgi-bin/yabb/Ya ... 1202861725
The guy who replied to my post said this:
"You then need to strip the header off the ROM, split it into its PRG and CHR segments."
So, I assume that means, remove the header first, then split and then concatenate.
http://www.nesworld.com/cgi-bin/yabb/Ya ... 1202861725
The guy who replied to my post said this:
"You then need to strip the header off the ROM, split it into its PRG and CHR segments."
So, I assume that means, remove the header first, then split and then concatenate.
headers
okay, that makes sense.
my issue was that once I removed the header, both ucon64 and readnes would not recognize the file, saying that it had a bad header. On my NES rom file, this is what the header looks like in HXD:
Left side:
And on the right side:
This is what I want to remove, correct?
my issue was that once I removed the header, both ucon64 and readnes would not recognize the file, saying that it had a bad header. On my NES rom file, this is what the header looks like in HXD:
Left side:
Code: Select all
4E 45 53 1A 04 01 41 00 00 00 00 00 00 00 00 00Code: Select all
NES...A.........- Hamtaro126
- Posts: 786
- Joined: Thu Jan 19, 2006 5:08 pm
header
okay, well I figured that this was the iNES header that I had to remove.
However, now I'm wondering how to split the CHR and PRG file from the NES rom. After you remove the header from the NES file, ucon64 and readnes will no longer recognize the file, or they say that it has a bad header.
All I did was go into the NES file with HXD and deleted those first 16 bytes.
Am I doing this wrong? And if not, then how did you split your PRG and CHR files after killing the header?
Thanks!
However, now I'm wondering how to split the CHR and PRG file from the NES rom. After you remove the header from the NES file, ucon64 and readnes will no longer recognize the file, or they say that it has a bad header.
All I did was go into the NES file with HXD and deleted those first 16 bytes.
Am I doing this wrong? And if not, then how did you split your PRG and CHR files after killing the header?
Thanks!
solved!
Okay, so I just figured out a really great way to successfully pull the PRG and CHR files along with the iNes header (HDR).
If you would like to split your iNES files all in one go, use tniNES 2.6. Here is a link: http://huizen.dds.nl/~patriekl/tniNES.html
This is definitely the easiest way to go, and then just use a hex (I use HXD) editor to copy the CHR & PRG for your desired size.
Thanks a lot for everybody's contributions and input to this post!
If you would like to split your iNES files all in one go, use tniNES 2.6. Here is a link: http://huizen.dds.nl/~patriekl/tniNES.html
This is definitely the easiest way to go, and then just use a hex (I use HXD) editor to copy the CHR & PRG for your desired size.
Thanks a lot for everybody's contributions and input to this post!
whats great about tnines is that it actually splits the code, and puts the header in its own separate file (a .HDR file). that way the PRG and CHR are extracted without any headers left in them at all.
Its as simple as doing this:
tnines -s mario.nes
check it out. the only thing is, roms with things like VRAM i don't understand because it created a footer file (.FTR) when I tried to do this. But so far it works with CHR ROM stuff.
Its as simple as doing this:
tnines -s mario.nes
check it out. the only thing is, roms with things like VRAM i don't understand because it created a footer file (.FTR) when I tried to do this. But so far it works with CHR ROM stuff.