News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Assigning sprites on Mega Man 2 boss select screen/generally finding stuff  (Read 3009 times)

Woodman

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
So I'm making a funny meme hack for my favorite streamer and came across something that for the life of me I cannot find the solution to. I was editing the palette in the weapons gained screen and when I entered back into the main boss select I encountered a problem that should be immediately obvious...


Before beating Razor Man vs after

So yeah, I need to find out how to reassign sprites so that they disappear appropriately with each boss. Now, usually if I know what a certain chunk of data does, I can mess with it until i figure out what the values do. But in this case, I have searched high and low throughout the rom, ram, and even PPU maps and cannot find anything that seems to be what Im looking for, mainly due to the fact that I can only search a single sprite value at a time since I have no idea how it would be formatted.

Now, if you have experience with mm2 and know the answer to my question, I would be thrilled if you shared that knowledge with me, but this recurring problem I am having where I have to comb through the ROM with little information on what I'm looking for will only get more tedious and annoying, I would imagine. While most of the time it works, it isnt exactly the most efficient way of doing things, I would imagine. That being said, does anybody have any tips/tricks on how to track and find specific data in a ROM, possibly by using the current state of the game? Any help is greatly appreciated

Ness

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
Lately I've been messing with sprites in the intro and stage select screen, but not in MM2, in MM5. I'm not an expert either so I'm not sure if I can be of any help but I'll shoot anyway.

In MM5 for the stage select screen what happens is that the sprites aren't linked to objects, but directly drawn. In the rom there is table that tells which tile number to use, that sets its X-Y coordinate, and its direction/palette. The table has all the sprites listed like this one after the other and can be found as such in the RAM as well.

In the rom they're also close to the palettes used for this screen.

MM2 should have one or several ram addresses dedicated to keeping track of "stages completed" or "weapons acquired".
I suspect you used sprites from MM's face for Razor Man, is that correct? I suggest trying to find the code that sets those sprites, branch out to free space and have it check for "stages completed" or "weapons acquired" so you may branch back accordingly.

Woodman

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Ok, so I am following what you're saying until the "branch out" part. Is there some sort of code that I can insert that will allow me to make the sprites disappear accordingly in unused space?

Oh, and in mm2 the sprites are written as "yy id palette xx", in case they are different than mm5

Ness

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
I was assuming wrong things (I had forgotten there is no MM face in the stage select screen in MM2) hence why I was telling to create new code for those sprites.

I'm having a look at the stage select screen code in FCEUX's debugger with the help of a ram map but I'm kind of running blind here.

What exactly did you do for Razor Man's sprites? Did you edit sprites related to Metal Man's ? Did you change its location, make it bigger?

Actually, which part of Razor Man isn't disappearing, is it the background part of the sprite part?

Looks likes it's the bg part. If that's the case what I was saying doesn't apply.
Did you use different tile locations to make Rozar Man's bg parts than the ones used for Metal Man by default? If that's the case, try to use the original tile locations. If it's not possible or doesn't help then we need to locate the code that dictates bg tile drawing for this screen.
« Last Edit: April 16, 2017, 04:15:27 am by Ness »

Woodman

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Actually, the parts that I am having trouble with are sprites that I re-purposed from other characters on the stage select screen (I basically just moved them over and changed their assigned palette). The problem I am having is that those sprites are still assigned to disappear from the original characters to which they were assigned. So basically, the reason only some sprites disappear is because razor man's sprites are a combination of metal man's and (mostly) flash man's sprites. The bg tiles are actually conveniently placed in the rom so that even blank tiles have their own ID, so there are no problems with the background.

Heres a screenshot of the PPU if that helps:


Ness

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
Sorry I'm not finding anything more.



As you can see the games does check ram address 9A which is "acquired weapons", however I'm not sure how it makes the connection between that, and whether or not to draw the sprites.

Also I'm unfamiliar with MM2 and it looks like some of the documentation at datacrystal is wrong (or maybe I'm missing something?), for instance according to it ram address 9A should be 04 when you only have the Flash Stopper, but when I set a PW for just that stage beaten, I get 20 for 9A.

Anyway if I'm reading this right it loads 9A (acquired weapons) to A, then set A to $0002 which is most likely an address used for temporary storage for calculation.

Then it does a "logical shift right", meaning that the bits are moved to the right and if there is a 1 for the last bit the carry flag is set. Then branches out if the carry flag is set.
Apparently this operation repeats for every single bit, and since each bit of 9A corresponds to an acquired weapon, that's how they know which stages have been cleared.

After that I'm lost. Meh, I tried, but since I'm unfamiliar with MM2 this is taking too much of my time to keep going.
Hope this helps, if you can't figure out the rest or find someone who can, I suggest trying to re-think your sprite and bg drawing so that your robot masters portraits correspond to the default sprite and bg tile use.
« Last Edit: April 17, 2017, 09:59:44 am by Ness »

Woodman

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Thank you for your efforts. I suppose I could just move the portraits around so bosses that need more sprites can have access to those sprites and then reroute their stages acordingly, but its a shame nonetheless.

pianohombre

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
    • My personal website of short stories and comics
There's an official Megaman 2 rom hack released by Capcom. It's called Megaman 9 and 10. I never could get into the NES Megamans. Honestly there's only a few nes games I could enjoy playing and most have had graphics updates and moved onto newer systems.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

Woodman

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
I'm pretty sure those arent romhacks considering they were released on wii virtual console...

pianohombre

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
    • My personal website of short stories and comics
Actually, this game looks fun. There really needs to be a lot more funny rom hacks. I recently downloaded a rom hack that makes Sonic gain weight with each ring he collects and I saw someone made a rom hack where you play streets of rage or something using that guy in the diabetes commercials.

I was actually planning on doing some graphics hacking. I just need to edit a couple sprites in the game (megaman x), but the sprites I want to use have different tile sizes so it's a little bit of a hassle. I have to move over the new sprites to free data then edit the assembly to arrange the sprites in game. I assume it's going to be very time-consuming and full of many errors before I get it working right. Perhaps I can message one of you two for some help.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

Woodman

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Hey thanks dude. If you're interested this hack is based off of the streamer Vinesauce and is going to be a full on graphics/music/level hack. Oh and I also finally got the portraits to cooperate by redesigning some characters and graphically downgrading others.

As for help with megaman x, I doubt either of us could help seeing as the SNES is a completely different animal. But my advice to your problem would be that if you cant fit what you want into the allotted space, your only option really is to redesign/downgrade your proposed edit if you don't have any advanced hacking knowledge

pianohombre

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
    • My personal website of short stories and comics
As for help with megaman x, I doubt either of us could help seeing as the SNES is a completely different animal. But my advice to your problem would be that if you cant fit what you want into the allotted space, your only option really is to redesign/downgrade your proposed edit if you don't have any advanced hacking knowledge

Good job solving your portrait problem, though I'll most likely have to do something different to fix the problem I'm facing. I need to change the sprite in the game from 16x16 tiles to 32x32 tiles so I won't be able to downgrade. I think I found some other people to help who have edited the specific game sorry to bother
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds