libretro / mame2003-plus-libretro

Updated 2018 version of MAME (0.78) for libretro. with added game support plus many fixes and improvements
Other
189 stars 108 forks source link

WIP: Michael Jackson's Moonwalker & Other Custom OSTs Discussion:) #302

Closed KMFDManic closed 5 years ago

KMFDManic commented 6 years ago

@markwkidd @twinaphex

This will be the next one in line for Custom OST! gpstar is working on finalizing things, and I will keep you both updated! Here is a test video I threw together for it:)

https://www.youtube.com/watch?v=PhIBMtFJkI8

Once the coding changes are committed on my Github, I will inform you, so you can grab them:)

markwkidd commented 6 years ago

Hell yeah! You know that Moonwalker is one of my favorite games, and it's always what I use first to test a new arcade emulation rig, right? Nice.

On Fri, Jul 6, 2018, 9:25 PM Kyland K notifications@github.com wrote:

@markwkidd https://github.com/markwkidd @twinaphex https://github.com/twinaphex

This will be the next one in line for Custom OST! gpstar is working on finalizing things, and I will keep you both updated! Here is a test video I threw together for it:)

https://www.youtube.com/watch?v=PhIBMtFJkI8

Once the coding changes are committed on my Github, I will inform you, so you can grab them:)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libretro/mame2003-plus-libretro/issues/302, or mute the thread https://github.com/notifications/unsubscribe-auth/ASphdipnHjdohlOSKM4pMPU2pwX6VwrOks5uEA38gaJpZM4VGLdf .

KMFDManic commented 6 years ago

@markwkidd I will be officially releasing this on Saturday the 14th. I will set you up with the pertinent samples and such for testing purposes, as well as let you know when the coding changes are on my Github.

Darknior commented 6 years ago

Yes excellent i love this game too :) Thanks for this future patch

KMFDManic commented 6 years ago

@Darknior @markwkidd Commits are now on my Github, if you want to play around with things. And, in my Release, go to the Mega NZ Link, Xtras/Arcade/Samples, to grab the appropriate samples and ReadMes!

https://github.com/KMFDManic/NESC-SNESC-Modifications/releases

You can message me on Reddit, under MDFMKanic, regarding fuller fledged Flacs, Wavs, etc, for testing purposes.

Note: Memory Limit Commit applies to Minis. So, you may not necessarily need that one. Hopefully, all works out, as things are testing through the roof on the Minis:) Enjoy:)

ghost commented 6 years ago

@KMFDManic ive added the pull request for moonwalker ost support for wav files. Ive tested with your samples all seems good.

KMFDManic commented 6 years ago

@grant2258 Flac files should work fine, as well. I will post some of those so you can test those, too...if you wish.

ghost commented 6 years ago

@KMFDManic I didnt add the flac stuff I just the driver changes its up to mark is he wants to change cores sample system like that.

markwkidd commented 6 years ago

I think it would be great to have support for a modern format like FLAC! A PR is very welcome as long as there are some folks willing to help make sure it works :)

It is likely another month before I do much new coding or testing myself, other than something like fixing a bug in existing code I wrote etc. It's all travel days and deadlines till the middle of august at least! I miss the month of May when I was in New Orleans the whole time, and I had time to code!

On Tue, Jul 17, 2018 at 10:43 AM, grant2258 notifications@github.com wrote:

@KMFDManic https://github.com/KMFDManic I didnt add the flac stuff I just the driver changes its up to mark is he wants to change cores sample system like that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libretro/mame2003-plus-libretro/issues/302#issuecomment-405607184, or mute the thread https://github.com/notifications/unsubscribe-auth/ASphdj82-3UC4BcPka9NdIz04RuLEV8vks5uHff3gaJpZM4VGLdf .

-- Mark W. Kidd http://facebook.com/markwkidd (606)536-0115

Wilstorm commented 6 years ago

@KMFDManic - Thanks for the work on this. These custom OST's are nice additions, thanks! I see the samples are 8-bit unsigned mono, roughly 352kbps. Is there any chance to test the 16-bit signed mono?

@markwkidd & grant2258 - I think FLAC would be a great optional especially for folks running on modern hardware. Unless FLAC runs decent on slower devices like the Pi then it's an even better optional. :) If you do implement FLAC support I'll do some testing.

