Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 24, 2015 12:21:00 GMT -5
That might help to change it but anyway i can add the switch in the VGM to XGM converter just in case the info is absent from the VGM file.
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 24, 2015 9:50:04 GMT -5
Thanks for the informations, indeed there is no setting for that. I think i only need to add a switch when converting VGM to XGM format to specify the target system (NTSC or PAL). Maybe something as "-p" for PAL system and by default conversion is done for NTSC system.
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 24, 2015 5:08:08 GMT -5
Hi Elusive, Can you describe the problem you have exactly ? You export from TFM to VGM then VGM to XGM and your music play too fast ? And on which system you play the final XGM music ? The XGM driver has one restriction: it plays music differently on PAL and NTSC system because all timings are frame based. If the initial VGM file do not indicate PAL / NTSC information then i need to add a flag in the VGM --> XGM conversion to define the target system (PAL or NTSC). That may be the solution That also mean you will have 2 different tracks for PAL and NTSC system (no choice here).
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 23, 2015 6:47:17 GMT -5
If you aim to share your code with me I can try to figure what happen and help you with that. I think BEX is actually interrupting the Z80 CPU on some specific tasks, i hope that is fixable !
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 23, 2015 5:06:52 GMT -5
Hi Vetea, Awesome progresses you made lately ! I'm really impatient to see it completed now In case you don't saw it, i fixed a minor issue in my z80_loadDriver() method from test.bex file so try to get the last version, it may fix the smalls issues you were experiencing. Also i don't know why but the PCM quality in Papy commando is pretty poor... even the Sega intro voice. Does it comes from your samples ? I think it can be improved !
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 23, 2015 5:00:23 GMT -5
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 22, 2015 8:10:29 GMT -5
Nice ! Glad you got it to work
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 21, 2015 8:26:01 GMT -5
Hi Davidian, Sorry for the late reply, i have been very busy lately. I tested your code and could not reproduce your problem. Here's a rom generated from your BEX code: dl.dropboxusercontent.com/u/93332624/dev/megadrive/test.binI modified the samples as i did not had your but you can heard that music is correctly played. Also here is the compiled XGC file: dl.dropboxusercontent.com/u/93332624/dev/megadrive/temp.xgcYou may try to replace your XGC by this one just to test if it comes from it. If that is the case then maybe you have an older XGMTool version but it shouldn't affect playback in this way, that's weird
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 15, 2015 17:24:05 GMT -5
Thanks for the comment Davidian XGM plays better with 14 Khz samples as the driver internally plays at 14 Khz but here i think the difference comes from the basic program which, for some reasons, seems to interrupt a lot the Z80 CPU and so hurts a lot on the XGM playback processing ! Did you try to do a simple XGM play without anything else running ? In my SOR2 test it was working correctly so i definitely think there is something in your basic program which make something wrong on the Z80 CPU.
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 11, 2015 11:26:33 GMT -5
Really pleased to heard that ! I sincerely hope it will meet your expectations
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 5, 2015 17:09:01 GMT -5
Bugs are resolved since a long time now =) The problem with speed can comes from the internal timing used in VGM file. If VGM are made for PAL system then they will be played too quickly on NTSC systems when converted to XGM. It needs to be played on a PAL system then... I will add some command to the XGMTool to take care of that (convert music speed between PAL and NTSC).
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 3, 2015 16:46:20 GMT -5
You're welcome ! I updated the message to give more informations. Just ask here if you need assistance
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Mar 3, 2015 11:00:55 GMT -5
Hi guys, I saw some people getting mad when it comes to add music and SFX in their BEX games so i hope that will help =) I made a new sound driver for SGDK and wanted to make it available in BEX as well so you will be able to have all the features of the XGM driver inside your BEX games =) You can find some technical informations the XGM driver here: chipmusic.org/forums/topic/15673/sega-genesis-new-xgm-driver/To make it simple the XGM driver allow you to play music (VGM / XGM format) while playing up to 4 SFX (PCM format) at same time. But the important point for you is that you can use it in BEX and as it uses the Z80 CPU it won't eat any resource from your program (or a very few percent) =) Here is a folder to demonstrate how to use it: pc.cd/nuWrtalKSo to explain a bit more the content of the folder: z80_xgm.bin That's the Z80 XGM driver in binary format, the program we load in Z80 memory. I recommend you to directly copy this file inside the BasiEgaXorz installation folder. null.raw An empty PCM file, the XGM driver requires it to work properly to don't forget to include it. I recommend you to directly copy this file inside the BasiEgaXorz installation folder. test.bex The BEX basic example containing all the code to load and use the Z80 XGM driver. sor2.xgc A compiled XGM music file. You can generate them from VGM file (VGM 1.5 at least) by using XGMTool (available in the demo folder). hat.raw, loop.raw, snare.raw Some small PCM samples used to test the SFX support of the XGM driver. PCM samples should be 8 bits signed at 14000Khz and size should be aligned to 256 bytes. You can convert any WAV files to raw PCM by using the WavToRaw tool (available in the demo folder). To align the size of the result RAW file you can use the SizeBnd tool (available in the demo folder), by default it aligns size on 256 bytes
So you almost know everything now, just remember that if you want to use the XGM driver, you first have to init the driver by calling the xgm_init method then you need to setup the vint event so it call xgm_vintProcess at each vint (see test.bex for an example). When this is done you are ready to use one the following methods from the XGM driver: xgm_init Initialize the XGM driver (load it in Z80 memory, init and wait for ready)
xgm_isPlayingMusic Return a value != 0 is the XGM driver is currently playing a music.
xgm_startPlayMusic Start music play. A1 register should contains the address of the XGM music. See test.bex for an example
xgm_stopPlayMusic Stop music play.
xgm_resumePlayMusic Resume music play after a Stop music command (can be used for pause).
xgm_isPlayingPCM(channel_mask) Return the play status of specified channel mask. channel_mask = 1 for channel 1 channel_mask = 2 for channel 2 channel_mask = 4 for channel 3 channel_mask = 8 for channel 4 We can test 2 channels by combining values: if channel_mask = 10 (8 + 2) then we test channel 2 and channel 4. In this case if return value = 8 then channel 4 is playing but not channel 2. See test.bex for an example
xgm_playPCM A1 register should contains the PCM sample address D1 register should contains the PCM sample length D2 register should contains channel and priority informations in this format: (priority << 4) | channel where priority is a value between 0 (lowest) and 15 (highest) and channel is a value between 0 and 3. See test.bex for an example
xgm_stopPCM D2 register should contains channel number (between 0 and 3) See test.bex for an example
xgm_setMusicTempo Allow to set the music tempo By default tempo is set to 60 Hz on NTSC system and 50 Hz on PAL system but you can change it freely.
xgm_getElapsedTime Returns the elapsed played music time in frame.
xgm_setBusProtection Allow to enable 68000 BUS protection. You should use it to prevent the Z80 using the 68000 bus during DMA to avoid PCM playback quality degradation. Note that the XGM driver expect DMA operations to happen during VBlank so it works best when that's the case. A normal use case of BUS protection: xgm_setBusProtection 1 ' do DMA operations xgm_setBusProtection 0
Sorry for the rough integration (as the need of loading song address directly in register) but my knowledge with this language is really limited and i met several issues (how to access asm labels from basic for instance ?) and if someone want to improve the integration (having proper BEX function to call XGM method) then he's welcome =) Have fun ! Edit: Updated to the last version of XGM driver (SGDK 1.22)
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Nov 27, 2012 18:28:54 GMT -5
Very glad to hear finally someone get the 8 MB version running on a MD1 I developed a specific Z80 driver which take care of not doing any 68k bus access during vblank (as i use a lot the DMA) so the PCM quality stay ok. Too bad i didn't had more rom space for the PCM (i used 4 bit ADPCM at 13 Khz), the quality could have be really better then ! Maybe i could try a 10 MB rom
|
|
Stef
Moldy Popcorn
Posts: 34
|
Post by Stef on Nov 26, 2012 18:06:31 GMT -5
Nope that won't work SSF2 uses bank switch which is not the case of this demo. The code has to take care of that. The mega everdrive allow up to 10 MB direct mapped rom so the 8 MB version should work. What you can do is to put the 2 x 4 MB in each eproms but then you need to reset and change eprom mask to get to other part
|
|