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 190179 times)

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #180 on: May 26, 2016, 09:41:47 am »
How many more bytes of ram do you need to go from $60 scenes to $FF scenes?

The scene map in RAM (composed of tile maps) starts at 7E:2800 and I think the next valid thing in RAM is at 7E:F000 (background scene map).

$60 scenes:
$60 scenes * $40 blocks per scene * $4 tile maps per block * $2 bytes per tile map =  $C000 bytes

$FF scenes * $40 blocks per scene * $4 tile maps per block * $2 bytes per tile map =  $1FE00 bytes
($100 might be possible, but I'm assuming that a value of $0 actually means $0 unique scenes in the code right now and would need to be changed to represent $100)

It looks like the code copies all the scene data to RAM at the start of the level and leaves it there.  So without changing the way it's stored it would use almost all of 128KB of WRAM for $FF scenes.  Some ideas:

1) Store the tilemaps as blocks in WRAM and get 4x savings.  Not sure how much it will slow down the in-level scene management code to have to read the block to get the tile. It should just be an extra 1-2 LDs with some address arithmetic.
2) Dynamically load the scene mapping data and have the level designer setup events to identify which scenes are active at different parts of the level.  I don't like this idea.
3) Some other form of compression.

I prefer (1) if we want to increase the limit.  (2) seems like too much extra work for the level designer to worry about.  They already have to manage VRAM.  And (3) would require compression that supports random access and the editor checking that the scene definitions would actually fit in the allocated WRAM space.

dn

  • Discord Staff
  • Jr. Member
  • *****
  • Posts: 17
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #181 on: May 26, 2016, 11:56:23 am »
Expansion doesn't seem to work with X1. Tried multiple roms, it just flat fails. Not sure if you've coded it to work with X1 or not yet.

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #182 on: May 26, 2016, 12:15:20 pm »
Probably a X1 1.0 vs 1.1 difference.  I only checked it with one of the versions and I can't remember which one.  I'll take a look at it later today.

Make sure the ROM is 1.5 MB in size and doesn't have any major code changes.  The editor does a few checks (size == 1.5 MB, snes header size says it's 2MB, modified instructions are in the right place, etc) on it before expanding and fails if the checks don't pass.

slidelljohn

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #183 on: May 26, 2016, 08:03:13 pm »
The scene map in RAM (composed of tile maps) starts at 7E:2800 and I think the next valid thing in RAM is at 7E:F000 (background scene map).

$60 scenes:
$60 scenes * $40 blocks per scene * $4 tile maps per block * $2 bytes per tile map =  $C000 bytes

$FF scenes * $40 blocks per scene * $4 tile maps per block * $2 bytes per tile map =  $1FE00 bytes
($100 might be possible, but I'm assuming that a value of $0 actually means $0 unique scenes in the code right now and would need to be changed to represent $100)

It looks like the code copies all the scene data to RAM at the start of the level and leaves it there.  So without changing the way it's stored it would use almost all of 128KB of WRAM for $FF scenes.  Some ideas:

1) Store the tilemaps as blocks in WRAM and get 4x savings.  Not sure how much it will slow down the in-level scene management code to have to read the block to get the tile. It should just be an extra 1-2 LDs with some address arithmetic.
2) Dynamically load the scene mapping data and have the level designer setup events to identify which scenes are active at different parts of the level.  I don't like this idea.
3) Some other form of compression.

I prefer (1) if we want to increase the limit.  (2) seems like too much extra work for the level designer to worry about.  They already have to manage VRAM.  And (3) would require compression that supports random access and the editor checking that the scene definitions would actually fit in the allocated WRAM space.

I have been slowly working on a few mmx1 projects
for awhile now and one of them is redesigning the rom
so it can play like super metroid. I have two ways that
I came up with for adding more scenes.

1) I have completely removed the graphics
compression in the rom freeing up all ram located
between 7F:0000-7F:7FFF. So now there is 25% of
the roms ram I can use for whatever I want like extra
scenes, weapons and items. My code is already about
95% complete just a couple small things left to do.

2)I will place doors in the level like in super metroid so
when you walk through them it will load new areas so
scene data will be changed in the new areas.


« Last Edit: May 26, 2016, 08:54:45 pm by slidelljohn »

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #184 on: May 26, 2016, 10:48:30 pm »
Expansion doesn't seem to work with X1. Tried multiple roms, it just flat fails. Not sure if you've coded it to work with X1 or not yet.

https://drive.google.com/file/d/0Bx9gzQZCkH8qZ2VmVnlpekVKSk0/view?usp=sharing

It should work in that version.  I forgot to try 1.1 where all the instructions I modified were offset by $16 bytes.  I also supported changing the level dimensions up to $20 x $20.  Most likely doesn't work correctly with the background, though, as it will run out of space.

I have been slowly working on a few mmx1 projects
for awhile now and one of them is redesigning the rom
so it can play like super metroid. I have two ways that
I came up with for adding more scenes.

