Original Post

Here is InsmEdit, the first editor for Insmouse No Yakata.

It’s a simple editor that can currently edit patches with level layouts, level passwords, and player starting positions.

It comes with a readme file that explains everything and an example patch that demonstrates its usage.

Special thanks to DogP for his forum post which encouraged me to do research on Insmouse and KR155E for his excellent FAQ which helped in finding out where the player starting positions are stored.

49 Replies

thunderstruck wrote:

Sounds like you are close to figuring out how the complete game works.

No, not really. I still know nothing about the monsters, the cutscenes (other than where some of their graphics are), or where the sound data is.

Would be great to be able to do a ROM hack that changes the complete game including graphics and sound and just using the game as an engine.

Do you think this is a better idea than creating an engine from scratch? Probably the hardest thing to get right is the renderer (Insmouse probably composes the view from BGMaps, since you can only see 3 tiles ahead of you) and the details like cutscenes.

Okay, I got the first nine edited. I’ll be working on the next 9.

Top job Ben, those look way cool.

Thanks, Hedgetrimmer.

I got the next 18 done.

It’s definitely getting harder to find characters that can fit within the 22 by 22 area and still look close to the original sprites. I’m not sure which ones are going to be the final nine after these.

Looking good Ben.

Thanks VBmills.

I’ve come up with a title for my special edition of the game. It’s going to be called:

Mansion of Insmouse: Mario Madness Edition

I’ve finalized the levels that I’ve made so far, complete with starting points and exit doors. I’m just not sure what original level maps they are going to replace yet.

Okay. All 45 level maps for “Mansion of Insmouse: Mario Madness Edition” now appear in the attached PDF file, in no particular order. I decided to take character sprites from Super Mario Bros 1, 2, and 3 for the NES, and then also from Super Mario World for the SNES. There weren’t too many more from these games that I could have used, which would have looked close to the original sprites, given the limited space I had to work with, so I’m really glad I managed to get 45 different characters represented.

Now, it’s time to see if I can actually make a game of it! This will probably be the hardest part for me.

I think you have done a great job Ben. All the characters look spot on and the name of the game is good too!

Hope you make it a proper game.

If you build it they will buy it! I am one of the they.

Although in this case, it will be: If I post it, they shall play it for free. 🙂

I take it that nobody has ever made drawings of the original level maps in this game, showing the original starting locations of the monsters in the game? If someone has, I would greatly appreciate being given access to those drawings. For now, I’m going to have to use trial and error on every single map and hope that I can get at least one monster to appear in every level of my special edition of the game.

I only know few things about monster positions, which I originally got from starting the game and running directly to a monster, writing down the position, then dying and repeating the process for each monster in a level.

However, since then I know of a better and more reliable way: use Mednafen’s debugger to teleport yourself to a position where you think there is a monster close (note: if you teleport yourself into the monster, you may be unable to move and will eventually get killed – but I have also seen cases where the monster simply moved away, so I’m not really sure).

First, freeze the game with Alt+A, enter (or exit) the debugger with Alt+D, once you are in the debugger, press Alt+3 to switch to the memory editor. Press G and enter the address 05003CFA. There are four bytes: the first two are your position (X, Y, same as when you edit starting positions), the next two are a copy of it (edit this too just to be sure, I don’t know why there’s a copy), and the byte after that is your direction (1 is up, 2 is down, 3 is right, 4 is left). Edit by pressing Ins and then typing the new values. Exit the debugger, then press Alt+R to resume the game. Turn around and maybe there will be a monster nearby.

I’ve tried searching for these coordinates in the ROM, but haven’t yet found any data related to the monsters. Hopefully that will be a lot easier when I have a more complete ROM map.

ROPE:
4, 17 (04 11 hex) – bright armless monster, facing up
10, 16 (0A 10 hex) or 10, 17 (0A 11 hex) – bright weak humanoid

ROAD:
20, 12 (14 0C hex) – bright armless monster, facing right (I think)
around 12, 12 (0C 0C hex) – dark armless monster
around 4, 19 (04 13 hex) – bright armless monster

