X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fcd%2Fpcm.c;h=7bd8685fa8a3573e5fdf41bf23a40e263156b038;hb=fa22af4cafc6a87a3d9da07f377fc93e6a3bf55d;hp=2b818e01771a9d21904e50c3594e67f43805efbd;hpb=68cba51e206ea6089e8ebc04d7dcd9980bc9575c;p=picodrive.git diff --git a/Pico/cd/pcm.c b/Pico/cd/pcm.c index 2b818e0..7bd8685 100644 --- a/Pico/cd/pcm.c +++ b/Pico/cd/pcm.c @@ -1,9 +1,13 @@ +// Emulation routines for the RF5C164 PCM chip. +// Based on Gens code by Stéphane Dallongeville +// (c) Copyright 2007, Grazvydas "notaz" Ignotas + #include "../PicoInt.h" #include "pcm.h" static unsigned int g_rate = 0; // 18.14 fixed point -void pcm_write(unsigned int a, unsigned int d) +PICO_INTERNAL_ASM void pcm_write(unsigned int a, unsigned int d) { //printf("pcm_write(%i, %02x)\n", a, d); @@ -46,19 +50,17 @@ void pcm_write(unsigned int a, unsigned int d) } -void pcm_set_rate(int rate) +PICO_INTERNAL void pcm_set_rate(int rate) { float step = 31.8 * 1024.0 / (float) rate; // max <4 @ 8000Hz step *= 256*256/4; g_rate = (unsigned int) step; if (step - (float) g_rate >= 0.5) g_rate++; - printf("g_rate: %f %08x\n", (double)step, g_rate); + elprintf(EL_STATUS, "g_rate: %f %08x\n", (double)step, g_rate); } -// TODO: make use of the fact that max_length == 3 - -void pcm_update(int *buffer, int length, int stereo) +PICO_INTERNAL void pcm_update(int *buffer, int length, int stereo) { struct pcm_chan *ch; unsigned int step, addr;