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

Author Topic: Megaman X Buster Upgrade  (Read 7854 times)

PowerPanda

  • Full Member
  • ***
  • Posts: 163
    • View Profile
Megaman X Buster Upgrade
« on: April 02, 2017, 06:34:27 pm »
Hi there. I'm working on a small hack to Megaman X that affects the way capsules are found. The Dash Boots are now skippable, and none of the other equipment requires the dash boots to obtain. The purpose of this hack is 2-fold:
1. For normal players, to allow them to change up their route through the game, trying new combinations of armors and powerups. There is no longer a need to do Chill Penguin first!
2. For hardcore players/speedrunners, to allow them to do an armor-free speedrun.

I've accomplished the first part of my hack with just a level editor. All 4 equipment capsules can be reached with precise jumps and wall kicks. However, there are 2 more things I'd like to add before releasing the patch. Unfortunately, both require a rom map, which does not exist anywhere I can find for Megaman X.
1. Zero's Buster - After you fight Vile, the game does a check to see if you've obtained the arm upgrade or not, then plays one of two versions of the cutscene. (One where Zero gives you the upgrade, and the other where he doesn't). I want to remove this check and always play the scene where he doesn't upgrade you. This is probably a 1-byte change. Does anyone know where this is in the Rom?
2. Sigma Final Form - Only 2 things damage Sigma in his final form: the Rolling Shield (2 pts damage) and an upgraded X-Buster at charge level 3 (1 pt damage). I would like to change this so that the X-Buster charge level 2 does 1 pt damage, and level 3 2 pts. This would allow a speed runner to do a buster-only no upgrade run. Any idea where this damage table is located?

ThegreatBen

  • Hero Member
  • *****
  • Posts: 742
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #1 on: April 04, 2017, 05:10:55 pm »
I dont know asm but I like what youre doing so I'll try to help, looking at game genie codes I can tell you that all armor parts are saved to a saved to a single ram byte (7E1F99) if I mess around I might be able to tell you the value of the buster part.


PowerPanda

  • Full Member
  • ***
  • Posts: 163
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #2 on: April 04, 2017, 08:07:23 pm »
I dont know asm but I like what youre doing so I'll try to help, looking at game genie codes I can tell you that all armor parts are saved to a saved to a single ram byte (7E1F99) if I mess around I might be able to tell you the value of the buster part.

I'm fairly certain that the values are
$01 - Subtank 1 - Storm Eagle
$02 - Subtank 2 - Armored Armadillo
$04 - Subtank 3 - Spark Mandrill
$08 - Subtank 4 - Flame Mammoth
$10 - Leg Parts
$20 - Body Parts
$40 - Arm Parts
$80 - Head Parts
(So if you had the Arm Parts and all 4 Subtanks, the byte would read $4F.) All of the upgrades would equal FF.)

What I don't know where to find is where the rom CHECKS the ram value to determine which of the 2 cutscenes to play.

justin3009

  • Hero Member
  • *****
  • Posts: 1647
  • Welp
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #3 on: April 05, 2017, 04:25:20 pm »
Code: [Select]
$88/D746 AD 99 1F    LDA $1F99  [$86:1F99]   A:0B30 X:001C Y:0008 P:envMXdizC
$88/D749 89 02       BIT #$02                A:0BFD X:001C Y:0008 P:eNvMXdizC
$88/D74B D0 01       BNE $01    [$D74E]      A:0BFD X:001C Y:0008 P:eNvMXdiZC
$88/D74D E8          INX                     A:0BFD X:001C Y:0008 P:eNvMXdiZC

NOP this (EA) so that when you go to Zero and initiate dialogue, it'll ALWAYS be the dialogue that's him with his failing power system instead of saying you're stronger but need an edge.

Code: [Select]
$88/D7C0 AD 99 1F    LDA $1F99  [$86:1F99]   A:05CC X:000C Y:000D P:envMXdiZc
$88/D7C3 89 02       BIT #$02                A:05FD X:000C Y:000D P:eNvMXdizc
$88/D7C5 F0 0C       BEQ $0C    [$D7D3]      A:05FD X:000C Y:000D P:eNvMXdiZc

