#include "game_types.h"

/* Image_Passthrough @ 0x08013014 (real 24B) -- range-gated byte filter (shared entry Passthrough2). Mirrors src/matched/Image_Passthrough.c. */
/* Returns the byte at src unless the address falls in the gated-out range
   (below 0x08546E58 with high bits clear, or high-half clear): then 0.
   Image_Passthrough2 is the same filter taking the byte in r3 (shared body,
   separate entry used by bl-callers and the DrawBlended loop). */
unsigned Image_Passthrough(unsigned char *src)
{
    unsigned char v = src[0];
    if (((unsigned)src >> 25) == 0) {
        if ((unsigned)src < 0x08546E58 || ((unsigned)src >> 14) == 0)
            return v;
        return 0;
    }
    return v;
}

unsigned Image_Passthrough2(int *dst, int *src, unsigned v)
{
    (void)dst;
    (void)src;
    if (((unsigned)src >> 25) == 0) {
        if ((unsigned)src < 0x08546E58 || ((unsigned)src >> 14) == 0)
            return v;
        return 0;
    }
    return v;
}
