Thursday, January 31, 2013

More sprites

Sprites are loading somewhat better today.  Here's level 0 Freeze.

Spell Sprites

Spell effect sprites are loading and rendering in their simplest form.  Needs work though.  Here's a debug shot of level 0 earth slide's first frame. 

Five-color images again like the ring menu icons... I do not know why.

Tuesday, January 29, 2013

Spell Editor

The graphics don't load yet, but at least the stats and icons do.

Monday, January 28, 2013

Map Flags

Implemented editing for a couple settings for composite maps last night - whether flammie is available on the map, and whether the magic rope is available. There are only a couple "unknowns" of these flags left, then composite map processing should be pretty well done.

The way the magic rope works is when you transition from a map where it's not available to one where it is, it saves off the ID of the door you went through. If you transition back to a no-rope map, it wipes it out. When you use the rope, it transitions through the saved-off door if it's non-zero. This has some weird side effects for indoor sections where you can't use it--for example, walk into the right side of gaia's navel then down into dwarf town.. using the rope takes you back up to gaia's navel, as you'd expect. But walk back down and through the first door into the gnome palace (the first room of which disallows magic rope) then back out, and suddenly that's your new magic rope warp point.

Sunday, January 27, 2013

Anonymous Comments

You should be able to post without a blogspot account now.

Enemy Stats Editor

Updating this broken thing, too.  May as well make all these stat-editing things work for the next build.

Saturday, January 26, 2013

Ring Menu stuff

The editor for these icons and their many strange five-color palettes will also be in the next release.

Weapon Editor

First rev of weapon editor

and apparently this ring blocks a bunch of conditions.

Friday, January 25, 2013

Numeric Stuff

Adding support for easy numeric stuff that's been documented for a long time anyway (like weapon/armor stats) before I start dealing with sprites and animations again.  I accidentally left the sprite editor selectable in Build 0202 - you can see what a mess they are at present.

Wednesday, January 23, 2013

Build 0202

 A few bugfixes, special events for maps, and I now list known bugs/to-do at the top of the release notes.

Release notes:

*** build 0202 ***

 - Process "Special events" for maps.  This fixes inconsistent trigger
   lists with a number of maps (248, 265, 17) and allows you to edit
   what happens when you step on a "special event" tile.
 - Fix size of right tab on composite maps view when collapsing then
   restoring it.
 - Add collision types for the partially destroyed crystal things in the
   mana fort interior.
 - Fixed issue where loading a new file would.. merge the fonts from the
   two files together.
 - Clear the display and close all secondary windows when loading a new
   file to avoid keeping stale data up.
 - Fixed issue where loading another project would continue to add more
   tiles, tilesets, and palettes on top of the ones from the previous
 - Fixed issue where sound effects samples weren't clearing out properly
   for a new load.
 - If you go to create a new project, then cancel the first dialog, it
   will no longer open the second one.

Triggers & Map Special Events

Ah ha.. the second "special event" for a map seems to be what happens what you step on a particular tile type.  The map I spoke of, in Pandora, has three of these lined up where you walk through to trigger the event.  It's more commonly used (as in the Mana Fort interior) for the whip post buttons that gather your party to one spot.

Tuesday, January 22, 2013


Not sure whose bright idea it was to store doors this way, but doors and step-on-to-execute events are stored on each map without a source x,y.  It pokes through the map from top to bottom looking for tiles of a certain type, and when it finds them, it pairs them iteratively with the door definitions defined for a map.  For example, 128, the waterfall map, has four such trigger tiles.  From the top of the map down, the first two are the door tiles to the map to the right, 129, so these are the first two defined for the map. The other two are the dialogue boxes that pop up while you walk through to get the sword.

0201 has bugs with how it detects and matches these together.  Working on fixing this.  Map 248 is an example of where it's way off - I'm counting double for multiple map pieces with door tiles placed on top of each other - this is part of the problem.

Edit: it looks like some maps (like 248) are also flagged with a second "special" event (like the map walk-on event that I already process) that is throwing off the count.  These are being processed now and most of the counts are looking okay, but I still don't know what the fuck this event is or how/when it's processed. Map 265 one has one that triggers the event where the girl joins you (Event 188), but this is a multi-room map, and I'm not sure yet how they make it only execute for entering through the one doorway.

Sunday, January 20, 2013

Build 0201

Let me know if you find any problems.  I'm aware of most of the minor stuff and it will get fixed eventually.  It should crash much less than the old one (or never? Let's go with never.)

Release notes:

