aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2022-10-19 13:47:19 +0200
committerBad Diode <bd@badd10de.dev>2022-10-19 13:47:19 +0200
commite577c73974aefb0d78ff8d731e002c47d9804326 (patch)
treebda80e952b6511b3942778163b75b44ee4943b03
parent21ba183db539542fff949fdd1da59029d9d4497a (diff)
downloaduxn64-e577c73974aefb0d78ff8d731e002c47d9804326.tar.gz
uxn64-e577c73974aefb0d78ff8d731e002c47d9804326.zip
Remove unnecessary drawing
-rw-r--r--src/ppu.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/ppu.c b/src/ppu.c
index bd1ce3c..44eae77 100644
--- a/src/ppu.c
+++ b/src/ppu.c
@@ -128,8 +128,6 @@ swap_buffers(void) {
128 osRecvMesg(&retrace_msg_queue, NULL, OS_MESG_BLOCK); 128 osRecvMesg(&retrace_msg_queue, NULL, OS_MESG_BLOCK);
129 } 129 }
130 osRecvMesg(&retrace_msg_queue, NULL, OS_MESG_BLOCK); 130 osRecvMesg(&retrace_msg_queue, NULL, OS_MESG_BLOCK);
131
132 current_fb ^= 1;
133} 131}
134 132
135void 133void
@@ -143,18 +141,11 @@ blit_framebuffer(void) {
143 for (size_t i = 0; i < screen_width; i++) { 141 for (size_t i = 0; i < screen_width; i++) {
144 size_t idx = i + j * screen_width; 142 size_t idx = i + j * screen_width;
145 pixels[idx] = palette[pixels_fg[idx] << 2 | pixels_bg[idx]]; 143 pixels[idx] = palette[pixels_fg[idx] << 2 | pixels_bg[idx]];
146 // TODO: write pixels directly? It may cause flickering.
147 // framebuffers[current_fb][idx] = palette[pixels_fg[idx] << 2 | pixels_bg[idx]];
148 } 144 }
149 } 145 }
150 dirty_lines[j] = 0; 146 dirty_lines[j] = 0;
151 } 147 }
152 // FIXME: This is a hack, we should only have to write to the framebuffer
153 // once, if there were actually no changes is better not to swap buffers at
154 // all right?
155 fb_copy_test(); // CPU blit (A)
156 current_fb ^= 1;
157 fb_copy_test(); // CPU blit (B)
158 current_fb ^= 1; 148 current_fb ^= 1;
149 fb_copy_test();
159 reqdraw = 0; 150 reqdraw = 0;
160} 151}