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

Author Topic: FF1 MMC5 Disassembly Updates  (Read 64978 times)

Vanya

  • Hero Member
  • *****
  • Posts: 1487
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #180 on: April 12, 2019, 05:55:35 am »
Love it!

The only thing I can nit pick so far is that the Items box could probably be one tile wider just to make it look a smidge cleaner.
Everything seems to be drawing and un-drawing correctly, too.

I prefer a different arrangement for the commands, but I already figured out how to change those myself for my personal use.

This is my arrangement if anyone is curious:
Spoiler:
Code: [Select]
Column 1:
   Fight
   Skill
   Magic
   Items

Column 2:
   Guard
   Hide
   Flee
   Gear

Oh! One thing I noticed is that the Guard command draws the shield icon immediately instead of waiting until the character's actual turn to come up. Is it applying the improved defense immediately, too?


PS-
Finally heard your new Marsh Cave song!
Love it! It fits right in with the rest of the music in the game.
I can totally imagine it also working well as the BGM for the ruined castle, too.

Are you planning to add any more songs?
I've always felt this game could use more music than just the extra battle themes they added into the remakes.
« Last Edit: April 12, 2019, 06:52:06 am by Vanya »

Jiggers

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #181 on: April 12, 2019, 02:53:53 pm »
Ah, yeah, the item box doesn't undraw the command box, so there's the command box border behind it now...

I prefer a different arrangement for the commands, but I already figured out how to change those myself for my personal use.

Woo! That's the point of this; to make it easier for people to do the changes they want to see!

The guard command was tricksy. It needs to take effect at the start of the turn, but there's nothing already set up for applying effects before enemies get a chance to act, so I triggered it to happen basically once you choose the option. But then it has to undo itself if you go back, otherwise you just set up a defensive boost while doing something else!

It uses the battlestate stat--same as hiding, but its $80 instead of $10. Which meant the code for showing an icon was already set up, so I figured why not--then I had the icons update immediately after each command input, because they weren't updating at the start of the turn for some reason. So if you had two characters guarding, neither one would have a shield icon show up until someone else took an action. *shrug*

So the way it works is, when an enemy does a physical attack, it loads the player's stats into the defender stats at $6030. While its doing that, is when it applies the defensive buff. That way its not directly editing the defense stat, the way Fog does, so it doesn't persist between turns.

Also, how do you feel about having it be renamed to "Def." and squishing the command box a tile to the left again?

Finally heard your new Marsh Cave song!
Love it! It fits right in with the rest of the music in the game.

Thanks! I actually wrote a bunch of new songs for the hack I was doing before, but I don't think any of them fit in FF1. And FF1's music is mostly good. The only songs I don't like besides the old cave song are the airship and floating castle. And that's just more a personal "eh, the melodies aren't that great to me" thing than an "ouch my ears are crying" thing. I still need to finish up work on that Fiend battle song I was doing and put it in... I really didn't like the remakes' new music, so I have no desire to try to put it in here or ask the person who put it in their hack. But if someone else wants to reach out to them for the score I can set it up as a branch in github?
« Last Edit: April 12, 2019, 03:12:57 pm by Jiggers »
I know exactly what I'm doing. I just don't know what effect it's going to have.

Vanya

  • Hero Member
  • *****
  • Posts: 1487
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #182 on: April 12, 2019, 05:06:46 pm »
Ah, yeah, the item box doesn't undraw the command box, so there's the command box border behind it now...

Also, how do you feel about having it be renamed to "Def." and squishing the command box a tile to the left again?

Hmmm... nah. I'd like it better if the item box was wider than the command box be squished.
Ultimately, I'm going to want to have the command box have 2 pages.
I feel that having the extra space for longer command names is worth the extra effort.

And speaking of longer names, I was wondering if something could be done for the class names?
Unless I'm mistaken, it would just require rearranging the character creation and status screens as the class names don't currently appear anywhere else.


Quote
Woo! That's the point of this; to make it easier for people to do the changes they want to see!

Groovy! There are a ton of text changes in my future by way of re-translating many of the enemy, equipment, spell and item names. :D


Quote
The guard command was tricksy. It needs to take effect at the start of the turn, but there's nothing already set up for applying effects before enemies get a chance to act, so I triggered it to happen basically once you choose the option. But then it has to undo itself if you go back, otherwise you just set up a defensive boost while doing something else!

