nolddor wrote:Nowadays, SGDK hasn't a SND_resumePlay_VGM();... only it has a Stop o Start function.kubilus1 wrote:Perhaps, what do you mean exactly?Someday there will be a VGM_resumePlay (); ...... xD
This function is very useful when you push pause into a game.
VGM Driver Update
Moderator: Mask of Destiny
It would be awesome to have this included!
The zip should contain the sound driver as well vgm_drv.h. I think with the SGDK setup this will become z80_vgm.c and z80_vgm.h.
Also, I am hosting the code here: http://code.google.com/p/gendev/source/ ... r%2Fdriver
...which I believe contains the .bin that the .h was made into
I don't see myself having time to make any changes right now, so the one I posted should be good. The code is extremely ugly ATM, once work lets up a bit I should be able to get back to it and clean things up some more.
The zip should contain the sound driver as well vgm_drv.h. I think with the SGDK setup this will become z80_vgm.c and z80_vgm.h.
Also, I am hosting the code here: http://code.google.com/p/gendev/source/ ... r%2Fdriver
...which I believe contains the .bin that the .h was made into
I don't see myself having time to make any changes right now, so the one I posted should be good. The code is extremely ugly ATM, once work lets up a bit I should be able to get back to it and clean things up some more.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
I updated SGDK to the last VGM driver, i experienced some playback issues with one of the sample i am providing in the "sound" sample exemple. Actually it seems to be the classic sonic 1 green hill theme... did you meet any problem with it ? or maybe i did something wrong with my patch code (or the client changed a bit and i did not see it).
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Oh it seems there is something wrong about the DAC in the last VGM driver, at least the one we can get the C pre compiled version. Any music using PCM sound completly off, DAC value seems completly random :-/
Edit: my fault ! I was not clearing Z80 memory when loading a new driver, that could be useful :p
Edit: my fault ! I was not clearing Z80 memory when loading a new driver, that could be useful :p
bank_8x is the bank for the 0x8? style PCM calls. This is filled in when the driver sees a 0xe0 command.
bank_bkp preserves the bank of the original PCM call when a sound effect changes the bank.
When the PCM playback is playing a SFX and reaches a point where the effect is done, the PCM pointer and bank is returned to the original playback location.
Eventually, I would love to be able to mix maybe multiple sound effects, possibly with the original PCM data, the trouble is the time it takes to change banks. If I could buffer then this could possibly be solved, but that has it's own challenges:
1. PCM samples and SFX have to be randomly accessible. We never know ahead of time when and where these will be played from (practically speaking.)
2. Buffering will require some down-time during the playback. It would seem possible that really busy tracks would not have enough down-time between samples to buffer.
Just making the VGM file itself buffer is probably the next step. Since the VGM playback is linear and consistent, I only have to worry about issue #2, which I think is unlikely to really be a problem, I hope. I should have time to then mix two PCMs (SFX + Sample or SFX + SFX) at 8khz.
bank_bkp preserves the bank of the original PCM call when a sound effect changes the bank.
When the PCM playback is playing a SFX and reaches a point where the effect is done, the PCM pointer and bank is returned to the original playback location.
Eventually, I would love to be able to mix maybe multiple sound effects, possibly with the original PCM data, the trouble is the time it takes to change banks. If I could buffer then this could possibly be solved, but that has it's own challenges:
1. PCM samples and SFX have to be randomly accessible. We never know ahead of time when and where these will be played from (practically speaking.)
2. Buffering will require some down-time during the playback. It would seem possible that really busy tracks would not have enough down-time between samples to buffer.
Just making the VGM file itself buffer is probably the next step. Since the VGM playback is linear and consistent, I only have to worry about issue #2, which I think is unlikely to really be a problem, I hope. I should have time to then mix two PCMs (SFX + Sample or SFX + SFX) at 8khz.
Here's my patched version: http://theadesilva.com/vgm_drv.h
It's a real ugly hack but provides some usefulness if you're making a musicdisk *ehem*.
z80 ram address 0x1a00 contains fm_bank
z80 ram address 0x1a01 contains psg_bank
z80 ram address 0x1a03 contains stop
fm_bank is incremented by one every time fm gets written. This is useful if you have a status bar or something that you're checking every v refresh. The number in there is the length of your bar, just write it to zero after you read it.
psg_bank is the same thing but for the psg
stop turns to 1 when the music stops or loops
It's a real ugly hack but provides some usefulness if you're making a musicdisk *ehem*.
z80 ram address 0x1a00 contains fm_bank
z80 ram address 0x1a01 contains psg_bank
z80 ram address 0x1a03 contains stop
fm_bank is incremented by one every time fm gets written. This is useful if you have a status bar or something that you're checking every v refresh. The number in there is the length of your bar, just write it to zero after you read it.
psg_bank is the same thing but for the psg
stop turns to 1 when the music stops or loops
Not sure why this track doesn't play well yet.....http://theadesilva.com/track4.vgm
-
- Very interested
- Posts: 208
- Joined: Mon Jun 25, 2007 7:19 pm
- Location: Besançon,France
- Contact:
i have tested this new driver's too.
First , thanks for your works , SGDK intégration seems to works very well
But i have also a little speed problem , here is my simple test rom :
http://sega4ever.power-heberg.com/tutod ... M_Test.zip
First , thanks for your works , SGDK intégration seems to works very well
But i have also a little speed problem , here is my simple test rom :
http://sega4ever.power-heberg.com/tutod ... M_Test.zip