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

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

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #200 on: March 23, 2017, 05:00:11 am »
Hi,
I've saved some videos on youtube about MFC and QT. Saw a really good example of how to edit a rom using a hex editor. I actually got into the program today and messed around with some things. I just added a menu item, but I was able to get it working properly so that's a big boost to working further on it. I've got a few additions I'd like to make, so I'll try working on it some more. BTW, there's a megaman x randomizer github online, not sure if you know that or if somehow you use the scv4 to randomize mm levels.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

Hart-Hunt

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #201 on: March 25, 2017, 09:21:16 pm »
Necro post.  Trying to modify a slight bit of a level in MMX2 and no matter what I do, even if I just open the ROM and save on any specific level, it completely corrupts that one specific level or the entire ROM.  Is X2 able to be viewed but NOT edited?  Maybe I have the wrong ROM, but it seems to load all the data up properly.

Edit: It might actually 'just' be Overdrive Ostrich's level that corrupts.  I tried saving generally on a few other levels, just fine, but ODO's level just instantly causes it to bug out and break.

Edit 2: Seems modifying most levels will cause numerous issues depending.  Morph Moth's level will have some pretty weird palette issues on the ladder section if you save there.
That's a shame. I didn't notice it when I modified the intro stage, and Wheel Gator's stage in X2. I can safely say the editor works fine for X1 though, even after expanding. Unless I've missed something, of course.

Hi,
I've saved some videos on youtube about MFC and QT. Saw a really good example of how to edit a rom using a hex editor. I actually got into the program today and messed around with some things. I just added a menu item, but I was able to get it working properly so that's a big boost to working further on it. I've got a few additions I'd like to make, so I'll try working on it some more. BTW, there's a megaman x randomizer github online, not sure if you know that or if somehow you use the scv4 to randomize mm levels.
Heya there. I'm an active user of this editor, having 2 active projects, and 1 future project with it in the Insane Difficulty Forums. So I'm highly grateful for all of the effort you seem to be willing to put in advance. :D If you need any help with the testing, or I don't know, something. I have some basic ASM knowledge (and only have "ideas" of basic programming. Don't know any programming language asides from that), which I've used in my MMX Hard Type projects. [disclaimer: I'll try to stay active in this thread from now on, but if you ever need to contact me and I'm not active, I'll sure be active in the Insane Difficulty forums. Life's busy for me these days. I'm also on Discord btw].

I've helped the guy who's done the randomizer, it's a really cool project.

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #202 on: March 26, 2017, 02:34:13 am »
I looked at Ostrich Overdrive level. I loaded both MMX2 with and without headers. The level/map seems to be loading incorrectly on both versions unfortunately. I checked through each level on all 4 games supported (mmx1-3 and rockman and forte). Seems to be the most damaged level. Most levels are loaded pretty standardly without too many if/else statements for exceptions. It's most likely a corruption in the rom that doesn't follow the rules (perhaps the level before used more memory than typical so the pointers are off). I wasn't able to get around to fixing the problem though since there's thousands of lines of code to look through.

I'm still learning how to try and manage this huge project more efficiently and have tried to understand Visual Studio better in general so tried to learn how to use the debugger to step through the code. You know the stuff where you can see variable values change etc., so you know where to go. I was able to use the program to do just something really simple. I wanted to add a minimize button next to the exit button for example on the dialog boxes/windows. So instead of reading through each line of code, like I typically do, I just clicked through the menu in the GUI and clicked an option to allow minimize boxes. I wish coding was always this easy.

Honestly, I'm trying to take my time learning all the hard stuff- vram, hex, asm, etc. If you try and learn everything in a day or two you will burn out and probably punch your computer screen never to return haha. I've programmed in assembly before (x86, NASM) so I'm familiar with it, although I'd never use it preferably. (Notice today how games are all 10gigs I doubt most students are using it also). I found a good wiki to learn some great stuff about the instructions SNES uses since it's different than other stuff. If you have any info on it, or tips that you think would be helpful feel free to message me about them. Looks like MMX3 is pretty well-documented, but few others are.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

