News: 11 March 2016 - Forum Rules

Author Topic: River City Ransom restoration?  (Read 3584 times)

tanookitoad979

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
River City Ransom restoration?
« on: June 20, 2017, 02:36:27 pm »
Hello everyone, I know I don't post here often but I've had an idea recently, and I'm not sure if it's been done before.

Essentially, what I'll be doing is a restoration of River City Ransom on NES with the old sprites and names, possibly even story if there was any changes, From Downtown Nekketsu Monogatari. My only concern is I'm not too sure how to edit the text, but I'm sure I can deal with the sprites just fine.

June 20, 2017, 06:29:51 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Ok, Update: turns out it hasn't been done before but I have some problems

first, like I said, I have no idea how to edit the text

second, The pant's on almost all the characters in the US version are blue and share a palette while the pants on characters in the JPN version use the shirt's palette. I have no idea how to fix this.

Please respond if you have any ideas.
« Last Edit: June 20, 2017, 06:29:51 pm by tanookitoad979 »

SpiderDave

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
    • spiderdave.me
Re: River City Ransom restoration?
« Reply #1 on: June 20, 2017, 06:59:52 pm »
Are you sure you wouldn't be better off just starting with the Japanese version of the game and basically doing a translation?

tanookitoad979

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: River City Ransom restoration?
« Reply #2 on: June 20, 2017, 07:09:34 pm »
I considered that but here's the thing: I'm still new to this, and as such I still don't quite understand editing text, or if there's gonna be any space limits when translating.

However  I'm willing to try if you have any advice.

Jorpho

  • Hero Member
  • *****
  • Posts: 4948
  • The cat screams with the voice of a man.
    • View Profile
Re: River City Ransom restoration?
« Reply #3 on: June 20, 2017, 09:11:28 pm »
You're the second person to come in here lately seeking such information.
http://www.romhacking.net/forum/index.php?topic=24252.0
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Psyklax

  • Hero Member
  • *****
  • Posts: 1112
    • View Profile
    • Psyklax Translations
Re: River City Ransom restoration?
« Reply #4 on: June 21, 2017, 04:36:45 am »
Indeed, someone already asked about this. In both cases, I don't quite understand the end goal. Do you want to translate DNM so that it is just like RCR (which seems like a lot of work for little gain), or do you want to edit RCR so it looks like DNM (a lot less work, in my opinion, especially if you're not interested in translating all the text). Hell, I could probably manage it myself in a day or two. Regarding the palettes (pants and shirts sharing palettes), can't you just change it so that it doesn't do that? You know, look for the sprites in RAM, locate where in the asm it's loaded, change that in the ROM? It wouldn't take much, though I can understand if you're new to this. I'll have a look later today. :)

EDIT: okay, I just had a look, and it didn't take me long to figure out the palette issue. Basically, every frame the game loads from ROM the information for each sprite (in case you don't know, sprites are held in RAM from $200 onwards). I found that at $CEE6 and $CEE7 in the ROM are the bytes that say which palette to use for Alex's legs in RCR (DNM is almost the same, just a couple of bytes off). This is used for whenever he's walking, jumping or doing regular punches - so not when you can see his feet, which is a different palette. In RCR it's 01 (the second palette, since 00 is used for his shirt). By simply changing those two bytes to 00, as in DNM, you get the same palette for shirt and pants. Of course, you also need to change the ones for kicking and for the other bad guys, but once you've figured out one, the rest will be simple to work out. :)

So, there you have it. My question remains: do you want a proper translation of DNM, or simply RCR with DNM graphics, because for me the latter is a lot easier. Changing English text to other English text is a damn sight simpler than changing kana to English.  ;D
« Last Edit: June 21, 2017, 06:24:39 am by Psyklax »

tanookitoad979

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: River City Ransom restoration?
« Reply #5 on: June 21, 2017, 01:52:55 pm »
So, there you have it. My question remains: do you want a proper translation of DNM, or simply RCR with DNM graphics, because for me the latter is a lot easier. Changing English text to other English text is a damn sight simpler than changing kana to English.  ;D

