Beispiel #1
0
        private static void EmuCallback(IntPtr userData, IntPtr stream, int len)
        {
            long bufCnt = len / 4;

            for (int i = 0; i < bufCnt; i++)
            {
                mds.Update(emuRenderBuf, 0, 2, OneFrame);

                frames[i * 2 + 0] = emuRenderBuf[0];
                frames[i * 2 + 1] = emuRenderBuf[1];
                //Console.Write("Adr[{0:x8}] : Wait[{1:d8}] : [{2:d8}]/[{3:d8}]\r\n", vgmAdr, vgmWait, buf[0], buf[1]);
            }

            Marshal.Copy(frames, 0, stream, len / 2);
        }
Beispiel #2
0
        private static int EmuCallback(short[] buffer, int offset, int count)
        {
            try
            {
                long bufCnt = count / 2;

                for (int i = 0; i < bufCnt; i++)
                {
                    mds.Update(emuRenderBuf, 0, 2, drv.Rendering);

                    buffer[offset + i * 2 + 0] = emuRenderBuf[0];
                    buffer[offset + i * 2 + 1] = emuRenderBuf[1];
                }
            }
            catch//(Exception ex)
            {
                //Log.WriteLine(LogLevel.FATAL, string.Format("{0} {1}", ex.Message, ex.StackTrace));
            }

            return(count);
        }