justin3009

  • Hero Member
  • *****
  • Posts: 1658
  • Welp
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #203 on: March 26, 2017, 11:25:59 am »
I've got more in-depth notes when it comes to the gameplay portion of X3 but not much else on the level system and such.  X3, I'm pretty certain actually, was built upon X2 so they share pretty much the 'exact' same system.  It'd be just a matter of porting the data over and altering a few exceptions.  Otherwise, they are virtually identical.

Event scripting is a bit of something I plan to study later on down the road.  I have a basic idea of how it flows in X3 along with a couple normal commands that are used quite frequently, but that's about it.  Unfortunately not much can be done on that front until the level system is stable.
'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.'

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #204 on: March 27, 2017, 12:16:33 am »
Necro post.  Trying to modify a slight bit of a level in MMX2 and no matter what I do, even if I just open the ROM and save on any specific level, it completely corrupts that one specific level or the entire ROM.  Is X2 able to be viewed but NOT edited?  Maybe I have the wrong ROM, but it seems to load all the data up properly.

Edit: It might actually 'just' be Overdrive Ostrich's level that corrupts.  I tried saving generally on a few other levels, just fine, but ODO's level just instantly causes it to bug out and break.

Edit 2: Seems modifying most levels will cause numerous issues depending.  Morph Moth's level will have some pretty weird palette issues on the ladder section if you save there.

I've been trying to debug this problem with the Overdrive Ostrich level. I've messed around with a few variables and haven't figured out why it's loading incorrectly yet. There's more than 20 vital variables that are used in each class function, so debugging is a bit tedious, especially since there's no comments in the declaration/header section. Although, I noticed if you use the EXPAND ROM feature in the program and save on the OO level, even after editing the layout/scenes/blocks, etc. it will finally save correctly. Saving at 2.5mb instead of 1.5mb doesn't seem like too bad of a solution. And I tested other levels of the rom they all seem to work fine as far as I know.

I also ran the Morph Moth level, after editing several features and saving and wasn't able to recreate your bug.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

justin3009

  • Hero Member
  • *****
  • Posts: 1658
  • Welp
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #205 on: March 27, 2017, 03:37:32 am »
I expanded the ROM as well and kept getting the same bugs. I wonder if the ROM I have is a different version or something.
'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.'

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #206 on: March 27, 2017, 04:46:12 am »
There's only 1 version of Megaman X2 as far as I know. MMX1 is the one with 2 different versions. I ran the rom in ZSNES (which most people don't recommend using), but it also worked fine in bsnes. So I removed the header from the original rom before expanding, but the game title still shows up in emulation so I don't think it did it correctly. Anyways, here's checksum info it might help out:
Original headered rom: 94e9a109170b6b835b73e6e24220ed97
Unheadered rom: 67905b989b00046db06df3434ed79f04

Both of those roms are the original 1.5mb snes roms.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

justin3009

  • Hero Member
  • *****
  • Posts: 1658
  • Welp
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #207 on: March 27, 2017, 05:45:06 pm »
I downloaded a different ROM and it seems to work fine.  Looks like the ROM I originally used was actually 2MB (It basically copied the last 0.5 to fill the rest of the 2MB space).  Got it working now it seems like.  This'll come in handy down the road!
'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.'

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #208 on: March 29, 2017, 09:00:21 pm »
justin3009:
Hey I've been talking with falchion22, about trying to edit his MMX1-Zero rom to include Zero's hair. (basically I'm trying to get my feet wet in hacking, figured this would be an easy start). He mentioned that I should edit the disassembled ASM to allow more tiles for Zero, because the sprite uses 64x32 instead of the regular 16x16 for MMX1. I noticed you did a Zero Project for MMX2 and MMX3. Did you have to get in there and edit any hex, or asm for the file? Or did you just basically overwrite the original MMX sprites using a program like Tile Layer Pro and then just change the palettes to reflect the color?

Thanks.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #209 on: April 10, 2017, 10:55:49 am »
Redguy,
Can you explain what the different colored boxes mean? I think you covered it in a previous thread, but it's not included anywhere in the program explanation (and there's no help file). I may edit this post to change after searching through this long forum thread.

