#include "game_types.h"

/* BG_ResetTileFlags @ 0x08014A50 (real 36B) -- clears flag bytes then ORs 12 or 3 into byte 0. Mirrors src/matched/BG_ResetTileFlags.c. */
/* Clears bytes 26/22, then ORs 12 (flag 24 clear) or 3 into byte 0. The
   dead mov r1,#0 is DCE-proof spill in the asm. */
void BG_ResetTileFlags(char *p)
{
    int keep, n;
    p[26] = 0;
    p[22] = 0;
    keep = p[0];
    n = p[24] == 0 ? 12 : 3;
    p[0] = (char)(keep | n);
}
