11 March 2016 - Forum Rules

Main Menu

FF1 MMC5 Disassembly Updates

Started by Jiggers, January 04, 2019, 05:36:47 AM

Previous topic - Next topic


Version 0.30

Visibly, not much new...

Battle stats are now integrated into general Character stats. Things like Elemental resistance and weakness, weapon sprite, palette, element, and category; number of hits, plus the multiplyer, and critical hit rate. The routine that adjusts stats based on what's equipped now fills in those stats as well, outside of battle. (This also means, for now, the whole 8 weapons and 8 armours per character thing is shafted. But that won't matter once I start the inventory stuff.)

During battle preperations, any stats that could be changed by a spell is backed up, and then restored after battle (but before level up stats are tweaked). In battle, character stats are edited directly, by both spells and attacks, so only one or two pointers are needed at a time, instead of the... like 8 or so there were before. No more IB/OB stat nonsense; if I find any more, I'll keep updating.

All the btl_defender, btl_attacker, and btlmag_xxx variables have been shifted up into the $6000 area of RAM, as part of my ongoing attempt to organize what's used and what's not.

As usual... probably some bugs. Just finished this, haven't tested it much. Actually just noticed I messed up some of the weapon stats with the Unadjust/readjust routines, and think I fixed them...
I know exactly what I'm doing. I just don't know what effect it's going to have.

I wrote some NES music! Its a legal ROM file. - I got a Ko-Fi page too.


Groovy. I'll give it a whirl and let you know if I find anything wierd.


Guh, sorry. Fixed bank was too full, had to move some stuff to Bank C (luckily made room by doing those edits.) So now the game will actually compile... File in last post updated!

Edit: Found some bugs. Not sure what the issue is or how to describe it. But Garland always messes up things. I'll poke at it some more in the next few days. So bad at testing this stuff.

Bug was in the explosions drawing for 2 Big Enemies and 6 Small Enemies, which the Garland battle uses, I guess! I just made it use DrawExplosions_PreserveX and then cut out some stuff that didn't look like it was needed anymore, so the routine looked more like the other ones. Okay. So, far as I can tell now, all the battle stuff works! Woo!


What could I have possibly edited to make his sprite entirely vanish?! I can walk on the throne now!
I know exactly what I'm doing. I just don't know what effect it's going to have.

I wrote some NES music! Its a legal ROM file. - I got a Ko-Fi page too.



Thinking about it, we could have a FF HD pack version using Mesen.

But now that I consider it. Final Fantasy III would profit the most by using HD scaled graphics.


HD pack would be awesome. And how I wish someone like Disch had done a diassembly of FF3 to play with...

Version 0.30 zip file is updated with my fixes. Also poked a few more things, since at some point I broke some features. Overworld music was resetting when exiting the menu, now it doesn't. Moved the Readjust/Unadjust equip stats routines to Bank E, so there's more space in Bank F again, and did some more RAM arrangement. There's a slight timing error warning but I doubt its anything too serious.

Still no King.  :'(
I know exactly what I'm doing. I just don't know what effect it's going to have.

I wrote some NES music! Its a legal ROM file. - I got a Ko-Fi page too.


yeah. Ever since the first few HD packs started coming out I've had those possibilities in the back of my mind. A nice hack of FF1, 2, & 3 with graphics like the Anniversary Editions would be pretty slick.

FF1 with updated item and equipment system, MP instead of Vancian casting, and an expanded jobs system with unique commands for each class.
*Drooling now*


Quote from: Jiggers on February 11, 2019, 04:38:12 PM
And how I wish someone like Disch had done a diassembly of FF3 to play with...

Hah.  Honestly the only reason I bothered with FF1 was because of my familiarity with the game.  I only played FF3 for 20 minutes and didn't get very far.

But, of course... there's nothing stopping YOU from doing an FF3 disassembly  ;)


I'm one of I'm sure quite a number of people who played FF3 to the final dungeon and stopped at its unforgiving length.
"My watch says 30 chickens" Google, 2018


I never got off the floating continent. It and FF5 are the only two I've never beaten.


Good news everyone! I found the King. He was undone by a rogue elemental weakness variable. - Version 0.31

New Thing - Red tint when player is attacked! Will add jam sprites and veins to the screen edges next.