Well yeah I just wanted to change the text in RCR to more closely match the original, I know most of the character names and such and The story isn't TOO far off... also, thank you for the advice on the palettes, that was my main problem problem, I'll try to use that (no guarantee I'll be competent enough to do it though.)

DANGER X

  • Full Member
  • ***
  • Posts: 167
  • Nes hacker & player
    • View Profile
    • Deadpool Nes
Re: River City Ransom restoration?
« Reply #6 on: June 21, 2017, 02:05:37 pm »
Yet another guy who wants the same thing as Googie, dude you need to change the color pointers in order to change the costume colors in certain graphics spots (I know what I said, he inserted the graphics exactly like you)

tanookitoad979

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: River City Ransom restoration?
« Reply #7 on: June 21, 2017, 02:08:26 pm »
Yet another guy who wants the same thing as Googie, dude you need to change the color pointers in order to change the costume colors in certain graphics spots (I know what I said, he inserted the graphics exactly like you)

Ok yes, and I'm sorry for the ignorance, but I don't understand how to do it, although I assume Psyklax explained it.

DANGER X

  • Full Member
  • ***
  • Posts: 167
  • Nes hacker & player
    • View Profile
    • Deadpool Nes
Re: River City Ransom restoration?
« Reply #8 on: June 21, 2017, 02:15:54 pm »
Don't worry I don't know either  :laugh:
Actually I have a small idea is just it takes so long and I can't find the exact value.

Psyklax

  • Hero Member
  • *****
  • Posts: 1112
    • View Profile
    • Psyklax Translations
Re: River City Ransom restoration?
« Reply #9 on: June 21, 2017, 03:49:34 pm »
Don't worry I don't know either  :laugh:
Actually I have a small idea is just it takes so long and I can't find the exact value.

Dude, I literally just explained it, it took me 5 minutes to find the bytes that set the palette for Alex's pants. :D
But seriously, if you really want I don't mind telling you how I found them. You just need FCEUX, it's awesome. If you really want I can just change all the necessary bytes and send you a patch. :D But I think helping you figure it out for the future would be more useful to you (give a man a fish etc).

So, step by step. I opened RCR in FCEUX and started the game, and Alex pops up. I pause and open the hex editor and look in the $200-300 range (the area in RAM known as sprite RAM). There you find 256 bytes dedicated to sprites: the NES can hold 64 sprites in memory, and each sprite is described with 4 bytes (any more than 64 on-screen and the game has to switch between them every other frame, which is why you see flickering). Remember, each sprite is only 8x8 (or 8x16, but only if you choose to do so for the game, which this one doesn't), so our Alex guy has several to make up his body. For more information on what the 4 bytes mean, read this:
https://wiki.nesdev.com/w/index.php/PPU_OAM
To keep it short, the first and last bytes say where on the screen to draw the sprite - obviously this can change every frame with moving sprites, though not all sprites have to move. The second byte says which tile it is (open the PPU viewer to see what tiles are in memory at that moment). And the third tile sets attributes, namely whether to flip the sprite around (when the game begins Alex is horizontally flipped), whether the sprite should be behind or in front of the background, and crucially, which of 4 palettes to use. This is the smallest two bits, so if your byte has x0 to x3, you can see the palette. Alex's shirt uses the first palette (0) and his pants uses the second (1).
With all this in mind, I look in RAM for any sprites with 30 or 31 (the tiles for his pants). It's easier before any guys show up cause there aren't so many tiles to check. :) Anyway, I see the first two sprites have exactly that, and their attributes are 41 (horizontal flip, palette 1). So I change it to 40 to change to palette 0, advance one frame, and hey presto, his pants change to white.
That's all great, except now I need to know the location in the ROM that TELLS the game that his pants should be palette 1. So I open the debugger and set a breakpoint for when the game writes to that attribute byte - in this case, $2E2 (and $2E6, but they're probably next to each other). I click Run, and find two instructions that write to it, but the key one is at $EEEB, because I can see where the number comes from. Directly above this instruction, it says it loads it from $8ED7, adds $40 if necessary (for the horizontal flip) and then writes it to the RAM.
So I go to $8ED7 in the hex editor and right-click, "go here in ROM file". That takes me to $CEE7. I can change the 01 to 00 and unpause the game - aha! One leg has permanently changed. Where's the other leg? Well, I try $CEE8 but that doesn't seem to do it, so I change $CEE6 instead. Woo, got it.
Well, that didn't take long, for Alex's pants, though obviously finding the location for every other character in the game will take some time (and don't forget this is only his pants while walking, we need to change his kicking, crouching etc), but it shouldn't be too much trouble, and once it's done, it's done. :)
I hope that was some help to you, and it shows how a little assembly learning can go a long way with your ROM hacking. Hell, I knew nothing until a couple of months ago. :D