Last active
May 7, 2025 03:36
-
-
Save kg68k/6d34134a58a0c652126a1d2407fa08fe to your computer and use it in GitHub Desktop.
Z-MUSIC v2 se_adpcm2 example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include "zmusic.h" | |
| static void se_adpcm2(int note_no, int pan, int freq, int priority) { | |
| register int reg_d1 __asm ("d1"); | |
| register int reg_d2 __asm ("d2"); | |
| register int reg_d3 __asm ("d3"); | |
| reg_d2 = note_no; | |
| reg_d3 = (priority << 16) | (freq << 8) | pan; | |
| reg_d1 = 0x14; // se_adpcm2 | |
| __asm volatile ( | |
| "trap #3" | |
| : // no outputs | |
| : "d" (reg_d1), "d" (reg_d2), "d" (reg_d3) | |
| : "d0", "a0" | |
| ); | |
| } | |
| int main(void) { | |
| char PcmFilename[] = "Res\\Snd\\pcm\\snd.pcm"; | |
| int note_no = 0; | |
| int pitch = 12; | |
| int vol = 100; | |
| int mix_note_no = -1; // Do not mixing | |
| int delay = 0; | |
| int cut = 0; | |
| int reverse = 0; | |
| int fade_in_out = 0; | |
| int pan = 3; | |
| int freq = 4; | |
| int priority = 0; | |
| int result = m_pcmset(note_no, PcmFilename, | |
| pitch, vol, mix_note_no, delay, cut, reverse, fade_in_out); | |
| printf ("m_pcmset() -> %d\n", result); | |
| se_adpcm2 (note_no, pan, freq, priority); | |
| return 0; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PCM8 v0.48b常駐時は正常に再生されません。
常駐なしか、PCM8Aなどの互換ドライバやPCM8 .48b+2を使用してください。