NOP this (EA) so after dialogue you no longer get the X-Buster upgrade.

I haven't tested the 2nd section fully as I'm not sure if that actually breaks capsules or not.  Otherwise, that's all you need and it's good to go.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

PowerPanda

  • Full Member
  • ***
  • Posts: 163
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #4 on: April 05, 2017, 08:52:42 pm »
Code: [Select]
$88/D746 AD 99 1F    LDA $1F99  [$86:1F99]   A:0B30 X:001C Y:0008 P:envMXdizC
$88/D749 89 02       BIT #$02                A:0BFD X:001C Y:0008 P:eNvMXdizC
$88/D74B D0 01       BNE $01    [$D74E]      A:0BFD X:001C Y:0008 P:eNvMXdiZC
$88/D74D E8          INX                     A:0BFD X:001C Y:0008 P:eNvMXdiZC

NOP this (EA) so that when you go to Zero and initiate dialogue, it'll ALWAYS be the dialogue that's him with his failing power system instead of saying you're stronger but need an edge.

You are a gentleman and a scholar.

April 07, 2017, 09:15:54 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
I have spoken to the guy who created the MegaED editor for the MMX series, and he has said that the damage charts for enemies have never been determined in the rom, so I think I'll drop that one from my scope for now. The rest has been tested and is working. Problem is, I made all the edits to a rom hash that RHDN doesn't recognize, so I'll need a bit of time to re-do my work on a recognized dump before I can post it here. I estimate the work will be done within the next 2 weeks. Look for it on the front page.
« Last Edit: April 07, 2017, 09:15:54 pm by PowerPanda »

rainponcho

  • Sr. Member
  • ****
  • Posts: 275
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #5 on: April 09, 2017, 08:32:00 pm »
Rev 1 rom
Code: [Select]
$84/9E6E A5 27       LDA $27    [$00:0F0F]   A:0000 X:1228 Y:00A0 P:eNvMxdizc
$84/9E70 29 7F       AND #$7F                A:0020 X:1228 Y:00A0 P:envMxdizc
$84/9E72 38          SEC                     A:0020 X:1228 Y:00A0 P:envMxdizc
$84/9E73 F9 37 EF    SBC $EF37,y[$86:EFD7]   A:0020 X:1228 Y:00A0 P:envMxdizC
$84/9E76 30 21       BMI $21    [$9E99]      A:001F X:1228 Y:00A0 P:envMxdizC

Put a breakpoint on 84:9E73 to see damage amounts to enemies. Or use it to cheat very quickly.

Code: [Select]
$84/9E45 B9 37 EF    LDA $EF37,y[$86:F199]   A:0002 X:1228 Y:0262 P:envMxdizc
$84/9E48 10 0E       BPL $0E    [$9E58]      A:0080 X:1228 Y:0262 P:eNvMxdizc

Sigma Final uses this value. $80 means no damage for normal shot. Edited and 1-shot kill.

Have fun testing all values. ;)

ThegreatBen

  • Hero Member
  • *****
  • Posts: 742
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #6 on: April 10, 2017, 08:25:38 am »
Since this project is about getting (or not getting) capsule upgrades would you consider speeding up the process for getting the hadouken? For completists like me who play the series once a year you tend to get really sick of armored armadillos stage.

DarkSamus993

  • Sr. Member
  • ****
  • Posts: 287
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #7 on: April 10, 2017, 10:23:20 am »
Since this project is about getting (or not getting) capsule upgrades would you consider speeding up the process for getting the hadouken? For completists like me who play the series once a year you tend to get really sick of armored armadillos stage.
@PowerPanda If you would like to add this to your project: change $87:CA96 to CMP #$01. This will make it so the the capsule will appear on the first visit with all the upgrades.