That sounds very cool.  Nice work.  Having free RAM and contained areas separated by doors like metroid will allow for a lot of new mods.

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #185 on: June 09, 2016, 11:43:02 pm »
I haven't been working on the mmx editor lately, but after finding a nasty bug in the map editor I figured it was worth updating it.
- Reworked the tile, map, and block editors to fix bugs and be more usable.
- Improved the menu layout and removed some of the half complete features/editors.

The new editors work like the scene/layout editor: right click does all the selection.  Left click performs the updates.  The map editor tries to guess the palette you want to display the tiles based on which tile you are editing in the selected map.  The map and block editors have the picture of the currently selected tile/map and the previously replaced time.  You can right click on the previously saved tile/map to reselect it.  It's a crappy version of undo, but undo is difficult to add.

https://drive.google.com/file/d/0Bx9gzQZCkH8qR0tPWUtiWHZyb2c/view?usp=sharing
« Last Edit: June 09, 2016, 11:56:35 pm by RedGuy »

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #186 on: June 25, 2016, 10:38:54 pm »
I added some preliminary Rockman and Forte support to this version of the editor.  You can view the levels, including events, and also run the emulator.  The event and level data is quite a bit different than the X games.  Not all of the events show up on the later levels because I need to figure out how the bosses trigger the next set of events.  Given that a few more things are compressed I'm going to have to figure out how easy it will be to add extended hirom before adding editing support.  I'd rather not allow modifying compressed or packed stuff in the existing ROM.

R&F uses hirom format and is also 4MB.  The compression algorithm is the same as X2/X3.

Thanks to a friend who answered a lot of questions on R&F and looked through several versions of the editor.

- Added initial Rockman and Forte support (view levels, events, emulator works, no editing).
- Added expansion of checkpoints in the X games.
- Fixed a X2 bug which would overwrite some data it shouldn't if the intro stage was saved.  Can be fixed by copying $2d0 bytes @ $f2035 from an unmodified version.  You will see $00's there if the bug exists.  I found it after noticing the water missing from Crab stage.

https://drive.google.com/file/d/0Bx9gzQZCkH8qUnJIb1h6UUtPb2c/view?usp=sharing
« Last Edit: June 26, 2016, 09:55:10 am by RedGuy »

Seeeeph

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #187 on: June 26, 2016, 01:46:46 am »
.
« Last Edit: August 22, 2016, 04:08:22 pm by Seeeeph »

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #188 on: June 26, 2016, 08:30:42 am »
A last minute fix to RF broke the X games.  I fixed that and edited the above link with the correct version.  Thanks for finding that.  I really need to do a better job of testing between "releases".

By disabling the internal editor do you mean disable the joystick so it doesn't try to sample button presses?  Or do you mean disable the internal emu completely so you can't use it?  It supports keyboard, but it won't allow keys that are already bound to the editor.  Unfortunately, there are certain useful keys like the arrow keys and the space bar that are already used.  In the future I will allow all key mappings to be changed or force all input to go to the internal emulator first so you can bind whichever keys you want without having them conflict with the existing editor key mappings.

https://drive.google.com/file/d/0Bx9gzQZCkH8qMWp1bEU5Z1ZkMEU/view?usp=sharing

- Added expanded camera lock support
- Changed max foreground unique scene count to $40 (WRAM limits it)
- Fixed various other bugs
« Last Edit: November 20, 2016, 01:37:43 pm by RedGuy »

Seeeeph

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #189 on: June 26, 2016, 05:51:27 pm »
.
« Last Edit: August 22, 2016, 04:08:13 pm by Seeeeph »

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #190 on: June 26, 2016, 05:57:18 pm »
What I meant was if it would be possible to enable external emulators like it worked before in xeenamo's original build? Not that I mind the internal emu or anything, its just that I rather use my emulator of choice for testing. Especially if I'm using an msu-1 emulator. Thanks!

If you hit the play button (green triangle facing right) it lets you setup and run an external emulator.  Make sure to save any changes before doing so as it references the file directly.  File->settings lets you change the external emulator.

Seeeeph

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #191 on: June 26, 2016, 09:06:33 pm »
.
« Last Edit: August 22, 2016, 04:08:01 pm by Seeeeph »

renicito

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #192 on: July 05, 2016, 01:43:48 am »
hi all, I would like to know if there is a tutorial for using the MEGAED X. Please if you can. :angel:

Bahamut ZERO

  • Hero Member
  • *****
  • Posts: 903
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #193 on: February 23, 2017, 04:29:57 pm »
If you're working with Megaman X 1 and want to use the editor's Rom Expand feature, make sure to use a V1.1 rom. V1.0 hangs after you go to start the game.

End of helpful necro post.
Like Super Mario Land? Then you'll love my first completed Rom Hack: Maniac on the Run!

justin3009

  • Hero Member
  • *****
  • Posts: 1658
  • Welp
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #194 on: March 19, 2017, 06:03:36 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.
« Last Edit: March 19, 2017, 06:15:26 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 #195 on: March 19, 2017, 08:27:41 pm »
I've lost time and interest in doing snes hacking for now so hopefully someone will pick this up and rewrite it in a more modern framework.  Major problems with it:
- Graphics should be decompressed in the expanded version (which should all be expanded to 4-6MB).  I wasted too much time trying to get everything to fit in the original locations.  It's too easy to break the ROM now.
- Game code changes should be written in ASM with help from an assembler to insert them rather than modifying the binary directly.
- Expanded ROM should be better planned out for what it needs to support.  Expanding things in later versions is a huge mess especially if people expect backwards compatibility.
- The editors dialog boxes have a lot of redundant code making them hard to maintain.

