It is currently Sun Sep 15, 2019 5:33 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Apr 27, 2019 12:54 pm 
Offline

Joined: Sat Apr 27, 2019 11:56 am
Posts: 34
Over the last few days I have been looking into the Taito audio engine in an attempt to understand it and modify/create a custom music track. This engine is much simpler in comparison to those by Konami and SunSoft so I figured it would be a good place to start out.

Searching the forums has produced a few threads pertaining to custom audio engines. I am unfamiliar with how well a custom audio engine would work with a game such as Bubble Bobble. My guess is a custom audio driver is used more in development rather than modifications.

Searching the web pointed me to some audio engine work previously done on Mega Man. This thread discusses reverse engineering the Mega Man 2 audio engine with a very nice text file detailing commands and note patterns. This text file was a great example of where to start in disassembling a game's audio engine.

Progress:

I have successfully identified Bubble Bobble's audio init, play, and sequencing routines. I have a disassembly project of the game's NSF with music tables, note sequence data, and register interactions labeled. At this point I think I am able to write my own music and insert the notes how I would like for the entire soundtrack. For example I believe I could take the sheet music from Metroid and get the notes in place to play during Bubble Bobble. However in reviewing the game's basic channel use I don't see any setup or use of samples. This makes porting music from other more complex games difficult I think.

Is modifying the game's audio engine to include channel 5 an impossibility? A simple example of outputting a sample on channel 5 might help me in understanding how it works. I am very comfortable working with assembly and interacting with channels 1-4 but I don't have experience with using samples on channel 5.


Top
 Profile  
 
PostPosted: Tue Apr 30, 2019 7:23 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3722
Location: Indianapolis
xamboni wrote:
Is modifying the game's audio engine to include channel 5 an impossibility? A simple example of outputting a sample on channel 5 might help me in understanding how it works. I am very comfortable working with assembly and interacting with channels 1-4 but I don't have experience with using samples on channel 5.


It could be quite difficult, but not because of the coding. That harder part will be finding a place for the sample data to live. Something big like the "sunsoft bass" will be nearly impossible, because when games have that much sample data, the game's memory layout is pretty much designed around it. Sample data needs to be at $C000-$FFFF. It has to be mapped into memory all the time, otherwise it'll be playing garbage data when the game changes banks. So sample data will need to be in the "fixed" bank. If there happens to be free space in there, then it's no problem. It's an unlikely place to find enough unused memory though.

fixed bank varies by mapper:
UNROM $C000-$FFFF
MMC1 no guaranteed fixed bank
MMC3 $E000-$FFFF

You could always trying playing game data as sample data, maybe there's something cool in there? Could use DMC IRQ to string multiple short samples together. Not gonna sound very musical, but it's something.


Top
 Profile  
 
PostPosted: Wed May 01, 2019 2:46 pm 
Offline

Joined: Sat Apr 27, 2019 11:56 am
Posts: 34
This is a really cool idea. Thanks for the heads up on finding memory in a bank that does not move. I am unfamiliar with what triggers a bank switch in memory. Is there something I can read on this?

I am going to port over some songs from other games on the channels I currently understand and see how it turns out.


Top
 Profile  
 
PostPosted: Wed May 01, 2019 3:16 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3722
Location: Indianapolis
A bank switch is triggered by the CPU writing to the mapper's control register, so it depends on the mapper used. If you exclude Famicom, the big 3 are UNROM (mapper #2), MMC1 (mapper #1), MMC3 (mapper #4). You can set breakpoints on writes to $8000-$FFFF to find them generally, because with few exceptions, mapper registers are write-only and mapped on top of ROM. Details of each mapper are linked here in the mapper grid:
https://wiki.nesdev.com/w/index.php/Mapper

Something I forgot to mention, there is a bug with the DMC sample playback that affects the controller port reading. You will need to rewrite the game's controller polling (usually pretty simple and easy to find in the NMI routine)
http://wiki.nesdev.com/w/index.php/Controller_reading#DPCM_conflict


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: JediJoey and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group