Music Engines
Moderator: Moderators
Music Engines
I spent a good amount of time reversing the implementation of the Taito music engine for Bubble Bobble last year. There was a ton of input from the community and it was a great deal of success and fun on my end. Semi-unfortunately the Taito engine music for Bubble Bobble is extremely basic. It only makes use of the first four channels on the NES sound chip which leaves a lot to be desired. I am happy to port music into the game on those channels but adding the sample channel would be amazing.
Is it possible to do a brain transplant on an NES cartridge for the sound engine? If I know where the sound engine's init routine is can we erase those bytes and put in something a bit more standard? No worries if this sounds like an undertaking. I can always port music over without the sample channel.
Is it possible to do a brain transplant on an NES cartridge for the sound engine? If I know where the sound engine's init routine is can we erase those bytes and put in something a bit more standard? No worries if this sounds like an undertaking. I can always port music over without the sample channel.
Re: Music Engines
Yes, but it's more involved than this:
The existing ROM on the cartridge is a "mask" ROM, and its contents cannot be changed.can we erase those bytes and put in something a bit more standard?
However, it's pretty easy to disable or remove the ROM on the cartridge and put a new one in its place, holding the values you want instead.
Re: Music Engines
Replacing a game's sounds engine is possible but it can be a lot of work. Adding the code for the new engine is the simplest part, specially if you can simply increase the size of the PRG-ROM. Identifying the RAM used by the old engine and remapping the variables of the new engine could be hard, specially if the new engine is more complex and needs more RAm, which might not be available. Then again, you could just cheat again and add PRG-RAM to the cartridge. If you plan on adding DPCM samples, then that could be a real challenge. Since samples have to be mapped to $C000-$FFFF during the whole time they're playing, you're gonna have a hard time opening up space for them. This would most likely require expanding the PRG-ROM and remapping some of the game's data.
Re: Music Engines
I have read through your response several times and I think I used the terms "cartridge" and "ROM" too loosely. As a first step I am doing everything through a debugger digitally. Does this change your perspective here or am I misreading still?lidnariq wrote: ↑Wed Jul 08, 2020 11:09 pmYes, but it's more involved than this:The existing ROM on the cartridge is a "mask" ROM, and its contents cannot be changed.can we erase those bytes and put in something a bit more standard?
However, it's pretty easy to disable or remove the ROM on the cartridge and put a new one in its place, holding the values you want instead.
Re: Music Engines
As far as additions to the game I am pretty comfortable there is a ton of room to work. Bubble Bobble was extremely simple in implementation. I could be wrong of course. Can you expand on remapping variables or point me to something I can read on a standard engine's variables?tokumaru wrote: ↑Wed Jul 08, 2020 11:13 pmReplacing a game's sounds engine is possible but it can be a lot of work. Adding the code for the new engine is the simplest part, specially if you can simply increase the size of the PRG-ROM. Identifying the RAM used by the old engine and remapping the variables of the new engine could be hard, specially if the new engine is more complex and needs more RAm, which might not be available. Then again, you could just cheat again and add PRG-RAM to the cartridge. If you plan on adding DPCM samples, then that could be a real challenge. Since samples have to be mapped to $C000-$FFFF during the whole time they're playing, you're gonna have a hard time opening up space for them. This would most likely require expanding the PRG-ROM and remapping some of the game's data.
Re: Music Engines
I was only talking about the hardware.
Re: Music Engines
That is epic! Thank you for the response. Is this a feature built into the hardware or a work around the community came up with? Given the expansion pins on the NES and SNES I am wondering if there is a "patch at runtime" feature.
Re: Music Engines
The Game Genie does patches at runtime, but only for 3 bytes (genie gives you three wishes, get it?). lidnariq was referring to replacing the ROM chip with a new ROM chip, you'd have to do that (or just use a modern reproduction board for MMC1, there's probably one that matches the config).xamboni wrote: ↑Wed Jul 08, 2020 11:44 pmThat is epic! Thank you for the response. Is this a feature built into the hardware or a work around the community came up with? Given the expansion pins on the NES and SNES I am wondering if there is a "patch at runtime" feature.
Transplanting a music engine is a job that ranges from extremely difficult, to slightly difficult. You can do a feasibility check by taking an NSF of the sound engine you want to use, run it in an emulator with a debugger and note how much RAM it uses compared to the original sound engine. The location doesn't matter, you can change those when you build the engine from source, but probably needs to be consecutive. Compare zeropage usage separately, of course. If that looks good, go through a similar process with ROM usage. You really need that memory to be consecutive, too. But it usually possible to expand the ROM to a larger size, if needed. RAM usage is the real limiting factory (other than CPU time, if it's close enough to matter).
Re: Music Engines
Wow, after all those years in the community, I finally understand what was the original meaning of "Game Genie". Makes sense. Thanks, Memblers !!
Depending on what you aim to do, you could either add DPCM implementation in the existing sound engine, or transplant another more powerful sound engine by the use of bankswitching (that other sound engine could use or not use DPCM).Is it possible to do a brain transplant on an NES cartridge for the sound engine? If I know where the sound engine's init routine is can we erase those bytes and put in something a bit more standard? No worries if this sounds like an undertaking. I can always port music over without the sample channel.
The problem is that DPCM samples needs to be there permanently somewhere in the $c000-$ffff range, and there's good chances the whole game is designed to have program data here. And then transplanting sound engine is not exactly easy either.