News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

newbie's hex problem

Started by nickgeo, February 22, 2018, 08:08:06 PM

Previous topic - Next topic

nickgeo

Hello everyone! Im new in this forum and about a few days ago I started with SMILE RF.The first thing I wanted to do was to clone a room.Specifically the room 792FD. I followed the guide exactly as it said. I Copied over the correct hex values with HxD to the 7E9A0 line.So my problem occurs when im trying to delete the actual "optional values" from the hex values of the present 7E9A0. Below an image is beeing displayed with red underlined the values that I deleted:
(EDIT: https://imgur.com/QvCFtvC  :colonrightv:)


The blue spots are the spots where the events1 data is ending and the events2 data begin. As you know the room 792B3 has 2 events. Event 1 and Event 2. So with a little help from the guide i tried to figure out what more I have to delete.As you probably know, the guide's clone room example, is the room 792B3 copied over to 7E9A0. So basically the problem occurs when I delete these values...The rooms become blacked out and sometimes with some crappy tiles. Also when I close the rom after this problem occurs, the rom cant reopen and an error is showing up. So what I have to do? Am I deleting the wrong values? Can someone please give me a hand? P.S. Sorry about bad english or misspelling if there's any.

Smiley

Do not ever just delete or insert bytes. That'll change the filesize of the rom and breaks every single pointer after what you've deleted, making the rom unusable.
Instead, move the data starting with E6 E5 back to where the first deletion was. In this case, you'd overwrite from 12 E6 on. Remember to always overwrite, not insert or delete!

Alternatively, you could just clone a room that has only one state to begin with and avoid all this hassle.

nickgeo

Do you mean like this? https://imgur.com/79eKj5Z I still cant open the rom after this...What I have done is, for example for the first ones, I cut the E6 E5 C4 DB C2 00 00 00 F0 80 values and paste write them on the red underlined values...

Smiley

Exactly like that. In that screenshot, 7E9A0-7E9C6 has all the needed data for a single-state room header. 7E9C7 onwards looks like door and scroll data (which your header does not point to btw).
So you should be able to open room E9A0 just fine in SMILE. If you can't, you probably added or deleted bytes. Pressing backspace in particular is a dangerous key when hex editing.

nickgeo

I reapeted this a couple of times just to make sure that I am not making any mistake like pressing backspace, undo or insert any value ....The results are the same tho...The rom cant open after these modifications....So do I made any mistake on the values that I have to move or what? :O_o:

MetroidNerd#9001

I would say try it again with an unedited ROM, you might have messed up something else too. If it works then, you've done it right.

nickgeo

#6
still gettin the same error. EDIT:So I tried to clone the same room as the guide's room with the exact same way and the rom STILL is unusable....I guess its HxD's fault, or I have to remove the values with a different way...

dewhi100

Can you do this? Start with a clean rom (again). In fact, make sure you run it before you change anything, just to make sure the checksum is OK. Also, make sure the ROM is headerless. If you go to the end of the file in HxD, last byte should be 02FFFFF.

Go through the tutorial again, and verify the ROM after every single edit you make. Note what bytes you changed and what they were before you changed them.  If you run into a problem again, try undoing your latest change. Re-read that step of the tutorial, and if you did exactly what it said, reply back here and give us the details on that step.

I myself screwed up my ROM when trying that tutorial for the first time. It's very easy to misread or skip steps, etc.

nickgeo

I tried it once again with a cleantestedwithsmile-rom. The rom is unheadered and still the same thing happens when I try to remove the optional bytes...
So here is exactly what I am doing step by step: 1) Copying over the room bytes from 792b3 to 7e9a0: https://imgur.com/EOLgP4j (rom and room 7e9ao is working fine after this)
2) Checking the bytes that I have to delete from the guides step: https://imgur.com/L49RD1w
3) Cutting the correct number of previous bytes to paste write them on the optional bytes: https://imgur.com/5tiEP2Z
4) Completing the procces with all optional bytes: https://imgur.com/Aen8Z16
5) Saving changes and refreshing room in smile: https://imgur.com/xOPCTg1
6) After closing and reopening smile this error occurs: https://imgur.com/Je8ZkNp
So its basically it. I dont know what is going wrong...

Smiley

Quote from: nickgeo on February 25, 2018, 07:02:41 PM
3) Cutting the correct number of previous bytes to paste write them on the optional bytes: https://imgur.com/5tiEP2Z
There's your problem. Cutting deletes bytes. You need to copy instead.
In HxD, click Extras -> Options, and make sure the box "Confirm insertion/deletion of bytes" is checked to avoid mistakes like this.

nickgeo

#10
So its almost fine I think...Are the values supposed to look like this? https://imgur.com/rv71U0N (the underlined red values are those that I copy and paste write them on the optional ones and the red unsaved values are the replaced ones)

After this, the rom is fine, but it seems the room 7e9a0 differs from 792b3: https://imgur.com/wesl6eq (the enemies are missing for example)


EDIT: I think I got the trick. I had to copy paste the correct previous bytes to replace the earlier optional ones and then I had to copy all the next bytes after the bytes I chosed to copy and paste them over the optional ones, and paste all those over the chosen ones.