]> git.sesse.net Git - pistorm/commitdiff
Add PiStorm API commands to toggle RTG FPS display/palette debug
authorbeeanyew <beeanyew@gmail.com>
Tue, 11 May 2021 11:26:59 +0000 (13:26 +0200)
committerbeeanyew <beeanyew@gmail.com>
Tue, 11 May 2021 11:26:59 +0000 (13:26 +0200)
platforms/amiga/pistorm-dev/pistorm-dev-enums.h
platforms/amiga/pistorm-dev/pistorm-dev.c
platforms/amiga/rtg/rtg-output-raylib.c
platforms/amiga/rtg/rtg.h

index eaa938e489137937435ef01869a8363be0695df7..a406b1854661e80429cf329c1a8b0db1ba8907aa 100644 (file)
@@ -31,6 +31,8 @@ enum pistorm_dev_cmds {
     PI_CMD_COPYRECT         = 0x0110, // [W] Generic memory copyrect with source and destination pitch.
     PI_CMD_COPYRECT_EX      = 0x0112, // [W] Extended memory copyrect with additional source/destination X/Y coordinates.
     PI_CMD_MEMSET           = 0x0114, // [W] Accelerated memset functionality to quickly clear a region of memory to a specific value.
+    PI_CMD_SHOWFPS          = 0x0118, // [W] Enable/disable RTG FPS display.
+    PI_CMD_PALETTEDEBUG     = 0x011A, // [W] Enable/disable RTG palette debug.
 
     PI_CMD_QBASIC           = 0x0FFC, // QBasic
     PI_CMD_NIBBLES          = 0x0FFE, // Nibbles
index 5f49d6c392a91009c31b52373d66484bbf16b7de..622eec4daabc323d3b7530f74f7127fbfbbff8dd 100644 (file)
@@ -289,6 +289,8 @@ void handle_pistorm_dev_write(uint32_t addr_, uint32_t val, uint8_t type) {
             }
             break;
 
+        case PI_CMD_SHOWFPS: rtg_show_fps((uint8_t)val); break;
+        case PI_CMD_PALETTEDEBUG: rtg_palette_debug((uint8_t)val); break;
         case PI_CMD_RTGSTATUS:
             DEBUG("[PISTORM-DEV] Write to RTGSTATUS: %d\n", val);
             if (val == 1 && !rtg_enabled) {
index d475ffafd822403ba86815cdd1fdcca3370164f4..39c1b01f1ca80c124a28fb46b0b4f22a8e34b80f 100644 (file)
@@ -400,3 +400,11 @@ void rtg_set_mouse_cursor_image(uint8_t *src, uint8_t w, uint8_t h) {
         update_mouse_cursor(src);
     }
 }
+
+void rtg_show_fps(uint8_t enable) {
+    show_fps = (enable != 0);
+}
+
+void rtg_palette_debug(uint8_t enable) {
+    debug_palette = (enable != 0);
+}
index 6a4f625df6b0961ee84e37d3ff0b120a7f99a700..0f08d1cd50febdcf310616e43a30e900ae80eab1 100644 (file)
@@ -23,6 +23,9 @@ void rtg_set_mouse_cursor_pos(int16_t x, int16_t y);
 void rtg_set_cursor_clut_entry(uint8_t r, uint8_t g, uint8_t b, uint8_t idx);
 void rtg_set_mouse_cursor_image(uint8_t *src, uint8_t w, uint8_t h);
 
+void rtg_show_fps(uint8_t enable);
+void rtg_palette_debug(uint8_t enable);
+
 int init_rtg_data(struct emulator_config *cfg);
 void shutdown_rtg();