Code: [Select]
$87/CA8D AD 7E 1F    LDA $1F7E  [$86:1F7E]   A:099A X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdiZC
$87/CA90 30 32       BMI $32    [$CAC4]      A:0904 X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdizC
$87/CA92 1A          INC A                   A:0904 X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdizC
$87/CA93 8D 7E 1F    STA $1F7E  [$86:1F7E]   A:0905 X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdizC
$87/CA96 C9 05       CMP #$05                A:0905 X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdizC
$87/CA98 90 2A       BCC $2A    [$CAC4]      A:0905 X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdiZC
$87/CA9A A9 05       LDA #$05                A:0905 X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdiZC
$87/CA9C 8D 7E 1F    STA $1F7E  [$86:1F7E]   A:0905 X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdizC
$87/CA9F AD 99 1F    LDA $1F99  [$86:1F99]   A:0905 X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdizC
$87/CAA2 2D 9C 1F    AND $1F9C  [$86:1F9C]   A:09FF X:0003 Y:0069 D:0E68 DB:86 S:012F P:eNvMXdizC
$87/CAA5 C9 FF       CMP #$FF                A:09FF X:0003 Y:0069 D:0E68 DB:86 S:012F P:eNvMXdizC
$87/CAA7 D0 1B       BNE $1B    [$CAC4]      A:09FF X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdiZC
$87/CAA9 2C 7C 1F    BIT $1F7C  [$86:1F7C]   A:09FF X:0003 Y:0069 D:0E68 DB:86 S:012F P:envMXdiZC
$87/CAAC 50 16       BVC $16    [$CAC4]      A:09FF X:0003 Y:0069 D:0E68 DB:86 S:012F P:enVMXdizC
$87/CAAE AD CF 0B    LDA $0BCF  [$86:0BCF]   A:09FF X:0003 Y:0069 D:0E68 DB:86 S:012F P:enVMXdizC
$87/CAB1 29 7F       AND #$7F                A:0920 X:0003 Y:0069 D:0E68 DB:86 S:012F P:enVMXdizC
$87/CAB3 C9 20       CMP #$20                A:0920 X:0003 Y:0069 D:0E68 DB:86 S:012F P:enVMXdizC
$87/CAB5 D0 0D       BNE $0D    [$CAC4]      A:0920 X:0003 Y:0069 D:0E68 DB:86 S:012F P:enVMXdiZC
$87/CAB7 80 0F       BRA $0F    [$CAC8]      A:0920 X:0003 Y:0069 D:0E68 DB:86 S:012F P:enVMXdiZC

ThegreatBen

  • Hero Member
  • *****
  • Posts: 742
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #8 on: April 12, 2017, 08:03:39 am »
Damn he released it without adding this, guess I'll try it myself.

PowerPanda

  • Full Member
  • ***
  • Posts: 163
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #9 on: April 12, 2017, 03:41:36 pm »
I will definitely look at changing the Hadoken capsule and Final Sigma. Thanks guys! I'm much more of a project coordinator than I am a tech guy, so all of the input here is invaluable.

April 12, 2017, 11:12:03 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
First off, thank you to DarkSamus993! I have tested the code for getting the Hadoken, and it works. Now, as long as you have all weapons/powerups and finish Armored Armadillo with full health, the Hadoken capsule will appear. Should make getting the powerup after entering a code that much faster.

Now, for Wolf Sigma, let's put our brains together and discuss.

Code: [Select]
$84/9E45 B9 37 EF    LDA $EF37,y[$86:F199]   A:0002 X:1228 Y:0262 P:envMxdizc
$84/9E48 10 0E       BPL $0E    [$9E58]      A:0080 X:1228 Y:0262 P:eNvMxdizc

Sigma Final uses this value. $80 means no damage for normal shot. Edited and 1-shot kill.

Have fun testing all values. ;)

Actually, the $80 makes sense! "80" in hexadecimal is "128" in decimal, which is 4*32. It's well-known that Megaman Bosses have 32HP. That could be a starting point.

Right now, the buster does 0:0:0:1 damage (4 numbers denote, uncharged, charge 1, charge 2, charge 3. Charge 3 is only available with the buster parts). I want it to do 0:0:1:1 damage. So that means I want both levels to do either $04 damage (if this is additive) or $7C damage (if this is subtractive).