New Thing - Press select in the start menu to swap characters. Expected behaviour: Press select, choose character, press A, (character should now be in cheer pose to indicate they're selected!) choose second character, press A: swap successful with original menu SFX noise, if SFX is turned on. Pressing B at any time should cancel the swap and return the cursor to the main list. Trying to swap dead and stoned characters, or the same character with themselves, should cause the "cr-kow" error SFX or screen shake without red tint.

New Thing - Press Start + Select while loading or saving a game to clear that slot. You will be warned! Press B to cancel, or A to accept. This feature added 2 new tiles: One skull'n'crossbones with a black background located in 0D_B4C9_menuorbs.bin, and one plain black tile in bank_09_data.bin -- but $C1 really should be the black tile, if $FF is the normal background colour, right...? Eh.

New Thing - After Character 4 picks their battle command, a prompt shows up asking: Ready? Yes/No answers. Press B to return to Character 4's input. Press A on yes to continue the battle turn, or Press A on No to return to Character 4's input.

New Thing - Pause game with select! Screen darkens, music stops, sprites may flicker in standard maps... otherwise, seems to work fine. Music will resume after (triangle may take a while to kick back in if you paused on a long note.)

Fixed Thing - Instead of a second A button press stopping music in the sound test menu, it would play the healing jingle; now music stops properly.
Fixed Thing - Temple of Fiends and Sea Shrine song names were swapped in the sound test menu.
Fixed Thing - Victory music would persist in the overworld after battle and other such music not starting/not stopping nonsense. Fixed.
Fixed Thing - All Square 2 music tracks swapped to MMC5 Square 2, so that Square 2 for default music tracks is solely for SFX.
Fixed Thing - Exiting the armour equip screen was overwriting the King of Coneria's visibility flag somehow.
Fixed Thing - Weapon and Armour stats (critical hits, elemental weaknesses, etc) are updated for characters at the start of each battle
Fixed Thing? - Physical attack ailments *should* no longer be given to a character after they die.

Bug? - Square 2 holding high note when using healing items or spells in the menu - fixed? Maybe?
Bug - Listening to the old healing jingle in the sound test menu twice in a row produces a short high-pitched note. No idea how to fix. Not really important?

To Do - Find the King.
To Do - Go over enemy stat loading for physical and magical attacks and make sure everything's there.
To Do - Options cursor finickyness
To Do - Intelligence stuff! See below
To Do - Option to clear save data Done
To Do - Battle turn confirmation after 4th character picks command (have had so many oopsie moments here)
To Do - Have hidden icon be updated separately from the rest of the names/HP/ailments.
To Do - ChaosDeath routine tweaks for smaller battle screen (still)?
To Do - Sorting menu needs to be bigger, sprites need to move further to the right and less to the left, which will be undone by--
To Do - Swap characters on menu screen intead of select screen Done.
To Do - Delete old swap routines and make lots of space in Bank E. Done
To Do - Inventory/Weapons/Armour screens and mechanics re-write
To Do - Save overworld / map music in place when transitioning to battle, then return to playing from where it left off after battle. (May not be possible?)
To Do - Move enemy stats permanently from Bank C to Z, in order to add more; specifically, a stat that holds an "item" to be stolen from them. And then make sure all routines loading stats can reference them properly.

Someone else will need to work on some battle stuff for this, at some point. It's the math again. I just don't know what to do with it. I don't know how intelligence should work to do anything, or how the extra critical hit/effectivity thing for damage should work... Its all... just too much.  :-[ I don't like it, its not fun for me, and the game is fully playable without tweaking it... so whatever. If someone out there wants it--the files are free for editing! Pitch in!

Far as FF3 goes... I love the first third of it, and then get to that damn giant warzone city and remember why I always quit. The pacing just breaks there, for me. Seems like everything's a side-dungeon to grind out, when there wasn't that much grinding to do in getting off the floating continent. Assuming I can even get past the weird king bird enemy that you need dragoons for--but oops, there's no way to train dragoons while trapped in the city, is there? (Is there??)

FF3 Disassembly... I've been off and on about that idea. It seems like a big project. And which version would be best to do it with? One already patched with a translation? Looking it up, I just found out there's another translation, too, never played that one... but it has more hacky-ness done to it, so maybe not a good pick for a disassembly? Someone suggested making an MMC5 patch... Hmm...

Well, for now, I ignored this project for a while to come back with a clearer head. So I guess I'll continue again when I have time.
I know exactly what I'm doing. I just don't know what effect it's going to have.

I wrote some NES music! Its a legal ROM file. - I got a Ko-Fi page too.


I would say if you are going to do a full game disassembly, do it off an official version. (that would be Japanese)
Disassembling a hack seems to make less sense, because it would be easier to disassemble the differences later.
"My watch says 30 chickens" Google, 2018


I would personally do whatever English translation is most prominent.

Whether or not something is "official" is largely irrelevant, IMO.  I'd want to do something my target audience is most likely going to be interested in.  And if the disassembly is going to be in English, the English version makes way more sense.


I guess I'd look at which translation is the least edited. So not the one with the B to dash and other stuff.

FF1 stuff: Now that I've got a pretty much stable version up, I'm working on tearing apart the inventory. How's this look for an equip screen? (The . in "Left H." got squished over by accident.)

At the moment, the weapon/armour offset is basically getting hard-coded. It reads 6 bytes of character inventory data, the first byte is $00 so it goes, okay, add the weapon items offset. After that, it adds the armour one. Doing away with "high bit set = equipped" because no need for it. If it exists in the inventory, its equip-able (eventually; haven't gotten that far yet.) But what I want to do at some point is work out a better way to differentiate between weapon and armour in the same screen... So that someday dual-wielding is possible. Or go the whole Bravely Second route and let the fighter equip swords to the head and body too. (8-Bit Theatre Fighter would be proud.) Wild ideas.

But how's it look? Not sure what to do with the extra space around the top and to the right of the weapon and left hand...
I know exactly what I'm doing. I just don't know what effect it's going to have.

I wrote some NES music! Its a legal ROM file. - I got a Ko-Fi page too.


It looks pretty good so far.
Are you planning to expand the character limit on equipment names at all?
If so it might be better to arrange things differently; with the stats and equipment slots all in one large square and the stats by themselves on the top 2 lines.

Something like this:

| Attack   XXX   Defense  XXX |
| Accuracy XXX   Evasion  XXX |
|    Left Hand  [XXXXXXX@]    |
|    Right Hand [XXXXXXX@]    |
|                             |
|    Head       [XXXXXXX@]    |
|    Body       [XXXXXXX@]    |
|    Arms       [XXXXXXX@]    |
|    Accessory  [XXXXXXX@]    |


Ooh, I like that! Good suggestion :D

Gonna go with 32 weapon slots, 32 armour slots... because that's what fits nicely on one screen. Its still twice what you could hold before so... Seems fair. Getting the screens looking right is finicky, but easy. All the tiny details and mechanics are gonna get hard from here. Really not looking forward to scrolling lists in the shops and battle.

Removing Armour and Weapons from the main menu to just put "Equip" instead also allowed me to remove the "WEAPON" squishy tiles. I will need to re-arrange the tileset some more now, maybe. And add a trash can icon? Maybe not... Lazy...
I know exactly what I'm doing. I just don't know what effect it's going to have.

I wrote some NES music! Its a legal ROM file. - I got a Ko-Fi page too.


I wish there would've been as stocks when you have same items, weapons, etc. Like as:

"Weapon x3"
"Weapon x4"
"Weapon x5"

So therefore it can prevent from having the same items, weapons, etc taking over it's inventory.


Glad I could help! :D

As much as it may terrorize your dreams to make scrolling menus, if you do manage it (fingers crossed) it might be a good idea to apply that to the weapon and armor inventories.

One of the things I've always found that makes an RPG feel unpolished is when you can't have at least one of every piece of equipment. Partially it is the completionist in me, but it is also a bit of me playing dress up during the end game.

You see, once everyone's level is maxed out I like to 'dress up' my party in whatever equipment I feel best fits their personality.

So FF1 by default has 40 weapons and 40 armors. As long as RAM isn't an issue it would add a lot of polish to have a scrolling inventory. And having multiples of weapons would be rad.

At this point I'm imagining an inventory similar to FF6 with a single column with a multiplier.

And one last thought, how about rewriting the discard button into a discard action? Instead of it taking space on the screen/inventory have it mapped to select or A + B.


Its just a matter of having the shop window start and stop displaying things in the list, I figure...

I've been playing around with how the discard option works. Code is getting pretty big, I think I have to do it a different way. Haven't even gotten to being able to equip items from the list yet. Problem is, the cursor is the item number, but when there's a space--should there even be a space? Should the list delete spaces so you don't have to scroll, or should it let you move items around in the list--I haven't even thought of moving items, oh boy...

So, with the edits I made to magic, there is 256 bytes free. I was thinking that could double the gameflags. But it could also be for equipment. 64 unique weapons, 64 unique armours... and then 128 bytes for the amount of each one. Otherwise, the issue is that the edits I made to the music driver require a bunch of non-consecutive bytes somewhere in RAM. It can't be in the part that gets swapped for saving the game, because all that becomes unusable, and music that uses it would mess up--which is the Prelude's melody, now. So right now I have those bytes being stored just before character data and after item data. If I didn't use that spot, there would be 192 bytes for items.

I want to add a few consumable item types as well--hi-potion, ether, pheonix down, eyedrops, smokebombs, wake-up bell, so 6 bytes for those. That would leave 46 bytes for weapons and armour each, including amount. But then no more room for any more consumables or key items...

Just kinda thinking aloud here now.

I put the Discard option where it is because it fills out the screen nicely. I got it set up to turn the cursor red, then you select the item to delete, then it goes bonkers because there's a sudden 0 in the middle of the lists. So, it could totally be the select button to do that. Or put it up at the top of the screen like the old screens had it.

Personally, I like not being able to keep every single piece of equipment. Striking a balance between really tight item management and having more space than there is equipment to fill it is how I'd make a game; but as this project is a base for what other people want to do with it... I'll try my best to work out a way for your requests!
I know exactly what I'm doing. I just don't know what effect it's going to have.

I wrote some NES music! Its a legal ROM file. - I got a Ko-Fi page too.


That would be very much appreciated!
You do make a good point for inventory management. Maybe you could throw in a variable that could control inventory capacity? That way it could be an easy option for users.