]> Shamusworld >> Repos - thunder/blobdiff - src/ym2151.c
Added MCU to execution loop and it works.
[thunder] / src / ym2151.c
index 46776eedba4887412417a013de2354836f722d58..a69a281e89a26cb544625a39c078ed20c3137ad2 100644 (file)
@@ -1,10 +1,17 @@
+//
+// Jarek Burczynski's YM2151 emulator
+//
+// Cleaned of most MAMEisms & cleaned up in general by James Hammons
+// (this is mostly a placeholder until I write my own)
+//
+
+#include "ym2151.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
 #include <stdint.h>
-//#include "driver.h"
-#include "ym2151.h"
 
 
 // Missing shit (from M.A.M.E.)
 #if 1
 #define PI 3.1415629535897932338
 static FILE * errorlog = 0;
-int cpu_scalebyfcount(int);
-void timer_remove(void *);
-void * timer_set(int, int, void (*)(int));
+//int cpu_scalebyfcount(int);
+//void timer_remove(void *);
+//void * timer_set(int, int, void (*)(int));
+
+// Bogus M.A.M.E. shite
+int cpu_scalebyfcount(int f) { return f; }
+void timer_remove(void * foo) { printf("STUB: timer_remove()\n"); }
+void * timer_set(int foo, int bar, void (* baz)(int)) { printf("STUB: timer_set()\n"); return 0; }
+
 #endif
 
 
@@ -821,7 +834,7 @@ void write_YM_D1L_RR_BASE(uint8_t n, uint8_t r, uint8_t v)
 ** 'rate' is sampling rate and 'bufsiz' is the size of the
 ** buffer that should be updated at each interval
 */
-int YMInit(int num, int clock, int rate, int sample_bits, int bufsiz, SAMPLE ** buffer)
+int YMInit(int num, int clock, int rate, int sample_bits, int bufsiz)//, SAMPLE ** buffer)
 {
        int i;
 
@@ -909,7 +922,7 @@ int YMInit(int num, int clock, int rate, int sample_bits, int bufsiz, SAMPLE **
 
        for(i=0; i<YMNumChips; i++)
        {
-               YMPSG[i].Buf = buffer[i];
+               YMPSG[i].Buf = 0;//buffer[i];
                YMPSG[i].bufp = 0;
                YMResetChip(i);
        }