News:

11 March 2016 - Forum Rules

Main Menu

Project: FF7 NES Upgrade

Started by Vanya, December 27, 2008, 10:58:55 PM

Previous topic - Next topic

Dr. Mario

I mean if someone else wants to step in and do some boss sprites, they totally should. I mean my main efforts are going towards my CV3 hack. I'm really only doing work for this when things aren't really moving in my main project. So if anyone else wants to jump in with some enemy sprites, feel free.
What is a man? Baby don't hurt me, don't hurt me, no more.

108 Stars

I´d really love to help out, but I m damn busy with Pier Solar-gfx atm...
How lonh do you think the gfx-upgrade will take anyway? I might be able to help in 2 months or so, if it is not finished by then....

Vanya

#42
Right now I'm gathering resources and accepting work, but I don't plan on inserting the new media until Lindblum finishes his translation.

Edit
Update on front page!!

Darkdata

If someone can figure out how the tile data is stored for tiles I would be glad to have it.

I can't seem to find it no matter what order I search in. Unless I missed something completely obvious. [more than likely]
Jul

Vanya

#44
Updated added to first post.

Darkdata. You might be interested in the new tile resource section. ^_^

I'll be posting more screen shots there in the future. ^_^

EDIT:Another new member added! Check first post. ^_^

Vanya

Things are slow right now, but this project won't die. I actually got to work for a week on an IT job as a subcontractor, but now it's back to being unemployed. ^_^


tummai

I just got finished reverse engineering the sound engine for The Guardian Legend, so I may have the skills now to reverse engineer the sound engine for this game.  I can give it a shot if you'd like.


Lindblum

tummai,
I can give you the research I've done on it so far.  I can change notes and keys, but beyond that it's got me quite confused.  Tonight I'll look for my Excel file where I tried to break apart and figure out the boss battle song (it also plays when you fight the soldiers at the beginning).  I'll root for your success. 
Confidence is the feeling you have before you understand the situation.

Vanya

That would be awesome, tummai! Please feel free to try. ^_^

And, a quick question. Have you ever tried messing with MM5's music engine?

tummai

Quote from: Lindblum on February 26, 2009, 05:38:32 PM
tummai,
I can give you the research I've done on it so far.  I can change notes and keys, but beyond that it's got me quite confused.  Tonight I'll look for my Excel file where I tried to break apart and figure out the boss battle song (it also plays when you fight the soldiers at the beginning).  I'll root for your success. 

Cool.  Send it my way.  I'm sure it will save me a lot of time.  Going in knowing where the songs are stored and what some of the music engine RAM does is much better than going in knowing nothing.  :)

Quote from: Vanya
That would be awesome, tummai! Please feel free to try. ^_^

And, a quick question. Have you ever tried messing with MM5's music engine?

No I haven't yet.  The Guardian Legend sound engine stuff that I've been working on for the past week or two is actually my first foray into ROM-hacking.  I have a little NES homebrew project that I want to start soon, but I didn't know what the hell I was doing as far as music/APU stuff, so I just put my face into the grindstone (with the help of blargg's handy APU reference document) to see if I could figure it out.  It worked.  I understand NES sound a lot better than I did two weeks ago. :)

I actually found your MM Powered Down thread the other day and downloaded the MM5 and MM1 ROMs, anticipating offering to help there.  So they are sitting on my hard drive waiting to be looked at.  It just happened that this FF7 thread came up with a new message first, so I posted in here.  I'm interested in taking a crack at both though.

Lindblum

#52
tummai,
If you want to give it a try this weekend take a look at this.  I've slacked off this research for almost 2 months, so it's good someone's interested. 

FF7NES-Boss Music.xls
Each line in this file is a chronology of what bytes are loaded from PRG-ROM to play the song, and a there's a guide for identifying notes from byte values, before or after bit truncation (AND #$3F if I recall).  I don't remember what breakpoints I used, but if you know how to use the debugger you can figure it out. 