LOVE:
around 22, 21 (16 15 hex) – bright armless monster
others unknown

Obviously, this is a time consuming process, so please post your discoveries for the benefit of others (it may also help me find the data in the ROM).

Heh… yeah, that technique does sound about as time consuming as what I was going to do. One thing that I would also need for this is the exact location of each original level map within the 24 by 24 square of tiles. When I made my PDF Level Map document for the game, I was careful to ensure that the size of each level was exactly correct based on playing and pausing the game and carefully observing each map screen. However, I don’t know how close to each edge each map appears within the 24 by 24 square of tiles. Is there a way to bring these up on screen somehow? Also, I was wondering if someone already posted pics of that on this site somewhere. I thought I saw them before but I can’t remember exactly.

Anyway, what I am planning to do is line up each original level map over all of mine and assume that if monsters appear in those original level maps and most of those corridors line up with a particular level map of mine, then I can safely replace the original with that particular one and hope that at least one monster will appear in the new level. If no monsters appear in the level, then I can slide the whole level in various directions and keep testing it until at least one monster appears in the level. This process might be about as time-consuming at the method you suggested, but I guess I won’t know until I actually try it out.

On another note, I made a handy reference table for the layout index and password index for each original level of the game, which will be helpful to any others who may try to make a new edition of the game using this level editor. The number and letter, which are attached to each level name, correspond to the respective number and letter that were created for each level name, which all appear in the “Mansion of Insmouse Level Maps” PDF document on this site, which can be found under the “Cheats & FAQs” tab for Insmouse No Yakata. All of the black numbers that appear in the table can be found in the InsmEdit Readme document that is found in the editor itself. The red numbers do not currently appear in the Readme document, so I filled them in under the assumption that all of the layout index numbers should be ordered in accordance with the alphabetical order of all level names. As I attempt to create my special edition of the game, I will be checking to see if all numbers for each level are, indeed, correct and will update the table if necessary.

Benjamin Stevens wrote:
Heh… yeah, that technique does sound about as time consuming as what I was going to do. One thing that I would also need for this is the exact location of each original level map within the 24 by 24 square of tiles. When I made my PDF Level Map document for the game, I was careful to ensure that the size of each level was exactly correct based on playing and pausing the game and carefully observing each map screen. However, I don’t know how close to each edge each map appears within the 24 by 24 square of tiles. Is there a way to bring these up on screen somehow? Also, I was wondering if someone already posted pics of that on this site somewhere. I thought I saw them before but I can’t remember exactly.

You could have just asked me to write a program to generate the layout pictures.

Anyway, I did just that and attached are the layouts in PNG format.

Attachments:

This is extremely helpful and will save me very much time. Many thanks for this!

These level layout pictures are truly proving to be very handy. So far, I have looked at the first 13 level layouts, compared them to my completely new ones, decided which new ones can best cover over the original ones so that the most original corridors are still included in the new level layouts, and then replaced the originals with my new ones. In each and every case, I managed to create a new level that has at least one monster in it on my very first try, so I didn’t have to slide the whole level layouts at all to see if a monster would appear in them. Thus, I am already over 25% done with my new edition of the game. Hopefully things will continue to run this smoothly.

Here is version 1.1. Change log:

*** What’s new in this version ***

This version adds new features, such as level time editing and support for IPS patches. It also fixes bugs and improves the user interface.

Files created with version 1 will work normally with version 1.1. However, if a file saved in version 1.1 that includes starting position resources is edited and saved in version 1, starting directions in those resources may be lost.

The readme file has been updated to document new features. It also documents where in the Insmouse No Yakata ROM the data patched by InsmEdit is located.

The Example.imp file has also been updated to illustrate the new features.

*** Changes from version 1 ***

* IPS patch support.

* In addition to editing starting position, you can now edit the direction as well.

* You can now choose the music track played on each level.

* The layout editor can now shift layouts around the map.

