Banner
Views: 235,913,161
Time: 2013-05-19 04:34:45 PM
31 users online: Alcaro, Alex No, Amos Defamos, aterraformer, brunochicoria, buggy789, Carld923, chineesmw, cyphermur9t, Disco, Falconpunch, Fireblast124, gamergod521, o grishnax, GroovyYoshi, o imamelia, Koopster, leod, MarioBros980, MaxodeX, o Megafonzie, o mockingod, mrdeppelman, Pikerchu13, Ramidalv, ShadowFire, o ShadowPhoenix, Thomas, WhiteYoshiEgg, Z0mbie1337, o Zildjian - Guests: 29 - Bots: 13Users: 22,843 (1,293 active)
Latest: IJayZz
Tip: The "No More Sprite Tile Limits" patch does NOT increase the limit for the amount of sprites onscreen at once.
Command-line SampleTool / non-broken AddmusicM
Forum Index - SMW Hacking - General SMW Hacking Help - Custom Music Help - Command-line SampleTool / non-broken AddmusicM
Pages: « 1 »
I'm trying to write an automatic build script that I can run every time I make a change to my hack, so that I don't have to "permanently" apply any tools/patches directly to my ROM (other than LM). So far, I've managed to automate:

* Applying all patches
* Custom sprite insertion
* Custom block insertion (via the manual custom blocks patch, which is totally way better than BTSD and really everyone should just use that)
* Fixing the ROM checksum (with the Checksum Fixer tool)

The only thing that's missing is custom music.

* I can run Addmusic 4.05 from the command line, but then I don't get custom samples. I'd have to use SampleTool to do that, and there's no command line version of the program. (I suppose I could use AutoHotkey or something to control the buttons and drop-down lists in SampleTool, but... eww.)
* Alternatively, I could run AddmusicM. AddmusicM has an interactive command line interface, but that can be automated by piping the ROM name and "yes" answer into it. However, its INIT.asm patch steals some of Lunar Magic's default patch locations, resulting in the "swimming on land" glitch if you apply it after saving to the ROM in LM.

Is there some way to get samples into the ROM that I can call from a command line?
Short answer: No. But you hopefully shouldn't have to use Sample Tool so much that it becomes too much of a problem.

Very technical long answer: You can make your own ASM patch for this sort of thing if you know where Sample Tool stores the tables in the ROM. Basically, you just run Sample Tool once so that it inserts its hack into the ROM, then find the level and overworld tables and put the locations of your own sample banks in there (insert them with incbins). You don't need to worry about RATS tags or SPC upload metadata; they're included in the bank files. So basically, your patch would (probably, this is untested) look something like this:

Code
org !OverworldTableLocation dl OWBank0+8 : dl OWBank1+8 : dl OWBank2+8 ; +8 needed because dl OWBank3+8 : dl OWBank4+8 : dl OWBank5+8 ; of the RATS tags. dl OWBank6+8 org !LevelTableLocation dl Bank0+8 : dl Bank1+8 : dl Bank2+8 dl Bank3+8 : dl Bank4+8 : dl Bank5+8 dl Bank6+8 : dl Bank7+8 : dl Bank8+8 ; etc. org !FreeBank0 Bank0: incbin Bank0.bnk org !FreeBank1 Bank1: incbin Bank1.bnk org !FreeBank2 Bank2: incbin Bank2.bnk ; etc.


Where it says !FreeBankX you need $8000 bytes of consecutive free space (an entire bank).

So yeah. As far as I'm aware there aren't any other options yet.

Also, if you're feeling particularly adventurous you could always skip the first "run Sample Tool on your ROM" step and just make your own patch from scratch. It's not that hard if you know what you're doing; to upload a Sample Tool sample bank just store the long address of the sample bank to upload to $00-$02 and jump to $8079, the SPC upload routine (it ends with RTS, though, so you'll have to get a bit creative here).
First I tried diffing the disassembler output on the ROM before and after SampleTool to figure out what it was doing. Then I tried overwriting an unused subroutine in bank 0 with code that JSRs to the address you mentioned.

Then I decided maybe I'll just stick with SampleTool...
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - Custom Music Help - Command-line SampleTool / non-broken AddmusicM

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2013 - SMW Central
Legal Information - Link To Us


Total queries: 29

Menu