It is currently Mon Oct 15, 2018 10:18 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Mon Aug 27, 2018 7:15 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1994
Location: Fukuoka, Japan
@DRW

Since I'm using the famitone/famitracker combo, I will test how much famitone can be separated in a fixed bank without issue. For the music, I think switching bank in the nmi seems a reasonable solution.

Now that I received many feedback, I will experiment based on that and see how it goes. I may have questions later if something goes wrong.

Thanks everyone!


Top
 Profile  
 
PostPosted: Mon Aug 27, 2018 7:40 pm 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1705
Banshaku wrote:
Since I'm using the famitone/famitracker combo

You mean the version where you use the FamiTracker driver for the music and FamiTone for the sound effects?
Not really what I would suggest. The FamiTracker driver is so big and quite CPU-heavy that I wouldn't use it in an actual game.

But if you really want to use such a big driver, you might just as well do the following, given that you use a mapper like MMC-1 where you can configure at runtime which bank is the fixed bank:

You put the FamiTracker and FamiTone driver plus some wrapper functions into bank A.
You put music into bank B or in several different banks.
You put sound effects into bank C.
The regular code is in fixed bank X.

Whenever you need to do something with music and sound effects, you do this:

(The code bank X is now in the fixed bank.)
1. You load bank A into the variable bank.
2. You call a function from bank A that switches which one is the fixed and which is the variable bank.
(Now bank A is the fixed bank and bank X is the variable one.)
3. You load bank B or C into the now new variable bank.
(Bank X is now inactive.)
4. You call any music and sound effects functions, switching between bank B and C as necessary.
5. You put the original code bank X back into the variable bank.
6. You switch which bank is the variable bank and which is the fixed one.
(Bank A is now the variable bank again and bank X is the fixed bank, just like in the beginning.)

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Mon Aug 27, 2018 9:47 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1994
Location: Fukuoka, Japan
Yes, I'm aware that this driver is heavy :lol:

My current project is used as a place holder for making my engine so once a "real" project will be created, I will remove the code under the sound_driver facade that just call the famitracker/famitone combo code in the back. So I'm not too concerned on the impact on my engine since the goal is not to have something performant but to use my old code/assets and see the performance impact with all those things together. It will be interesting to see where it slow down, when and why.

Once I make some original game I will just target my music for famitone 2 (or any other lightweight driver available at the time) and will be fine.

Because of the size, I will test the "swap the driver in the nmi" pattern to see how it goes and check how you need to organize your code based on that. That will be a lot of new things to learn from it. What you wrote is very close to what I will do so I will keep you example if I have issues with my test.

Thank again for the example!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 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