I'm not sure I understand how to change the code that you quoted, since I can't figure out how "10 0E" translates to $80 (I'm still very, very new to ASM). But knowing that you're probably looking for either a value of $04 or $7C, does that give you any ideas?
« Last Edit: April 12, 2017, 11:12:03 pm by PowerPanda »

pianohombre

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • My personal website of short stories and comics
Re: Megaman X Buster Upgrade
« Reply #10 on: April 13, 2017, 04:04:23 am »
Panda,
I was actually just working on fixing a bug in a MMX game that deals with the leg capsules (or dash boots as you described). So I got the game to start with leg capsules at the introduction stage and they show up all throughout the entire game, but I had some difficulty getting them to display if the player selects PASS WORD instead of START GAME. So for example, if they type in a password that skips the intro stage it returns to original megaman no dash, or at least in the game I was working on broken dash. I could force leg capsules, but then if someone used a password that for example gave them all armor/weapon upgrades it would override those. I was brainstorming a lot, but I was working with limited memory so couldn't find a location to store the asm instructions.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

rainponcho

  • Sr. Member
  • ****
  • Posts: 275
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #11 on: April 13, 2017, 09:34:27 am »
Sorry for not being more clear.

Code: [Select]
LDA $EF37,y[$86:F199] ==> damage tables start at 86:EF37


This tells us that

wolf sigma
86:f199 = rom 37199 = 80  [normal buster]
86:f19a = rom 3719a = 80  [charge 1]
86:f19b = rom 3719b = 01  [charge 3]
86:f19c = rom 3719c = 80  [charge 2] ==> 01


Other examples:

normal sigma
86:f17b = rom 3717B = 01 01 01 01

sigma dog
86:f08b = rom 3708B = 01 02 03 03

Speedrunners could analyze all enemy data and compute optimal damage formulas.

DarkSamus993

  • Sr. Member
  • ****
  • Posts: 287
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #12 on: April 13, 2017, 11:12:26 am »
Adding to rainponcho's notes:

LDA $EF37,y[$86:F199] ==> $86:EF37 is the index values for all the damage tables. In other words, $86:EF37 + index value = damage table location.
Code: [Select]
0046 = $86:EF7D = enemies
0064 = $86:EF9B = boss i-frames
0082 = $86:EFB9 = ???
00A0 = $86:EFD7 = Vile, Bee Blader, Thunder Slimer, Anglerge
00BE = $86:EFB9 = ???
00DC = $86:F013 = Sting Chameleon, D-Rex, RT-55J, Utuboros
00FA = $86:F031 = Storm Eagle, Rangda Bangda
0118 = $86:F04F = Flame Mammoth, Cruiziler
0136 = $86:F06D = Chill Penguin, Mole Borer
0154 = $86:F08B = Spark Mandrill, Bospider, Velguarder
0172 = $86:F0A9 = Armored Armadillo
0190 = $86:F0C7 = Launch Octopus
01AE = $86:F0E5 = Boomer Kuwanger
01CC = $86:F103 = ???
01EA = $86:F121 = ???
0208 = $86:F13F = ???
0226 = $86:F15D = ???
0244 = $86:F17B = Sigma
0262 = $86:F199 = Wolf Sigma

Code: [Select]
Wolf Sigma damage chart:
$86:F199 = 80 80 01 80 80 [80 80] 80 80 02 80 80 80 80 80 [80] 80 [80] 02 80 80 80 80 80 [80 80 80] 80 [80 01]

buster:
$86:F199 = normal
$86:F19A = charge 1
$86:F19B = charge 3
$86:F19C = charge 2
$86:F19D = hadouken
$86:F19E = ???
$86:F19F = ???

normal:
$86:F1A0 = homing torpedo
$86:F1A1 = chameleon sting
$86:F1A2 = rolling shield
$86:F1A3 = fire wave
$86:F1A4 = storm tornado
$86:F1A5 = electric spark
$86:F1A6 = boomerang cutter
$86:F1A7 = shotgun ice
$86:F1A8 = ???

charged:
$86:F1A9 = homing torpedo
$86:F1AA = ???
$86:F1AB = rolling shield
$86:F1AC = fire wave
$86:F1AD = storm tornado
$86:F1AE = electric spark
$86:F1AF = boomerang cutter
$86:F1B0 = shotgun ice
$86:F1B1 = ???
$86:F1B2 = ???
$86:F1B3 = ???
$86:F1B4 = mine cart
$86:F1B5 = ???
$86:F1B6 = ???

rainponcho

  • Sr. Member
  • ****
  • Posts: 275
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #13 on: April 13, 2017, 11:56:55 am »
Awesome work and thoroughly detailed (and lightning fast)! Thanks - was wondering what most of those values were. :mrgreen:

PowerPanda

  • Full Member
  • ***
  • Posts: 163
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #14 on: April 13, 2017, 12:19:48 pm »
DarkSamus, RainPoncho, you are truly incredible. Is there a disassembly you're working off of, or do we need to create a knowledge base here on romhacking?

pianohombre

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • My personal website of short stories and comics
Re: Megaman X Buster Upgrade
« Reply #15 on: April 13, 2017, 05:51:57 pm »
PowerPanda,
there already is a RAM Map with most of the information on the game here at RHDN. If you'd like to edit the information in the RAM Map to include more enemy data you can try editing the RAM MAP at this page:
http://datacrystal.romhacking.net/wiki/Mega_Man_X:RAM_map

Learn how to login on the wiki via this page:
http://datacrystal.romhacking.net/wiki/Main_Page

Also, in post #2 you talked about the armor/weapon upgrades and listed some numbers. Those figures are actually incorrect. Here's the values for how upgrades are stored:
Format: dcbaZYXW
Upgrades: W = Head; X = Arm (Buster); Y = Body (Armor); Z = Leg (Dash).
Sub-tanks: a = Eagle; b = Armadillo; c = Mandrill; d = Mammoth.

The format is an 8-digit binary "flag" for each upgrade. So for example, if you obtained the Buster (X) and got subtanks on the Eagle stage (a) and the Armadillo stage (b) the binary would look like this:
00110010. You then convert that to hexadecimal (50). So now any part of the game that deals with upgrades/subtanks you store/load that value, which is kept in memory, in this case ($7E:1F99).
« Last Edit: April 13, 2017, 06:06:47 pm by pianohombre »
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

rainponcho

  • Sr. Member
  • ****
  • Posts: 275
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #16 on: April 13, 2017, 07:42:45 pm »
Quote
Is there a disassembly you're working off of, or do we need to create a knowledge base here on romhacking?

Think it's safe to say that we both used Geiger Snes9x debugger to fish out all the code posted so far. Basically on-the-fly as needed.

Although DarkSamus993 is definitely the more skilled one at hacking, disassembly, explaining.

PowerPanda

  • Full Member
  • ***
  • Posts: 163
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #17 on: April 13, 2017, 11:37:44 pm »
Yeah. I wish I could get the SNES 9x Debugger working on my computer. I plan to give it another go next week and find out exactly what I'm doing wrong.

Anyway, all changes are tested and working. The Hadoken shows up on the first visit through Armored Armadillo, and it's now possible to defeat Wolf Sigma in a no-upgrade buster only challenge (though you must do so without getting hit). I also made the Hadoken 1-hit kill him, but there is only 1 RNG pattern that lifts your character high enough to launch it. Good luck staying alive till then. ;)

I'm planning to make 1 more change (requiring Head Parts to get the Heart Tank in Armored Armadillo's stage), and then I'll compile V1.1 and upload it here. A huge thank you again to all of you guys. All I really did (aside from level editing) was compile your work to make this happen. Does anyone that contributed want to suggest a better name for the patch than "No Forced Upgrades"?

DarkSamus993

  • Sr. Member
  • ****
  • Posts: 287
    • View Profile
Re: Megaman X Buster Upgrade
« Reply #18 on: April 14, 2017, 12:58:52 am »
Think it's safe to say that we both used Geiger Snes9x debugger to fish out all the code posted so far. Basically on-the-fly as needed.
Yep, that's what I use most of the time. I switch to bsnes-plus when I need to do special tracing.

pianohombre

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • My personal website of short stories and comics
Re: Megaman X Buster Upgrade
« Reply #19 on: April 14, 2017, 03:14:19 am »
Since everyone here is already talking about enemy data does anyone know where the location of Zero's sprite in MMX? X's sprite is already known and I was going to look through the object viewer in MegaEd X to try and find it, but maybe someone here already knows the location. Thanks.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds