Hello, brand new member here and looking for some advice and pointers
I am working on a personal project, a sort of rom utility for emulation. Basically all the sega roms you find online are named as *.bin, regardless of whether they are genesis, 32x, or another type, and this gives us very little info about the actual contents of the file, and makes file association a bit tricky since .bin files are used by many applications.
What I am working on would look at a certain hex address (within the rom header) that lists the console name, sends it to a string variable, and based off of some if logic renames the file extension to one more descriptive of the actual file.
I am pretty new at this, and have worked out a program places the bytes into a string variable, but it curently prints "There is an error" and I have deliberatly created a what should look like a 32X file to this program, so unless I am screwy, it should be printing "This is a 32X rom."
Yes, lol. It is still alive and kicking online, many sites devoted to it. Some are devoted to a particular game instead of it as a whole.
I was already aware of eidolon's inn, but thank you anyway. I have googled the hell out of this sort of utility, but it does not seem to exist. Besides which, most of the online sega community prefers a .bin format for various reasons (easier patching, for one. actual .smd files are interleaved, basically shuffled) and I do not want to actually change the data withen the file, just rename the extension for the sake of organization (I am pretty ocd about File organization).
The first 16 bytes define what system it is. Why not create a char array of size 16, loop through the file pointer until all 16 bytes are read, the output the contents to the standard output buffer?
You could also just assign it to a string, then do a strcmp().
Lol, that is rather funny is it not? It is more than likely from the rom-copier, as most SNES roms have a .smc file extension, from the Super Magicom, but I use a utility to rename it to .sfc, super famicom, which is supported by all snes emulators, but that is neither here nor there.
It seems you missed an important part of that document, that those 16 bytes are at an offset of 0x100, or 256 bytes in. If I could send those 16 bytes to a string, I should be able to do it quickly.
I think some of you are missing the point here, lol. I posted this in beginners because I am just that, a beginner. The C++ I know is just the basic stuff I learned in my fundamentals of programming class, and want to learn other things for personal utility.
Ok, let me state my request in a more specific manner: how would you read a specific 16 bytes from a file, and then send them to a string variable. Please use n00b-speak, lol.
Ok, that did what I needed, thank you maeriden! Had to do a quick google to see which lib I had to include, never used that particular command before. I should be able to proceed from here, again thank you.
Not going to mark as solved just yet, not untill I am certain the project is done. Would you care to be included in the credits? Just going to be a little utility floating around the net for emulation geeks like myself, no money or whatever, just knowing your name is on something peopl find useful.
It doesn't say. It just explains that the header begins 256 bytes into the ROM. If I were to program a Genesis ROM, I'm assuming that I can put whatever I want there?