*** build 0201 ***

 - You can now pass a .som project as a command-line argument, and it will
   open it (ie, associate the filetype in windows)
 - Added a collapse/expand button to the left-side tree.
 - Title screen tree graphic and organization of the logos and such are
   loading, finally.  Curious whose bright idea it was to use JPEG
   compression for that tree graphic and spend 20-30 seconds decompressing
   it.  Later I'll make it so you can import your own and compress it back;
   it's just for show for now.
 - Add graph and function input for character stats editor.
 - Add an "Edit" palette button on the Tileset16 screen.
 - Add collision type for those little crystals in the mana fort that you
   have to slash a few times.
 - Fix minor hex/dec conversion issue with finding referencing events from
   the door editor screen.
 - Preliminary support for exporting to a 6 MB ExHiRom ROM (a la Tales of
   Phantasia).  This includes a number of SOM code mods that have probably
   not been tested thoroughly enough.  Will only happen if your ROM requires
   between 4 and 6 MB of space.  Also, it only expands as necessary now (not
   at all if you added nothing, to 3 MB, then to 4 MB, then to 6.)
 - Add menu item for exporting an IPS patch, which is not yet implemented.
 - Preliminary loading of sound effects, but these aren't editable yet.
   Before audio is fully editable/expandable/whatnot I need to do a bit
   of a re-org of how they store stuff in SPC700 memory.
 - Add ability to pull a section off into another window so you can work
   with two related sections side by side.
 - MIDI importer improvements; still not wonderful, but getting closer to
   what I want.
 - Fix an issue where the tileset editor wouldn't let you edit foreground
 - Preliminary support for sprite loading.  Some sprites render properly
   on maps.  Most bosses (Except Mantis Ant, who was my test subject for
   boss tile decompression) do not yet. Composite maps may show exceptions
   for displaying some sprites - these should not crash or otherwise affect
   stability.. debug-only.
 - Complete rewrite of map editors.. should be much faster and more
   stable now.  Removed OpenGL components.  Should no longer depend on
   OpenTK DLLs.
 - Fix bug where map piece filtering for the initial map (128) would be
   blank until you switch maps.
 - Fix object directions - up and down were swapped.
 - More convenience shortcuts on various components.
 - Allow changing direction and "mobile" flag of objects.
 - Update selection in tileset view when eyedropper used to pick a tile
   from a map piece.
 - Fix bug where map filtering wouldn't work correctly when flipping
   through maps.

Known issues:
 - Having issues getting the right scrolling range on the scrollbars I use
   on stuff like the map editors and the music editor.
 - As mentioned, many sprites do not look right yet.


Stats editing works.  Here I am with 500 HP .. minus some from trying to get a good screenshot, one-shotting the mantis ant at level 1.

Some minor cleanup and build 0201 should be on its way.

Saturday, January 19, 2013


I'll probably drop the first 2.x release in a couple days.  Lots of speed and stability improvements, the ExHiRom stuff, and preliminary sprite stuff (no sprite editing yet.. needs work.. but a lot of them show up on maps) are among the changes.  Also took out the OpenTK dependency.  I want to polish up the character stats editor a bit before I do the release (it doesn't write anything back to the rom at the moment)

Wait, is anyone even still interested in these things?

Friday, January 18, 2013

Map piece editing also now much faster.  You can pull each map editor to its own window, edit the piece, and see the composite map update when you hit OK.  Hasn't crashed yet, it's orders of magnitude faster, and it's barely using any CPU at all.  In other words, it's actually somewhat usable now.

Thursday, January 17, 2013

Multi-window editing

This is something I got some requests for a while back.  Seemed useful to add.

Menus missing in the screenshots (like "Music" on the music editor window), but they're there now.

Wednesday, January 16, 2013

Composite Map Rendering/Editing much improved.  Stabler and faster.  Everything else needs to be worked on still, particularly the "Map pieces."

.. and fixed a bug where apparently you couldn't edit the foreground section of tilesets.  Lovely.

Tuesday, January 15, 2013

Extended Hirom

Finished playing the 6 MB Extended Hirom version.  169 total changes to code to make it work, made painstakingly one by one by savestating before a crash, generating a code dump, and finding where it jumped to a patch of 00s instead of code (or in the trickier cases, where it read from zeros instead of data). 

Probably still some crashes in it that I didn't get to test.  This will go into some build of the editor in the near future... to be used only if the data you're trying to write exceeds 4 MB (and doesn't exceed 6 MB, in which case I can't fucking help you.) 

I guess there's some extended format that supports 8 MB as well, but it sounds like it's largely unsupported by emulators (did any game actually use it?  I get the feeling Tales of Phantasia is the only reason anyone bothers to support the 6 MB one..)

