aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-04-19 15:22:13 +0200
committerBad Diode <bd@badd10de.dev>2023-04-19 15:28:08 +0200
commit2e8ab813a9e4c2d908d5450e346a81d2a91a75e8 (patch)
treecbbb9c68851293b9166db57160c1409474e57fce
parent2d99fe361bd795dd120f51e6bc0c37105cad491a (diff)
downloaduxngba-2e8ab813a9e4c2d908d5450e346a81d2a91a75e8.tar.gz
uxngba-2e8ab813a9e4c2d908d5450e346a81d2a91a75e8.zip
Fix compiler warnings
-rw-r--r--src/main.c21
-rw-r--r--src/ppu.c1
2 files changed, 9 insertions, 13 deletions
diff --git a/src/main.c b/src/main.c
index 1dc5b5f..1193e9e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -37,8 +37,6 @@
37#define CONTROL_METHODS CONTROL_CONTROLLER,CONTROL_MOUSE,CONTROL_KEYBOARD 37#define CONTROL_METHODS CONTROL_CONTROLLER,CONTROL_MOUSE,CONTROL_KEYBOARD
38#endif 38#endif
39 39
40#define PROF_ENABLE 1
41
42#ifdef PROF_ENABLE 40#ifdef PROF_ENABLE
43#if PROF_ENABLE == 0 41#if PROF_ENABLE == 0
44#define TEXT_ENABLE 1 42#define TEXT_ENABLE 1
@@ -53,6 +51,7 @@
53#ifndef PROF_SHOW_Y 51#ifndef PROF_SHOW_Y
54#define PROF_SHOW_Y 0 52#define PROF_SHOW_Y 0
55#endif 53#endif
54/*
56// #define PROF_SHOW() \ 55// #define PROF_SHOW() \
57// do { \ 56// do { \
58// txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\ 57// txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\
@@ -75,21 +74,19 @@
75// txt_position((PROF_SHOW_X), (PROF_SHOW_Y)+3);\ 74// txt_position((PROF_SHOW_X), (PROF_SHOW_Y)+3);\
76// txt_printf("FLIP: %lu ", flip_cycles);\ 75// txt_printf("FLIP: %lu ", flip_cycles);\
77// } while (0) 76// } while (0)
77// */
78#define PROF_SHOW() \ 78#define PROF_SHOW() \
79 do { \ 79 do { \
80 txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\ 80 txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\
81 txt_printf("1BPP: %lu 2BPP: %lu", ppu_icn_cycles, ppu_chr_cycles);\ 81 txt_printf("1BPP: %lu 2BPP: %lu", ppu_icn_cycles, ppu_chr_cycles);\
82 } while (0) 82 } while (0)
83#define PROF_INIT() \ 83static u32 ppu_pixel_cycles = 0;
84 static u32 ppu_pixel_cycles = 0;\ 84static u32 ppu_chr_cycles = 0;
85 static u32 ppu_chr_cycles = 0;\ 85static u32 ppu_icn_cycles = 0;
86 static u32 ppu_icn_cycles = 0;\ 86static u32 flip_cycles = 0;
87 static u32 flip_cycles = 0;\ 87static u32 eval_cycles = 0;
88 static u32 eval_cycles = 0;\ 88static u32 input_cycles = 0;
89 static u32 input_cycles = 0;\ 89static u32 mix_cycles = 0;
90 static u32 mix_cycles = 0;
91
92 PROF_INIT();
93#else 90#else
94#define PROF(F,VAR) (F) 91#define PROF(F,VAR) (F)
95#define PROF_SHOW() 92#define PROF_SHOW()
diff --git a/src/ppu.c b/src/ppu.c
index 9937d95..c258fe2 100644
--- a/src/ppu.c
+++ b/src/ppu.c
@@ -600,7 +600,6 @@ ppu_2bpp(u32 *layer, u16 x, u16 y, u8 *sprite, u8 clr, u8 flip_x, u8 flip_y) {
600 } 600 }
601 } 601 }
602 } else { 602 } else {
603 u8 clr0 = blending[0][clr];
604 u8 clr1 = blending[1][clr]; 603 u8 clr1 = blending[1][clr];
605 u8 clr2 = blending[2][clr]; 604 u8 clr2 = blending[2][clr];
606 u8 clr3 = blending[3][clr]; 605 u8 clr3 = blending[3][clr];