It uses the battlestate stat--same as hiding, but its $80 instead of $10. Which meant the code for showing an icon was already set up, so I figured why not--then I had the icons update immediately after each command input, because they weren't updating at the start of the turn for some reason. So if you had two characters guarding, neither one would have a shield icon show up until someone else took an action. *shrug*

So the way it works is, when an enemy does a physical attack, it loads the player's stats into the defender stats at $6030. While its doing that, is when it applies the defensive buff. That way its not directly editing the defense stat, the way Fog does, so it doesn't persist between turns.

I like it! It's kinda like what is called in Pathfinder RPG a "swift action".


Quote
Thanks! I actually wrote a bunch of new songs for the hack I was doing before, but I don't think any of them fit in FF1. And FF1's music is mostly good. The only songs I don't like besides the old cave song are the airship and floating castle. And that's just more a personal "eh, the melodies aren't that great to me" thing than an "ouch my ears are crying" thing. I still need to finish up work on that Fiend battle song I was doing and put it in... I really didn't like the remakes' new music, so I have no desire to try to put it in here or ask the person who put it in their hack. But if someone else wants to reach out to them for the score I can set it up as a branch in github?

With all due respect to the person that did those down-mixes (something I could never do without excessive effort and time), I don't really like the 8-bit versions of those songs. They sound a bit too noisy to me, if that makes any sense.

Truthfully, I'm not super in love with most of the new battle music in the remakes.
I think that any new battle music added to the game should be different and bad ass like the battle songs from the other games.

