]> git.sesse.net Git - pistorm/commitdiff
Fix PiStorm dev manual memset, change RTG FPS display/palette debug stuff
authorbeeanyew <beeanyew@gmail.com>
Tue, 11 May 2021 10:14:50 +0000 (12:14 +0200)
committerbeeanyew <beeanyew@gmail.com>
Tue, 11 May 2021 10:14:50 +0000 (12:14 +0200)
platforms/amiga/pistorm-dev/pistorm-dev.c
platforms/amiga/rtg/rtg-output-raylib.c

index 4aafd1991a61b7a8b732fdbca48d836b86c0cbdf..5f49d6c392a91009c31b52373d66484bbf16b7de 100644 (file)
@@ -225,7 +225,7 @@ void handle_pistorm_dev_write(uint32_t addr_, uint32_t val, uint8_t type) {
                     memset(dst_ptr, pi_byte[0], val);
                 } else {
                     for (uint32_t i = 0; i < val; i++) {
-                        m68k_write_memory_8(pi_ptr[0] + i, val);
+                        m68k_write_memory_8(pi_ptr[0] + i, pi_byte[0]);
                     }
                 }
             }
index 849db67a9c24daf18f9d485e6876b5549685ed82..d475ffafd822403ba86815cdd1fdcca3370164f4 100644 (file)
@@ -13,8 +13,6 @@
 #include <string.h>
 #include <unistd.h>
 
-//#define DEBUG_RAYLIB_RTG
-
 #define RTG_INIT_ERR(a) { printf(a); *data->running = 0; }
 
 uint8_t busy = 0, rtg_on = 0, rtg_initialized = 0;
@@ -28,7 +26,7 @@ extern uint16_t rtg_pitch, rtg_total_rows;
 extern uint16_t rtg_offset_x, rtg_offset_y;
 
 static pthread_t thread_id;
-static uint8_t mouse_cursor_enabled = 0, cursor_image_updated = 0, updating_screen = 0;
+static uint8_t mouse_cursor_enabled = 0, cursor_image_updated = 0, updating_screen = 0, debug_palette = 0, show_fps = 0;
 static uint8_t mouse_cursor_w = 16, mouse_cursor_h = 16;
 static int16_t mouse_cursor_x = 0, mouse_cursor_y = 0;
 
@@ -221,18 +219,18 @@ reinit_raylib:;
                 DrawTexturePro(raylib_cursor_texture, cursor_srcrect, dstrect, origin, 0.0f, RAYWHITE);
             }
 
-#ifdef DEBUG_RAYLIB_RTG
-            if (format == RTGFMT_8BIT) {
-                Rectangle srcrect = { 0, 0, 256, 1 };
-                Rectangle dstrect = { 0, 0, 1024, 8 };
-                //DrawTexture(raylib_clut_texture, 0, 0, RAYWHITE);
-                DrawTexturePro(raylib_clut_texture, srcrect, dstrect, origin, 0.0f, RAYWHITE);
-                dstrect.y += 8;
-                DrawTexturePro(raylib_cursor_clut_texture, srcrect, dstrect, origin, 0.0f, RAYWHITE);
+            if (debug_palette) {
+                if (format == RTGFMT_8BIT) {
+                    Rectangle srcrect = { 0, 0, 256, 1 };
+                    Rectangle dstrect = { 0, 0, 1024, 8 };
+                    DrawTexturePro(raylib_clut_texture, srcrect, dstrect, origin, 0.0f, RAYWHITE);
+                }
+            }
+
+            if (show_fps) {
+                DrawFPS(GetScreenWidth() - 128, 0);
             }
-#endif
 
-            DrawFPS(width - 200, 0);
             EndDrawing();
             if (format == RTGFMT_RBG565) {
                 for (int y = 0; y < height; y++) {