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

Author Topic: MegaED X, the Megaman X hacking tool (Now with MMX2 support)  (Read 117256 times)

pianohombre

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #280 on: August 20, 2017, 07:44:34 pm »
Hey that's great! By changing it to 0xE0 it looks exactly how it does in the editor. That's a good clue as to how to fix it. Only problem is I see it's directly copied from the rom in bank 86, and 0x60 is hard-coded there, so it should recognize to fully load the entire graphic.

Also, were these instructions directly before the subtank is loaded in the ram @ 7E152E? I need to find the something similar for the ride armor module graphics, that are having a similar problem loading.

Thanks for the help!
One small step for man,
one giant leap for mankind. -Neil Armstrong

protorock

  • Jr. Member
  • **
  • Posts: 11
  • Proud Newbie Graphic Hacker
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #281 on: August 21, 2017, 08:40:11 am »
I have used the editor, works pretty good i cant replace bosses.Example boomerang kuwanger with vile in sigma castle 1.

that is actually the only problem i have ran into

pianohombre

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #282 on: August 21, 2017, 05:26:18 pm »
@protorock, are you the main hacker for protoman 21xx? I saw a demo looks pretty cool. They actually changed the stages also, not just the palettes and sprites.

Can I ask what happens when you change the bosses around? I've only swapped around a few enemies, and I had to change the VRAM to do it. I think you would have to hack the assembly also, because each boss has a weapon weakness, and gives you a weapon after defeated. Not sure if that's copied when you change bosses. Plus, for Vile in Sigma stage there's a giant event revolving around that fight, that influences a small cutscene with Zero and enables large blocks of text.
One small step for man,
one giant leap for mankind. -Neil Armstrong

slidelljohn

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #283 on: August 22, 2017, 08:58:29 pm »
Hey that's great! By changing it to 0xE0 it looks exactly how it does in the editor. That's a good clue as to how to fix it. Only problem is I see it's directly copied from the rom in bank 86, and 0x60 is hard-coded there, so it should recognize to fully load the entire graphic.

Also, were these instructions directly before the subtank is loaded in the ram @ 7E152E? I need to find the something similar for the ride armor module graphics, that are having a similar problem loading.

Thanks for the help!

Yes it's loaded before $7E:152E ($7E:162E in spark mandrill stage) but not directly before. This is loaded when the level first loads. $86:b4de-$86:b4fb is the data for the sprite graphics in vram.

I could look at the source code and probably fix it. Can you post the function that loads the graphics?

Also can you post a picture of the ride armor module graphics that are messed up like you did with the sub tank?

pianohombre

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #284 on: August 22, 2017, 10:21:35 pm »
https://pastebin.com/70tf3UkK

Scroll down to where it says //subtank @line 147. That inserts the values 0x96, later used as an address offset to load the graphic in RenderObject.
@line 206, it loads the correct palette, and other stuff that I've commented out to manually load the tiles.
There's more stuff below a giant nested for loop, where it's loaded onto the screen. That's also commented out. If you have any questions let me know.

I'll try and post a photo of the armor module graphic later.
One small step for man,
one giant leap for mankind. -Neil Armstrong

slidelljohn

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #285 on: August 23, 2017, 07:13:23 am »
It looks like line 261 is where it decompresses the image.
Are the lines at 263-266 the code that converts the decompressed graphics to a pc image? If so, then I think
at line 268 it needs the extra code to reposition the tiles
for how they are loaded into vram.