Of the new music in the remakes, the ones that I think would be worth while to receive new 8-bit arrangements are:
"Opening Demo",
"Church" (I'd use this for the Elfheim town theme),
"Ruined Castle" (but only as a basis for a new creepy song for the Earth Cave, just take the castle theme out of it and replace it with something new),
"Deep Place" (as the basis for a new song for the Sea Shrine, right now it's just has a copy of Chaos' Temple with a different tone),
and "Inside a Boss Battle" (this is the one battle song I feel stands on it's own, it would make a good theme for non-fiend bosses; I still want the old dungeon theme for mini-boss battles).

Actually, how can I change the battle music?

PS-
I have always liked the Floating Castle theme, I just think it could use some reverb.

Mari42

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #183 on: April 12, 2019, 06:25:46 pm »
Has anyone still noticing the "X-Heal P5" bug that appears in some sort?  :-\

Jiggers

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #184 on: April 12, 2019, 08:11:25 pm »
Has anyone still noticing the "X-Heal P5" bug that appears in some sort?  :-\

Is that in a shop, in the item menu, or in battle?

And speaking of longer names, I was wondering if something could be done for the class names?
Unless I'm mistaken, it would just require rearranging the character creation and status screens as the class names don't currently appear anywhere else.

Also the equipment screen, just 'cos. But yeah, all you need to do to make them longer is add more bytes to their name in Bank A. Bank E's got the lut_PtyGenBuf where you can re-arrange the boxes and where sprites and names and the class name show up. I set it so Thief and Ninja are centered in the new game screen but I can take that code out if it mucks things up. Or you can, its at PtyGen_DrawOneText. From the CMP #01 to the INC dest_x, just take that out.

Actually, how can I change the battle music?

PS-
I have always liked the Floating Castle theme, I just think it could use some reverb.

I love the Ruined Castle theme. Exactly my kinda music.

So for music stuff, Bank D, if you want to change the notes themselves. If you mean have a different song play during battle... Bank B, PrepBattleVarsAndEnterBattle--its track $50 (they start at $41 for the Prelude).

Mini tutorial time!

Spoiler:
In Bank B, find this:
.WORD SKYCASTLE_SQ1
.WORD BLANK
.WORD SKYCASTLE_TRI
.WORD BLANK
.WORD SKYCASTLE_SQ2

and change it to this:

.WORD SKYCASTLE_SQ1 
.WORD SKYCASTLE_SQ2
.WORD SKYCASTLE_TRI
.WORD SKYCASTLE_SQ3 ; MMC5 square channels
.WORD SKYCASTLE_SQ4

Do a search for "SKYCASTLE_SQ2:" to find where the actual note data is stored, and make two new labels for SQ3 and SQ4 nearby.

Put the following beneath SKYCASTLE_SQ3:
.byte $F4, $C#, $D0
.word SKYCASTLE_SQ1

And beneath SKYCASTLE_SQ4:
.byte $F4, $C#, $D0
.word SKYCASTLE_SQ2

Now, Sky Castle uses the $FD tempo, so you can check lut_NoteLengths to see how long you want the $C# byte to be--3, or 4 would be something to try. So you'd change $C# to $C3 for example.

And then, go into a town or castle or dungeon, and press B+Select to enter the sound test menu, scroll to the Sky Castle music, and listen. It's echo, not reverb, but... $C4 sounds pretty close to a reverb. $C5 might be too short a delay to really tell. $C2 is too long a delay and it stops sounding nice.

$F4 triggers halving the channel's volume ($F4 again to turn it back up) and $C# will rest for a bit before playing any notes. $D0 loops to the .word following it, so it basically copies the already existing music on a delay.
I know exactly what I'm doing. I just don't know what effect it's going to have.

Mari42

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #185 on: April 12, 2019, 08:34:44 pm »
Is that in a shop, in the item menu, or in battle?

Item menu

Jiggers

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #186 on: April 12, 2019, 09:44:01 pm »
Do you remember what you were doing before you saw it? Using any items or anything?

Right now there should be no way to get X-Heals in your inventory without adding them into your save file or editing RAM directly while playing. P5 is the text that displays when you have $FF amount. 99 is the cap, so you could change $5C22 to $63 to max them out if that's what you want.

If you started out with 0 X-heals and somehow got a bunch of them after using a different item, that's a different matter...



Trying to do a few updates... LIFE and LIFE 2 should now work in battle. SOFT works, but displays "Ineffective" after displaying "Cured!" so I don't know what's up with that.

All consumable items now play the Heal SFX in the menu.

The Wakeup Bell has its own SFX in battle--but man is battle SFX wonky as heck. I guess they never used it enough to find out its broken if you try to have more than 1 block of square 2 data. I was trying to have it play different notes--a ding and then a dong, but like... 4 of each. Except it only parses 2 blocks, so 2 different notes. So now it just goes tinkly-tinkly-riiiiing, which I guess works fine and doesn't overstay its welcome anyway.

Still don't know what to do about targeting in battle. I'll update github when I'm done the rest though.
I know exactly what I'm doing. I just don't know what effect it's going to have.

Mari42

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #187 on: April 12, 2019, 09:52:11 pm »
Do you remember what you were doing before you saw it? Using any items or anything?

Right now there should be no way to get X-Heals in your inventory without adding them into your save file or editing RAM directly while playing. P5 is the text that displays when you have $FF amount. 99 is the cap, so you could change $5C22 to $63 to max them out if that's what you want.

If you started out with 0 X-heals and somehow got a bunch of them after using a different item, that's a different matter...

I only got it right AFTER the battle. So, that's what I saw that it was still there.

Vanya

  • Hero Member
  • *****
  • Posts: 1487
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #188 on: April 13, 2019, 03:03:44 am »
Something's not right cause buying spells in the magic shops got borked.
It's asking for a wierd string as a price and not deducting anything from my gold.
And it gives me the spell anyway for free.

EDIT:
I was messing around with rearranging the Party Generator screen and I noticed something.
I added some Default names so I could see their positions without having to input anything.
However, when I did press the A button to enter the naming screen, the default name was already erased.
Doesn't do much good to have default names if they get erased.

Anyway this is what I came up with to allow up to 11-letter jobs:
(These are in-game, not mock-ups.)









« Last Edit: April 14, 2019, 12:20:08 am by Vanya »

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6885
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #189 on: April 13, 2019, 11:46:00 am »
Are you images private or something? Because I'm only seeing large minus signs for your images.
"My watch says 30 chickens" Google, 2018

Jiggers

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #190 on: April 13, 2019, 02:31:39 pm »
I only got it right AFTER the battle. So, that's what I saw that it was still there.

Did you use any items in that battle? Like a heal? >.> 'Cos... I had the X-heal and Heal swapped, so using a heal would decrease the X-heal amount... which would explain it... XD

Something's not right cause buying spells in the magic shops got borked.
It's asking for a wierd string as a price and not deducting anything from my gold.
And it gives me the spell anyway for free.

EDIT:
I was messing around with rearranging the Party Generator screen and I noticed something.
I added some Default names so I could see their positions without having to input anything.
However, when I did press the A button to enter the naming screen, the default name was already erased.
Doesn't do much good to have default names if they get erased.

Yeah, I'm only getting the grey minus signs too.

What town is the magic messing up in? Everything's been normal for me as far as Elfland, except I ran into not being able to afford magic despite having more than enough money. I had EnterShop clear the shop_curprice variables (that share space with some battle variables now) and that fixed it, but the prices looked normal...

For the names being blank: Look for "DoNameInput":
Code: [Select]
LDX char_index          ; wipe this character's name
    LDA #$FF
    STA ptygen_name, X
    STA ptygen_name+1, X
    STA ptygen_name+2, X
    STA ptygen_name+3, X
    STA ptygen_name+4, X
    STA ptygen_name+5, X
    STA ptygen_name+6, X

I might have put that in because it was easier than filling in 00s after a name was put in but start was pressed to finish it.

Actually... I wonder how names would act if they were null-terminated early... Edit: Okay in menus (good actually), bad in battle. Very bad in battle.

Today's to-do list:
* fix poison messaging drawing
* fix life/soft messaging

* maybe find that targeting bug
* re-write how battle displays names
* make sure you can't press start at character generation without at least 1 non-$FF, non-$00 character in the name...
* get past the marsh cave without the game breaking

* figure out why when a character has over 256 HP, getting hit sets them to 1 HP
« Last Edit: April 13, 2019, 08:03:12 pm by Jiggers »
I know exactly what I'm doing. I just don't know what effect it's going to have.

Disch

  • Hero Member
  • *****
  • Posts: 2716
  • NES Junkie
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #191 on: April 13, 2019, 03:59:45 pm »
Okay so I got the 9 small formation totally working as far as I can tell.  I'm going to start the 4 large formation next, which should be pretty easy now that I have the structure.

I also merged the latest master into my branch and noticed a few bugs:

1)  I think you might already know this, but targetting doesn't work -- it seems to just target a random enemy no matter which on you pick.
2)  Player sprites are .... wrong?  If you start a new party and try to change classes, the class DOES seem to change, but the graphic doesn't change.  This persists into the game:  I have a team of 4 fighters and in game it LOOKS like I have FT/TH/BB/RM, even though they all have stats of fighters.



