Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Disch on March 10, 2014, 10:46:35 pm

Title: Back from the Dead, looking for spare time project
Post by: Disch on March 10, 2014, 10:46:35 pm
Hey everyone.  I've been gone from the scene for maybe 5-6 years now (or longer?)  I don't know how many remember me, or how many people I knew are even still around.  But it's good to see the scene is still alive and well!  Or maybe lots of you don't even have a clue who I am/was.  That's fine.

Anyway, I left the scene because of work.  It's been kicking my ass.  But now I'm trying to come back for the same reason.  I come home from work and I'm tired of my usual projects.  So I figure I'd look for something not overly difficult to do... yet still fun and puzzle-solving-ish.

Basically I want to make a level editor for a game.  Preferably an NES game.  Preferably one which doesn't already have its level format documented.  I'm open to any and all suggestions as long as the game doesn't totally suck.

SNES is a possibility... but I probably won't have the required stick-to-it-iveness to work on a SNES game.  NES should be no problem since I know the system inside and out.

So please give your suggestions in this thread.  I'll entertain any NES/FC/FDS game that doesn't suck and doesn't already have an editor (or one that only has really crappy outdated editors).
Title: Re: Back from the Dead, looking for spare time project
Post by: Pennywise on March 10, 2014, 11:07:27 pm
It's kind of hard to forget you when I'm always using you mapper docs as a reference. Welcome back.

Anyhow, Vice Project Doom has the reputation of being a really cool and awesome action game. Perhaps even worthy enough of a level editor.

There's also Conquest of the Crystal Palace which I think is a really underrated game.
Title: Re: Back from the Dead, looking for spare time project
Post by: Gideon Zhi on March 10, 2014, 11:18:35 pm
Basically I want to make a level editor for a game.  Preferably an NES game.  Preferably one which doesn't already have its level format documented.  I'm open to any and all suggestions as long as the game doesn't totally suck.

Arkista's Ring is the one I've always suggested to people looking to get (back) into the swing of things. It's a really simple (note: not "easy", just simple) action game for the NES, vaguely Zelda-reminiscent but more action/arcadey. The game's always had a weird charm for me. I don't think I'd do anything with a level editor if one was made, but the game's cute and simple enough that the formats would hopefully not pose too much difficulty.

Also,
Quote
<Pennywise> Disch is back
<qeed> why isnt he on irc
Title: Re: Back from the Dead, looking for spare time project
Post by: Piotyr on March 10, 2014, 11:36:55 pm
I remember your avatar does that count?
Title: Re: Back from the Dead, looking for spare time project
Post by: BRPXQZME on March 11, 2014, 12:50:48 am
He is risen.
Title: Re: Back from the Dead, looking for spare time project
Post by: Disch on March 11, 2014, 01:52:32 am
Good suggestions so far.

Also I just thought that maybe it wouldn't even have to be a level editor.  What about a music editor?  You don't see a lot of those.


@ the IRC thing.  I forgot all about IRC.  I might pop in later, but that's kind of a distraction.  =P


EDIT:  actually... yeah... the more I think about it the more I like a music editor idea.  Are there any that exist?

