News: 11 March 2016 - Forum Rules

Author Topic: Project: FF7 NES Upgrade  (Read 133020 times)

Dr. Mario

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: Project: FF7 NES Graphics Upgrade
« Reply #40 on: January 17, 2009, 08:35:04 pm »
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

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #41 on: January 18, 2009, 07:37:04 am »
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

  • Hero Member
  • *****
  • Posts: 1939
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #42 on: January 18, 2009, 11:14:11 am »
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!!
« Last Edit: January 22, 2009, 12:54:00 pm by Vanya »

Darkdata

  • Full Member
  • ***
  • Posts: 121
  • People who hurt others to feel better are idiots.
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #43 on: January 23, 2009, 12:55:57 pm »
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]

Vanya

  • Hero Member
  • *****
  • Posts: 1939
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #44 on: January 25, 2009, 12:23:36 am »
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. ^_^
« Last Edit: January 29, 2009, 10:48:50 am by Vanya »

Vanya

  • Hero Member
  • *****
  • Posts: 1939
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #45 on: February 19, 2009, 11:46:15 am »
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. ^_^

Nerd42

  • Full Member
  • ***
  • Posts: 244
    • View Profile
    • DJ Nerd42
Re: Project: FF7 NES Upgrade
« Reply #46 on: February 26, 2009, 10:40:03 am »
good luck :)

tummai

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Tummai Games
Re: Project: FF7 NES Upgrade
« Reply #47 on: February 26, 2009, 04:49:00 pm »
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.

Nerd42

  • Full Member
  • ***
  • Posts: 244
    • View Profile
    • DJ Nerd42
Re: Project: FF7 NES Upgrade
« Reply #48 on: February 26, 2009, 05:06:04 pm »
Dude that would ROCK ... then we could add more ff7 music ! :)

Lindblum

  • Sr. Member
  • ****
  • Posts: 445
  • Sometimes... Sometimes the diaper leaks.
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #49 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. 
Confidence is the feeling you have before you understand the situation.

Vanya

  • Hero Member
  • *****
  • Posts: 1939
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #50 on: February 27, 2009, 12:03:54 am »
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

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Tummai Games
Re: Project: FF7 NES Upgrade
« Reply #51 on: February 27, 2009, 08:23:27 am »
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

  • Sr. Member
  • ****
  • Posts: 445
  • Sometimes... Sometimes the diaper leaks.
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #52 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. 

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)
« Last Edit: February 27, 2009, 11:37:03 am by Lindblum »
Confidence is the feeling you have before you understand the situation.

KungFuFurby

  • Full Member
  • ***
  • Posts: 168
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #53 on: February 27, 2009, 11:27:10 am »
The max HP is 32767 or 65535 if you didn't account for the cheat code.  :o

Vanya

  • Hero Member
  • *****
  • Posts: 1939
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #54 on: February 27, 2009, 11:36:26 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

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Tummai Games
Re: Project: FF7 NES Upgrade
« Reply #55 on: February 27, 2009, 12:15:33 pm »
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

  • Sr. Member
  • ****
  • Posts: 445
  • Sometimes... Sometimes the diaper leaks.
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #56 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.  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. 
« Last Edit: February 27, 2009, 12:45:30 pm by Lindblum »
Confidence is the feeling you have before you understand the situation.

tummai

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Tummai Games
Re: Project: FF7 NES Upgrade
« Reply #57 on: February 27, 2009, 12:43:39 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

  • Sr. Member
  • ****
  • Posts: 445
  • Sometimes... Sometimes the diaper leaks.
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #58 on: February 27, 2009, 01:05:23 pm »
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

  • Hero Member
  • *****
  • Posts: 1939
    • View Profile
Re: Project: FF7 NES Upgrade
« Reply #59 on: February 27, 2009, 11:45:47 pm »
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.