* By pressing the middle mouse button or scroll wheel (whichever your mouse has), the position of the tile being pointed to in the layout editor will be remembered. You can then paste it into a starting position resource.

* The layout editor does not flicker anymore.

* Added the “Lamps” feature in the layout editor.

* Password indexes are now checked for validity. This applies to all resources that use them.

* The status of the “Grid” feature in the layout editor is preserved when editing different layouts. This also applies to the “Lamps” feature.

* The main window can now be resized.

* The readme file, if opened from within InsmEdit, will open to the right of the main window rather than over it.

* InsmEdit will now ask you whether you want to save changes to a modified patch when you choose “New” or “Open…” from the File menu.

* No more potential instability after opening a patch when a patch is already open.

* No more crash when choosing “Open…” from the File menu, then cancelling the resulting dialog box.

* No more crash when the resource limit is exceeded.

Attachments:

I have discovered how to edit the monsters.

First, I had the brilliant idea of finding out where in the RAM the player’s health is stored. I decided to search for the health because there are only three places in the game where it is modified: at the start of a new game, when you pick up a heart, and when a monster attacks you. I went to a monster with 2 hearts, dumped the WRAM to a file, let it attack me, dumped the new state of the WRAM to another file, then searched for a location where a byte changed from having the value 2 to the value 1. There was only one such place, and testing confirmed that it was indeed the health. Fun fact: if you modify that variable, you can have more than 5 hearts. Up to 7 icons will show, with two being behind the ammo icons.

I then searched the disassembly and discovered the place where the health is decremented. It turned out to be a function that controls monster attacks. I put a write breakpoint onto it in Mednafen and discovered the place in WRAM where the monsters are. Each monster takes up 56 bytes and there is room for 6 monsters. To confirm this, I put a write breakpoint onto the first byte of that space and reset the game. The first function to write to it was the function that loads the monsters from ROM to WRAM. I looked at the disassembly of that function and found three places in ROM which are related to the monsters.

The first is an array that specifies which kind of monsters appear in each level. For example, the monsters in ROPE are of a different kind than the monsters in HYDE. There are four kinds, and only one may appear in each level, possibly because of memory limitations. Interestingly, the kinds are numbered not in the order in which they appear, but apparently in the order in which they were created.

The second is an array of pointers. There is one pointer for each level, and it points to the monster list for that level. Each monster has a starting position, a size and color (large and dark, large and bright, small and dark, or small and bright), an unknown byte that’s probably the starting direction, and two unused bytes (probably padding).

Apparently, they were trying to save space in the ROM by using pointers instead of a fixed-length monster list, but that is both pointless and ironic, because there is a lot of unused space in the ROM, and 16-bit values are used pretty much everywhere where they could have used 8-bit values. The layouts also only store one tile per byte, where they could have stored at least two, or even four if there wasn’t a special tile type for the exit. And the monster coordinates use four bytes, even though two would have been enough and then the two padding bytes wouldn’t have been needed. Each monster list is also terminated by a special entry, which itself takes up 8 bytes. However, two programmers are credited for this game, so maybe that explains the inconsistencies. Still, I should probably be thankful for the game’s simplicity, because that also makes it easy to hack.

The presence of pointers makes it a bit tricky to add new monsters to the levels without breaking other levels. So, Ben, if you want to add monsters to your levels, you can send me a list of monsters for each level, and I can make an IPS patch for you, until I figure out a simple way to add monster editing to InsmEdit.

EDIT:
Guy Perfect has just suggested that I could just change the monster list pointers to unused space in the ROM. That should work.

First of all: I love how you reverse engineer this game. It seems like every time you post something in this thread you discovered a new cool secret.

I have recently grown interest in this whole Rom-hacking thing and already looked into the Mednafen and RealityBoy debugger. However, I it is somehow hard to find a starting point as there is don’t seem to be allot of tutorials about this specific task. Do you consider writing something like a HowTo to share some of your experience?

 

Write a reply

You must be logged in to reply to this topic.