amalgamation
[picodrive.git] / Pico / sound / sound.c
index c0b3252..6a45033 100644 (file)
@@ -8,14 +8,9 @@
 \r
 \r
 #include <string.h>\r
-#include "sound.h"\r
 #include "ym2612.h"\r
 #include "sn76496.h"\r
 \r
-#ifndef __GNUC__\r
-#pragma warning (disable:4244)\r
-#endif\r
-\r
 #if defined(_USE_MZ80)\r
 #include "../../cpu/mz80/mz80.h"\r
 #elif defined(_USE_DRZ80)\r
 // master int buffer to mix to\r
 static int PsndBuffer[2*44100/50];\r
 \r
-//int z80CycleAim = 0;\r
-\r
 // dac\r
-short *dac_out;\r
-unsigned short dac_info[312]; // pppppppp ppppllll, p - pos in buff, l - length to write for this sample\r
+static unsigned short dac_info[312]; // pppppppp ppppllll, p - pos in buff, l - length to write for this sample\r
 \r
 // for Pico\r
 int PsndRate=0;\r
@@ -51,7 +43,7 @@ void YM2612TimerHandler(int c,int cnt);
 extern int *sn76496_regs;\r
 \r
 \r
-static void dac_recalculate()\r
+static void dac_recalculate(void)\r
 {\r
   int i, dac_cnt, pos, len, lines = Pico.m.pal ? 312 : 262, mid = Pico.m.pal ? 68 : 93;\r
 \r
@@ -107,7 +99,7 @@ static void dac_recalculate()
 }\r
 \r
 \r
-void sound_reset()\r
+PICO_INTERNAL void sound_reset(void)\r
 {\r
   void *ym2612_regs;\r
 \r
@@ -169,7 +161,7 @@ void sound_rerate(int preserve_state)
 \r
 \r
 // This is called once per raster (aka line), but not necessarily for every line\r
-void sound_timers_and_dac(int raster)\r
+PICO_INTERNAL void sound_timers_and_dac(int raster)\r
 {\r
   int pos, len;\r
   int do_dac = PsndOut && (PicoOpt&1) && *ym2612_dacen;\r
@@ -217,7 +209,7 @@ void sound_timers_and_dac(int raster)
 }\r
 \r
 \r
-void sound_clear(void)\r
+PICO_INTERNAL void sound_clear(void)\r
 {\r
   int len = PsndLen;\r
   if (PsndLen_exc_add) len++;\r
@@ -226,7 +218,7 @@ void sound_clear(void)
 }\r
 \r
 \r
-int sound_render(int offset, int length)\r
+PICO_INTERNAL int sound_render(int offset, int length)\r
 {\r
   int  buf32_updated = 0;\r
   int *buf32 = PsndBuffer+offset;\r
@@ -333,7 +325,7 @@ static void DrZ80_irq_callback()
 #endif\r
 \r
 // z80 functionality wrappers\r
-void z80_init()\r
+PICO_INTERNAL void z80_init(void)\r
 {\r
 #if defined(_USE_MZ80)\r
   struct mz80context z80;\r
@@ -367,7 +359,7 @@ void z80_init()
 #endif\r
 }\r
 \r
-void z80_reset()\r
+PICO_INTERNAL void z80_reset(void)\r
 {\r
 #if defined(_USE_MZ80)\r
   mz80reset();\r
@@ -384,14 +376,14 @@ void z80_reset()
   Pico.m.z80_fakeval = 0; // for faking when Z80 is disabled\r
 }\r
 \r
-void z80_resetCycles()\r
+PICO_INTERNAL void z80_resetCycles(void)\r
 {\r
 #if defined(_USE_MZ80)\r
   mz80GetElapsedTicks(1);\r
 #endif\r
 }\r
 \r
-void z80_int()\r
+PICO_INTERNAL void z80_int(void)\r
 {\r
 #if defined(_USE_MZ80)\r
   mz80int(0);\r
@@ -402,7 +394,7 @@ void z80_int()
 }\r
 \r
 // returns number of cycles actually executed\r
-int z80_run(int cycles)\r
+PICO_INTERNAL int z80_run(int cycles)\r
 {\r
 #if defined(_USE_MZ80)\r
   int ticks_pre = mz80GetElapsedTicks(0);\r
@@ -415,7 +407,7 @@ int z80_run(int cycles)
 #endif\r
 }\r
 \r
-void z80_pack(unsigned char *data)\r
+PICO_INTERNAL void z80_pack(unsigned char *data)\r
 {\r
 #if defined(_USE_MZ80)\r
   struct mz80context mz80;\r
@@ -430,7 +422,7 @@ void z80_pack(unsigned char *data)
 #endif\r
 }\r
 \r
-void z80_unpack(unsigned char *data)\r
+PICO_INTERNAL void z80_unpack(unsigned char *data)\r
 {\r
 #if defined(_USE_MZ80)\r
   if(*(int *)data == 0x00005A6D) { // "mZ" save?\r
@@ -456,7 +448,7 @@ void z80_unpack(unsigned char *data)
 #endif\r
 }\r
 \r
-void z80_exit()\r
+PICO_INTERNAL void z80_exit(void)\r
 {\r
 #if defined(_USE_MZ80)\r
   mz80shutdown();\r
@@ -464,7 +456,7 @@ void z80_exit()
 }\r
 \r
 #if defined(__DEBUG_PRINT) || defined(__GP2X__)\r
-void z80_debug(char *dstr)\r
+PICO_INTERNAL void z80_debug(char *dstr)\r
 {\r
 #if defined(_USE_DRZ80)\r
   sprintf(dstr, "Z80 state: PC: %04x SP: %04x\n", drZ80.Z80PC-drZ80.Z80PC_BASE, drZ80.Z80SP-drZ80.Z80SP_BASE);\r