Saturday, January 12, 2013

More stuff.

This is something I think we've all wanted to be able to do at some point.  This game is so much more fun to play when your movement isn't restricted by where the other characters are.  The "fix" I'm working on for this has its share of problems (for example, it flips the fuck out when you try to bring up a ring menu for someone offscreen), but I'd like to clean it up and include it as an automated fix... in fact, I think there's already a checkbox for it.

As for the ExHiRom patching, it's giving me an excuse to play through the game again (it's actually been a long time) to fix where it still crashes. I'm at Matango, as you may have guessed from the gif.  It's pretty stable so far and low on non-catastrophic glitches.  The only one I've noticed is some palleting issues with layer 3 (also visible in the gif) but I think this might just be a Snes9x issue.

Friday, January 11, 2013


Converting to ExHiRom (which will effectively triple the potential size of the ROM, to 6 MB) seems to be.. doable, but it's going to require some code patches.

The addressing for SNES addresses C0xxxx-FFxxxx (HiRom ROM range, and typically how HiRom code accesses ROM) is the same, but it varies for the range (00xxxx-3F0000), which under HiRom points to ROM, but in ExHiRom points to the upper portion of the ROM (see

SOM, of course, is littered with code that jumps to 01xxxx, 02xxxx, etc - so either I patch this code (replacing 01xxxx with C1xxxx, etc), or copy a bunch of it to the 4xxxxx range (which is a waste of space that I'd rather avoid).

FuSoYa's expansion tool looks like it copies the ROM from 008xxx to the 408xxx range (to avoid such problems for 16-bit addressing?) but why does it not surprise me that SOM is actually calling out these types of addresses as 24-bit in some of the code... and using HiRom-style Cxxxxx, Dxxxxx etc in other parts of the code.  Meh.

Edit: So far, 64 24-bit address references changed in SomExHi.smc, and I've managed to get the game to play up until you fall down the waterfall, at which point it crashes.  Getting this to work for all code paths is going to be a long process.

Thursday, January 10, 2013

ROM file sizes

"Export to ROM" now only expands if necessary.. changing fixed-size things won't bump your ROM up to 4 MB anymore.  If you added things, it first pads it up to 3 MB if necessary, then to 4.  If it goes over 4 (which won't play) it will warn you on the little status log thing.

Sound Effects

Sound effects are sort of loading.  As I was hoping, they're basically just a single-channel version of the music data, so I can use the same code to process them. 

Not sure how the sampling works for them yet, but the music samples start at 0x20, so I'd have to imagine 00 through 1F are reserved for these.  There are 5F3 bytes loaded into SPC RAM at 0x4800 from 31AE2 in the ROM, that appear directly before the music samples (which are swapped in and out dynamically as songs are loaded, whereas this block is loaded on game startup along with the effects themselves) -- I'd guess this block has the samples I'm looking for.

Wednesday, January 9, 2013

SPC Stuff

Checking out how the game organizes SPC700 memory so I can do stuff like allowing sample expansion and warn if the samples you chose won't all fit into memory for a given song.

Looks like the DSP code runs until SPC address x4DF1, so I have about 70% of the RAM (45K) left to play with for samples and music data.

Edit: Meh, on second glance, the music data sits at 1A00, and runs until 2C00, between two blocks of code.  Some of the larger songs (like the mana beast fight theme) take up almost this entire block.  I'm going to have to do some reorganizing before longer songs are doable.

Edit2: Ah ha; the 2C00 block that appears after the music data (from C32137 in the ROM) seems to be the sound effects, something I hadn't found much on until now. Nice I guess, but moving it elsewhere would be nice... optimally I'd stick that stuff at 1A00, followed by the music, followed by the samples (which currently start at 4DF1 and run through pretty much the rest of the SPC RAM), that way all the dynamic stuff is in one big block, and I can shift it around as I please. I'm pretty sure all the static stuff (code, and presumably the sound effects) gets uploaded once when the game starts then never again.  Music is also tricky because all of the offsets and jumps it uses are 16-bit ROM addresses, so I'm guessing it applies some static offset (like 1A00) to them to figure out where in SPC RAM to actually jump.

Kind of wish I had Tales of Phantasia's code that streams samples in and out as needed.  That would be a hell of a project to import...

Tuesday, January 8, 2013

Trying to catch up

Yes, I'm still around.  No, I haven't answered your emails.  I have a bunch of them to go through.  Hopefully get to it soon.

Lots of stuff still needs finishing and improvement.  I've been touching up the MIDI importer, which has always worked like shit at best.