EDIT:

Wait... is that #2 bug intentional?  Like up/down changes the graphic, but right/left changes the class.
« Last Edit: April 13, 2019, 04:46:13 pm by Disch »

Jiggers

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #192 on: April 13, 2019, 04:55:35 pm »
Yes it is! In case someone wants to make a hack with characters or something. Or just... no reason, but because I could do it? XD

I wonder if the targeting bug is there if you turn off auto-target in the options menu...
I know exactly what I'm doing. I just don't know what effect it's going to have.

Disch

  • Hero Member
  • *****
  • Posts: 2716
  • NES Junkie
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #193 on: April 13, 2019, 05:36:07 pm »
Some more bugs:

1)  Looks like during battle box drawing, sometimes you're waiting for a frame but NOT calling MusicPlay.  Which results in the music ever-so-slightly slowing down while those boxes are being drawn/undrawn.

2)  Game hangs after you win a battle??????  I have a FCEUX (v2.2.2) savestate which reproduces the bug:
https://www.dropbox.com/s/1ua66d1slgzg6pd/FinalFantasy.fc1?dl=0

(walk directly right after loading the state, and just hold A to win the fight, then CRASH)



EDIT:

4 large formation is rendering properly!





EDIT 2:

For the "mix" formation, following the pattern puts enemies pretty close to the party.

Ignoring that the palettes are all screwed up... which of the below would you prefer?

or



The one on the left followed the "tiered" pattern a bit better.  But the one on the right doesn't get SO close to the top hero (note:  when the hero is swinging his weapon or casting a spell, it bumps RIGHT AGAINST that enemy)


Ideally I could just move ALL the small enemies one tile to the left to get the best of both worlds, but that won't work because then one of the small enemies shares an attribute block with one of the large ones.

So yeah... which one do you like more?
« Last Edit: April 13, 2019, 06:31:57 pm by Disch »

Jiggers

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #194 on: April 13, 2019, 07:53:34 pm »
I can move the characters back a bit more as well, two tiles if need be, and have the ailments stack up behind them instead of in one row... But I like the second one, giving them more room. Since I have magic animating a tiny bit, more room is always better. Have I mentioned how glad I am you're doing this?

I'm not sure what to do about the music not playing while things are drawing... I don't think I did any changes to the actual screen-drawing routines, so it might be likely the original game had that too? Hopefully I'll remember to get around to checking it out when I finish up the other bugs!

As for the crash... I'm stumped. I did some changes to the end of battle stuff, but that doesn't even get that far. I tracked it down to GiveRewardToParty in Bank B, at least. Which is definitely not something I've touched. It gets to MultiByteCmp, then...

