#ifndef __FACE_SPRITES_H__
#define __FACE_SPRITES_H__

/*
 * Face sprite frames
 * Auto-generated by prepare_doom_faces.py + grit
 *
 * Total faces: 32
 * Face size: 24x32 px (3x4 tiles)
 * Tiles per face: 48 u32 words = 192 bytes
 *
 * Usage:
 *   copymem((void*)addr, (void*)FACE_TILE_DATA[faceIndex], 192);
 */

#define FACE_CHAR_START   462  /* moved to free gap 462-473 to avoid shotgun overlap */
#define FACE_TILE_COUNT   12
#define FACE_TILE_BYTES   192
#define FACE_COUNT        32

/* Face index defines */
#define FACE_IDLE_BASE     0   /* 15 faces: 5 damage x 3 dir */
#define FACE_OUCH_FRONT   15   /* 5 faces: one per damage lvl */
#define FACE_OUCH_SEVERE  20
#define FACE_EVIL_GRIN    25
#define FACE_DEAD         30
#define FACE_GOD          31

/* Individual face tile data (each is 48 u32 words = 192 bytes) */
extern const unsigned int face_00Tiles[48];
extern const unsigned int face_01Tiles[48];
extern const unsigned int face_02Tiles[48];
extern const unsigned int face_03Tiles[48];
extern const unsigned int face_04Tiles[48];
extern const unsigned int face_05Tiles[48];
extern const unsigned int face_06Tiles[48];
extern const unsigned int face_07Tiles[48];
extern const unsigned int face_08Tiles[48];
extern const unsigned int face_09Tiles[48];
extern const unsigned int face_10Tiles[48];
extern const unsigned int face_11Tiles[48];
extern const unsigned int face_12Tiles[48];
extern const unsigned int face_13Tiles[48];
extern const unsigned int face_14Tiles[48];
extern const unsigned int face_15Tiles[48];
extern const unsigned int face_16Tiles[48];
extern const unsigned int face_17Tiles[48];
extern const unsigned int face_18Tiles[48];
extern const unsigned int face_19Tiles[48];
extern const unsigned int face_20Tiles[48];
extern const unsigned int face_21Tiles[48];
extern const unsigned int face_22Tiles[48];
extern const unsigned int face_23Tiles[48];
extern const unsigned int face_24Tiles[48];
extern const unsigned int face_25Tiles[48];
extern const unsigned int face_26Tiles[48];
extern const unsigned int face_27Tiles[48];
extern const unsigned int face_28Tiles[48];
extern const unsigned int face_29Tiles[48];
extern const unsigned int face_30Tiles[48];
extern const unsigned int face_31Tiles[48];

/* Frame pointer table for dynamic face loading */
static const unsigned int* const FACE_TILE_DATA[32] = {
    face_00Tiles,
    face_01Tiles,
    face_02Tiles,
    face_03Tiles,
    face_04Tiles,
    face_05Tiles,
    face_06Tiles,
    face_07Tiles,
    face_08Tiles,
    face_09Tiles,
    face_10Tiles,
    face_11Tiles,
    face_12Tiles,
    face_13Tiles,
    face_14Tiles,
    face_15Tiles,
    face_16Tiles,
    face_17Tiles,
    face_18Tiles,
    face_19Tiles,
    face_20Tiles,
    face_21Tiles,
    face_22Tiles,
    face_23Tiles,
    face_24Tiles,
    face_25Tiles,
    face_26Tiles,
    face_27Tiles,
    face_28Tiles,
    face_29Tiles,
    face_30Tiles,
    face_31Tiles
};

/* Fixed face BGMap: always references chars 462-473 (0x1CE-0x1D9) */
static const unsigned short faceMap[12] __attribute__((aligned(4))) = {
	0x01CE,0x01CF,0x01D0,0x01D1,0x01D2,0x01D3,0x01D4,0x01D5,0x01D6,0x01D7,0x01D8,0x01D9
};

#endif /* __FACE_SPRITES_H__ */