Watch the following values in FCEUX while the game runs and play with them.  These are a good starting point if you want to study the engine.

RAM Byte Adresses:
$C7-$C8   Dynamic Note Pointer
$6E54   Square1 (??-3F)
$6E55   Square2 (??-3F)
$6E56   Triangle(?) (??-3F)
$6E57   Noise(?) (??-3F)
$6EAC   Pitch shift
RAM Command Adresses:
$A341   Push note
$A342   Pitch shift
$A345   Truncate to 00-3F
$A347   Set note
$A352   Set note

ROM(RAM) Byte Adresses:
0x1C242-0x1C2B2($C232-$C2A2)   Boss Music Square1 (113B)
0x1C2CD-0x1C339($C2BD-$C329)   Boss Music Square2 (109B)
0x1C34C-0x1C3A9($C33C-$C399)   Boss Music Triangle(?) (94B)
0x1C3BB-0x1C36E($C3AB-$C45E)   Boss Music Noise(?) (180B)
*Don't forget the soldiers at the beginning count as bosses.

The RAM addresses (in parentheses) are the ones you'll see in the xls (where I used 0x instead of $ for Excel formatting reasons). 

I'd like to understand how the headers are set up, and what the control bytes do. 

Tip of the day: Use a cheat to set $6F62 to 00 so Bosses stay under 256HP.  (KFF, to clarify, this zeroes the high byte)
Confidence is the feeling you have before you understand the situation.

KungFuFurby

The max HP is 32767 or 65535 if you didn't account for the cheat code.  :o

Vanya

Quote from: tummai on February 27, 2009, 08:23:27 AM
Quote from: Vanya
That would be awesome, tummai! Please feel free to try. ^_^

And, a quick question. Have you ever tried messing with MM5's music engine?

No I haven't yet.  The Guardian Legend sound engine stuff that I've been working on for the past week or two is actually my first foray into ROM-hacking.  I have a little NES homebrew project that I want to start soon, but I didn't know what the hell I was doing as far as music/APU stuff, so I just put my face into the grindstone (with the help of blargg's handy APU reference document) to see if I could figure it out.  It worked.  I understand NES sound a lot better than I did two weeks ago. :)

I actually found your MM Powered Down thread the other day and downloaded the MM5 and MM1 ROMs, anticipating offering to help there.  So they are sitting on my hard drive waiting to be looked at.  It just happened that this FF7 thread came up with a new message first, so I posted in here.  I'm interested in taking a crack at both though.

Excellent! I look forward to working with you on both projects! If you need any assistance please feel free to ask. As project director I'll be glad to support any of our members as best I can with research etc. ^_^

Just a heads up for everyone. I'll be making an update next week with lots of new resource files and an updated team roster!

tummai

Quote from: Lindblum on February 27, 2009, 09:57:23 AM
tummai,
If you want to give it a try this weekend take a look at this.  I've slacked off this research for almost 2 months, so it's good someone's interested. 


ROM(RAM) Byte Adresses:
0x1C242-0x1C2B2($C232-$C2A2)   Boss Music Square1 (113B)
0x1C2CD-0x1C339($C2BD-$C329)   Boss Music Square2 (109B)
0x1C34C-0x1C3A9($C33C-$C399)   Boss Music Triangle(?) (94B)
0x1C3BB-0x1C36E($C3AB-$C45E)   Boss Music Noise(?) (180B)
*Don't forget the soldiers at the beginning count as bosses.

The RAM addresses (in parentheses) are the ones you'll see in the xls (where I used 0x instead of $ for Excel formatting reasons). 

I'd like to understand how the headers are set up, and what the control bytes do. 

Thanks a lot!  Actually I do most of my work on the weekdays.  Oddly enough my job allows more free time than home life does (infant at home).  At least right now it does. 

I took a quick peek though and I figured out a few details about the song format:

