Loading...
Searching...
No Matches
piece.h
Go to the documentation of this file.
1#ifndef PIECE_H
2#define PIECE_H
3
4#include <snes.h>
5
6/* Piece types (1-7, matching tile colors) */
7#define PIECE_I 1
8#define PIECE_O 2
9#define PIECE_T 3
10#define PIECE_S 4
11#define PIECE_Z 5
12#define PIECE_L 6
13#define PIECE_J 7
14
15#define NUM_PIECE_TYPES 7
16#define NUM_ROTATIONS 4
17#define CELLS_PER_PIECE 4
18
19/* Direct cell accessors — return row/col offset for cell i of (type, rot) */
20s8 pieceGetCellRow(u8 type, u8 rot, u8 i);
21s8 pieceGetCellCol(u8 type, u8 rot, u8 i);
22s8 pieceSpawnRow(u8 type);
23s8 pieceSpawnCol(u8 type);
24u8 pieceRandom(void);
27
28#endif
static u8 i
Definition main.c:156
signed char s8
8-bit signed integer (-128 to 127)
Definition types.h:43
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition types.h:46
u8 pieceRotateCW(u8 rot)
Definition piece.c:108
u8 pieceRandom(void)
Definition piece.c:102
u8 pieceRotateCCW(u8 rot)
Definition piece.c:114
s8 pieceSpawnCol(u8 type)
Definition piece.c:97
s8 pieceGetCellCol(u8 type, u8 rot, u8 i)
Definition piece.c:86
s8 pieceGetCellRow(u8 type, u8 rot, u8 i)
Definition piece.c:80
s8 pieceSpawnRow(u8 type)
Definition piece.c:92
OpenSNES Master Header.