#include "game_types.h"

/* Sound_AddChannel @ 0x08010830 (real 84B) -- counter-gated bitmap + channel param forward. Mirrors src/matched/Sound_AddChannel.c. */
/* When the counter at the first island lags the second, draws the bitmap;
   then bumps the slot counter and forwards (slot, b, c, d, e) into
   Sound_InitChannelParams. Pool islands are verbatim code-as-data words. */
extern void Image_DrawBitmap(int a, int b, int c);
extern void Sound_InitChannelParams(int *buf, int a, int b, int c, int d, int e);

void Sound_AddChannel(int a, int b, int c, int d, int e)
{
    int *slot;
    (void)a;
    if (*(int *)0x1C022100 < *(int *)0x6041C202)
        Image_DrawBitmap(*(int *)0x23806051, *(int *)0x23806051, 175);
    slot = (int *)(*(int *)0x6093009B +
                   (*(int *)0x1C0260D1 << 4));
    (*(int *)0x1C0260D1)++;
    Sound_InitChannelParams(slot, b, c, d, d, e);
}
