Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: CryinOnion on June 06, 2020, 12:02:06 pm

Title: Help modifying or removing hex value
Post by: CryinOnion on June 06, 2020, 12:02:06 pm
Greetings from Barcelona,

I'm working in a Street Fighter IV (NES bootleg) hack.

(https://i.imgur.com/l0wPB8x.png)

This is the original title screen (with slight changes). The only references to SFIV appears here and on another screen. Apparently, chinese title means "Fighter Legend" so, I'm trying to do something like that

(https://i.imgur.com/pRkSg36.png)

Usually this is a piece of cake for me. I just map the tiles like this

(https://i.imgur.com/X1xyCZo.png)

checking the values in the PPU viewer and then modify it as I wish. In this case I don't even need extra tiles. As I said, it should be a piece of cake, but...

(https://i.imgur.com/eWgFU63.png)

The hex value I marked in green before F0 seems to be some kind of "multiplier". It literally makes the E in "STREET" double. If I change the value from 02 to 05 for example, five "E's" appear. I have tried to simply replace 02 with the value of another tile, or put value 00 and the title screen crashes. Same problem to change the copyright year. "1993" appears as "1-the value that multiplies x2-9-3"

I could simply delete "Street Fighter IV" from the screen by emptying the tiles and leave the year as it is, but it's too "sloppy" so, if someone could explain to me how I could fix it, I'd be eternally grateful.
Title: Re: Help modifying or removing hex value
Post by: Cyneprepou4uk on June 06, 2020, 02:26:47 pm
You can transfer that logo data to a free space and extend it. Or you can delete some text, last line for example, replacing it with spaces the same way as game compresses data, which will free up some bytes, allowing you to shift data inbetween. Or you can move that blue text 1 tile to the left, replacing 3 spaces to the right with compressions, freeing up 2 bytes in data
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 06, 2020, 10:24:54 pm
Sounds great...  How do I do it?XD. Sorry, I forget to mention, zero programming skills... 😅
Title: Re: Help modifying or removing hex value
Post by: Cyneprepou4uk on June 07, 2020, 12:49:12 am
For the last 2 methods you don't need programming, just edit logo data. For example to move first line of blue text to the left decrease byte at 13756, which counts spaces from the end of the orange line

You'll probably feel more comfortable with highlighted bytes by code/data logger
Title: Re: Help modifying or removing hex value
Post by: Vanya on June 07, 2020, 06:23:59 am
What happens if you change the multiplier value into a letter value instead?

For example instead of:

ED EE EF 02 F0 81

Change it into:

ED EE EF ED F0 81

Does it still crash or write STRSET?
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 08, 2020, 03:08:55 pm
If I do exactly this (Change it into ED EE EF ED F0 81) we have a total crash:

(https://i.imgur.com/RV9z6Cp.png)

About no need to know programming to do that, sorry man, but your explanations sounds like chinese to me... :o Maybe a explanation for dummies (step by step with screenshots) will help me.
Title: Re: Help modifying or removing hex value
Post by: Vanya on June 08, 2020, 04:52:59 pm
Wow. That was unexpected.
Are those hex values the exact same ones corresponding to the tiles in the PPU viewer?
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 09, 2020, 01:10:02 pm
Yep. If you see the tile map I made a little bit above, the hex values match, except that instead of showing "ED EE EF F0 F0 81", being F0 the top of the "E" in "STREET", use the value "02" to show two top "E" parts. As I said, if I change that value to 05 for example, it shows five "E's", so it certainly works as a multiplier.
Title: Re: Help modifying or removing hex value
Post by: Cyneprepou4uk on June 09, 2020, 03:26:16 pm
Try changing 83 as well. I think it is a control byte for reading 3 raw bytes after it without multipliers
Title: Re: Help modifying or removing hex value
Post by: Vanya on June 09, 2020, 03:33:58 pm
That's what I was thinking too. Just tried the wrong byte.
Castlevania 3 uses a similar setup for the title graphics, and mentioning the 83 sparked some familiarity in my noggin.
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 10, 2020, 01:17:29 pm
In Spain we have a song that says the following (more or less): As Jack the Ripper said, let's go by pieces...

When I replace the value 02 with 83 on that specific line it works (1)

(https://i.imgur.com/DK3Pn6e.png)

Just in the next line the value is repeated (2) to generate two black tiles. If I try same trick It crashes  :banghead:. Same with (3) and (4).

I also tried to change the copyright year using same system (5). No positive results.


And finally, on the character selection screen, there is the same problem. An attempt is made to replace the value 02 with 83 with no result.

(https://i.imgur.com/tMUN5Dz.png)

And that's it. I still have a lot of work to do, so I have a couple of weeks before I get stuck if I don't fix this problem. Still, thanks (to both of you) for your interest and help.
Title: Re: Help modifying or removing hex value
Post by: Cyneprepou4uk on June 10, 2020, 01:57:24 pm
I never told you to replace 02 with 83. I said that you should change 83. See you after your next attempt  >:D
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 10, 2020, 02:33:26 pm
XD change for what?
Title: Re: Help modifying or removing hex value
Post by: Cyneprepou4uk on June 10, 2020, 03:41:09 pm
Use your own brains
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 10, 2020, 05:41:47 pm
Excuse me, but this is like you telling me:

-I don't speak or read Chinese, what do those symbols mean?

-"Mîao I Sing Lin Wa".

-What does that mean?

-Use your own brains.

If you think about it, that's a pretty rude way to answer.
Title: Re: Help modifying or removing hex value
Post by: Cyneprepou4uk on June 10, 2020, 05:53:01 pm
It's your own fault for being inattentive

83 ED EE EF 02 F0

83 = print 3 following bytes as is
02 = print 1 following byte 2 times

Figure out the rest
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 10, 2020, 08:28:29 pm
Quote
It's your own fault for being inattentive
Respectfully, that's the worst apology I've ever heard. With this I can guess one of these options:

1) You're the opposite of humble, which is assuming anyone can make a mistake.

2) You're accustomed to people answering you rudely, in which case it wouldn't be your fault.

Anyway, without an apology I don't think it's right to accept your help.
Title: Re: Help modifying or removing hex value
Post by: Cyneprepou4uk on June 11, 2020, 04:28:33 am
Are you saying that you won't edit the title screen because of me?  :laugh:  Suit yourself  >:D
Title: Re: Help modifying or removing hex value
Post by: Vanya on June 11, 2020, 12:37:29 pm
I don't want to get into this, but I do want to let you know that around here you are expected to experiment on your own at least.

As for your issue, swapping out an 83 for a 02 is a pretty big change that you should expect will cause problems to some degree. It's pretty clear these values mean different things.

I mentioned before that I was reminded of how Akumajou Densetsu / Castlevania III formats the title screen's data. It's organized into a tile-map.

Like Cyneprepou4uk said, 83 is telling the game to place the next 3 tiles and 02 tells it to print the next tile 2 times.

You already know you can place more E's by increasing the 02 and reducing it to 00 crashes the game.
And you know 83 writes the next 3 bytes.

So if you want to change it to read FIGHTER LEGEND, you have to take these control values into consideration and the amount of space you have to work with in the tile-map.

When I made the initial changes to the re-translated version of the Akumajou Densetsu title screen I had to draw out all the tile-map data on a sheet of grid paper and make sure I wasn't using more bytes than there was available.

You'll need to do something similar.
Fortunately, I can tell you that seeing how the data is laid out will help show you what the control bytes do.
Title: Re: Help modifying or removing hex value
Post by: bogaabogaa on June 13, 2020, 03:24:30 am
I had like to point out that Cyneprepou4uk provided excellent learning material and is active helping many people here on RHDN. He is not speaking Chinese and when you don't understand something it is up do you to break it down to get further help with your trouble.
In this topic he did investigate and figure some stuff out that is needed for this task. Sure you can't be thank full if you can't use the information but your outlet is just provoking.
Here what he means with no programming skill needed to figure this out a bit.

In the first picture I removed the tiles so I have just the control byte left. This should make the explanations above easier to observe.

Second picture I play around with a control byte to see what it does.

(https://i.imgur.com/yZosg4C.png)
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 14, 2020, 01:13:37 am
This issue seems to have become a snowball that keeps growing, so I just want to explain my point, because I think some things have been misunderstood:

First of all, I have never questioned Cyneprepou4uk's contributions to this community. I also don't question that he tried to help me. All I was looking for was an apology for his disrespect. Since he has insisted on making fun (and continues to do so)
https://www.romhacking.net/forum/index.php?topic=30827.0

Spoiler:
(https://i.kym-cdn.com/entries/icons/facebook/000/022/138/highresrollsafe.jpg)
I didn't think it was right to accept his help. That doesn't mean I refuse to thank him for his help because I don't know what to do with it (that seems childish to me!). Nor does it mean that I closed the post or that I didn't accept help from anyone else, for example from Vanya, who has been patient and correct at all times.

Thirdly, speaking Chinese (it pains me to clarify) is just one example of the gap between your explanations and my knowledge. Here's another example: Until yesterday I didn't consider that each value is equivalent to one byte of information... I know that it is normal to take certain knowledge for granted when one specializes in something. There is a saying that goes, "There is no worse teacher than one who knows a lot". For my part, I used words like "explanation for fools" or "zero programming skills" in reference to myself, so I don't think anyone would accuse me of being touchy.

In short: "Peace, brothers" I am not looking for trouble, I have simply been stepped on and instead of lowering my head and going my way I have asked for an apology.

P.S. I still have no idea how to solve my problem, because this last night I did a sprint to finish part of my project. Today (which is tomorrow for me) in the night I'll try with the last explanations you've given me, but I'm afraid you'll hear from me again. See you then!
Title: Re: Help modifying or removing hex value
Post by: Cyneprepou4uk on June 14, 2020, 05:51:56 am
Dude, your large posts waste RHDN's limited server resources, you should become a patreon to compensate for it >:D

Here is my last little hint on this topic, hope it's not too hard for you
83 (ED EE EF) | 02 (F0)
85 (ED EE EF 02 F0)

Cheers! :beer: :thumbsup:
8-bit fan
Title: Re: Help modifying or removing hex value
Post by: bogaabogaa on June 15, 2020, 03:58:48 am
I a not a fan of bulling ether. Not sure what makes him act like this. Still he did bring the matter closer. He might be annoyed in the way you questioning things.. I am also bad with this people stuff so I mostly lath about it and don't wanna investigate more toward that matter.

I like to show a workflow that might help solving some compressed tile mapping formats. This is also a workflow that works for coders as it is mostly faster to figure easy formats with try and error. I made notes of the current format. After the offset you see the byte array unchanged. I made spaces after the control byte to get a better overview.

In the next two lines I did changes to make it more compact and easy to edit. I did see that changing the control byte to 87 will create visual glitches further down. So I was only able to rid of one 02 byte at once. The third line seems good enough I did replace the ffff with 3333 so you see you can edit what was empty space before.

Last thing I did is paste them back in in reverse order so you see it is almost close to what you like to have.

(https://i.imgur.com/wZsrfRV.png)

Also you don't need read books to code. A CPU is easy to understand. The code to make a program work will get complex and there is a lot that will make this machine fail. Just saying a CPU is on a bus where memory is mapped. It will jump to memory and execute what is there. It is easy to look up everything what it does. When you go forward don't be afraid to put a breakpoints to a memory location. You don't need to go deep just understanding how to copy a value and how it points to things can help to do creative things very quick.
Title: Re: Help modifying or removing hex value
Post by: CryinOnion on June 15, 2020, 03:39:27 pm
Thanks for your help, but especially for your sympathy. Yesterday a friend from the community offered to do this little job for me, and to explain to me how to do it if I wanted to.He speaks Spanish and in his own words "he doesn't know much about programming", which I think has made it easier for us to speak the same language (literally and figuratively). I don't worry about learning, "au contraire", although I recognize that I was investigating on my own the modifications he had made to the rom and I still don't understand how he did it, although now I do understand some concepts better.

Anyway, I hope you won't hear from me for a long time (in a good way) ;). Greetings to all and thank you for your time.