Code: [Select]
      PHP                     ; if not equal...
      PLA
      AND #$81                ; clear all flags except N,C.  Presumably this is to clear Z
      PHA                     ;  strangely, this also clears I!  nuts!  Why it preserves N is
      PLP                     ;  is a mystery, as its result here is not reliable.
      RTS                     ; and exit

The RTS goes straight to the forever loop. *shrug* Doesn't happen on Mesen, though...

Update: I FIXED THE TARGETING BUG. It was... super easy actually... After selecting an enemy, I didn't notice that the target was being put in Y and kept through all the RTSing until it set the command. So it was being thrown away through all the roster box undrawing/command box re-drawing... It still is, but instead of loading it before the RTS stuff, I just have it load into Y after the drawing. What a silly bug.
« Last Edit: April 13, 2019, 08:27:17 pm by Jiggers »
I know exactly what I'm doing. I just don't know what effect it's going to have.

Disch

  • Hero Member
  • *****
  • Posts: 2716
  • NES Junkie
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #195 on: April 13, 2019, 08:26:53 pm »
Ugh... I might have sent you on a wild goose chase with that crashing bug.  It's likely just a corrupted savestate.  Sorry.   :banghead:


EDIT:

Okay mixed formations seem to be working, so everything should be done as far as enemy placement goes.  Changes are all pushed to the 'enemyplacement' branch.  IMO, it's ready to be merged into master.

Do you know how to merge it?  Or do you want me to?  (I didn't want to touch master without you knowing since you seem to be working off of it directly)
« Last Edit: April 13, 2019, 09:14:06 pm by Disch »

Jiggers

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #196 on: April 13, 2019, 10:09:13 pm »
Hah, no worries. At least I got to figure out how to use FCEUX's debugger!

So, I've been poking around this GitHub Desktop program trying to figure out how to even download your changes and... I'm lost. Frankly I'm not even sure I know how to download the master branch after I send a change through. But I'm done for tonight, just pushed one more change to make physical attacks wake up players (and enemies), so... Go ahead and squish it all together if you can! :D
I know exactly what I'm doing. I just don't know what effect it's going to have.

Disch

  • Hero Member
  • *****
  • Posts: 2716
  • NES Junkie
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #197 on: April 13, 2019, 10:19:36 pm »
Okay.  I've merged my changes into the latest master.  If you do a "pull" you should get them.  I wish I could help you more with the GitHub Desktop program but I've never used that client before.

Vanya

  • Hero Member
  • *****
  • Posts: 1487
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #198 on: April 14, 2019, 12:36:12 am »
Are the images visible now?


What town is the magic messing up in?

Cornelia. Never mind, it doesn't happen in the current master anymore.


Fantastic work, Disch! Can't wait to see these in action.

About the player character positions, I think having the status icons in a column instead of in a row so they can be pushed back a bit would be a good idea.

And last thing before I get to testing. Should I start a branch too for all the tinkering I'm doing?
Also, can specific files be merged into the master or does it always have to be the whole thing?


EDIT:
Just noticed this. When I talk to an NPC their sprite disappears behind the background layer.
It just makes them disappear entirely unless the background tile uses black.
In those cases they just look like they are behind the background.
« Last Edit: April 14, 2019, 01:59:00 am by Vanya »

Jiggers

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: FF1 MMC5 Disassembly Updates
« Reply #199 on: April 14, 2019, 01:35:46 am »
Yeah, probably best to keep things separate--I break enough stuff on my own! XD

I really like what I see so far! Haven't gotten into battles that press the small enemies up closest yet. When I do, I'll see about moving the players back. That HP bug is driving me crazy right now, and there's still some more things I want to tweak... and then I think I might take a break for a while. Maaaybe. This is kind of addicting.



EDIT:
Just noticed this. When I talk to an NPC their sprite disappears behind the background layer.
It just makes them disappear entirely unless the background tile uses black.
In those cases they just look like they are behind the background.

Somehow a change I made got undone after I undid the change. I had one of those "what if" moments and thought if I changed a number, I could get rid of sprites covering up the bottom of dialogue boxes. Ended up just not showing them a tile lower at all. I undid it, but must have uploaded it too late and it got back into the github version? Anyway, fixed that!

AND I found out why the high byte of HP was getting turned to 0... because uh... I didn't understand why the mathbuf high bytes had to be zeroed and just... zeroed all the high bytes... even though that's where defender HP is kept...  :P

Oh! And I can see the first two images now. That works alright!

Thanks again for all your efforts lately, all of you!
« Last Edit: April 14, 2019, 02:57:36 am by Jiggers »
I know exactly what I'm doing. I just don't know what effect it's going to have.