Well it turns out that most of my work contributing to this project was nearly wasted. I added an 'End Emulation' to the menu options, but it looks like if you just press the Escape key it does the same thing. I didn't see the command in the text file for the program when working on it myself. I'm working on adding an Undo button, so you can't fix any mistakes you might have accidentally done instead of having to reload the entire program. I've noticed that's very tedious. Unfortunately, I thought the SMILE program was open-source also, but searching around online I only found dead links to the source code. I think Lunar Magic is also closed-source. Each rom handles things differently, but seeing how they do things may always help. I also would like to output a separate window to display the title screen and a window solely for editing the megaman x sprite (one which can be zoomed in).

Editing text is easiest using a hex editor. It's pretty hard to rewrite an entire program for something that's already done pretty well to begin with using a program less than 1mb and it only takes about 15 minutes to learn how to do. So I probably won't attempt to do anything with text via MegaEd X.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

justin3009

  • Hero Member
  • *****
  • Posts: 1658
  • Welp
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #210 on: April 10, 2017, 02:26:22 pm »
justin3009:
Hey I've been talking with falchion22, about trying to edit his MMX1-Zero rom to include Zero's hair. (basically I'm trying to get my feet wet in hacking, figured this would be an easy start). He mentioned that I should edit the disassembled ASM to allow more tiles for Zero, because the sprite uses 64x32 instead of the regular 16x16 for MMX1. I noticed you did a Zero Project for MMX2 and MMX3. Did you have to get in there and edit any hex, or asm for the file? Or did you just basically overwrite the original MMX sprites using a program like Tile Layer Pro and then just change the palettes to reflect the color?

Thanks.

Totally missed this reply.

I deciphered the Sprite Assembly, Animation Data and VRAM data for MMX2/MMX3 essentially.  I'm pretty sure MMX1 uses the same thing but it doesn't send the data to the CX4 chip to be messed with at all.

The main thing for making larger sprites we'd want to worry about is the Sprite Assembly.  I'm not sure if I remember the case or not, but for X2/X3 to even add in new animations for X or Zero I had to separate them entirely from the rest of the game.  X3 mainly has it where X/Zero are their own entities and don't share the main data area with any other sprites, X2 however doesn't have that yet since I haven't figured out how to handle the 'NPC PC' system like X3 yet.

Animation data speaks for itself in how it works.

VRAM data is basically tells where the graphics are from in ROM and how much to store into VRAM.  I believe it also includes where to store in VRAM as well.

To get things into X2, I basically just copy/pasted what I did from X3 into the game since their engine is quite literally the same on that account.  I'm pretty sure I can do the same thing for X1, but I'm just lazy.  It's a bit of a tedious process but it's definitely doable, no worries there.

It'd be a lot easier to handle if there was an editor for the sprite assembly and such as it'd make things tremendously more doable with little to no time consumption in the long run.

Edit:

Also, the text is easily editable if you use Atlas/Cartographer and move the data into empty space.  Works wonders.  The only 'REAL' annoyance with text editing though is how many damn commands the game uses per string.  It's pretty ridiculous but they are necessary.
« Last Edit: April 10, 2017, 03:21:43 pm by justin3009 »
'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.'

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #211 on: April 10, 2017, 10:00:51 pm »
Redguy,
Can you explain what the different colored boxes mean? I think you covered it in a previous thread, but it's not included anywhere in the program explanation (and there's no help file). I may edit this post to change after searching through this long forum thread.

With event editor open and selecting an event:
* Red Box - event trigger (X works on block boundary, Y works on pixel boundary of event position)

Event specific:
* Purple Lines - palette/graphics/tile dynamic changes.  If you click a graphics change the editor will attempt to let you know which enemies are loaded after the event: red - not loaded, green - loaded in the forwards direction of the event, yellow - loaded in the backwards direction of the event, blue - loaded in both directions of the event.  The subId is split into 2 nibbles that index into a table for forwards/backwards lookup depending on the direction X is traveling when crossing it.
* Green Boxes/Yellow Lines - Camera locks.  When event is triggered if X crosses into the green box then the camera bounds are changed to the yellow lines.

Event type.  If the editor doesn't know how to display them they end up being pink squares.  Most event types 0 and 1 show up this way.
* 0 - usually objects like powerups
* 1 - various scripted events
* 2 - palette/graphics/tile dynamic changes and camera locks
* 3 - enemies and some interactive objects like elevators and platforms

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #212 on: April 16, 2017, 06:54:47 am »
Thanks RedGuy that helps a little. justin, yea if there was better sprite handling the program would be a lot more appealing. MegaEd already decompresses the graphics, but if the program let you recompile the sprites from the rom as they appear in-game, then let you edit them, and then reloaded them in the rom in the correct locations it would make sprite handling better.

