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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#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 80
#define HH_PAL_IDX_SKY 0
#define HH_PAL_IDX_BRICK 1
const static uint8_t hh_g_sprite_palette[HH_SPRITE_COUNT] = {
//TODO: FIGURE OUT HOW TO DEAL WITH DYNAMIC PALLETS
//TODO: make a buffer of 16 no-collider sprites (instead of the current 1)
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,
7,7,7,7, //??
7,6,6,6,6,6,6,6, //baskets
7,7,7,7,7,7,7,7,7,7, //shop
7,7,7,7,7, //shop
6,6,6,6,6, //(hi-)score
3,3,3,3,3,3, //title_screen icon
6,6,6,6,/*6,6,6,6,6,6, //title_screen large letters
6,6,6,6,*/
//other palettes here:
// [HH_PAL_IDX_SKY] = 0,
};
const static 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
{0x0,0x0,0x1},//25
{0x1,0x1,0x1},//26
{0x1,0x1,0x2},//27
{0x2,0x2,0x3},//28
{0x3,0x4,0x5},//29
{0x5,0x1,0x7},
{0xd,0x8,0xa}},//24
{//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}},
{//player //TODO: use one less color && update player indexed sprites
{0x0,0x0,0x0},
{0x1,0x1,0x1},
{0x4,0x2,0x5},
{0x7,0x3,0x7},
{0xe,0xe,0xe},
{0x7,0x2,0x3}, //elemental
{0xc,0x5,0x3},
{0xe,0xc,0x7}},
{//crates
{0x5,0x7,0x7},
{0x3,0x1,0x2},
{0x6,0x2,0x2},
{0x7,0x4,0x4},
{0xa,0x7,0x5},
{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}},
{//white
{0x1,0x2,0x3},
{0xf,0xf,0xf},
{0xf,0xf,0xf},
{0xf,0xf,0xf},
{0xf,0xf,0xf},
{0xf,0xf,0xf},
{0xf,0xf,0xf},
{0xf,0xf,0xf}},
{//Dev palette (7)
{0x0,0xf,0xf},
{0xf,0xf,0xf},
{0xf,0x0,0xf},
{0xf,0xf,0x0},
{0xf,0x0,0x0},
{0x0,0xf,0x0},
{0x0,0x0,0xf},
{0x0,0x0,0x0}}
};
void hh_setup_palettes();
//TODO: UPDATE THIS FUNCTION
/** @brief return palette index that belongs to tilemap index */
uint8_t hh_get_palette(uint8_t tile_idx);
//TODO: UPDATE THIS FUNCTION
bool hh_colidable(uint8_t tile_idx);
|