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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tummai

Pages: 1 2 [3]
41
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 03, 2009, 06:11:21 pm »
Found more info. 
All songs start with "FF 00 __ __ 01 __ __ 02 __ __ 03 __ __ FF"
00-03 seem to be channel indexes, and the 2 bytes after them are the bigendian addresses of those channel streams relative to the song's root address.  That's super important. 
After the song header comes the header of the first channel, which is a series of opcodes and values that I hope tummai can figure out (I'm pretty sure "D8 __" sets the pitch shift).  Then there's the actual melody block (notes, note lengths and rests), followed by the D0 repeat byte. 

This is already in my notes.  :)

Quote
The bad news is, I calculate we only have enough room for about 3 or 4 more songs (about 400-500 bytes each).  I'm all for destroying a few present songs to fit in better ones, even if they're truncated versions. 

It may be possible to introduce a new opcode to place in the channel headers (or even just the first channel header) that can indicate a bank and an address, and then we can write some code for that opcode that will:

1)dynamically write some copy code to RAM (so that it can be executed after we've bankswitched away from the sound engine bank)
2)switch banks to the bank specified in the opcode
3)go to the address specified in the opcode and copy the song data to RAM
4)switch back to the sound engine and reroute pointers to the song data in RAM.

If we can pull something like this off, then we can scatter songs all across the ROM in any open space we find.

This will require:

1) enough RAM to hold the data for one song at a time.
2) enough RAM to hold the song-copying code (which should be quite short). 
3) enough ROM space in the sound engine bank to hold the new opcode code (shouldn't be a problem)

If we don't have the RAM, we'll have to find another solution.  But we might have it!  Is the RAM in $7000-7999 used by the game at all?

42
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 02, 2009, 08:48:35 am »
I've noticed $6E00-$6E01 happens to store the address of the current song.  This address is loaded from $C7-$C8 (dynamic music pointer).  Set an execution breakpoint at $9DAD to watch this pointer get set when the song changes.  Yadda yadda yadda, the song pointers are stored at 0x1B8B2:
   MusicPtrLo = $B8A1 + 2*Index
   MusicPtrHi = $B8A2 + 2*Index
It looks like there are 12 repetitive pointers for Rebel Army at the end of this array, so I bet we could turn those into pointers to new songs :laugh:

At 0x6156($E146-$E1EB) is a list of song indices.  Each index represents a location, and its value is the song to be loaded.  For example:
   $E146==05   World Map is FF2 Rebel Army
   $E170==03   Kalm is FF2 Town
   ...Don't bother figuring out the rest, I have most of that done already.
You can set an execution breakpoint at $E12B to see where a song Index is loaded from.

Cool.  That matches my notes, except for the $E146 part which I hadn't gotten to yet.

As a test, I copied one of the songs into some free space at 0x1DBA0 (in the same bank as the loading routines), thus creating a 9th song.  I made a pointer to it at the end of the $B8A1 table (the first repeat of the Rebel Army pointer) and then changed all of the bytes in the E146 table to 09 (the new 9th pointer) and guess what, it worked!  Looks like this will be possible :)

The only snag is that some songs are hard-coded (ie, their song number is loaded directly into A and not pulled from the 0x6156/$E146 table), so we will have to find all of these instances and hard-code the song we want.  The title-screen for example is a hard-coded load at 0x071719 (execution breakpoint $9709).  The introduction soldier "boss" battle is hard-coded too at 0x23FDF (execution breakpoint BFCF).

Still, it looks like you nailed it.  If we can decode the song format, we can add our own songs in.  Cool deal.

43
Newcomer's Board / Re: Introduction Topic
« on: March 02, 2009, 06:41:23 am »
Hi there

Glad to see you found the place Dastari :)  That set of links that Killa B posted is where you should start.

44
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 02, 2009, 02:05:50 am »
Yes, those are the ones I found.  When you were playing the game, you didn't hear any other songs, did you?

45
Personal Projects / Re: Project: FF7 NES Upgrade
« on: March 01, 2009, 10:54:57 pm »
I was giving this a look today at work.  It's going a little slower than I thought it would, since the version of FCEUX that I found that could actually run the game has a buggy Trace Logger, but I was able to locate some songs, which should help me trace back to how to call songs.

I have a question though.  Searching through the ROM I found only 8 songs.  That seems like so few.  Someone who has played through the game, can you confirm if there are only 8 songs (songs that repeat over and over) in the game?  It will help me move onto the next step if I can get this confirmed.

46
Personal Projects / Re: Project: FF7 NES Upgrade
« 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.

47
Personal Projects / Re: Hack Project: Mega Man Powered Down
« on: February 27, 2009, 12:23:17 pm »
Just checking in on this thread.  I will try to help out with unraveling MM5's sound engine so we can change the songs.  Looks like there is already a doc that explains some stuff: http://www.romhacking.net/docs/capmusfrm.txt.  That will help a lot. :)

48
Personal Projects / Re: Project: FF7 NES Upgrade
« 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.

49
Personal Projects / Re: Project: FF7 NES Upgrade
« 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.

50
Personal Projects / Re: Project: FF7 NES Upgrade
« 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.

51
Personal Projects / Re: Video demo of my untitled platform homebrew game
« on: February 09, 2009, 04:46:20 pm »
Could be quite tough if you make one or more of those spike-blocks move too.  Like if the 5th from the left on the bottom row of spikes moved up and down :)

Well, remember that this is the second area you'll visit in the game, so I don't want it to be too evil.  In the final area, however...   ::)

Are you going to add a harder "2nd quest"? :)

btw, I like your background tiles.  Are you drawing those yourself?

52
Personal Projects / Re: Video demo of my untitled platform homebrew game
« on: February 08, 2009, 07:15:35 pm »
Oh dear lord. I hate those disappearing blocks with a burning passion.

- What's not to love about these?  Hehehe.

Could be quite tough if you make one or more of those spike-blocks move too.  Like if the 5th from the left on the bottom row of spikes moved up and down :)

53
Personal Projects / Re: Video demo of my untitled platform homebrew game
« on: January 25, 2009, 02:22:13 am »
That's awesome.  Great job man!  Looks like it plays really smooth.

54
Newcomer's Board / Re: Introduction Topic
« on: January 20, 2009, 09:08:06 am »
Howdy,

I'm tummai.  I'm 28 and I think we got our first NES when I was 6.  And there was the ATARI 7800 before that and the ATARI 2600 before that.  So I guess I go back to ET and Keystone Kapers as far as playing.  I played alot of stuff on the Genesis and SNES too, but around the time the PS1 came out, I kinda stopped playing games until very recently (last October?) when I picked up Dragon Quest 5 for the DS.  It brought me back into game-mode.

Never hacked a thing in my life before last Sunday when I decided to give it a try.  I'm trying to trace through The Guardian Legend for the NES to see how it works.  My ultimate goal is to write my own homebrew NES game and put it on a cart, which isn't directly related to ROM-hacking, but I also have an interest in being part of one of these projects translating Japanese games in English.   Oh, I forgot to mention I live in Japan now and translate stuff as a hobby (mostly Dragon Quest-related stuff).  I'm not a pro, but I hope to be one someday (that's why I do it as a hobby).  I'm getting better everyday (I hope).

That's my intro.  Looking forward to becoming a regular here.  Adios.

Pages: 1 2 [3]