aboutsummaryrefslogtreecommitdiff
path: root/src/ppu/internals.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ppu/internals.c')
-rw-r--r--src/ppu/internals.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ppu/internals.c b/src/ppu/internals.c
index 7826ece..e4817f1 100644
--- a/src/ppu/internals.c
+++ b/src/ppu/internals.c
@@ -4,8 +4,9 @@
#include "ppu/internals.h"
bool hh_ppu_vram_valid_address(hh_ppu_addr_t addr) {
+ #warning unimlemented
(void) addr; // compiler bruh
- return true; // TODO
+ return true;
}
void hh_ppu_vram_write(hh_s_ppu_vram_data data) {
@@ -36,7 +37,7 @@ hh_s_ppu_vram_data hh_ppu_2nat_fam(hh_s_ppu_loc_fam_entry e) {
data[0] = HH_RESIZE(e.tilemap_index, 9, 0) << 0 |
HH_RESIZE(e.palette_index, 2, 0) << 10 |
HH_RESIZE(e.position_y, 2, 0) << 13;
- data[1] = HH_RESIZE(e.position_y, 4, 0) << 0 |
+ data[1] = HH_RESIZE(e.position_y, 7, 3) << 0 |
HH_RESIZE(e.position_x, 8, 0) << 5 |
e.vertical_flip << 14 |
e.horizontal_flip << 15;
@@ -64,7 +65,7 @@ hh_s_ppu_vram_data hh_ppu_2nat_aux(hh_s_ppu_loc_aux aux) {
return out;
}
-hh_s_ppu_vram_data hh_ppu_2nat_sprite(hh_ppu_loc_sprite_data_t sprite_data) {
+hh_s_ppu_vram_data hh_ppu_2nat_sprite(const hh_ppu_loc_sprite_data_t sprite_data) {
hh_ppu_data_t* data = malloc(sizeof(hh_ppu_data_t) * HH_PPU_VRAM_TMM_SPRITE_SIZE);
for (unsigned i = 0; i < HH_PPU_SPRITE_WIDTH * HH_PPU_SPRITE_HEIGHT; i++) {
@@ -84,9 +85,9 @@ hh_s_ppu_vram_data hh_ppu_2nat_sprite(hh_ppu_loc_sprite_data_t sprite_data) {
hh_s_ppu_vram_data hh_ppu_2nat_color(hh_ppu_rgb_color_t rgb) {
hh_ppu_data_t* data = malloc(sizeof(hh_ppu_data_t) * HH_PPU_VRAM_PAL_ENTRY_SIZE);
- data[0] = HH_RESIZE(rgb[0], 3, 0) << 0 |
+ data[0] = HH_RESIZE(rgb[0], 3, 0) << 8 |
HH_RESIZE(rgb[1], 3, 0) << 4 |
- HH_RESIZE(rgb[2], 3, 0) << 8;
+ HH_RESIZE(rgb[2], 3, 0) << 0;
hh_s_ppu_vram_data out = {
.data = data,