ghost commented 6 years ago

@Wilstorm there is a readme that give you the info on how to make the wavs if you want to do it yourself here is the info from the readme

_km_mame2003_xtreme_moonwalker_7_14_18.txt

Wilstorm commented 6 years ago

@grant2258 - That sounds good. Are the 16-bit left/right channel samples available for testing? I would guess the 16-bit WAV & FLAC are from the same source being lossless. The ones in the archive are an 8-bit mono-mix (you can tell by the bitrate), so they are much smaller. It would be a fun test. The file size (loaded/using memory) is the biggest factor it seems followed by processing to PCM. It will be lossless but smaller than WAV but also longer to process to a PCM stream. It would be interesting to see if there's performance "stutter" using FLAC's vs WAV's or no difference but a nice space savings going to FLAC as it's lossless.

I have converted about 2,500 CD's to WAV, FLAC and MP3 using EAC (all commercial pressings hash verified but local and homemade a little tougher but still hash verified with multiple passes) so I have that process down to a science. I think I can pull it off in my sleep, I think!

♪♫♬ I--M, I--M, shove a B between and it's IBM, no one can copy them. ♪♫♬

Wilstorm commented 6 years ago

I was just messing around with the 8-bit samples and I can get them 51% smaller as FLAC vs the equivalent WAV so the space savings is significant.

Wilstorm commented 6 years ago

Ok last one just for fun if you're into that kind of stuff. I was just messing with a spectrogram of the Final Fight samples because I have both the 8-bit mono-mix and 8-bit left/right split. From the screenshots below it looks like the right channel has been completely discarded. I mainly use a spectrogram to see if an audio file has been upconverted so take it with a grain of salt! ;)

Final Fight 8-bit left channel: final fight left channel

Final Fight 8-bit right channel: final fight right channel

Final Fight 8-bit mono-mix: final fight 8-bit mono-mix

ghost commented 6 years ago

Well in all honesty there is problems adding this commit because a lot has changed on our fork it will involve some work on our part whenever the free time comes for the flac. The wavs do work so that will have to do for the moment.

Unmerged paths: (use "git add/rm ..." as appropriate to mark resolution)

    both modified:   Makefile
    both modified:   Makefile.common
    both modified:   src/artwork.c
    deleted by us:   src/audit.c
    both modified:   src/common.c
    both modified:   src/common.h
    both modified:   src/drivers/system18.c
    both modified:   src/fileio.c
    both modified:   src/fileio.h
    deleted by us:   src/libretro/osd.c
    both modified:   src/sound/samples.c

it appears it was forked from here https://github.com/libretro-mirrors/mame2003-plus-libretro and that mirror is back at aprils code base

Wilstorm commented 6 years ago

@grant2258 - Thanks Grant, wav is great and I have no issues at all here. I think flac is just the iciing and not required at all.

I was looking at the readme and it's pretty neat that you could potentially have both wav and flac in the sample archive and it will prioritize the flac over wav if it finds both or you can do a combination of some wav and some flac if needed.

KMFDManic commented 6 years ago

@Wilstorm If you want any of the flacs to test, I can throw some into the Mega NZ Link.

ghost commented 6 years ago

@KMFDManic that would be great if you could add some flac that way i can have something to work with when i get the time to do the coding

Wilstorm commented 6 years ago

@KMFDManic - Yes that would be great! :)

KMFDManic commented 6 years ago

@grant2258 @Wilstorm

https://mega.nz/#F!e55DVTqA!jkfylvaQ-6I0Y59Ov1SamA

Xtras/Arcade/Samples/moonwlkbwavs&_flacs

Enjoy:)

Also @Wilstorm I would like to "test" an 8 bit flac sample set, if you don't mind sharing that. I am curious to see what magic you can work with the sizes. I would, ideally, love to get all of the Custom OSTs down in size.

ghost commented 6 years ago

@KMFDManic thanks for the flac it motivated me to fix it the pull req is on only tested with 16 bit flac

@markwkidd i squashed the commit to keep it tidy a more detailed breakdown is here https://github.com/grant2258/mame2003-plus-libretro/commits/moonwalker

markwkidd commented 6 years ago

