spu: try to improve timing
[pcsx_rearmed.git] / plugins / dfsound / externals.h
index f638b94..f3fbc67 100644 (file)
@@ -118,6 +118,7 @@ typedef struct
  unsigned int      prevflags:3;                        // flags from previous block\r
  unsigned int      bIgnoreLoop:1;                      // Ignore loop\r
  unsigned int      bNewPitch:1;                        // pitch changed\r
+ unsigned int      bStarting:1;                        // starting after keyon\r
  union {\r
   struct {\r
    int             iLeftVolume;                        // left volume\r
@@ -261,9 +262,9 @@ void do_samples(unsigned int cycles_to, int do_sync);
 void schedule_next_irq(void);\r
 void check_irq_io(unsigned int addr);\r
 \r
-#define do_samples_if_needed(c, sync) \\r
+#define do_samples_if_needed(c, sync, samples) \\r
  do { \\r
-  if (sync || (int)((c) - spu.cycles_played) >= 16 * 768) \\r
+  if (sync || (int)((c) - spu.cycles_played) >= (samples) * 768) \\r
    do_samples(c, sync); \\r
  } while (0)\r
 \r