Journey sound sample in mame2003-plus, solved
-
@mahoneyt944 As a rule the closer the MAME builds the easier the code is to backport without having to radically rework it
the mcr code is way different in those later builds from MAME78, ideally all your after is the sample code so you dont have to
update a ton of stuff.Unfortunately the tape sample addition came slap bang in the middle of a huge update to the midway mcr drivers and all related code files......
0.98u4: Merged mcr1.c and mcr2.c to mcr.c driver. Aaron Giles consolidated the MCR 1/2/3 drivers and documented all the PCBs.
0.98u2: Changed vidhrdw\mcr12.c to vidhrdw\mcr.c. Removed machine\mcr.h. Partial rewrite of the MCR video system. Should
still work roughly the same, just a little different under the covers. This is still very much a work in progress [Aaron Giles].
0.98u1: Some major cleanup on the MCR drivers [Aaron Giles]: Implemented Super Sound I/O interrupts properly. Filled
out all memory maps according to schematics. Fixed sound sync with various sound boards, allowing for kludges to be
removed from Power Drive and Star Guards. Re-verified all connections from wiring diagrams. Documented various lamp and driver boards from the games.Here is some prelim work i did on the sample code in the mcr2.c driver the other night you might wanna try and finish it, basically im trying to backport just the tape samples
without having to update all of the above but there are two issues which i'll explain briefly bellow............/* bit 0 turns cassette on/off */ //sample_set_pause(0, ~data & 1); make it stop for now sample_stop(0, ~data & 1);
This should be sample_pause MAME2003 doesn't support that feature so i've made it sample_stop for now pending a test to see if the tape sample will actually
still turn on and off on the bonus levels without having to update MAME2003's sample core to support pausing, it might however just end up playing all through
the game or at the wrong times without the pause command.Right the other thing is during the midway update they changed how the sound code is piped via the IO ports, i cant use the new handling so attempt to roll the code back
using the existing code we have for this in the older driver guesswork more or less or but i have put a little thought into it :)//ssio_set_custom_output(4, 0x01, journey_op4_w);
install_port_write_handler(0, 0x04, 0x04, journey_sample_select_w);ssio_set_custom_output(4, 0x01, wacko_op4_w);
install_port_write_handler(0, 0x04, 0x04, wacko_mux_select_w);notice wacko has the same values as journey with regards to the sound write via the IO ports in the new driver so i simply match that up in our ole driver, it could be
right it could be wrong that's guesswork afterall ;)anyway here is my current WIP it should compile in MAME2003 let me know how you get on with it.
https://www.sendspace.com/file/rp0ak7 -
Actually we cant have sample_stop(0, ~data & 1); as that define is for a later version of the MAME sample player, i think this should be ok
static WRITE_HANDLER( journey_sample_select_w )
{
/* if we're not playing the sample yet, start it */
if (!sample_playing(0))
sample_start(0, 0, 1);/* bit 0 turns cassette on/off */ if ((~data & 1)) sample_stop(0);
}
-
@arcadez2003 if I'm understanding your thoughts. You're trying to put everything journey needs for the cassette into the mcr2.c driver to be stand alone? We could add new functions in there that only support journey leaving other games undisturbed
From what I read the tape would pause when you were on the normal levels then resume in the bonus rounds. That way everytime you were on a bonus round you'd be listening to a new clip of the song instead of starting from the beginning of the song each time.
You can test the cassette from the service menu under "cassette" too btw. You can play the tape, pause it then resume. If it works there it will work in the game.
And I tested journey in mame2010, the cassette works but the sound of the rest of the game is crackling. What ever they did to the audio wasn't a good change as it sounds near perfect in mame2003-plus. And don't get me started on the menus, 2003 seems much more stable. So if we could just add the cassette without a major overhaul that would be ideal.
-
Ok good news and bad, firstly the good i have the sample up and running now which is good in the sense at least i know all the code in the driver is good
however now the bad the sample is playing constantly when it shouldn't be, i know what the problem is just not sure how to go about hacking around it
im gonna ask dink if he has any suggestions later if not then the samples will have to be updated to support the pause feature.And i may as well tell ya now this wont be easy as the sample code from MAME98 is totally different from MAME2003.
-
Is sample stop not working ?
-
@grant2258 said in Journey sound sample in mame:
Is sample stop not working ?
It's meant to pause rather than stop per say with the code they added but i think i've got it to start and stop now, certainly i can turn the sample tape on
and off now in the service mode the only problem now is im not good enough at the game to actually get to the bonus stage where the tape sample
actually kicks in to see if it'll trigger and then turn off correctly as it's meant to.Well it's upto you @mahoneyt944 to test this out with the driver i send ya earlier simply find and then replace with this.............
static WRITE_HANDLER( journey_sample_select_w )
{
if ((data & 1) == 0)
sample_stop(0);else if (!sample_playing(0)) sample_start(0, 0, 1);
}
-
ive not really played that game much it is hard though
-
@grant2258 said in Journey sound sample in mame:
ive not really played that game much it is hard though
Aye and the cheats only give ya unlimited lives, cannot die would have been better for testing hopefully @mahoneyt944 will be good at it.??
i assume so since he noticed the sample doesn't work in the first place he must be able to get to the bonus stage -
ill test and report back
-
@arcadez2003
The sample is too large and crashes the mixer....3 minute song. If I cut it to 1:30, it works. Might need to figure out the size limit and expand it to except the whole songcould probably change the code to this too?
static WRITE_HANDLER( journey_sample_select_w ) { if ((data & 1) == 0) sample_stop(0); else sample_start(0, 0, 1); }
-
Hmm might it be a memory issue with the sample.?? certainly we had to use a sample shrinking program to reduce the Toaplan samples down from 160mb
to around 20mb or so for xbox use back in the day as the games could crash due to the 64mb memory limit , as for the handler whatever you think is best
i just grabbed it from FBN and reworked it for our codebase...........static void journey_op4_write(UINT8, UINT8 data)
{
if ((data & 1) == 0) {
BurnSampleStop(0);
}
else if (!BurnSampleGetStatus(0)) {
BurnSamplePlay(0);
}
}static WRITE_HANDLER( journey_sample_select_w )
{
if ((data & 1) == 0)
{
sample_stop(0);
}
else if (!sample_playing(0))
{
sample_start(0, 0, 1);
}
}I had it like this before but it seems cleaner the above way
/*
static int tape_off = 1;
int journey_sound_playing = 0;WRITE_HANDLER( journey_sample_select_w )
{
tape_off = ((~data & 1));if (tape_off) { if (journey_sound_playing == 1) { journey_sound_playing = 0; sample_stop(0); } } else { if (journey_sound_playing == 0) { journey_sound_playing = 1; sample_start(0,0,1); // tape sample } }
}
*/ -
@arcadez2003 yeah I like this way, short and sweet. I'll test the else if statement
static WRITE_HANDLER( journey_sample_select_w ) { if ((data & 1) == 0) sample_stop(0); else sample_start(0, 0, 1); }
The full sample is 15.4MB, cut in half it works. So it's a memory issue. Need to figure that out. Worse case we can link multiple smaller samples
It would be cool to get the pause feature added so it's correct though. Plus it would get old always hearing the intro lol.
Great step in the right direction ๐
-
Just tested the smaller sample and there's an issue. The sample starts just before going to the bonus scene then it restarts in the beginning of the bonus scene. I'm guessing this is where the pause feature would need to be working so you don't notice the change. Or maybe it's the else if I removed ๐ I'll test again. Man this game is hard.
-
@mahoneyt944 said in Journey sound sample in mame:
Just tested the smaller sample and there's an issue. The sample starts just before going to the bonus scene then it restarts in the beginning of the bonus scene. I'm guessing this is where the pause feature would need to be working so you don't notice the change.
Try it again with the original handler before you changed it to see if that smooths it out, listen with regards to the sample pause feature apart from not having the time
to work on adding support for it now, due to the massive rewrite of every sound core circa MAME93 i dont see any easy way to backport the code for this from MAME98.In a nutshell in MAME2003 our sample handlng is split between samples.c and mixer.c where as in later MAME both of these were combined into one file and the code
totally rewritten, it's like chalk and cheese the code is not compatible with our older core, and i dont mind telling ya it might be above my level to create the sample
pause code myself totally from scratch, but at least we have the sample playing now which although there are a few niggles here and there is better than no sample at all :)Feel free to study the code and try and add support for the sample pausing yourself if you fancy taking a stab at it sometime.............
-
@arcadez2003
Very valid points... ... Hmmmmm
I have an idea, what if we leave the song playing on loop and just mute it instead of stopping it? That way the bonus scene will always have a random sound clip playing. This would be much better than always listening to the same intro on every bonus scene. Our start option will unmute and then play. Stop will just mute but continue playing. If it's already playing just unmute. A pause workaround.Maybe
static WRITE_HANDLER( journey_sample_select_w ) { if ((data & 1) == 0) sample_set_volume(0,0); else if (!sample_playing(0)) { sample_set_volume(0, 100); sample_start(0, 0, 1); } else sample_set_volume(0, 100); }
I'll have to test the volume values.
Update this works!, Though it's a little quieter than it should be at 100, this is rock-'n'-roll so it needs to be loud :)
Now to fit the whole song :)
-
I'm pushing 1:50 with some compression audio tricks. Still 1:13 shy. We need to figure out how to expand the memory here like they did in mame2010 or get really good at compressing this sample. I dropped it from 32 float to 16 bit and it's still not enough but saved space for sure. If the memory can't be expanded maybe we can link multiple samples somehow. If that were possible you could have a whole journey album playing at random, which would be pretty awesome.
What is default value of "sample_set_volume"? This is basically a pre-mixer amplifier from what I can tell. It doesn't seem to have a cap, well it does technically when you get clipping . I'm using "1500" and it sounds pretty good. "100" just sounds flat to me. I'm guessing "1000" might be default but not sure.
-
I used audacity to shrink the Toaplan samples it was so long ago i cant mind the settings i used, but im sure i set it to mono and 8-bit the sample went from
160mb down to 20mb or so, what are you using here an Rpi.?? the sample does not crash for me on the xbox and we only have 64mb of memory all in
im sure the rpi has more, although it doesn't make sense it would crash in MAME2003 but not MAME2010.With regards to sample set volume default values i dunno much about it really having only set the volume in the main interface
btw 25 is the standard volume setting for this game...............struct Samplesinterface journey_samples_interface =
{
1,
25,
journey_sample_names
}; -
@arcadez2003 I'm using a rpi3b+, the sample works in 2010 fully. I had to use audacity to cut the sample from 3:03 to 1:50 for it to work in 2003plus. Then saved it as 16 bit mono. It started as 32 float mono. Cutting it down makes it work. If not I get a screech that crashes the emulator.
The volume thing is tricky because you have mixer volumes and levels and the sample volume. I'm not sure exactly why but if set to 100, I can hear it but the other game sounds are much louder. If I set it to 10,000 it hits clipping. If I set it to 5000 I get clipping. 2000 is too loud, 1500 is slightly too loud, 1000 is probably just right.
-
this mame wont use stereo samples only mono you need to save each channel
-
@grant2258 Im pretty sure it's right. I got it from here http://www.progettosnaps.net/samples then I used audacity to cut it down more. The sample won't work in 2003plus if it's 3 minutes long. But it does works at 1:50 just fine (audacity- export wav 16 bit). So it's a space issue I think. 1:55 crashes.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.