foxygit / fake-08-xbox360 Log in
commit dafd1af8a4c54a0322a86bfa6443bebfdcd6d74a
Author:     Jon Bell <jondbell@protonmail.com>
AuthorDate: Sat Apr 25 22:08:46 2020 -0600
Commit:     Jon Bell <jondbell@protonmail.com>
CommitDate: Sat Apr 25 22:08:46 2020 -0600

    tighten flip buffer loop
---
 source/graphics.cpp | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/source/graphics.cpp b/source/graphics.cpp
index 73532bc..6eeb1b8 100644
--- a/source/graphics.cpp
+++ b/source/graphics.cpp
@@ -646,16 +646,14 @@ void Graphics::palt(uint8_t c, bool t){

 void Graphics::flipBuffer(uint8_t* fb) {
 	short x, y;
-    for(x = 0; x < 400; x++) {
-    	for(y = 0; y < 240; y++) {
-			if (x < 128 && y < 128) {
-				uint8_t c = _pico8_fb[x*128 + y];
-				Color col = PaletteColors[_gfxState_screenPaletteMap[c]];
-
-				fb[((x*240)+ (239 - y))*3+0] = col.Blue;
-				fb[((x*240)+ (239 - y))*3+1] = col.Green;
-				fb[((x*240)+ (239 - y))*3+2] = col.Red;
-			}
+    for(x = 0; x < 128; x++) {
+    	for(y = 0; y < 128; y++) {
+			uint8_t c = _pico8_fb[x*128 + y];
+			Color col = PaletteColors[_gfxState_screenPaletteMap[c]];
+
+			fb[((x*240)+ (239 - y))*3+0] = col.Blue;
+			fb[((x*240)+ (239 - y))*3+1] = col.Green;
+			fb[((x*240)+ (239 - y))*3+2] = col.Red;
     	}
     }
 }