1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
#pragma once
#include <stdint.h>
#include "ppu/types.h"
// handles sprites
// Bg sprites
// Fg or entity sprites
//TODO: pack data inside of sprite_palette LUT
//HH_PPU_PALETTE_COUNT
#define HH_SPRITE_COUNT 32
#define HH_PAL_IDX_SKY 0
#define HH_PAL_IDX_BRICK 1
uint8_t hh_g_sprite_palette[HH_SPRITE_COUNT] = {
0,1,1,1,1,1,1,1,1,1, //1+9
1,1,1,1,1,1,1,1,1,1, //6+4
1,1,1,1,1,1,1,1,1, //9
7,7,7,2,7,7,1,2,7
//other palettes here:
};
hh_ppu_loc_palette_table_t hh_g_palette = {
{//palette info here
{0x1,0x2,0x3},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0}},
{//Bricks
{0x1,0x2,0x3},//01
{0xd,0x8,0xa},//24
{0x0,0x0,0x1},//25
{0x1,0x1,0x1},//26
{0x1,0x1,0x2},//27
{0x2,0x2,0x3},//28
{0x3,0x4,0x5},//29
{0x5,0x1,0x7}},
{//slime
{0x1,0x2,0x3},
{0x1,0x3,0x2},
{0x4,0x8,0x3},
{0x7,0xa,0x4},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0}},
{
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0}},
{
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0}},
{
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0}},
{
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0}},
{
{0xf,0xf,0xf},
{0xf,0xf,0xf},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0},
{0x0,0x0,0x0}}
};
/** @brief return palette index that belongs to tilemap index */
uint8_t hh_get_palette(uint16_t tile_idx);
bool hh_colidable(uint16_t tile_idx);
|