spu: try to improve timing
[pcsx_rearmed.git] / plugins / dfsound / externals.h
index dd05a5a..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
@@ -197,6 +198,7 @@ typedef struct
  unsigned char * pSpuIrq;\r
 \r
  unsigned int    cycles_played;\r
+ unsigned int    cycles_dma_end;\r
  int             decode_pos;\r
  int             decode_dirty_ch;\r
  unsigned int    bSpuInit:1;\r
@@ -240,7 +242,6 @@ typedef struct
  int           * SB;\r
  int           * SSumLR;\r
 \r
- int             pad[29];\r
  unsigned short  regArea[0x400];\r
 } SPUInfo;\r
 \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