@grant2258 there is a little c99 syntax issue emscripten is choking on: http://p.0bl.net/19901

`

src/sound/samples.c:32:4: error: implicit declaration of function 'readsample' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

readsample(Machine->samples->sample[samplenum], samplenum, Machine->samples, 1, 0); ^ 4`

On Thu, Jul 19, 2018 at 6:47 AM, grant2258 notifications@github.com wrote:

@KMFDManic https://github.com/KMFDManic thanks for the flac it motivated me to fix it the pull req is on only tested with 16 bit flac

@markwkidd https://github.com/markwkidd i squashed the commit to keep it tidy a more detailed breakdown is here https://github.com/grant2258/ mame2003-plus-libretro/commits/moonwalker

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libretro/mame2003-plus-libretro/issues/302#issuecomment-406235425, or mute the thread https://github.com/notifications/unsubscribe-auth/ASphdkw0mnVTtXIzK0Mf3busosaVtWkPks5uIGPbgaJpZM4VGLdf .

-- Mark W. Kidd http://facebook.com/markwkidd (606)536-0115

Wilstorm commented 6 years ago

@KMFDManic - You rock and thanks a bunch for sharing! :) Here's the 8-bit mono mix and 8-bit stereo WAV's encoded to FLAC. I was able to go from 86.4 down to 42.5 which is roughly a 51% space savings with the 8-bit mono and from 172MB to 73.9MB (which is is a whopping 57% smaller) on the 8-bit stereo.

Both the 16-bit mono and stereo have already been converted to FLAC but I tested it anyway I could only gain 1% more than what they already did. A little more on the mono vs stereo.

One thing I always wondered about is if zipping files as small as possible requires more processing to decompress (time) vs just storing them in zip format with no compression. I suppose either way is only nano seconds of difference.

Anyhow these samples are a lot of fun and pretty cool to listen too. MJ at the arcade! ;) They definitely have some distortion but I would imagine the original arcade had to do it to save space back then? Here's a few interesting spectrogram pics below. The first is the 8-bit mono mix of 'Beat It' and the second is the 16-bit mono mix. You can see they are pretty much identical but the 16-bit depth is more clear. Which I think is the difference between 'quantizing' sampled frequencies from 8-bit (256 values) to 16-bit (65,535 values). You can really see the hard cut off at around 16 kHz on the arcade samples which would be roughly equivalent to an mp3 ripped at 128k back then, if they were around that long ago. :) The last pic is the original from his CD 'Number Ones'.

Michael Jackson - Beat It (8-bit mono mix): beat it mono

Michael Jackson - Beat It (16-bit mono mix): beat it mono 16

Michael Jackson - Beat It (Number Ones CD): beat it org

ghost commented 6 years ago

@markwkidd went to fix it removed the pull req. I seen the prototyping was added already.

@Wilstorm test away you now have flac the distortion is normal when listening on windows the volume needs raised it mentions that in the readme it will fine in mame itself

KMFDManic commented 6 years ago

@Wilstorm that link seems to be going to your own login. Can you try zipping up folders and sending via:

https://uploadfiles.io/ Or, whichever other hosting site you feel worthwhile to do it through. Thanks for checking things out. You seem to have quite a background deal of experience in the various encoding and conversion processes. I have my own share from doing many many Turbografx-CD and Sega-CD Games, and so on, hehe:)

Wilstorm commented 6 years ago

@KMFDManic - Sorry, I am not great on good file hosting websites. Here's a link at the site you suggested. It's a really handy site I'll have to bookmark that one.

My other "hobby" would be ripping music CD's. I have stacks and stacks of CD's in my basement and a few years back I started looking into the most accurate bit-for-bit method I could find and it lead me to Exact Audio Copy (EAC -- it's free too) and it just kind of built from there researching all the best options and settings to use.

There's another similar program that you have to pay $50 or something for and it has fewer options but is very user friendly for those that just want to get a decent rip quickly. I preferred to research and understand the process of what I was including and eliminating in the process. I know there's some true audiophiles that get into the hair splitting details beyond my understanding unless they explain it in layman's terms but that I guess that's why they call them audiophiles. Take everything I write with a grain of salt and feel free to correct anything that I might misunderstand.

Anyway lately I've been reading up on the "loudness wars" which has a great wiki explaining it and also there's an online loudness database to compare album pressings. It is kind of interesting and I've been tracking down some older pressings of my favorite music before they favored loudness over dynamic range.

@grant2258 - Thank you for all the new updates and adding FLAC support and thanks KFMDManic for the samples to test things out! Triumph, triumph I say good sirs! ;)

ghost commented 6 years ago

@KMFDManic i have a bug report for you. Im not sure weather to post this here or on your repo. Using wavs everything is ok. When we use flacs we get a segfault on exiting . Ive temperately fixed this by disabling the auto_free code (not ideal but better than a segfault). This one is easily missed as it happens on RA exit. It will stop hi scores and anything else RA saves on exit working.

update the issue is fixed the fix is simple I have added the pull req here and a pull request is on your repo as well.

If there is any problems just @myname I dont use libretro much anymore but happy to help with little things on the mame2003 improvement when i can

KMFDManic commented 6 years ago

@grant2258 Much appreciated. Very nice of you to take the time to look into fixing things up, for the benefit of many:) Is it possible the segfault could potentially cause other conflicts, aside from the resulting ones from RA exiting? Again, thanks for the lesser of two evils fix, for now!

@Wilstorm Thank you. I didn't get a chance to grab it yet. But, I will when I am hope. Looking forward to testing it out:)

ghost commented 6 years ago

@KMFDManic not a problem at all. Mame tracks allocated memory with auto_malloc and auto_free functions. When you do a manual free() the auto_free doesnt know youve done it and tries again and you get a segfault.

Its just mames exit cleanup whatever ra does on exit would be effected and mame like saving hi scores ect and ra saving changed options ect.

It also only effects ost games that use flac samples so its not a major thing. Wavs are completely uneffected as are all other games.

I think these osd tracks give games a nice authentic feel I think gpstar does great work.

KMFDManic commented 6 years ago

@grant2258 Always great to have second, third, fourth, and more opinions on something as important as Custom OSTs. These certainly add a tremendous additional element to the games we all grew up on loving. It will be very tough to think of one to surpass Moonwalker. Final Fight was Big Blue Frontend's idea. And, gpstar continued that awesomeness, getting it working for MAME 2003. He originally wanted to do it with MAME 2014. I advised that MAME 2003 was the only route he should consider! And, that has worked out, quite nicely! Mortal Kombat was his next one. Then, I started thinking of other ones that would benefit, such as NBA Jam with Sega CD OST, and Out Run (absolutely loved how this one turned out:). Then, of course the ultimate one I could think of, Michael Jackson's Moonwalker with the Real Deal music! But, what could possibly be as cool as these? I have a few interesting ideas that could be fun. But, these ones are really top notch. Street Fighter II (whichever version) seems to be the post proposal. But, it has been done in a very nice way on SNES9x with MSU-1 support, already! Is it really worth the effort to do it? Not exactly sure:) But, it would definitely need the 3DO Soundtrack, if it was done! Not to mention, the speed up when low health, would need accounted for! So, what else could possibly match the greatness of these previous Custom OSTs:)? I will keep trying to ponder another fun idea or two! Also, with Out Run Custom OST, I actually contacted the copyright owners, as well as the original Artists, for permission to use their music, once it was added. I showed them Test Demonstrations of them in action. They were fine with it as long as no profit was made, hehe:)

@Wilstorm Great work on the flac conversions. I will continue to test and try new things out:)

@markwkidd As always, thanks for bringing me into this great Community:) MAME is my lifeblood, right after the original NES, of course!

Wilstorm commented 6 years ago

@KMFDManic - Thanks for sharing and pulling all these custom OST's together. They are definitely the icing on the cake and an incredibly fun addition. It's pretty cool the copyright owners gave you their blessing for cool projects like these. I definitely look forward to what you come up with next!

KMFDManic commented 6 years ago

@Wilstorm Great work on the 8bit flac. 8bit isn't currently supported in the coding. But, I wanted to see how things played out. This isn't an issue on PC, obviously. But, on the Mini NES/SNES, there is roughly 230/330 Internal NAND Flash Memory to work with! So, those who want to stick to using that memory, 8bit flac would be a true godsend. Gpstar is going to start looking into 8bit flac working with MAME 2003. If it goes through, and everything works out, it would be greatly appreciated if you could assist on getting a good set of the flacs together for Release and Public Consumption in my Set:) I will follow-up with you on this, once everything is said and done. I am also pondering the next Custom OST that would be workable.

KMFDManic commented 6 years ago

@grant2258 @Wilstorm We are currently attempting to get Double Dragon Custom OST done. But, there is a weird conflict. @grant2258 I temporarily reverted a few of your commits (but, have them backed up), just to ensure I can pinpoint the potential conflict. But, if you can both do me a favor, and test this on your PC end. Test ANY Double Dragon game:

Oddly enough, they work on Mini NES/SNES! But, on PC, when gpstar tried compiling it, they crashed! gpstar believes there may be a potential conflict with the Yamaha YM2151 emulator code? There are a few things that do not run the same way on PC, as they do on the Mini. 2nd and 3rd opinions would go a long way on this one:) Irem Games are the other fun conflict I have to deal with every once in awhile:) But, that is a different story!

Reverted Commits: (Did this temporarily, but will put back once things are sorted out!)

https://github.com/KMFDManic/mame2003-xtreme

Current Coding: (ideally where I want things to be in final form!)

https://github.com/gpstar81/mame2003-xtreme


debug output is:

stop reason = EXC_BAD_ACCESS (code=1, address=0x5031623bc)
    frame #0: 0x0000000111f21956 mame2003_libretro.dylib`YM2151UpdateOne + 2246
mame2003_libretro.dylib`YM2151UpdateOne:
->  0x111f21956 <+2246>: addl   0x39c0(%r10,%rax,4), %ecx
    0x111f2195e <+2254>: imull  0xc(%r10,%rsi), %ecx
    0x111f21964 <+2260>: shrl   %ecx
    0x111f21966 <+2262>: addl   %ecx, (%r10,%rsi)
Target 0: (RetroArch) stopped.```

In any case, thank you both, or anyone else who tests Double Dragon (Any Version:)
ghost commented 6 years ago

you want mame-xtreme or mame2003-plus tested ?

ghost commented 6 years ago

its works fine on mame2003+ end. is gpstar using 32 or 64 bit I remember i had to do a YM2151fix for 64 bit not sure if you port has that or not.

ghost commented 6 years ago

@KMFDManic ok its fixed big man i put a pull req in for gpstar one line of code :)

KMFDManic commented 6 years ago

@grant2258 You absolutely rock! You have been a huge help in getting Double Dragon Custom OST in order:) Thanks again!

ghost commented 6 years ago

not a problem my good man its all for a good cause

KMFDManic commented 6 years ago

I don't want to give too much away, but here is my idea for the title screen!

https://www.youtube.com/watch?v=F4VNZAnJ1UE

I think it is perfectly fitting. What do you think?

Again, I am thoroughly glad you sorted this so fast! I can now go to work happy:)

ghost commented 6 years ago

Well i just finished work early for a change this was fixed fast because i already had an idea what it was from fixing it before 👍 i like the title screen tunage!

Wilstorm commented 6 years ago

A little late but tested ddragonu, ddragn2u and ddragon3 and all 3 run fine.

KMFDManic commented 6 years ago

@grant2258 @Wilstorm Thank you both:) And, @grant2258 Glad you enjoyed the selection for the title screen. Choosing an Arcade Game to have a Custom OST is no easy task. There is a very fine line between gimmick and annoying, versus timeless! The Custom OSTs that have been done thus far are all timeless! They will hold up well, and still be fun in 10+ years down the road. Something like Pac-Man Fever being played during Pac-Man, every single stage, would surely drive you insane, after a half dozen stages! Double Dragon has what it takes to pull off a Custom OST. There is an incredible amount of music and cover tunes related to Double Dragon, that will make this a perfect choice! I think a combination of vocals and high energy guitar driven songs will do the trick, in this case!

Thanks again!

And, @grant2258 since you compiled the Xtreme, can you test In the Hunt, and see how Irem Encryption sounds for you? That is the only other thing I am worried about fixing for the moment! Just curious how it plays out for you. In the latest Xtreme Coding, depending on how it is compiled, Irem Games on the Mini can have bad sound or good sound! I am wondering if there is a definitive fix for this oddity:)

Much appreciated! You both, as well as everyone else involved, is helping make MAME 2003 more amazing, by the day, for the Mini NES/SNES!

NOTE: I changed this issue to a Topic of Discussion, so we can continue with the greatness of the Custom OSTs!

ghost commented 6 years ago

arcade done some fixes on irem see if its the same in 2003+

KMFDManic commented 6 years ago

@grant2258 My primary goals for MAME 2003 Xtreme are the following:

ghost commented 6 years ago

can you give me more detail on what compile makes a difference ?

KMFDManic commented 6 years ago

@grant2258 This is where things get tricky! The compiler used to fix Irem is the official one Nintendo uses Buildroot2015, which ironically works with Irem properly! But, some other Cores do not properly compile with this set-up! The one that does not work with Irem properly is the standard gcc cross compile! This is another case where on PC Irem functions ok, but on the Mini, there is something breaking it! It isn't a HUGE deal, as I can still do Irem using the Buildroot2015. But, I would rather be able to do it like most other Cores with the standard gcc cross compiler set-up! I am just curious, like with the goofball Double Dragon break, what could cause Irem sound to not function:) Thanks so much for the input!

ghost commented 6 years ago

try adding -fsigned-char to your platform flags arm has the same problem without that flag

KMFDManic commented 6 years ago

@grant2258 Thanks, yet again:) I am going to do another video, once Double Dragon is done. I want to showcase "Arcade Games with Rocking Soundtracks". These, in essence, will be the rare Arcade Games that have real songs in them, to a degree. Like Violent Storm! I know a few of them. Not sure if you are familiar with any? But, these are definitely inspiration for many a Custom OST:)

ghost commented 6 years ago

never heard them to be honest my ne chd games I dont have any of them. I dont know why i dont i just seem to stick to the rom based ones. Looking forward to the video! let us know when its posted :)

Wilstorm commented 6 years ago

@KMFDManic - I agree I am a big fan of Pac-Man Fever (the whole album) but it could wear a bit thin if played to many times back to back. I would love to see it on CD again but Columbia/CBS is keeping it under tight wraps and refuses to re-release it. Then when Buckner & Garcia attempted the remake in the late 90s due to Columbia/CBS's refusal and no access to the original it just wasn't as good.

I really look forward to how it turns out and I agree I've "groomed" my kids to appreciate these old classics so hopefully they will carry the legacy by continuing to play them years down the road! ;)

@grant2258 - It's time! Download gigs and gigs of CHD's! You know you want them to be readily available to play by burning up all your storage! I think I have 500 or 600GB with all the rollbacks...

KMFDManic commented 6 years ago

@grant2258 Arcade Games with vocal tracks are quite rare:) But, luckily, over the years, I have run into enough to get my attention. I will showcase some of these in the video, along with Double Dragon Custom OST, once it is done! Did you ever see the video where I played Rogha? Haha:) gpstar is back on track, with your coding fix. Thanks for saving a hell of a lot of time. We would have had to dig through a lot of commits to find anything related to a Double Dragon break! Really hoping the Irem flag recommendation pans out, too! In my current Core Set, I have 3 MAME 2003 Cores. MAME 2003 Xtreme (which has the goals I listed above in my other post), MAME 2003 Irem Variant (obviously, til it gets fixed:), and of course MAME 2003 Plus Experimental! (which I test every single time you guys add commits!)

@Wilstorm I think I figured out something that would "help" Pac-Man work! I was inspired to recommend something that we had not yet done with previous Custom OSTs. Most games have songs that "loop", after the track for that level is done! So, obviously, games such as Missile Command, Pac-Man, would get absolutely tedious if you used one single track, and it looped, looped, looped! I think I hit the nail on the head, as far as an absolutely perfect workaround to keep things fresh. Think mixtape:) From the moment you start Pac-Man, it will have Pac-Man Fever, of course! But, when the song typically ends, it will bridge into another song! So, essentially, it would be a subset of songs, all spliced cleverly together, like a mixtape:) So, Pac-Man Fever, and multiple other songs, back to back, which would truly and surely make any one shot (typically single track song) games perfect fodder for Custom OSTs!