1) Any value #$C0 and above is an opcode.  Each opcode takes one or more operands (looks like most take 1, but #$DB for example takes 4). I don't quite know what all of these do yet, (I will soon though!) but it is clear that #$C9 is a rest. (your red question marks in the xls file).  And #$D0 appears to be the repeat opcode (notice it occurs at the end of each channel).  Also, that last string of bytes after the #$D0 on the triangle channel is likely your percussion.  The Guardian Legend does this same kind of thing (encoding the percussion into one of the other channels).  I think the reason this is done is because the percussion is very simple and often overwritten (by SFX that use the noise channel).

2) I think values less than #$40 will be your Note Length indicators.  The song first uses #$06, plays a long string of notes, then uses $0C (twice the value of# $06) and that note in the song is twice as long.  Then it goes back to #$06.  When it gets to the fast part near the end of the song, we find a #$04.  Actually, I'm not 100% sure that #$40 is the upper limit, since you list tone values down to #$0D.  I am just guessing from how the code branches.  This will become more clear as I go through the engine more.

3) Values between #$40 and #$C0 are probably note values.

Another thing I noticed is that the ROM has a LOT of #$00s.  How lucky :).  I think it will be possible to use this space for music if we need to.

Lindblum

#56
I'm glad you were able to understand my file and give us this info so quickly!  I believe i we figure out how songs are indexed and how they're called, we can figure out how to add a few new songs from FF7 and FF7AC (I don't think Anxious Heart or Yakusoku no Chi would digitize very well).  It's quite clear they put the minimal effort in this soundtrack.  If we change battle songs I'd like to make them faster to distract you from the tortoise-like gameplay (which I wish I could figure out how to accelerate). 

Hey, do you know how to rip/insert an NSF for this?  Would that make it easier to work on?  I only have failed experiences in music hacking. 
Confidence is the feeling you have before you understand the situation.

tummai

Quote from: Lindblum on February 27, 2009, 12:35:00 PM
I'm glad you were able to understand my file and give us this info so quickly!  I believe i we figure out how songs are indexed and how they're called, we can figure out how to add a few new songs from FF7 and FF7AC (I don't think Anxious Heart or Yakusoku no Chi would digitize very well).  It's quite clear they put the minimal effort in this soundtrack. 

Hey, do you know how to rip/insert an NSF for this?  Would that make it easier to work on?  I only have failed experiences in music hacking. 

I've never tried to insert an NSF into a ROM, but my guess is that it isn't possible.  Pretty much every NES game has its own unique sound engine (minus the case of a company reusing code for several of its own games), with its own file formats for the music.  NSFs, if I understand them correctly, actually have the sound engine built in.  If they are ripped directly from a game, they will have that game's sound engine stored in the file with them.  If they are produced using a tracker like Famitracker, they will have that tracker's sound engine.  (If I'm dead wrong on this, someone please correct me).

So what we'll have to do is figure out this NES FF7 music format, then convert whatever music we want to use from an NSF or MIDI or whatever into the FF7 NES music format.

I'm new at this though, so I might be wrong.

Lindblum

I think if we have the MIDIs (they're easy to find), we can look at the tracks in something like Anvil Studio, and transcribe the notes by hand.  The songs aren't THAT long.  If you find out how to call a song, then it might be worth adding the Chocobo theme, and I'd insert the code to call it when mounting a chocobo, and to call the default music when dismounting.  Another thing I should've done is document every song in the game (they don't use as many as should), find their approximate address ranges, and have an ordered list of tracks, which will become useful for figuring out how to call songs by index. 
Figuring out notes, loops and timing is all great, but it's useless if we don't know what's going to be enough to add additional tracks, even if it's a small "Hello World" ditty. 

Here are some savestates to help jump around the game.  I play 3 identical ROMs so I can use more states. 
Confidence is the feeling you have before you understand the situation.

Vanya

I was wondering about adding more songs. In the end I don't think we'll have all the songs since the FF7's soundtrack is very long indeed. However if only a few songs make it in the hack will immediately be pure pwnage. ^_^

And, I believe you have the right idea about how nsf's work there, tummai.