#include "game_types.h"

/* Sub_0800E8E8 @ 0x0800E8E8 (real 92B) -- zero block plus channel-clear and preset quad. Mirrors src/matched/Sub_0800E8E8.c. */
/* Zeroes words 14-18, raises the base+2464 flag byte, clears the channel,
   inits the preset quad (flag 2; 63/256/4096/4096), and pins words 2/3 to
   1/0xA31. */
extern int Sound_ClearChannel(int *base);

void Sub_0800E8E8(int *p)
{
    int *base = *(int **)0x02000134;
    int *q;
    p[14] = 0;
    p[15] = 0;
    p[16] = 0;
    p[17] = 0;
    p[18] = 0;
    *(unsigned char *)(base + 2464) = 1;
    Sound_ClearChannel(base);
    *(int *)((char *)base + 0xA34) = 2;
    q = (int *)((char *)base + 0xA38);
    q[3] = 63;
    q[2] = 256;
    q[0] = 4096;
    q[1] = 4096;
    p[2] = 1;
    p[3] = 0xA31;
}