Anyone seen some other Megaman X engines out there? I think one good one pretty closely resembled MMX and the true game physics:
https://www.youtube.com/watch?v=Dx3_cOdIeu8

I found this video from another video about abandoned mmx fan games. The author of that program started and re-started over a several year period. Looks like he made it with game maker.

[Update: I pretty much gave up on trying to modify that bug in the Overdrive Ostrich stage, but I was replaying the game (to collect all Zero parts for an alternate ending) and came across that stage. Actually, playing that level helped me understand that bug. So if you guys don't remember at the end of the level you take a rocket ship from below to a different area of the level way upwards. So the bug drops you onto the area where the boss fight is, except there's no boss. This is most likely because opening up the stage overwrites default cursor values or something. I'll take another crack at it.]

[Update2: I thought editing MMX-X position, Y position, camera X position, or camera Y position would fix the bug, but checking the values of a rom with working OO stage and buggy OO stage only values that changed were cam Y position, but changing those values to the default values in the working rom didn't solve the problem. It just made megaman start 3 feet in the air or so. I think the program overwrites crucial assembly in the rom that deals with that level and the rocket ship and where MM starts. Maybe instead of there being just backgrounds/graphics in that location of the rom like on most levels it has other info such as telling the emulator/snes 'hey megaman starts at the bottom of this level, not at block/layout/map 00,00 like most levels'. Somewhere in a few of the functions that deal with loading the level or saving there has to be an new exception written that deals with that level (level 7, type 1 for MMX2) that will fix this bug. It's loading the tile/map for where Megaman X fights Overdrive Ostrich first @ block 0 so maybe it incorrectly stores that part of the level in that location in memory, overwriting the original beginning of the level. I'm going to have to try and find the address in memory where MMX2 level 7 starts and then compare hex/assembly of buggy and working roms so I can better see what is making the error. Simply setting breakpoints and debugging the program in Visual Studio is not as helpful. I've also noticed that the program loads the wrong palette for this level. The level is supposed to have desert-like ground after exiting the cave not concrete like ground. I'm not exactly sure why the program ruins this part of the game at this level yet doesn't create errors when other key events happen- such as during the dig machine on MMX1, Sea Canthller on MMX2 or the many X-hunter routines. I haven't saved at every level in the game or done extensive debugging, testing so maybe it also crashes during other save areas. If anyone would like to comment on this note please do]
« Last Edit: April 29, 2017, 10:04:36 pm by pianohombre »
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #213 on: May 04, 2017, 08:24:23 am »
Good news! At least for justin3009 and anyone else worried about the Overdrive Ostrich bug. I was able to pinpoint the error. If you have the open-source MegaEd X files here's the code to correct, just open up MegaED X.cpp and scroll down to 'case ID_FILE_SAVE:', this was line 454 for me. Scroll down towards the bottom you're going to change one line.

old code:
Code: [Select]
if (newLayoutSize > layoutSize)
switch (MessageBox(hWnd, "The layout size is more than the original layout size.\nYou can corrupt the data of ROM if you don't know what are you doing.\nAre you sure to continue?",
"Warning", MB_ICONWARNING | MB_YESNOCANCEL))
{
case IDYES:
WRITE_LAYOUT:
// Update the layout
nmmx.SaveLayout();
break;
case IDNO:
break;
case IDCANCEL:
return 0;
}
else goto WRITE_LAYOUT;

new code:
Code: [Select]
if (newLayoutSize > layoutSize)
switch (MessageBox(hWnd, "The layout size is more than the original layout size.\nYou can corrupt the data of ROM if you don't know what are you doing.\nAre you sure to continue?",
"Warning", MB_ICONWARNING | MB_YESNOCANCEL))
{
case IDYES:
WRITE_LAYOUT:
// Update the layout                                             
nmmx.SaveLayout();
break;
case IDNO:
break;
case IDCANCEL:
return 0;
}
else if (nmmx.type != 1 && nmmx.level != 7) goto WRITE_LAYOUT;

Basically, you're just adding an if statement in the WRITE_LAYOUT jump to skip doing the SaveLayout function for only Overdrive Ostrich, during the else. It still will try to use SaveLayout when checking if old layout size matches new layout size. This basically renders the layout editor useless. It's kind of a temporary problem until I can find a permanent solution. It was causing problems with the layout when saving. Although, I'm not sure if it's needed for other levels, I've included an if statement just in case it causes issues. Actually, running across another bug on the Bubble Crab stage is also fixed by a similar if statement. Right before the COMPRESS_TILES routine put the same exact if statement but change the level number. It was creating issues with the font during saving.

new code:
Code: [Select]
else if (nmmx.type != 1 && nmmx.level != 3) goto COMPRESS_TILES;

One important thing to note and that is not my fault because I checked in the latest MegaEd X version is that when you try to save a file with a header it will crash when you run it in an emulator. I'm not sure exactly why it does this I looked through SNEScore.cpp, MegaEDcore.cpp, and MegaED X.cpp for about an hour and couldn't narrow it down. In Luciano's MegaED X version it could save both headered and unheadered roms. So to save correctly in RedGuy's version either use an unheadered rom, or use the 'Save As' feature on headered roms. Weird that Save As would work, but not Save. I had also tried to save a MMX1 rom with a header and it still crashed. Something happened across versions that caused issues. If anyone has been able to locate the problem please let me know.
« Last Edit: May 06, 2017, 03:50:53 am by pianohombre »
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #214 on: May 19, 2017, 12:29:08 am »
Good news I have figured a way around the bug in Overdrive Ostrich. It has do with the compression algorithm. Basically for some reason the counter wasn't reaching high enough so it wasn't loading enough zeroes in the program, causing the layout to load way up in the level. When I manually inserted the correct values into a byte memory address array it was able to load fine, after I added some more zeroes (it needed about 296 zeroes and the max value the array could hold was 255 so I had to do a work-around). Unfortunately, I've been fiddling with it all day I can't make it look pretty. I basically wanted to just jump over 6 values in the array and use the original, but it causes issues so I have to manually insert the values. Another problem is that it uses absolute values, rather than relative values. This may cause issues with anyone working in the layout editor who changes too many things. But this is terrific I was able to finally use the layout editor and change the level around in an unexpanded rom in Overdrive Ostrich.

I'm not sure how major this bug was, but it was my white whale I had to solve it. Yea expanding the rom works and nowadays memory is so cheap that people have no problem saving NES games that are 10 gigs, but the best thing about this fix is someone who doesn't know this program and its glitches can play around with this level without knowing what they're doing and not have it be glitchy on accident and have to search for days only to finally figure out expanding the rom fixes the glitch. I'll post an edit with the code in the next few days it's kind of late. If you think this warrants a new release on github let me know. There's still several things I'd like to try to fix as far as the levels. I've only gone as far as testing mmx2 though so mmx3 is a whole other ballgame, and well even though rockman&forte is supported I'm not sure how well the program handles it. for mmx2/3 there's so many offsets and separate programs to deal with tiny things and it just seems like little is included for r&f. I'm not sure if it's just extremely compatible, or no one has tried to tame the beast yet. Levels load fine and everything. I haven't tried saving anything though.

Original code in CompressionCore.cpp:
Code: [Select]
WRITE:

if (!sizeOnly) {
dst[writeIndex++] = counter;
dst[writeIndex++] = buf;
}
}
                                        else..

Modified code:
Code: [Select]
WRITE:

if (!sizeOnly) { //debug:i<155 will save but can't edit layout

if (writeIndex == 27 && buf==0 && overdrive_ostrich) counter += 34;
dst[writeIndex++] = counter;
dst[writeIndex++] = buf;
if (writeIndex == 19 && overdrive_ostrich) {
dst[writeIndex++] = 254; //original values pulled from working rom
dst[writeIndex++] = 0;
dst[writeIndex++] = 254;
dst[writeIndex++] = 0;
dst[writeIndex++] = 238;
dst[writeIndex++] = 0;
i = 517; //next non-zero value in src
}
}

And 'overdrive_ostrich' is a boolean value that checks for nmmx.type, nmmx.level, and expandedROM. It's set to true if all those variables match (1,7,false) and I pass it as a parameter when calling LayoutRLE in MMXCore.cpp. You will have to change LayoutRLE.h also if you add the parameter of course, but this allows you to save the layout when editing level 7 in mmx2. I know it's complicated, but I've worked on it a lot and this works. I tried to make it less ugly by just increasing the writeIndex by 6 rather than rewrite values that the original dst loads in a working rom, but that didn't work (it's a byte array initialized with an address location not a typical array where you define the size and then iterate through). I also tried to use relative values rather than absolute but couldn't figure a way to do that. I'm afraid with too much tinkering people will mess up these values, or that a MMX2 rom with a different checksum value will behave differently. When working with MegaEd for this level it would pass 234 instead of 254 at index 19 and then skip 254 and 238. What those values do is set the counter to write the buffer a certain number of times. So you see the buffer is 0 in all those cases so when loadlayout runs the RLE decompression it's checking for those values so it knows to write the buffer however many times. This is why the rom was screwed up after saving; these zeroes need to be outputted or the layout will load way high up where the cursor doesn't read.

I know this is extremely complicated and tedious. I'll just create a github so anyone can download an executable and not have to worry about this junk. I wanted to wait until I added the Undo option to the program before I released the source on github. I suppose I have time no one is begging for fixes on the MMX2 game on this specific level.

On a separate note, I stumbled across a neat little project someone is doing involving Megaman X, although very optimistic, and it looks like it's been abandoned:
[url]http://sprites-inc.co.uk/archive/index.php?thread-1786.html[url]
« Last Edit: May 22, 2017, 07:38:38 am by pianohombre »
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

Ice Man

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #215 on: May 23, 2017, 04:10:21 pm »
I'm quite new to MMX hacking and I was wondering how or if I can edit the font? I know it's compressed somewhere at E0200 but I can't seem to edit it or anything. Will your editor eventually support font editing as well? I'd love to add more symbols for a translation I'm making. :)

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #216 on: May 24, 2017, 02:47:15 am »
Ice Man,
The font in Megaman X uses RLE compression, and LZSS compression for MMX2 and MMX3. You don't need to worry about this though, lunar compress will decompress the graphics for you. (I'm not sure if it's able to correctly decompress x2 or x3 however). Your best bet is to extract the graphics using lunar compress and then edit them using tile layer pro or tile molester. I can jot down a note to look into adding the font to the editor, but it would be pretty strict such as pulling a specific sized block from the game at the specific offset, then re-inserting that exact block back into that game at the address location after editing. It looks like I can just copy the Tileset editor window and put the font in there. Are you sure it's at location E0200? How large is the block? Is that the snes address or pc address?

It looks like the user kabuchi203 was successfully able to translate Megaman Battle Network into Spanish on the GBA and he needed to add a couple letters for the Spanish alphabet you may want to shoot him a message. You'll probably want to expand the rom and then put the new font table in the extra space, assuming the font table would be larger, although then you'd have to re-assign every location that uses a letter.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

justin3009

  • Hero Member
  • *****
  • Posts: 1658
  • Welp
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #217 on: May 24, 2017, 06:25:24 am »
X1/X2/X3 I'm pretty sure all share the same decompression routine so I wouldn't worry there.  If they are different, X2/X3 for sure has a decompressor and even code on this site too to do it in it's own separate program.  Mainly focused at X3, but X2/X3 share the exact same routine so it works vice versa.
« Last Edit: May 24, 2017, 10:55:02 am by justin3009 »
'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.'

Ice Man

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #218 on: May 24, 2017, 07:10:33 am »
@pianohombre:
That's the problem. I',m not very familiar with Lunar Compress yet and don't know how to extract/reinsert the graphics properly.
Editing them with a tile editor is the least problem for me.
E02000 is PC address, iirc. It did include the font and it was like 64KB large.

What does MM:BN has anything to do with the SNES?
I know there's a French translation of MMX. Might as well ask the author. Thanks!

EDIT: Got the help needed. Thanks though!

Font offset is at E6BB4.
« Last Edit: May 24, 2017, 02:29:27 pm by Ice Man »

pianohombre

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #219 on: May 25, 2017, 01:00:14 am »
Iceman,
glad you got the help you needed. There was an example in the LC source code notes of how to extract MMX font. It looks like you must have found that because you got that same exact offset. If you're translating using Roman alphabet probably better off just editing the French version because they have more than 26 letters.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds