Hi MarkeyJester. I'm interested in using the core yamaha (including other hardware) in ways not imposed by Sega's SDKs (assuming they're real). E.g. the core yamaha can't play samplerates above 16khz according to Sega sdks, but if I can buffer two 8-bit channels at 22050khz each (or 44100khz stereo) then I can get some more flexibility from the yamaha. I'm guessing this MegaPCM has coincidence with my curiosity... I'm also looking for any genuine documents and/or datasheets for the core yamaha unrelated to Sega. Same request for other hardware in MarsCD.
I made an optimized version of "sub_7272E" and "sub_72764". Firstly though, at the waitYM macro, change it to this: Code (Text): waitYM macro @wait\@ btst #7,(a0) bne.s @wait\@ endm Then at "sub_7272E", change all the code upto (but not including) "word_72790". Code (Text): sub_7272E: ; XREF: loc_71E6 stopZ80 lea ($A04000).l,a0 waitYM move.b d0,(a0) waitYM move.b d1,1(a0) move.b #$2A,(a0) startZ80 rts ; End of function sub_7272E ; =========================================================================== loc_7275A: ; XREF: sub_72722 move.b 1(a5),d2 bclr #2,d2 add.b d2,d0 ; ||||||||||||||| S U B R O U T I N E ||||||||||||||||||||||||||||||||||||||| sub_72764: ; XREF: loc_71E6A; Sound_ChkValue; sub_7256A; sub_72764 stopZ80 lea ($A04000).l,a0 waitYM move.b d0,2(a0) waitYM move.b d1,3(a0) move.b #$2A,(a0) startZ80 rts ; End of function sub_72764 If you're going to reuse an address, it's faster to set it to a0. Also, because the address was set, the bottom waitYMs were no longer needed. Also, I not sure but the "nops" in the stopZ80 macro don't seem to be necessary (as far as I know); so remove them.
A problem with the Hivebrain Mega PCM. I was testing it in Sonic 1 but when getting a 1-Up in a Special Stage the FM 6 instrument went missing.
That's not an issue with MegaPCM, that's a vanilla S1 sounddriver issue. (One of many) Which already has a wiki guide for fixing it, btw.
I'm having an issue installing Mega PCM with the latest Hivebrain disassembly, I can't find any of the files that the instructions of the first post are pointing to. Also, are there instructions for doing this in the GitHub disassembly? I'm trying to re-implement the Sonic 1 prototype drums and I was told I need to apply this for that to work
You don't need to replace the sound driver to reimplement the Sonic 1 proto drums. If you're using Hivebrain 2022 or GitHub AS, it's as simple as changing one line in the sound driver and three in the DAC driver: Spoiler Hivebrain 2022 (GitHub AS equivalents in parentheses) Open sound/Sound Driver.asm (s1.sounddriver.asm) and find DAC_sample_rate: Spoiler Code (Text): DAC_sample_rate: dc.b 18, 21, 28, 29, $FF, $FF GitHub AS lists the sample rates as hexadecimal, but is otherwise identical here. Add 5 to each of the first four values like so: Spoiler Code (Text): DAC_sample_rate: dc.b 18+5, 21+5, 28+5, 29+5, $FF, $FF Then, open sound/DAC Driver.asm (sound/z80.asm) and find PCM_Table (zPCM_Table) Spoiler Code (Text): PCM_Table: zsample dKick, 17h ; Kick sample zsample dSnare, 1h ; Snare sample zsample dTimpani, 1Bh ; Timpani sample The table is laid out differently in GitHub AS, but the values are the same. Change the pitch values from 17h, 1h, and 1Bh to 19h, 6h, and 20h respectively: Spoiler Code (Text): PCM_Table: zsample dKick, 19h ; Kick sample zsample dSnare, 6h ; Snare sample zsample dTimpani, 20h ; Timpani sample That's basically it. If you're using Hivebrain 2005 or the older ASM68K-based Git disasm, it's a little more complicated; the sound driver changes are more or less the same, but you'll need to build a replacement for the incbin'ed DAC driver. Information on that (and source of these instructions) can be found here.
Thanks! I actually got help from someone on this topic elsewhere, but I’m glad you posted it here too for anyone else who happens upon it. Funny story: I was doing this as part of a bugfixing spree to make a “perfect” Sonic copy for myself. Changing the drums made the filesize go up to 539kb and for some reason changing the GHZ palette to match the beta made the filesize go back to 512kb. (Those were the only two QoL changes I made)
It probably would make more sense to edit this part, then: Code (Text): if Revision=0 dcb.b $62A,$FF else dcb.b $63C,$FF endc ;dcb.b ($10000-(*%$10000))-(ROM_End-SoundDriver),$FF
Weird, but beta drums works correctly, if I just replace samples in the realese version disasm for those from the prototype..
I'm having a weird issue with MegaPCM, For some reason WAV samples play at a very low pitch even at $01 pitch, And even if I change the rate to 8khz, it still sounds super low the exact same way. This only happens for WAV files, making it RAW works, But I'd still like to know if there's a fix for it in the future.