In mmx3 the level with the F ride armor module standing under the stairs delete (00's) all of the vram at $FE00-$FFFF.
Then look at the module and it should look like how it does in the editor. If you die the graphics should load normal again. Now delete the same vram that you just deleted and change the value at $08:DAC0 (60) to E0 and die and the graphics should still be messed up like how the are in the editor. I haven't seen what the messed up graphics look like in the editor but it should look the same.

This is the data that repositions the decompressed
module graphics into vram:
$08:DABF-$08:DAC0 10 60 1st part
$08:DAC1-$08:DAC2 10 E1 2nd part

pianohombre

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #286 on: August 23, 2017, 05:37:36 pm »
I think you understand the graphics for the most part, except you wouldn't want to change anything at line 268 (that's palettes/color junk). If anything there should be another shift or offset to load the second set of graphics for the subtank (probably needs to be loaded separately, not sure if it's possible to load them both at the same time). Maybe there's a way to add the second set of graphics before tile4bpp2raw is executed.

here's the definition of gfxrle:
Code: [Select]
int GFXRLE(BYTE* rom, BYTE *dest, int pointer, int size, int type, bool obj)
so if gfxrle is ran twice with rom + 0x400, tram + size of first set of graphics, new size, etc. as parameters maybe it will load into "tram" the entire graphic so that tile4bpp2raw is able to pick up those last 2 tiles. Or maybe adding an offset to the pointer variable will get to the location for the second set of graphics.

However, if you scroll down the program, for example, many shifts and offsets are done after tile4bb2raw and mapAddr is initialized.

Code: [Select]
if (nmmx.type == 2) {
                // temporary fix for the boss sprites that have assembly information that is off by 0x20 or 0x40.
                tile -= (assemblyNum == 0x61 || assemblyNum == 0x92) ? 0x20 :
                    (assemblyNum == 0x68 || assemblyNum == 0x79 || assemblyNum == 0xae) ? 0x40 :
                    0x0;
                tile &= 0xFF;

This may not work for work for the subtank though, since "tile" is an unsigned variable and the tiles range from 0-6.



As you can see with the photo, even the Maverick Hunter Bit/Byte in the sub-boss room below doesn't load 100% correctly. Probably about 80-95% of the sprites load correctly in the editor. Mainly sub-bosses and bosses have trouble loading correctly. I've been meaning to make a list of all the broken sprites. It's not a huge bug though, as long as people understand just because the sprite isn't assembled in the editor correctly, doesn't mean it won't run fine in an emulator/flash cart.
« Last Edit: August 24, 2017, 08:42:41 am by pianohombre »
One small step for man,
one giant leap for mankind. -Neil Armstrong

Hart-Hunt

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #287 on: August 25, 2017, 09:55:20 am »
Heya there. Just so you know, your work is really appreciated! I've been taking a break from my MMX mod, I decide to check out RHDN, and suddenly there's fresh work on the editor! I helped redguy test i when he updated it, so I'm familiar with most of the quirks it had at the moment.

I only made a stage so far (I like having the intro stage to introduce design elements here and there). So, if you have any doubts about some things work in the editor, feel free to ask me (I don't know any programming, I'm just a tester / user).
Mod for you guys to see: http://ngplus.net/index.php?/files/file/17-mega-man-x-new-hard-type-wip-alpha-release/

I'm active at NG+, not so much here:
http://ngplus.net/

Thanks for all of your work on it! The idea is to make three mods in total, one for each of the SNES MMXs.

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1492
  • Welp
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #288 on: August 26, 2017, 12:10:02 pm »
Just a heads up, might be good to cap the 'enemy' value per game (IE: How many enemies, objects there are and what not)

Just found out in X3 the values range from 00-6B for enemy data in stages, but this includes various objects such as the platforms, elevators and such I believe as well. There's enough data setup for 535 bytes, 107 enemies in stage data that are 5 bytes each starting at:

86:E28E and ending at 86:E4A5

Most of this data may already be known and probably already in the editor, but doesn't hurt to bring it up for a bit later.

Code: [Select]
$02/E17F BD 90 E2    LDA $E290,x[$06:xxxx]   A:xxxx X:xxxx Y:00DA P:envMxdIzc ;Load how damage enemy deals to X/Zero when colliding
$02/E182 85 26       STA $26    [$00:0D3E]   A:xxxx X:xxxx Y:00DA P:envMxdIzc
$02/E184 BD 91 E2    LDA $E291,x[$06:xxxx]   A:xxxx X:xxxx Y:00DA P:envMxdIzc ;Load how much life enemy has
$02/E187 85 27       STA $27    [$00:0D3F]   A:xxxxX:xxxx Y:00DA P:eNvMxdIzc
$02/E189 BD 92 E2    LDA $E292,x[$06:xxxx]   A:xxxx X:xxxx Y:00DA P:eNvMxdIzc ;Load damage table single-byte value to use (Loads other pointers based on this value)
$02/E18C 85 28       STA $28    [$00:0D40]   A:xxxx X:xxxx Y:00DA P:envMxdIzc
$02/E18E BD 8E E2    LDA $E28E,x[$06:xxxx]   A:xxxx X:xxxx Y:00DA P:envMxdIzc ;Load which enemy to use (May be graphical data and animation data not entirely certain)
$02/E191 85 16       STA $16    [$00:0D2E]   A:xxxx X:xxxx Y:00DA P:envMxdIzc
$02/E193 BD 8F E2    LDA $E28F,x[$06:xxxx]   A:xxxx X:xxxx Y:00DA P:envMxdIzc ;Load sprite assembly for enemy? (Not entirely sure on this either)

Gets a bit confusing because there's data for 00-6B for them in stages, but the graphical values which I ASSUME 06:E28E is goes way beyond that.
'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.'

Hart-Hunt

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #289 on: August 27, 2017, 03:43:21 pm »
So, trying the altest version posted, I had to whitelist the file because it was reported as malicious by avast. After I do that, I try to open MegaEd X and message pops saying MSVCP140D.dll, VCRUNTIME140D.dll and ucrtbased.dll are missing.

Previous versions of MegaEd X work fine. Anything I'm missing?

pianohombre

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #290 on: August 30, 2017, 09:55:11 pm »
HartHunt:
Yes,
it seems you're missing some run-time libraries. Please make sure you're running the latest version of Visual Studio. If you're trying to compile it yourself, it seems to work in v2015. I'm not sure why Avast is giving you that error. I virus-scanned it myself with my anti-virus and it's fine. If you're worried about malware the open-source is available on github. You can always download and compile it yourself. Maybe just copying and pasting the executable from the debug directory is the wrong thing to do? You may need to install .NET. When I downloaded the version from Redguyyyy I just needed that retro.dll and it worked fine.

Also,
thanks to everyone who is supporting this site with donations.
« Last Edit: September 04, 2017, 03:45:16 am by pianohombre »
One small step for man,
one giant leap for mankind. -Neil Armstrong

Hart-Hunt

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #291 on: September 11, 2017, 11:09:56 am »
Thank you! I'll try updating Visual Studio and see if that works. Yeah, it was more about letting you know that Avast didn't like the file. It can happen with executible files. I'll update the post later.

Update:
After updating Visual studio, it throws the error "The application was unable to start correctly (0xc00007b)". It seemed strange, so I tried to compile the source code. I couldn't get it to work that way either. I'm running Windows 10 64.
« Last Edit: September 11, 2017, 06:00:01 pm by Hart-Hunt »

pianohombre

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #292 on: September 13, 2017, 04:00:29 pm »
@Hart-Hunt,
Reading through several forum posts in MSDN, and other sites, here's what I got:
"Error 0xc000007b is commonly caused by mixing up 32-bit and 64-bit libraries. "

This program was written before 64-bit architecture. There's probably some mix-up in the dll files. Some people suggest the easiest solution is to re-install Visual Studio, .NET, or Direct X.
One small step for man,
one giant leap for mankind. -Neil Armstrong

Hart-Hunt

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #293 on: September 15, 2017, 03:30:10 pm »
Nope, that's not the solution, I tried that before posting. VS is definitely up to date. One can't also compile the source code with the latest VS. Lastly, also before posting, I had other users also try to use the 1.3 .exe and also compiled it. Which version of Visual Studio did you use? There's definitely something missing on your end.

pianohombre

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #294 on: September 15, 2017, 04:39:02 pm »
Well it compiles and runs fine on my PC.

Some specs:
Windows 10 64-bit

Microsoft Visual Studio Community 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Community

Visual Basic 2015   00322-20000-00000-AA649
Microsoft Visual Basic 2015

Visual C# 2015   00322-20000-00000-AA649
Microsoft Visual C# 2015

Visual C++ 2015   00322-20000-00000-AA649
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   14.0.20626.0
ASP.NET and Web Tools

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GenerateUnitTest   1.0
Generates unit test code for methods in classes under test.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50616.0
Microsoft SQL Server Data Tools
One small step for man,
one giant leap for mankind. -Neil Armstrong