EDIT 2:  SNES is on the table for music editing.  I know the SPC system really well, and it'd be easy to decipher music data when it's already isolated from the rest of the ROM.
Title: Re: Back from the Dead, looking for spare time project
Post by: JCE3000GT on March 11, 2014, 02:34:31 am
Welcome back Disch!  Hope life treated you well enough the past few years.  :D
Title: Re: Back from the Dead, looking for spare time project
Post by: Vanya on March 11, 2014, 06:40:15 am
Better level editors for CV1 & CV3 would be great though they are half way out of your criteria.
Sure there is Stake and ReVamp, but neither lets you change the room order or scrolling data or whatever those games use.
Being able to really change how levels are arranged in those two games would allow for some much better hacks.
There is only so much you can do with TSA editing alone.
Title: Re: Back from the Dead, looking for spare time project
Post by: Grond on March 11, 2014, 11:16:08 am
Yo Disch! Good to see you show up on the RH scene again (though I've hardly ever been part of it myself, always sort of lurking at the edge).

You want to make an editor, eh... my first instinct is to suggest that you add a music editor to FF Hackster, but you'd probably find it boring and tedious revisiting that game, whereas I can't keep away from it (even though I'm not working with it at the moment; rather I'm doing a FF Tactics hack).

Hmm... I'm trying to think of decent NES games that don't seem to have editors yet. How about Dragon Warrior III or IV, Battletoads, TMNT II, DuckTales, Little Nemo, Willow, Ninja Gaiden II, Clash at Demonhead, Wizards & Warriors I or II?

If you decide to go SNES, what about one of the Castlevanias? I don't think they have any editors. It would be cool if that 'Dracula X' game could be made into something closer to Rondo of Blood. Super CV IV is more deserving of an editor, though, and would probably inspire better hacks.

Well, whatever you decide to do, just try to have fun with it and don't stress over it :)
Title: Re: Back from the Dead, looking for spare time project
Post by: Disch on March 11, 2014, 01:54:22 pm
Thanks, thanks.  Getting stressed over a hobby project is not likely with me.    =P  I have enough stress with work and stuff.. the hobby project is to reduce stress!

That said... Clash at Demonhead is probably my fav of the suggestions so far as far as level editors go.  But that game was kind of weird.

I'm really leaning more towards just making a music editor for a game.  That'd be something simpler to start with, and it's something I don't really see a lot of.

So let me rephrase my question:

- What is a popular (for hacking) NES/SNES game that doesn't have a music editor?

I've been gone so long I don't know what games are hip with the kids these days.  Last I can remember everyone and their sister was making Megaman 2&3 hacks.
Title: Re: Back from the Dead, looking for spare time project
Post by: Griever on March 11, 2014, 02:00:30 pm
Kirby's Adventure - LZ/RLE combined scheme with a few variations algo  ;)
Title: Re: Back from the Dead, looking for spare time project
Post by: Disch on March 11, 2014, 02:06:01 pm
I distinctly remember writing a de/re-compressor for Kirby.  I think MathOnNapkins was also using it for his Link to the Past editor.  I forget the name.... 'Compresch'?

I guess putting that in a level editor for Kirby is do-able.
Title: Re: Back from the Dead, looking for spare time project
Post by: Celice on March 11, 2014, 06:39:42 pm
make FF3Hackster edit levels and events :p

For real though, it's just cool to see you pop up again. Whatever you end up doing, I'll be interested in!
Title: Re: Back from the Dead, looking for spare time project
Post by: Disch on March 11, 2014, 07:13:10 pm
Thanks Celice.


I wonder how difficult it would be to make some kind of generic music editor for SNES games that uses something like xml (or json, or some other external text file) for the game-specific details.

Maybe that's a little ambitious... but I guess it depends on how many similarities I can find between different games.  I'll have to start with 1 or 2 and see.

So what are some SNES games everyone cares about?  Is SMW still huge?  Maybe that + FF6?
Title: Re: Back from the Dead, looking for spare time project
Post by: Gideon Zhi on March 11, 2014, 10:23:57 pm
For real though, it's just cool to see you pop up again. Whatever you end up doing, I'll be interested in!

This. Totally this.

In the meantime, any chance you'd offer to get NotsoFatso integrated into XBMC and open the door for more emulated sound formats (spc, psf) in the process? :)
Title: Re: Back from the Dead, looking for spare time project
Post by: JCE3000GT on March 11, 2014, 10:48:10 pm
Thanks Celice.


I wonder how difficult it would be to make some kind of generic music editor for SNES games that uses something like xml (or json, or some other external text file) for the game-specific details.

Maybe that's a little ambitious... but I guess it depends on how many similarities I can find between different games.  I'll have to start with 1 or 2 and see.

So what are some SNES games everyone cares about?  Is SMW still huge?  Maybe that + FF6?

Super Mario World and Final Fantasy 6 are still huge, however both of which now have utilities that can pretty much do anything including import/convert music using the MML (music macro language) format.  Though, if you wanted to improve upon the music editing scene for these games it would be greatly appreciated by both communities for sure.  I can only speak for myself, but, importing songs the old fashioned way (hex editor FTW!) in FF6 is time consuming and the MML option isn't perfect (having to alter and convert MIDIs to MML). 

If you're looking for an SNES game to do that would be good to do, Final Fantasy V is needing some love at the moment.  I've got some information for that version of the Square SPC core which shares with Seiken Densetsu 2 and Mystic Quest but it isn't complete by and means and it is the last SNES Final Fantasy that isn't well documented with various tools/utilities present. 

At any rate I'm super excited to see you back in the scene, I only we could of finished FFTribute.  ;)
Title: Re: Back from the Dead, looking for spare time project
Post by: Disch on March 12, 2014, 12:27:52 am
JCE:

Thanks.  It sounds like those would be poor ones to start with then.

FF5 & SoM are a good place to start.  I'll probably do that then.  I certainly welcome any info you have on the music format.


@ Gideon:

The odds of me ever making another player plugin are slim to none.  =(  Sorry.
Title: Re: Back from the Dead, looking for spare time project
Post by: bailli on March 12, 2014, 06:43:37 am
For SoM have a look at this: http://somedit.blogspot.de/2013/07/music-stuff.html
Title: Re: Back from the Dead, looking for spare time project
Post by: Disch on March 12, 2014, 05:59:20 pm
It seems like there's more tools than I thought for editing in-game music.  Though they all seem to be midi/mml/etc importers, rather than interactive editors.

I wonder how well an interactive editor would go over?

Thanks for the input everyone.   I think I have what I need to continue with this.
Title: Re: Back from the Dead, looking for spare time project
Post by: JCE3000GT on March 12, 2014, 07:34:44 pm
It seems like there's more tools than I thought for editing in-game music.  Though they all seem to be midi/mml/etc importers, rather than interactive editors.

I wonder how well an interactive editor would go over?

Thanks for the input everyone.   I think I have what I need to continue with this.

So were you thinking more of an SPC "tracker" similar to mod/it tracker?  If so would you still incorporate an import feature?  Not just import midi/mod/it/s3m/etc but other SPC raw sequences as well? 
Title: Re: Back from the Dead, looking for spare time project
Post by: Disch on March 12, 2014, 09:17:53 pm
That was kind of the idea.  Though I don't really have much experience with other trackers so I was just going to approach this as "the kind of editor I would want to use if i was using this".  Though that might not be the best idea because existing trackers might be better than what I'm imagining.

But whatever.  It's a funsie project.  If it ends up being crappy I can update it later with better ideas.  Or not.  Whatever.  =P


This is all step 10 though.  I'm still on step 2.


As for import/export:  no idea.  Hadn't originally planned on it, but since it's popular maybe I'll consider it.  But that's like step 14.

March 15, 2014, 10:39:02 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
So... here's the data on the musical score in Secret of Mana, based on what I've searched within the past few days:

Code: [Select]
SCORE DATA:
==================================
00-B3 are tones
B4-C2 is sustain
C3-D1 is rest.

For all of the above, value%15 is the length of the note (run through a lut to get length in clocks)
For tones, the note (C, C#, D, etc) is determined by value/15.  Where 0=C, 1=C#, 2=D, 3=D#, etc


Other values are 'commands' as illustrated below.

D2 aa     = write aa to FC01+X   Set volume to 'aa'
                   zero FC00+X      disable/stop vol fading
                   zero FC80+X

D3 aa bb  = fade to volume 'bb' over 'aa' updates
                'bb' is the target volume
                'aa' is time delay (higher values = slower fade)
                   
D4 aa     = write aa to FC41+X   Set Pan to 'aa'
                   zero FC40+X      disable/stop pan fading
                   zero FC81+X

D5 aa bb  = fade to pan 'bb' over 'aa' updates
                'bb' is the target pan
                'aa' is time delay (higher values = slower fade)

D6 aa bb  = write aa+1 to FCC1+X  ???
            write bb   to 0120+X  ???  not sure what this does.
                                        causes some kind of eventual update
                                        to FD80,1+X

D7 aa bb cc =  write aa to   0160+X     depth?
               write bb+1 to FCA0+X     set vibrato counter reload value to bb+1
               write 1    to FCE0+X     set vibrato counter to 1 so it updates immediately
               write cc   to 0121+X     set vibrato enable/phase selection
                       
                        Enable/disable vibrato and set phase/rate (but not depth?  Unless 0160 is depth?)
                        aa = ?vib depth?
                        bb = rate (00 = fastest, FF = slowest)
                        cc = enable/phase selection

D8        =  disable vibrato (by writing 0 to 0121+X)

D9 aa bb cc =  write aa to   0161+X     depth?
               write bb+1 to FCA1+X     set tremolo counter reload value to bb+1
               write 1    to FCE1+X     set tremolo counter to 1 so it updates immediately
               write cc   to 0140+X     set tremolo enable/phase selection
                        same as D7, but tremolo instead of vibrato

DA        =  disable tremolo by writing 0 to 0140+X

DB aa bb  =  ??? $0763   complex.  Uses a lot of things I don't have ID'd yet:  FCC0, FD00, FDA0, FDA1, 0141, FDE0, FDE1

DC        =  ??? $07B4   Zero's 0141, FDE0, FDE1

DD aa     =  Sets noise freq to aa & 0x1F.  Does not enable/disable noise for this channel, it's just a pitch change

DE        =  Enable noise for this channel

DF        =  Disable noise for this channel

E0        =  Enable Mod for this channel

E1        =  Disable Mod for this channel

E2        =  Enable Echo for this channel
 
E3        =  Disable Echo for this channel

E4 aa     =  Set octave

E5        =  Increment octave

E6        =  Decrement octave

E7 aa     =  Set current key change value to 'aa' (00 = normal key, 01 = C becomes C#, 02 = C becomes D, etc)

E8 aa     =  Modify current key change value by 'aa' ('aa' is added to current key change)

E9 aa     =  ??? $09B0  --- sets FD40+X and exits.  Not sure what that var is for.  Used in pitch calculations.
 
EA aa     = write aa to 5D+X   = current instrument as written to reg.. and does a few other things:
            copy 16 bit ptr from  1800+aa -> FD20+X   ( ??? )
            copy 16 bit ptr from  1880+aa -> FE80+X   (resets ADSR data to instrument defaults)
           
EB aa     =  Sets attack rate to 'aa' & 0x0F
                    FE80+X = FE80+X & 0x70 | ('aa' & 0x0F) | 0x80

EC aa     =  Sets decay rate to 'aa' & 0x07

ED aa     =  Sets the sustain level to 'aa' & 0x07

EE aa     =  Sets the sustain rate to 'aa & 0x1F

EF        =  Reset ADSR values to instrument defaults

F0 aa     =  ??? $0944:  increments 5C+X, then does a bunch of other crap
                no idea what it's doing  ???

F1        =  ??? $096B:  decrements 5C+X, then other stuff. No idea ???

F2        =  $09BC  ??? -- kills return address from stack and does a lot of heavy calls.  End music/sfx maybe?

F3 aa     =  $0620  ??? -- if sfx, this is a NOP
                            for music:  $7D = 'aa'
                                        $7C = 0
                                        $80 = 0

F4 aa bb  =  $062D  ???   no freaking idea.  Uses 80,81,82.  Fairly complex

F5 aa     =  $06B3 - NOP  (goes right to RET), 'aa' is unused

F6 aa bb  =  $06B0 - NOP.  'aa' and 'bb' are unused

F7 aa bb  =  $0733 - NOP.  'aa' and 'bb' are unused

F8 aa     =  Sets music master volume (FF = normal, 00 = silent).  Does not apply to 'special' instrument
                see $00AC variable description (all this command does is assign that var)

F9 aa bb cc = $0917 - NOP for sfx.
                For music, a conditional jump.  'aa' is a loop counter, and 'ccbb' forms the address (add 6,7 to it just
                    like with the FA command)
                The thing that's weird is that it's backwards.  You only jump WHEN the loop counter reaches the given value.
                I would expect it to jump UNTIL the loop counter reaches the value
                Also, the loop counter doesn't get reset by this command.  See command FC.

FA aa bb  =  $0905  NOP for sfx.
                For music... Standard jump. $0C,D+X = bbaa + $06,7
                jump to bbaa + [$06,7].  Not sure what significance
                6,7 is, but in the track it is fixed at $E233   ???

FB aa bb  =  $0995  NOP for sfx.  For music... conditional jump to bbaa + $06,7
                jump only if the channel has its chan bitmask set in var $C4
                Once jump is taken, that bit in C4 is cleared.  Not sure if/how C4 can be set again.  ???

FC        =  $093A  NOP for sfx.  For music, zero out the loop counter.

FD aa     =  $09B4  NOP for sfx.  For music, sets special instrument ID (assigns $FF88).  See $FF88 and $00AC description for details

FE        =  $09BC - same as F2
FF        =  $09BC - same as F2

A few other notes:

- Vibrato and Tremolo seem to be broken due to a bug in how they get initialized when a tone starts.  The bug should be easy to fix, I just have to get around to doing it (and testing it out).

- 'Mod' enable is similar to Vibrato but uses the SPC's built-in "modulation" function rather than manually adjusting the pitch.  This has many downsides over the manual vibrato:  1)  it doesn't work on voice 0.  2)  It doesn't work if the previous voice is inaudible.  3)  You don't have control over things like rate/depth.

- All jump addresses in the SPC seem to be offset by a fixed amount.  This amount is stored at $0006,7 in SPC memory.  For the track I was examining (A Curious Tale), this value was fixed at $E233.  I haven't checked but this probably varies per song and the value at 06,7 changes depending on where the score data resides in the SNES.  That way addresses are relative to SNES memory rather than SPC memory.

- Sound effects (sfx) appear to use the exact same code as music.  With a few differences... the biggest being that some commands (mainly jumps) are NOPs for sfx and only work for music.

- The conditional jump commands don't make any freaking sense.  My test SPC didn't use any of them.  I wouldn't be surprised if no songs in the game use them.  They're totally asinine.

- On the SPC there is only one noise generator... so setting the noise freq (command DD) on one channel affects it for all channels.  The music engine keeps track of music and sfx settings separately... and will use the music setting only if no sfx are currently playing anything with the noise.



I'm probably going to start on the editor next... to see if I can load up and play sounds from the ROM.  We'll see how it goes.  Wish me luck!
Title: Re: Back from the Dead, looking for spare time project
Post by: Lenophis on March 17, 2014, 02:11:27 pm
Luck is irrelevant, you are Disch. You will succeed.