Here's the last version I compiled late last year.  Maybe it fixes the problems your observing:
https://drive.google.com/file/d/0Bx9gzQZCkH8qeVVnVmwyM0lORGs/view?usp=sharing

The source is at:
https://github.com/RedGuyyyy/MegaEdX

Good luck to whoever takes it up.

pianohombre

  • Sr. Member
  • ****
  • Posts: 334
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #196 on: March 21, 2017, 09:43:01 pm »
I've been tirelessly reading through the last 4 pages of forum threads, where I last left off getting the source code for the project. I'm recently unemployed so have quite a bit of free time to fiddle around with the source code. Hopefully, RedGuy has commented the source code well. Problem with Luciano's C++ was that he didn't explain how he interacted with assembly, hex, and linked the different files together in the GUI. I will try re-reading these replies since 90% of it went over my head. Particularly interesting is this event editor working with the sprites. Right now the windows pop up in those tiny little boxes. I'll have to change my screen resolution to try and get a better view of the blocks, level, sprites, etc.

Is the latest working executable in the github source, or should I try clicking on one of the many links and using those?

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

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #197 on: March 21, 2017, 11:25:51 pm »
The executable is only at the link in my previous post.  I never got around to adding it to the github repository.

You're going to be disappointed about the comments - they are only slightly better than what was there originally.  Another thing to add to the list of things that should be redone/rewritten is the core library should provide a proper interface to modify the contents of the ROM.  A lot of the editor dialogs go in and directly modify the binary which makes it hard to maintain.  The SCV4 editor did a better job at this, but it still wasn't great.  With a solid core library to access the various data structures in the ROM you could then rewrite the GUI code and clean up a lot of the hacks.  I basically learned about snes architecture and rom hacking by working on the editor.   In the process I wrote some ugly code and it's way past the point of needing a rewrite.

The editor source isn't a good place to learn how the ROM works.  You're better off looking at traces and stepping in a debugging enabled emulator to look and match that with what the editor does.  There are a few people I know who are doing mmx1-3 hacks including Justin who can also probably help you understand the game engine.

pianohombre

  • Sr. Member
  • ****
  • Posts: 334
    • View Profile
    • My personal website of short stories and comics
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #198 on: March 22, 2017, 05:36:34 am »
I believe the open-source of SMILE (super metroid) is available to look at. That will help at least me understand game-specific editing a little more. Where did you go to understand how to deal with Visual Basic and C++ GUI handling, such as how to attach a function to a button, open a window, close a window, etc.?

I was able to do some minor tweaking to the level design, such as change the colors of the enemies using offset values which was kind of neat. I remember trying to use the palette or tile editor before and grabbing my hair. My ultimate goal when trying to get Lucciano to release the source was to create a super user-friendly game editor. Even possibly being able to just drag and drop enemies, or palettes/tiles to change the design of the level. Only messing around for just an hour I was able to completely screw up one scene and then completely undo my mistakes manually. Just adding an Undo button, probably wouldn't be too difficult, you see it even in Windows paint, probably wouldn't take too long once I figure out the libraries.

I agree it really is a shame that you didn't comment the code (#1 rule in programming). However, I don't want to criticize you too much because I'm pretty rookie when it comes to dealing with the GUI, and I majored in computer science, yet focused on mainly web programming, not game or graphic design. The x2/x3 and internal emulation was pretty neat. Again if you could point me to some free guide online on how to program the GUI in C++ that would be great. I have VB 2015.

Just a side note. MM has mainly been ignored in the gaming community, for more popular games, yet even super metroid snes had major overhauls. I think it didn't become popular on the SNES because it completely avoided save games, and then on the N64 it looked really ugly. They haven't even had any recent remakes of the games, despite releasing some collections for the ps3 and the wii. Nintendo has mainly dumped MM, possibly because Capcom cross-platformed onto the Playstation quickly who knows. I've seen many rom hacks for the NES I'm really surprised only a few people have tried tweaking the 16-bit version. Once this project becomes an amazing utility that is very user-friendly there could be several new hacks in the next 5 years or so. I just watched a trailer for Megaman X Corrupted earlier. The developers are making the game on Adobe Flash I believe. Ridiculous. The project has been in the works for a few years now. It may even get abandoned before completion without releasing any beta files.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: MegaED X, the Megaman X hacking tool (Now with MMX2 support)
« Reply #199 on: March 22, 2017, 09:19:34 pm »
The editor uses windows API calls directly - probably because it was originally written many years ago.  I just searched API calls from the source and read Microsoft's documentation on them.  That coupled with running it in a debugger is how I learned.  I've played around with MFC (SCV4 Randomizer) and QT (bsnes-plus) since.  QT is pretty intuitive and there are plenty of examples available.