From 927de41c62d31add91b68444d76a4a1a83fa9f02 Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Thu, 25 Jan 2024 22:51:04 -0800 Subject: [PATCH 01/53] Properly adjusting hi16's addend relocation. --- tools/psyq-obj-parser/psyq-obj-parser.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/psyq-obj-parser/psyq-obj-parser.cc b/tools/psyq-obj-parser/psyq-obj-parser.cc index 418012b10..869b7613f 100644 --- a/tools/psyq-obj-parser/psyq-obj-parser.cc +++ b/tools/psyq-obj-parser/psyq-obj-parser.cc @@ -1338,6 +1338,10 @@ bool PsyqLnkFile::Relocation::generateElf(ElfRelocationPass pass, const std::str uint8_t* sectionData = (uint8_t*)malloc(size); memcpy(sectionData, section->section->get_data(), size); fmt::print(" :: Altering bytestream to account for HI symbol+addend relocation\n"); + if (addend < 0) { + fmt::print(" :: Adjusting for negative addend\n"); + addend += 0x10000; + } addend >>= 16; sectionData[offset + 0] = addend & 0xff; addend >>= 8; From d733bfb075b5fb4b7cdb4d294edd2a56837cc185 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:45:10 +0000 Subject: [PATCH 02/53] Update Greek translation --- i18n/el.po | 1114 ++++++++++++++++------------------------------------ 1 file changed, 346 insertions(+), 768 deletions(-) diff --git a/i18n/el.po b/i18n/el.po index 750169fe1..a0255b987 100644 --- a/i18n/el.po +++ b/i18n/el.po @@ -1,18 +1,23 @@ -# +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# # Translators: -# Γιωργος Πονηρης , 2021 -# +# Γιωργος Πονηρης , 2024 +# +#, fuzzy msgid "" msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-22 06:35+0000\n" -"Last-Translator: Γιωργος Πονηρης , 2021\n" -"Language-Team: Greek (https://www.transifex.com/grumpycoders/teams/99251/" -"el/)\n" -"Language: el\n" +"PO-Revision-Date: 2021-03-27 04:53+0000\n" +"Last-Translator: Γιωργος Πονηρης , 2024\n" +"Language-Team: Greek (https://app.transifex.com/grumpycoders/teams/99251/el/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: el\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/cdrom/cdriso-ecm.cc:282 @@ -27,7 +32,7 @@ msgstr "" #: src/cdrom/cdriso-sbi.cc:41 #, c-format msgid "Loaded SBI file: %s.\n" -msgstr "Άνοιγμα αρχείου SBI: 1%s.\n" +msgstr "Άνοιγμα αρχείου SBI: %s.\n" #: src/cdrom/cdriso.cc:252 #, c-format @@ -37,24 +42,23 @@ msgstr "Κομμάτι %.2d (%s) - Αρχή :%.2d:%.2d:%.2d, Μήκος:%.2d%.2d #: src/cdrom/cdriso.cc:268 #, c-format msgid "Loaded CD Image: %s" -msgstr "Φορτώθηκε η εικόνα CD: 1%s" +msgstr "Φορτώθηκε η εικόνα CD: %s" #: src/core/OpenGL_GPU/gpu_opengl.cc:463 -#, fuzzy msgid "OpenGL GPU configuration" -msgstr "Ρυθμίσεις SPU" +msgstr "Ρυθμίσεις OpenGL GPU" #: src/core/OpenGL_GPU/gpu_opengl.cc:464 msgid "Fill polygons" -msgstr "" +msgstr "Γέμισμα πολυγώνων" #: src/core/OpenGL_GPU/gpu_opengl.cc:464 msgid "Wireframe" -msgstr "" +msgstr "Περίγραμμα" #: src/core/OpenGL_GPU/gpu_opengl.cc:465 msgid "Vertices only" -msgstr "" +msgstr "Μόνο κορυφές" #: src/core/OpenGL_GPU/gpu_opengl.cc:468 msgid "Polygon rendering mode" @@ -62,15 +66,15 @@ msgstr "" #: src/core/OpenGL_GPU/gpu_opengl.cc:479 src/core/OpenGL_GPU/gpu_opengl.cc:484 msgid "No MSAA" -msgstr "" +msgstr "Καθόλου MSAA" #: src/core/OpenGL_GPU/gpu_opengl.cc:479 msgid "{}x MSAA" -msgstr "" +msgstr "{}x MSAA" #: src/core/OpenGL_GPU/gpu_opengl.cc:481 msgid "MSAA" -msgstr "" +msgstr "MSAA" #: src/core/OpenGL_GPU/gpu_opengl.cc:499 src/gpu/soft/gpu.cc:261 msgid "Use linear filtering" @@ -87,12 +91,12 @@ msgstr "" #: src/core/OpenGL_GPU/gpu_opengl.cc:518 #, c-format msgid "Display horizontal range: %d-%d" -msgstr "" +msgstr "Οριζόντιο εύρος display: %d-%d" #: src/core/OpenGL_GPU/gpu_opengl.cc:519 #, c-format msgid "Display vertical range: %d-%d" -msgstr "" +msgstr "Κατακόρυφο εύρος display: %d-%d" #: src/core/OpenGL_GPU/gpu_opengl.cc:520 #, c-format @@ -102,21 +106,20 @@ msgstr "" #: src/core/OpenGL_GPU/gpu_opengl.cc:521 #, c-format msgid "Resolution: %dx%d" -msgstr "" +msgstr "Ανάλυση: %dx%d" #: src/core/OpenGL_GPU/gpu_opengl.cc:523 msgid "Clear colour" -msgstr "" +msgstr "Εκκαθάριση χρώματος" #: src/core/OpenGL_GPU/gpu_opengl.cc:524 -#, fuzzy msgid "Clear VRAM" -msgstr "Εκκαθάριση" +msgstr "Εκκαθάριση VRAM" #: src/core/cdrom.cc:1708 #, c-format msgid "CD-ROM Label: %.32s\n" -msgstr "Ετικέτα CD-ROM 1%.32s\n" +msgstr "Ετικέτα CD-ROM: %.32s\n" #: src/core/cdrom.cc:1709 #, c-format @@ -174,9 +177,9 @@ msgid "Step out (no callstack)" msgstr "" #: src/core/debug.cc:219 -#, fuzzy, c-format +#, c-format msgid "Breakpoint triggered: PC=0x%08x - Cause: %s %s\n" -msgstr "Πυροδότηση Breakpoint. PC=0x%08x - Cause: %s\n" +msgstr "" #: src/core/debug.cc:319 src/gui/widgets/assembly.cc:455 #: src/gui/widgets/assembly.cc:533 @@ -188,14 +191,12 @@ msgid "Exec" msgstr "" #: src/core/debug.h:37 src/gui/widgets/typed_debugger.cc:285 -#, fuzzy msgid "Read" -msgstr "Ανάγνωση Byte" +msgstr "" #: src/core/debug.h:37 src/gui/widgets/typed_debugger.cc:287 -#, fuzzy msgid "Write" -msgstr "Γραφή Byte" +msgstr "" #: src/core/gdb-server.cc:604 msgid "GDB client" @@ -227,9 +228,8 @@ msgid "Go to primitive##{}" msgstr "" #: src/core/gpu.cc:1096 src/core/gpu.cc:1193 -#, fuzzy msgid "Go to texture##{}" -msgstr "Αντιγραφή" +msgstr "" #: src/core/gpu.cc:1108 src/core/gpu.cc:1205 msgid "Go to CLUT##{}" @@ -238,7 +238,7 @@ msgstr "" #: src/core/gpu.cc:1134 #, c-format msgid "Line %i" -msgstr "" +msgstr "Γραμμή %i" #: src/core/gpulogger.cc:285 #, c-format @@ -270,32 +270,31 @@ msgid "Texture depth:" msgstr "" #: src/core/gpulogger.cc:306 -#, fuzzy msgid "4 bits" -msgstr "Shift κατα 24 bits" +msgstr "4 bits" #: src/core/gpulogger.cc:309 msgid "8 bits" -msgstr "" +msgstr "8 bits" #: src/core/gpulogger.cc:312 msgid "16 bits" -msgstr "" +msgstr "16 bits" #: src/core/gpulogger.cc:319 -#, fuzzy, c-format +#, c-format msgid "Dithering: %s" -msgstr "Έκδοση" +msgstr "" #: src/core/gpulogger.cc:319 src/core/gpulogger.cc:334 #: src/core/gpulogger.cc:393 src/core/gpulogger.cc:406 msgid "No" -msgstr "" +msgstr "Όχι" #: src/core/gpulogger.cc:319 src/core/gpulogger.cc:334 #: src/core/gpulogger.cc:393 src/core/gpulogger.cc:406 msgid "Yes" -msgstr "" +msgstr "Ναι" #: src/core/gpulogger.cc:334 #, c-format @@ -303,14 +302,12 @@ msgid " Set: %s, Check: %s" msgstr "" #: src/core/gpulogger.cc:343 -#, fuzzy msgid "Display Enabled" -msgstr "Προβολή" +msgstr "Οθόνη ενεργοποιημένη" #: src/core/gpulogger.cc:345 -#, fuzzy msgid "Display Disabled" -msgstr "Προβολή" +msgstr "Οθόνη απενεργοποιημένη" #: src/core/gpulogger.cc:352 msgid "DMA Off" @@ -321,18 +318,16 @@ msgid "FIFO Query" msgstr "" #: src/core/gpulogger.cc:358 -#, fuzzy msgid "DMA Read" -msgstr "Ανάγνωση Byte" +msgstr "" #: src/core/gpulogger.cc:361 -#, fuzzy msgid "DMA Write" -msgstr "Γραφή Byte" +msgstr "" #: src/core/gpulogger.cc:371 msgid "Horizontal resolution:" -msgstr "" +msgstr "Οριζόντια ανάλυση:" #: src/core/gpulogger.cc:393 #, c-format @@ -341,31 +336,30 @@ msgstr "" #: src/core/gpulogger.cc:394 msgid "Vertical resolution:" -msgstr "" +msgstr "Κατακόρυφη ανάλυση:" #: src/core/gpulogger.cc:404 -#, fuzzy, c-format +#, c-format msgid "Output mode: %s" -msgstr "Έξοδος" +msgstr "" #: src/core/gpulogger.cc:405 msgid "15 bits" -msgstr "" +msgstr "15 bits" #: src/core/gpulogger.cc:405 -#, fuzzy msgid "24 bits" -msgstr "Shift κατα 24 bits" +msgstr "24 bits" #: src/core/gpulogger.cc:405 -#, fuzzy, c-format +#, c-format msgid "Display depth: %s" -msgstr "Προβολή" +msgstr "" #: src/core/gpulogger.cc:406 -#, fuzzy, c-format +#, c-format msgid "Interlaced: %s" -msgstr "Γραφή Byte" +msgstr "" #: src/core/gpulogger.cc:412 msgid "Texture Window" @@ -380,23 +374,21 @@ msgid "Draw Area End" msgstr "" #: src/core/gpulogger.cc:421 -#, fuzzy msgid "Draw Offset" -msgstr "Μετατόπιση αρχείου" +msgstr "" #: src/core/gpulogger.cc:424 msgid "Unknown" -msgstr "" +msgstr "Άγνωστο" #: src/core/memorycard.cc:348 #, c-format msgid "The memory card %s doesn't exist - creating it\n" -msgstr "Η καρτα μνήμης 1%s δεν υπάρχει - γίνεται δημιουργία της\n" +msgstr "Η καρτα μνήμης %s δεν υπάρχει - γίνεται δημιουργία της\n" #: src/core/memorycard.cc:367 src/core/memorycard.cc:385 -#, fuzzy msgid "Error reading memory card." -msgstr "Φόρτωση κάρτας μνήμης %s\n" +msgstr "" #: src/core/memorycard.cc:370 #, c-format @@ -416,24 +408,25 @@ msgstr "Αποθήκευση κάρτας μνήμης %s\n" #: src/core/pad.cc:702 src/core/pad.cc:795 #, c-format msgid "Unknown command for pad: %02X\n" -msgstr "" +msgstr "Άγνωστη εντολή χειριστηρίου: %02X\n" #: src/core/pad.cc:897 -#, fuzzy msgid "Pad configuration" -msgstr "Ρυθμίσεις SPU" +msgstr "Ρύθμιση χειριστηρίων" #: src/core/pad.cc:903 msgid "Pad 1" -msgstr "" +msgstr "Χειριστήριο 1" #: src/core/pad.cc:904 msgid "Pad 2" -msgstr "" +msgstr "Χειριστήριο 2" #: src/core/pad.cc:907 msgid "Rescan gamepads and re-read game controllers database" msgstr "" +"Επανασκανάρισμα για χειριστήριο και επανανάγνωση της βάσης δεδομένων " +"χειριστηρίων" #: src/core/pad.cc:913 msgid "Use raw input for mouse" @@ -456,11 +449,11 @@ msgstr "" #: src/core/pad.cc:921 msgid "Pad" -msgstr "" +msgstr "Χειριστήριο" #: src/core/pad.cc:930 msgid "Set defaults" -msgstr "" +msgstr "Επαναφορά" #: src/core/pad.cc:945 msgid "Keyboard Up" @@ -504,101 +497,99 @@ msgstr "" #: src/core/pad.cc:971 msgid "Keyboard {}" -msgstr "" +msgstr "Πληκτρολόγιο {}" #: src/core/pad.cc:986 src/gui/gui.cc:1993 -#, fuzzy msgid "Auto" -msgstr "Αυτόματη αποθήκευση" +msgstr "Αυτόματο" #: src/core/pad.cc:987 msgid "Controller" -msgstr "" +msgstr "Χειριστήριο" #: src/core/pad.cc:988 msgid "Keyboard" -msgstr "" +msgstr "Πληκτρολόγιο" #: src/core/pad.cc:991 msgid "Circle" -msgstr "" +msgstr "Ο" #: src/core/pad.cc:991 msgid "Cross" -msgstr "" +msgstr "Χ" #: src/core/pad.cc:991 msgid "L1" -msgstr "" +msgstr "L1" #: src/core/pad.cc:991 -#, fuzzy msgid "Select" -msgstr "Επιλογή BIOS" +msgstr "Select" #: src/core/pad.cc:991 msgid "Square" -msgstr "" +msgstr "⬜" #: src/core/pad.cc:991 src/gui/widgets/isobrowser.cc:149 msgid "Start" -msgstr "Έναρξη" +msgstr "Start" #: src/core/pad.cc:991 msgid "Triangle" -msgstr "" +msgstr "Δ" #: src/core/pad.cc:992 msgid "Analog Mode" -msgstr "" +msgstr "Αναλογική λειτουργία" #: src/core/pad.cc:992 msgid "L2" -msgstr "" +msgstr "L2" #: src/core/pad.cc:992 msgid "L3" -msgstr "" +msgstr "L3" #: src/core/pad.cc:992 msgid "R1" -msgstr "" +msgstr "R1" #: src/core/pad.cc:992 msgid "R2" -msgstr "" +msgstr "R2" #: src/core/pad.cc:992 msgid "R3" -msgstr "" +msgstr "R3" #: src/core/pad.cc:995 msgid "Up" -msgstr "" +msgstr "Πάνω" #: src/core/pad.cc:996 msgid "Right" -msgstr "" +msgstr "Δεξιά" #: src/core/pad.cc:997 msgid "Down" -msgstr "" +msgstr "Κάτω" #: src/core/pad.cc:998 msgid "Left" -msgstr "" +msgstr "Αριστερά" #: src/core/pad.cc:1001 msgid "Digital" -msgstr "" +msgstr "Ψηφιακό" #: src/core/pad.cc:1002 msgid "Analog" -msgstr "" +msgstr "Αναλογικό" #: src/core/pad.cc:1003 msgid "Mouse" -msgstr "" +msgstr "Ποντίκι" #: src/core/pad.cc:1004 msgid "Negcon (Unimplemented)" @@ -613,21 +604,20 @@ msgid "Guncon (Unimplemented)" msgstr "" #: src/core/pad.cc:1010 src/gui/widgets/pio-cart.cc:55 -#, fuzzy msgid "Connected" -msgstr "Η σύνδεση έκλεισε!\n" +msgstr "Συνδεδεμένο" #: src/core/pad.cc:1019 msgid "Analog mode" -msgstr "" +msgstr "Αναλογική λειτουργία" #: src/core/pad.cc:1027 msgid "Controller Type" -msgstr "" +msgstr "Είδος χειριστηρίου" #: src/core/pad.cc:1043 msgid "Device type" -msgstr "" +msgstr "Είδος συσκευής" #: src/core/pad.cc:1054 msgid "Mouse sensitivity X" @@ -683,16 +673,14 @@ msgid "Signed overflow in SUB instruction from 0x%08x!\n" msgstr "" #: src/core/psxinterpreter.cc:815 -#, fuzzy, c-format +#, c-format msgid "Attempted unaligned JR to 0x%08x from 0x%08x, firing exception!\n" msgstr "" -"Συναντήθηκε δεσμευμένη εντολή στην διεύθυνση 0x%08x, ενεργοποίηση exception\n" #: src/core/psxinterpreter.cc:841 -#, fuzzy, c-format +#, c-format msgid "Attempted unaligned JALR to 0x%08x from 0x%08x, firing exception!\n" msgstr "" -"Συναντήθηκε δεσμευμένη εντολή στην διεύθυνση 0x%08x, ενεργοποίηση exception\n" #: src/core/psxinterpreter.cc:879 #, c-format @@ -723,7 +711,8 @@ msgstr "" #, c-format msgid "Encountered reserved opcode from 0x%08x, firing an exception\n" msgstr "" -"Συναντήθηκε δεσμευμένη εντολή στην διεύθυνση 0x%08x, ενεργοποίηση exception\n" +"Συναντήθηκε δεσμευμένη εντολή στην διεύθυνση 0x%08x, ενεργοποίηση " +"exception\n" #: src/core/psxinterpreter.cc:1108 #, c-format @@ -749,11 +738,9 @@ msgid "Error allocating memory!" msgstr "Πρόβλημα στην εκχώρηση μνήμης!" #: src/core/psxmem.cc:135 -#, fuzzy, c-format +#, c-format msgid "Could not open EXP1:\"%s\".\n" msgstr "" -"\n" -"Αδυναμία ανοίγματος: %s\n" #: src/core/psxmem.cc:143 #, c-format @@ -765,16 +752,14 @@ msgid "" "\n" " No BIOS loaded, emulation halted.\n" "\n" -"Set a BIOS file into the configuration, and do a hard reset of the " -"emulator.\n" +"Set a BIOS file into the configuration, and do a hard reset of the emulator.\n" "The distributed OpenBIOS.bin file can be an appropriate BIOS replacement.\n" msgstr "" "\n" " Κανένα αρχείο BIOS δεν έχει φορτωθεί, η εξομοίωση σταμάτησε\n" "\n" "Επιλέξτε ένα αρχείο BIOS στις ρυθμίσεις και επανεκκινήστε τον εξομοιωτή\n" -"Το διαμοιρασμένο αρχείο OpenBIOS.bin μπορεί να χρησιμοποιηθεί ως μία " -"κατάλληλη αντικατάσταησ του BIOS.\n" +"Το διαμοιρασμένο αρχείο OpenBIOS.bin μπορεί να χρησιμοποιηθεί ως μία κατάλληλη αντικατάσταησ του BIOS.\n" #: src/core/psxmem.cc:200 #, c-format @@ -798,17 +783,17 @@ msgstr "Φόρτωση BIOS: %s\n" #: src/core/psxmem.cc:237 #, c-format msgid "Known BIOS detected: %s (%08x)\n" -msgstr "" +msgstr "Ανιχνέυτηκε γνωστό BIOS: %s(%08x)\n" #: src/core/psxmem.cc:239 #, c-format msgid "OpenBIOS detected (%08x)\n" -msgstr "" +msgstr "Ανιχνεύτηκε το OpenBIOS (%08x)\n" #: src/core/psxmem.cc:241 #, c-format msgid "Unknown bios loaded (%08x)\n" -msgstr "" +msgstr "Φορτώθηκε άγνωστο BIOS (%08x)\n" #: src/core/psxmem.cc:276 #, c-format @@ -881,14 +866,14 @@ msgid "PCSX-Redux booting\n" msgstr "Εκκίνηση του PCSX-Redux\n" #: src/core/r3000a.cc:40 -#, fuzzy, c-format +#, c-format msgid "Copyright (C) 2019-%i PCSX-Redux authors\n" -msgstr "Πνευματικά δικαιώματα (C) 2019-2021 συγγραφείς του PCSX-Redux\n" +msgstr "" #: src/core/r3000a.cc:50 -#, fuzzy, c-format +#, c-format msgid "CPU type: %s\n" -msgstr "Επεξεργαστής: %s" +msgstr "" #: src/core/sio.cc:367 msgid "Wrong block number" @@ -913,18 +898,16 @@ msgid "Game-dependent dithering (slow)" msgstr "" #: src/gpu/soft/gpu.cc:243 -#, fuzzy msgid "No dithering (fastest)" -msgstr "Κανένα - Γρηγορότερο" +msgstr "" #: src/gpu/soft/gpu.cc:244 msgid "Always dither g-shaded polygons (slowest)" msgstr "" #: src/gpu/soft/gpu.cc:246 -#, fuzzy msgid "Soft GPU configuration" -msgstr "Ρυθμίσεις SPU" +msgstr "" #: src/gpu/soft/gpu.cc:247 msgid "Dithering" @@ -941,9 +924,8 @@ msgid "" msgstr "" #: src/gpu/soft/gpu.cc:273 -#, fuzzy msgid "Soft GPU debugger" -msgstr "Παύση GPU dump" +msgstr "" #: src/gpu/soft/gpu.cc:275 msgid "" @@ -1005,7 +987,7 @@ msgstr "BIOS" #: src/gui/gui.cc:715 msgid "VRAM" -msgstr "" +msgstr "VRAM" #: src/gui/gui.cc:1055 msgid "Output" @@ -1015,17 +997,16 @@ msgstr "Έξοδος" #: src/gui/widgets/isobrowser.cc:66 src/gui/widgets/memcard_manager.cc:63 #: src/gui/widgets/vram-viewer.cc:482 msgid "File" -msgstr "Αρχείο" +msgstr "Αρχεία" #: src/gui/gui.cc:1081 src/gui/gui.h:377 src/gui/widgets/isobrowser.cc:67 #: src/gui/widgets/isobrowser.h:50 -#, fuzzy msgid "Open Disk Image" -msgstr "Άνοιγμα αρχείου εικόνα" +msgstr "Άνοιγμα δίσκου" #: src/gui/gui.cc:1082 src/gui/widgets/isobrowser.cc:68 msgid "Close Disk Image" -msgstr "" +msgstr "Κλείσιμο δίσκου" #: src/gui/gui.cc:1086 msgid "Load binary" @@ -1041,12 +1022,11 @@ msgstr "" #: src/gui/gui.cc:1098 msgid "global{}" -msgstr "" +msgstr "global{}" #: src/gui/gui.cc:1100 -#, fuzzy msgid "Save state slots" -msgstr "Αποθήκευση κατάστασης" +msgstr "" #: src/gui/gui.cc:1101 msgid "Quick-save slot" @@ -1061,23 +1041,20 @@ msgid "Show named save states" msgstr "" #: src/gui/gui.cc:1118 -#, fuzzy msgid "Save global state" -msgstr "Αποθήκευση κατάστασης" +msgstr "" #: src/gui/gui.cc:1120 -#, fuzzy msgid "Load state slots" -msgstr "Φόρτωση κατάστασης" +msgstr "" #: src/gui/gui.cc:1123 msgid "Quick-load slot" msgstr "" #: src/gui/gui.cc:1148 -#, fuzzy msgid "Load global state" -msgstr "Φόρτωση κατάστασης" +msgstr "" #: src/gui/gui.cc:1152 msgid "Open LID" @@ -1085,7 +1062,7 @@ msgstr "Άνοιγμα LID" #: src/gui/gui.cc:1156 msgid "Close LID" -msgstr "Κλείσιμο LID:" +msgstr "Κλείσιμο LID" #: src/gui/gui.cc:1160 msgid "Open and close LID" @@ -1104,14 +1081,12 @@ msgid "Emulation" msgstr "Εξομοίωση" #: src/gui/gui.cc:1175 -#, fuzzy msgid "Start emulation" -msgstr "Εξομοίωση" +msgstr "Έναρξη εξομοίωσης" #: src/gui/gui.cc:1178 -#, fuzzy msgid "Pause emulation" -msgstr "Εξομοίωση" +msgstr "Παύση εξομοίωσης" #: src/gui/gui.cc:1181 msgid "Soft Reset" @@ -1126,9 +1101,8 @@ msgid "Configuration" msgstr "Ρυθμίσεις" #: src/gui/gui.cc:1192 -#, fuzzy msgid "Manage Memory Cards" -msgstr "Αποθήκευση κάρτας μνήμης %s\n" +msgstr "Διαχείριση καρτών μνήμης" #: src/gui/gui.cc:1195 src/gui/gui.cc:1295 msgid "GPU" @@ -1140,12 +1114,11 @@ msgstr "SPU" #: src/gui/gui.cc:1197 msgid "UI" -msgstr "" +msgstr "Διεπαφή" #: src/gui/gui.cc:1198 -#, fuzzy msgid "System" -msgstr "Είδος Συστήματος" +msgstr "Σύστημα" #: src/gui/gui.cc:1199 msgid "Controls" @@ -1164,9 +1137,8 @@ msgid "CRT-lottes shader" msgstr "" #: src/gui/gui.cc:1231 -#, fuzzy msgid "Configure Shaders" -msgstr "Ρυθμίσεις" +msgstr "" #: src/gui/gui.cc:1235 msgid "PIO Cartridge" @@ -1182,7 +1154,7 @@ msgstr "Ένδειξη καταγραφών" #: src/gui/gui.cc:1241 msgid "Lua" -msgstr "" +msgstr "Lua" #: src/gui/gui.cc:1242 msgid "Show Lua Console" @@ -1197,9 +1169,8 @@ msgid "Show Lua editor" msgstr "Προβολή επεξεργαστή Lua" #: src/gui/gui.cc:1248 -#, fuzzy msgid "CPU" -msgstr "GPU" +msgstr "CPU" #: src/gui/gui.cc:1249 msgid "Show Registers" @@ -1210,14 +1181,12 @@ msgid "Show Assembly" msgstr "Ένδειξη Assembly" #: src/gui/gui.cc:1252 src/gui/gui.cc:1254 -#, fuzzy msgid "Show DynaRec Disassembly" -msgstr "Ένδειξη Assembly" +msgstr "" #: src/gui/gui.cc:1256 msgid "" -"DynaRec Disassembler is not available in Interpreted CPU mode. Try enabling " -"[Dynarec CPU]\n" +"DynaRec Disassembler is not available in Interpreted CPU mode. Try enabling [Dynarec CPU]\n" "in Configuration->Emulation, restart PCSX-Redux, then try again." msgstr "" @@ -1226,9 +1195,8 @@ msgid "Show Breakpoints" msgstr "Προβολή Breakpoints" #: src/gui/gui.cc:1260 -#, fuzzy msgid "Show Callstacks" -msgstr "Στοίβα κλήσεων" +msgstr "" #: src/gui/gui.cc:1261 msgid "Memory Editors" @@ -1236,7 +1204,7 @@ msgstr "Επεξεργαστές μνήμης" #: src/gui/gui.cc:1272 msgid "Show Memory Observer" -msgstr "" +msgstr "Ένδειξη παρατηρητή μνήμης" #: src/gui/gui.cc:1273 msgid "Show Typed Debugger" @@ -1267,14 +1235,12 @@ msgid "Show VRAM viewer #" msgstr "Ενεργοποίηση προβολής VRAM #" #: src/gui/gui.cc:1307 -#, fuzzy msgid "Show GPU logger" -msgstr "Παύση GPU dump" +msgstr "" #: src/gui/gui.cc:1308 -#, fuzzy msgid "Show GPU debug" -msgstr "Παύση GPU dump" +msgstr "" #: src/gui/gui.cc:1312 msgid "Show SPU debug" @@ -1282,16 +1248,15 @@ msgstr "" #: src/gui/gui.cc:1315 msgid "CD-Rom" -msgstr "" +msgstr "CD-Rom" #: src/gui/gui.cc:1316 -#, fuzzy msgid "Show Iso Browser" -msgstr "Προβολή πηγής" +msgstr "" #: src/gui/gui.cc:1319 msgid "Misc hardware" -msgstr "" +msgstr "Υπόλοιπο hardware" #: src/gui/gui.cc:1320 msgid "Show SIO1 debug" @@ -1299,7 +1264,7 @@ msgstr "" #: src/gui/gui.cc:1324 msgid "Kernel" -msgstr "" +msgstr "Kernel" #: src/gui/gui.cc:1325 msgid "Kernel Events" @@ -1315,31 +1280,27 @@ msgstr "" #: src/gui/gui.cc:1330 msgid "Rendering" -msgstr "" +msgstr "Απεικόνιση γραφικών" #: src/gui/gui.cc:1331 -#, fuzzy msgid "Full window render" msgstr "Απόδοση πλήρους οθόνης" #: src/gui/gui.cc:1334 -#, fuzzy msgid "Fullscreen" -msgstr "Απόδοση πλήρους οθόνης" +msgstr "Πλήρης οθόνη" #: src/gui/gui.cc:1338 -#, fuzzy msgid "Show Output Shader Editor" -msgstr "Προβολή επεξεργαστή Lua" +msgstr "" #: src/gui/gui.cc:1339 msgid "Show Offscreen Shader Editor" msgstr "" #: src/gui/gui.cc:1340 -#, fuzzy msgid "Reset shaders" -msgstr "Επαναφορά όλων" +msgstr "Επαναφορά shaders" #: src/gui/gui.cc:1348 msgid "Help" @@ -1350,9 +1311,8 @@ msgid "Show ImGui Demo" msgstr "Προβολή επίδειξης ImGui" #: src/gui/gui.cc:1351 -#, fuzzy msgid "Show UvFile information" -msgstr "Πληροφορίες OpenGL" +msgstr "Προβολή πληροφοριών UvFile" #: src/gui/gui.cc:1353 src/gui/gui.cc:2258 msgid "About" @@ -1407,14 +1367,12 @@ msgid "Kernel handlers" msgstr "" #: src/gui/gui.cc:1476 -#, fuzzy msgid "Callstacks" -msgstr "Στοίβα κλήσεων" +msgstr "" #: src/gui/gui.cc:1525 -#, fuzzy msgid "Memory Card Manager" -msgstr "Σύνδεση της κάρτας μνήμης 1" +msgstr "Διαχειριστής Καρτών Μνήμης" #: src/gui/gui.cc:1529 src/gui/widgets/registers.cc:65 msgid "Registers" @@ -1435,9 +1393,8 @@ msgid "Breakpoints" msgstr "Breakpoints" #: src/gui/gui.cc:1545 -#, fuzzy msgid "Named Save States" -msgstr "Αποθήκευση κατάστασης" +msgstr "" #: src/gui/gui.cc:1549 src/gui/widgets/memory_observer.cc:382 #: src/gui/widgets/memory_observer.cc:388 @@ -1445,24 +1402,20 @@ msgid "Memory Observer" msgstr "" #: src/gui/gui.cc:1553 src/gui/widgets/typed_debugger.cc:1062 -#, fuzzy msgid "Typed Debugger" -msgstr "Ενεργοποίηση Αποσφαλματωτή" +msgstr "" #: src/gui/gui.cc:1559 -#, fuzzy msgid "Output Video" -msgstr "Έξοδος" +msgstr "" #: src/gui/gui.cc:1564 -#, fuzzy msgid "Offscreen Render" -msgstr "Απόδοση πλήρους οθόνης" +msgstr "" #: src/gui/gui.cc:1570 -#, fuzzy msgid "PIO Cartridge Configuration" -msgstr "Ρυθμίσεις SPU" +msgstr "" #: src/gui/gui.cc:1574 msgid "SIO1 Debug" @@ -1477,9 +1430,8 @@ msgid "GPU Logger" msgstr "" #: src/gui/gui.cc:1591 -#, fuzzy msgid "UI Configuration" -msgstr "Ρυθμίσεις" +msgstr "Ρυθμίσεις Διεπαφής" #: src/gui/gui.cc:1597 msgid "Locale" @@ -1490,14 +1442,12 @@ msgid "Reload locales" msgstr "Επαναφόρτωση γλωσσών" #: src/gui/gui.cc:1617 -#, fuzzy msgid "Main Font Size" -msgstr "Μέγεθος" +msgstr "Μέγεθος Κύριας Γραμματοσειράς" #: src/gui/gui.cc:1618 -#, fuzzy msgid "Mono Font Size" -msgstr "Μέγεθος" +msgstr "Μέγεθος Mono Γραμματοσειράς" #: src/gui/gui.cc:1620 msgid "Use Widescreen Aspect Ratio" @@ -1519,24 +1469,20 @@ msgid "" msgstr "" #: src/gui/gui.cc:1640 -#, fuzzy msgid "System Configuration" -msgstr "Ρυθμίσεις" +msgstr "Ρυθμίσεις Συστήματος" #: src/gui/gui.cc:1642 -#, fuzzy msgid "Preload Disk Image files" -msgstr "Φορτώθηκε η εικόνα CD: 1%s" +msgstr "" #: src/gui/gui.cc:1643 -#, fuzzy msgid "Enable Auto Update" -msgstr "Ενεργοποίηση αποκωδικοποιητή XA" +msgstr "Ενεργοποίηση αυτόματης ενημέρωσης" #: src/gui/gui.cc:1650 -#, fuzzy msgid "Update configuration" -msgstr "Ρυθμίσεις SPU" +msgstr "Ενημέρωση ρυθμίσεων" #: src/gui/gui.cc:1651 msgid "" @@ -1557,15 +1503,15 @@ msgstr "" #: src/gui/gui.cc:1664 msgid "Enable auto update" -msgstr "" +msgstr "Ενεργοποίηση αυτόματης ενημέρωσης" #: src/gui/gui.cc:1670 msgid "No thanks" -msgstr "" +msgstr "Όχι ευχαριστώ" #: src/gui/gui.cc:1679 msgid "Update available" -msgstr "" +msgstr "Διαθέσιμη ενημέρωση" #: src/gui/gui.cc:1681 msgid "" @@ -1591,7 +1537,7 @@ msgstr "" #: src/gui/gui.cc:1699 msgid "Update" -msgstr "" +msgstr "Ενημέρωση" #: src/gui/gui.cc:1711 src/gui/gui.cc:1716 msgid "" @@ -1601,11 +1547,11 @@ msgstr "" #: src/gui/gui.cc:1722 msgid "Download" -msgstr "" +msgstr "Κατέβασμα" #: src/gui/gui.cc:1732 msgid "An error has occured while downloading the update." -msgstr "" +msgstr "Ένα σφάλμα προέκυψε κατά το κατέβασμα της αναβάθμισης" #: src/gui/gui.cc:1738 src/gui/widgets/assembly.cc:947 #: src/gui/widgets/breakpoints.cc:38 src/gui/widgets/registers.cc:339 @@ -1614,24 +1560,23 @@ msgid "Cancel" msgstr "Ακύρωση" #: src/gui/gui.cc:1747 -#, fuzzy msgid "UvFiles" -msgstr "Αρχεία" +msgstr "UvFiles" #: src/gui/gui.cc:1750 -#, fuzzy, c-format +#, c-format msgid "Read rate: %s" -msgstr "Ανάγνωση Byte" +msgstr "Ρυθμός ανάγνωσης: %s" #: src/gui/gui.cc:1752 -#, fuzzy, c-format +#, c-format msgid "Write rate: %s" -msgstr "Γραφή Byte" +msgstr "Ρυθμός γραφής: %s" #: src/gui/gui.cc:1754 #, c-format msgid "Download rate: %s" -msgstr "" +msgstr "Ρυθμός κατεβάσματος: %s" #: src/gui/gui.cc:1756 msgid "Caching" @@ -1650,9 +1595,8 @@ msgid "Idle Swap Interval" msgstr "" #: src/gui/gui.cc:1950 -#, fuzzy msgid "Reset Scaler" -msgstr "Επαναφορά όλων" +msgstr "" #: src/gui/gui.cc:1956 msgid "Speed Scaler" @@ -1700,7 +1644,7 @@ msgstr "" #: src/gui/gui.cc:1980 msgid "OpenGL GPU *ALPHA STATE*" -msgstr "" +msgstr "OpenGL GPU *Βρισκεται σε πρώιμη κατάσταση*" #: src/gui/gui.cc:1981 msgid "" @@ -1713,11 +1657,11 @@ msgstr "" #: src/gui/gui.cc:1993 msgid "NTSC" -msgstr "" +msgstr "NTSC" #: src/gui/gui.cc:1993 msgid "PAL" -msgstr "" +msgstr "PAL" #: src/gui/gui.cc:1996 msgid "System Type" @@ -1808,9 +1752,8 @@ msgid "Web Server Port" msgstr "Θύρα Εξυπηρετητή Web" #: src/gui/gui.cc:2092 -#, fuzzy msgid "Enable SIO1 Server" -msgstr "Ενεργοποίηση εξυπηρετητή GDB" +msgstr "Ενεργοποίηση SIO1 Server" #: src/gui/gui.cc:2101 msgid "" @@ -1820,14 +1763,12 @@ msgid "" msgstr "" #: src/gui/gui.cc:2105 -#, fuzzy msgid "SIO1 Server Port" -msgstr "Θύρα εξυπηρετητή GDB" +msgstr "Θυρίδα εξυπηρετητή SIO1" #: src/gui/gui.cc:2106 -#, fuzzy msgid "Enable SIO1 Client" -msgstr "Ενεργοποίηση εξυπηρετητή GDB" +msgstr "Ενεργοποίηση SIO1 Client" #: src/gui/gui.cc:2119 msgid "" @@ -1838,22 +1779,19 @@ msgstr "" #: src/gui/gui.cc:2123 msgid "SIO1 Client Host" -msgstr "" +msgstr "\"Πελάτης\" SIO1" #: src/gui/gui.cc:2126 -#, fuzzy msgid "SIO1 Client Port" -msgstr "Θύρα εξυπηρετητή GDB" +msgstr "Εξυπηρετητής SIO1" #: src/gui/gui.cc:2130 -#, fuzzy msgid "Reset SIO" -msgstr "Επαναφορά όλων" +msgstr "Επαναφορά SIO" #: src/gui/gui.cc:2141 -#, fuzzy msgid "Reconnect" -msgstr "Η σύνδεση έκλεισε!\n" +msgstr "Επανασύνδεση" #: src/gui/gui.cc:2154 msgid "SIO1Mode" @@ -1900,13 +1838,12 @@ msgid "Themes" msgstr "Στυλ" #: src/gui/gui.cc:2266 src/gui/gui.cc:2340 -#, fuzzy msgid "Version" msgstr "Έκδοση" #: src/gui/gui.cc:2271 msgid "Copy to clipboard" -msgstr "" +msgstr "Αντιγραφή στο πρόχειρο" #: src/gui/gui.cc:2277 msgid "" @@ -1914,29 +1851,32 @@ msgid "" "\n" "Probably built from source." msgstr "" +"Δεν υπάρχουν πληροφορίες για την έκδοση του λογισμικού\n" +"\n" +"Πιθανόν χτίστηκε από τον πηγαίο κώδικα." #: src/gui/gui.cc:2279 src/gui/gui.cc:2357 -#, fuzzy, c-format +#, c-format msgid "Version: %s" -msgstr "Έκδοση" +msgstr "Έκδοση: %s" #: src/gui/gui.cc:2280 -#, fuzzy, c-format +#, c-format msgid "Changeset: %s" -msgstr "Αποθήκευση cheats σε: %s\n" +msgstr "Αλλαγές: %s" #: src/gui/gui.cc:2283 -#, fuzzy, c-format +#, c-format msgid "Date & time: %s" -msgstr "Ημερομηνία και ώρα" +msgstr "Ημερομηνία & ώρα: %s" #: src/gui/gui.cc:2292 msgid "Authors" -msgstr "" +msgstr "Συγγραφείς" #: src/gui/gui.cc:2300 msgid "Licenses" -msgstr "" +msgstr "Άδειες λογισμικού" #: src/gui/gui.cc:2312 msgid "OpenGL information" @@ -1944,11 +1884,11 @@ msgstr "Πληροφορίες OpenGL" #: src/gui/gui.cc:2314 msgid "OpenGL error reporting: enabled" -msgstr "" +msgstr "Αναφορά σφαλμάτων OpenGL: Ενεργοποιημένη" #: src/gui/gui.cc:2316 msgid "OpenGL error reporting: disabled" -msgstr "" +msgstr "Αναφορά σφαλμάτων OpenGL: Απενεργοποιημένη" #: src/gui/gui.cc:2319 msgid "" @@ -1962,7 +1902,7 @@ msgstr "" #: src/gui/gui.cc:2327 msgid "Enable OpenGL error reporting" -msgstr "" +msgstr "Ενεργοποίηση αναφοράς σφαλμάτων OpenGL" #: src/gui/gui.cc:2330 msgid "" @@ -1981,18 +1921,16 @@ msgid "Core profile: %s" msgstr "Προφίλ πυρήνα: %s" #: src/gui/gui.cc:2337 src/gui/widgets/assembly.cc:535 -#, fuzzy msgid "no" -msgstr "Mono" +msgstr "όχι" #: src/gui/gui.cc:2337 src/gui/widgets/assembly.cc:535 msgid "yes" -msgstr "" +msgstr "ναι" #: src/gui/gui.cc:2338 -#, fuzzy msgid "Vendor" -msgstr "πωλητής" +msgstr "Πωλητής" #: src/gui/gui.cc:2339 msgid "Renderer" @@ -2008,38 +1946,38 @@ msgid "Texture units: %d" msgstr "" #: src/gui/gui.cc:2347 -#, fuzzy msgid "Extensions:" -msgstr "επεκτάσεις:" +msgstr "Επεκτάσεις:" #: src/gui/gui.cc:2356 -#, fuzzy msgid "FFmpeg information" -msgstr "Πληροφορίες OpenGL" +msgstr "Πληροφορίες FFmpeg" #: src/gui/gui.cc:2358 #, c-format msgid "License: %s" -msgstr "" +msgstr "Άδεια: %s" #: src/gui/gui.cc:2359 -#, fuzzy, c-format +#, c-format msgid "Configuration: %s" -msgstr "Ρυθμίσεις" +msgstr "" #: src/gui/gui.cc:2362 msgid "List of supported formats:" -msgstr "" +msgstr "Λίστα με formats που υποστηρίζονται:" #: src/gui/gui.cc:2380 msgid "" "List of supported codecs: (D: Decoder, E: Encoder, L: Lossy, S: Lossless)" msgstr "" +"Λίστα με codecs που υποστηρίζονται: (D: Decoder, E: Encoder, L: Lossy, S: " +"Lossless)" #: src/gui/gui.cc:2420 #, c-format msgid "%s codecs" -msgstr "" +msgstr "%s codecs" #: src/gui/gui.h:253 msgid "Ok" @@ -2047,7 +1985,7 @@ msgstr "ΟΚ" #: src/gui/gui.h:378 msgid "Open Binary" -msgstr "Άνοιγμα δυαδικού αρχείου" +msgstr "Άνοιγμα binary" #: src/gui/gui.h:379 msgid "Open Archive" @@ -2058,9 +1996,8 @@ msgid "Select BIOS" msgstr "Επιλογή BIOS" #: src/gui/gui.h:381 src/gui/widgets/pio-cart.h:36 -#, fuzzy msgid "Select EXP1" -msgstr "Επιλογή BIOS" +msgstr "" #: src/gui/gui.h:428 msgid "Notification" @@ -2071,9 +2008,8 @@ msgid "Offscreen CRT shader Configuration" msgstr "" #: src/gui/shaders/crt-lottes-offscreen.lua:59 -#, fuzzy msgid "Enable gaussian blur" -msgstr "Ενεργοποίηση αποχρώσεων του γκρι" +msgstr "" #: src/gui/shaders/crt-lottes-offscreen.lua:61 msgid "Hard Pixel factor" @@ -2084,9 +2020,8 @@ msgid "Hard Scanline factor" msgstr "" #: src/gui/shaders/crt-lottes-offscreen.lua:65 -#, fuzzy msgid "Enable Scanlines" -msgstr "Ενεργοποιημένο" +msgstr "" #: src/gui/shaders/crt-lottes-offscreen.lua:67 msgid "Use S-rgb" @@ -2094,14 +2029,12 @@ msgstr "" #: src/gui/shaders/crt-lottes-offscreen.lua:70 #: src/gui/shaders/crt-lottes-output.lua:83 -#, fuzzy msgid "Reset to defaults" -msgstr "Επαναφορά όλων" +msgstr "" #: src/gui/shaders/crt-lottes-output.lua:58 -#, fuzzy msgid "Output CRT Shader Configuration" -msgstr "Ρυθμίσεις" +msgstr "" #: src/gui/shaders/crt-lottes-output.lua:64 msgid "Warp intensity" @@ -2112,35 +2045,32 @@ msgid "Mask intensity" msgstr "" #: src/gui/shaders/crt-lottes-output.lua:68 -#, fuzzy msgid "Greyscale" -msgstr "Ενεργοποίηση αποχρώσεων του γκρι" +msgstr "" #: src/gui/shaders/crt-lottes-output.lua:70 msgid "Trinitron" -msgstr "" +msgstr "Trinitron" #: src/gui/shaders/crt-lottes-output.lua:70 msgid "Trinitron 2x" -msgstr "" +msgstr "Trinitron 2x" #: src/gui/shaders/crt-lottes-output.lua:70 msgid "Trio" -msgstr "" +msgstr "Trio" #: src/gui/shaders/crt-lottes-output.lua:72 -#, fuzzy msgid "Mask type" -msgstr "Προβολή types" +msgstr "Είδος μάσκας" #: src/gui/widgets/assembly.cc:443 msgid "Load symbols map" msgstr "Φόρτωση χάρτη συμβόλων" #: src/gui/widgets/assembly.cc:444 -#, fuzzy msgid "Reset symbols map" -msgstr "Φόρτωση χάρτη συμβόλων" +msgstr "" #: src/gui/widgets/assembly.cc:450 src/gui/widgets/assembly.cc:525 msgid "Pause" @@ -2159,7 +2089,7 @@ msgstr "" #: src/gui/widgets/assembly.cc:459 src/gui/widgets/console.cc:53 #: src/gui/widgets/dynarec_disassembly.cc:106 msgid "Options" -msgstr "Επιλογές" +msgstr "Ρυθμίσεις" #: src/gui/widgets/assembly.cc:460 msgid "Combined pseudo-instructions" @@ -2172,9 +2102,8 @@ msgid "" msgstr "" #: src/gui/widgets/assembly.cc:470 -#, fuzzy msgid "Pseudo-instructions filling" -msgstr "Γέμισμα ψευδο-εντολών" +msgstr "" #: src/gui/widgets/assembly.cc:475 msgid "" @@ -2227,54 +2156,47 @@ msgstr "" #: src/gui/widgets/assembly.cc:709 src/gui/widgets/assembly.cc:737 #: src/gui/widgets/breakpoints.cc:171 -#, fuzzy msgid "GUI" -msgstr "GPU" +msgstr "Διεπαφή" #: src/gui/widgets/assembly.cc:718 msgid "Create symbol here" -msgstr "" +msgstr "Δημιουργία συμβόλου εδώ" #: src/gui/widgets/assembly.cc:723 -#, fuzzy msgid "Remove symbol" -msgstr "Φόρτωση χάρτη συμβόλων" +msgstr "Αφαίρεση συμβόλου" #: src/gui/widgets/assembly.cc:727 -#, fuzzy msgid "Copy Address" -msgstr "Διεύθυνση" +msgstr "Αντιγραφή διεύθυνσης" #: src/gui/widgets/assembly.cc:732 src/gui/widgets/registers.cc:39 -#, fuzzy msgid "Go to in Memory Editor" -msgstr "Επεξεργαστές μνήμης" +msgstr "" #: src/gui/widgets/assembly.cc:735 -#, fuzzy msgid "Run to Cursor" -msgstr "Ανατρέξτε στον κέρσορα" +msgstr "" #: src/gui/widgets/assembly.cc:744 -#, fuzzy msgid "Toggle Breakpoint" -msgstr "Προβολή Breakpoints" +msgstr "" #: src/gui/widgets/assembly.cc:748 src/gui/widgets/assembly.cc:753 -#, fuzzy msgid "Remove Breakpoint" -msgstr "Προβολή Breakpoints" +msgstr "" #: src/gui/widgets/assembly.cc:757 src/gui/widgets/assembly.cc:954 #: src/gui/widgets/assembly.cc:956 src/gui/widgets/assembly.cc:962 -#, fuzzy msgid "Assemble" -msgstr "Assembly" +msgstr "" #: src/gui/widgets/assembly.cc:887 src/gui/widgets/breakpoints.cc:153 #: src/gui/widgets/memory_observer.cc:170 #: src/gui/widgets/memory_observer.cc:328 -#: src/gui/widgets/memory_observer.cc:424 src/gui/widgets/typed_debugger.cc:961 +#: src/gui/widgets/memory_observer.cc:424 +#: src/gui/widgets/typed_debugger.cc:961 msgid "Address" msgstr "Διεύθυνση" @@ -2287,9 +2209,8 @@ msgid "Symbols" msgstr "Σύμβολα" #: src/gui/widgets/assembly.cc:936 src/gui/widgets/assembly.cc:938 -#, fuzzy msgid "Add symbol" -msgstr "Φόρτωση συμβόλων" +msgstr "" #: src/gui/widgets/assembly.cc:939 #, c-format @@ -2297,9 +2218,8 @@ msgid "Add symbol for address 0x%08x:" msgstr "" #: src/gui/widgets/assembly.cc:941 -#, fuzzy msgid "Add" -msgstr "Διεύθυνση" +msgstr "" #: src/gui/widgets/assembly.cc:957 #, c-format @@ -2314,9 +2234,8 @@ msgid "Clear" msgstr "Εκκαθάριση" #: src/gui/widgets/assembly.cc:984 src/gui/widgets/dynarec_disassembly.cc:73 -#, fuzzy msgid "Close" -msgstr "Κλείσιμο LID:" +msgstr "Κλείσιμο" #: src/gui/widgets/assembly.cc:1012 msgid "Refresh" @@ -2339,23 +2258,21 @@ msgid "Load Symbols" msgstr "Φόρτωση συμβόλων" #: src/gui/widgets/breakpoints.cc:30 src/gui/widgets/breakpoints.cc:128 -#, fuzzy msgid "Edit label of breakpoint {}##{}" -msgstr "Προσθήκη Breakpoint" +msgstr "" #: src/gui/widgets/breakpoints.cc:32 -#, fuzzy, c-format +#, c-format msgid "Change the label of breakpoint %s:" -msgstr "Αλλαγή της τιμής του καταχωρητή %s:" +msgstr "" #: src/gui/widgets/breakpoints.cc:33 src/gui/widgets/breakpoints.cc:164 msgid "Label" -msgstr "" +msgstr "Ετικέτα" #: src/gui/widgets/breakpoints.cc:51 -#, fuzzy msgid "Clear maps" -msgstr "Breakpoints" +msgstr "" #: src/gui/widgets/breakpoints.cc:55 msgid "" @@ -2437,18 +2354,16 @@ msgid "Breakpoint Type" msgstr "Είδος Breakpoint" #: src/gui/widgets/breakpoints.cc:163 -#, fuzzy msgid "Breakpoint Width" -msgstr "Breakpoints" +msgstr "" #: src/gui/widgets/breakpoints.cc:166 msgid "Add Breakpoint" msgstr "Προσθήκη Breakpoint" #: src/gui/widgets/console.cc:34 -#, fuzzy msgid "Close Console" -msgstr "Κονσόλα Lua" +msgstr "Κλείσιμο κονσόλας" #: src/gui/widgets/console.cc:41 src/gui/widgets/dynarec_disassembly.cc:95 #: src/gui/widgets/log.cc:130 @@ -2461,13 +2376,12 @@ msgstr "" #: src/gui/widgets/console.cc:48 src/gui/widgets/dynarec_disassembly.cc:100 #: src/gui/widgets/log.cc:126 -#, fuzzy msgid "Monospace" -msgstr "Mono" +msgstr "" #: src/gui/widgets/console.cc:97 msgid "Input" -msgstr "" +msgstr "Είσοδος" #. Disassemble button #: src/gui/widgets/dynarec_disassembly.cc:60 @@ -2476,9 +2390,8 @@ msgstr "" #. Save to File button #: src/gui/widgets/dynarec_disassembly.cc:65 -#, fuzzy msgid "Save to File" -msgstr "Αρχείο" +msgstr "Αποθήκευση σε αρχείο" #: src/gui/widgets/dynarec_disassembly.cc:70 #: src/gui/widgets/dynarec_disassembly.cc:71 @@ -2492,9 +2405,8 @@ msgid "" msgstr "" #: src/gui/widgets/dynarec_disassembly.cc:82 -#, fuzzy msgid "Close Disassembler" -msgstr "Ένδειξη Assembly" +msgstr "" #. Show buffer size returned from disassembly function #: src/gui/widgets/dynarec_disassembly.cc:112 @@ -2504,7 +2416,7 @@ msgstr "" #: src/gui/widgets/events.cc:38 src/gui/widgets/memcard_manager.cc:200 msgid "ID" -msgstr "" +msgstr "ID" #: src/gui/widgets/events.cc:39 msgid "Core" @@ -2532,8 +2444,8 @@ msgstr "" #: src/gui/widgets/gpulogger.cc:42 msgid "" -"Logs each frame's draw calls. When enabled, all the commands sent to the GPU " -"will be logged and displayed here. This will contain only a single frame " +"Logs each frame's draw calls. When enabled, all the commands sent to the GPU" +" will be logged and displayed here. This will contain only a single frame " "worth of commands. The feature can be pretty demanding in CPU and memory." msgstr "" @@ -2549,16 +2461,15 @@ msgstr "" msgid "" "When enabled, the framebuffer will be constantly redrawned using the " "selected commands, allowing to see the resulting output immediately. This " -"doesn't make sense to have this enabled when: (1) the CPU is running and (2) " -"the GPU logging isn't enabled. Selection of which commands to replay is done " -"using the first checkbox in the logger display below. The [T] button will " -"select all commands for replay from the top and until this command." +"doesn't make sense to have this enabled when: (1) the CPU is running and (2)" +" the GPU logging isn't enabled. Selection of which commands to replay is " +"done using the first checkbox in the logger display below. The [T] button " +"will select all commands for replay from the top and until this command." msgstr "" #: src/gui/widgets/gpulogger.cc:57 -#, fuzzy msgid "Show origins" -msgstr "Ένδειξη καταγραφών" +msgstr "" #: src/gui/widgets/gpulogger.cc:59 msgid "" @@ -2593,10 +2504,10 @@ msgstr "" #: src/gui/widgets/gpulogger.cc:92 msgid "" -"When enabled, hovering a command in the logger view will highlight it in the " -"vram display. Individual commands can be selected for highlight by using the " -"second checkbox in the logger view. The [B] and [E] buttons can be used to " -"specify the beginning and the end of a span of commands to highlight." +"When enabled, hovering a command in the logger view will highlight it in the" +" vram display. Individual commands can be selected for highlight by using " +"the second checkbox in the logger view. The [B] and [E] buttons can be used " +"to specify the beginning and the end of a span of commands to highlight." msgstr "" #: src/gui/widgets/gpulogger.cc:99 @@ -2667,16 +2578,16 @@ msgstr "" #: src/gui/widgets/gpulogger.cc:161 msgid "at PC = " -msgstr "" +msgstr "Στο PC =" #: src/gui/widgets/handlers.cc:40 msgid "Invalid data at 0x100" -msgstr "" +msgstr "Μη-έγκυρα δεδομένα στην διεύθυνση 0x100" #: src/gui/widgets/handlers.cc:48 #, c-format msgid "Priority %i" -msgstr "" +msgstr "Προτεραιότητα %i" #: src/gui/widgets/handlers.cc:51 msgid " No handlers" @@ -2703,9 +2614,9 @@ msgid "No iso or invalid iso loaded." msgstr "" #: src/gui/widgets/isobrowser.cc:103 -#, fuzzy, c-format +#, c-format msgid "GAME Label: %s" -msgstr "Ταυτότητα παιχνιδιού: %s" +msgstr "" #: src/gui/widgets/isobrowser.cc:119 msgid "Cache files" @@ -2713,7 +2624,7 @@ msgstr "" #: src/gui/widgets/isobrowser.cc:128 msgid "Compute CRCs" -msgstr "" +msgstr "Υπολογισμός CRCs" #: src/gui/widgets/isobrowser.cc:133 msgid "" @@ -2747,28 +2658,24 @@ msgid "Enabled" msgstr "Ενεργοποιημένο" #: src/gui/widgets/log.cc:69 -#, fuzzy msgid "Enable all" -msgstr "Ενεργοποιημένο" +msgstr "Ενεργοποίηση όλων" #: src/gui/widgets/log.cc:73 -#, fuzzy msgid "Disable all" -msgstr "Απενεργοποιημένο" +msgstr "Απενεργοποίηση όλων" #: src/gui/widgets/log.cc:86 -#, fuzzy msgid "Displayed" -msgstr "Προβολή" +msgstr "" #: src/gui/widgets/log.cc:88 -#, fuzzy msgid "Display all" -msgstr "Προβολή" +msgstr "" #: src/gui/widgets/log.cc:92 msgid "Hide all" -msgstr "" +msgstr "Κρύψιμο όλων" #: src/gui/widgets/log.cc:105 msgid "Special" @@ -2791,9 +2698,8 @@ msgid "Follow" msgstr "Ακολούθηση" #: src/gui/widgets/luaeditor.cc:58 -#, fuzzy msgid "Auto run" -msgstr "Αυτόματη αποθήκευση" +msgstr "" #: src/gui/widgets/luaeditor.cc:60 src/gui/widgets/shader-editor.cc:492 msgid "Auto save" @@ -2812,31 +2718,28 @@ msgid "Raw" msgstr "" #: src/gui/widgets/memcard_manager.cc:64 -#, fuzzy msgid "Import file into memory card 1" -msgstr "Φόρτωση κάρτας μνήμης %s\n" +msgstr "Εισαγωγή αρχείου στην κάρτα μνήμης 1" #: src/gui/widgets/memcard_manager.cc:68 -#, fuzzy msgid "Import file into memory card 2" -msgstr "Φόρτωση κάρτας μνήμης %s\n" +msgstr "Εισαγωγή αρχείου στην κάρτα μνήμης 2" #: src/gui/widgets/memcard_manager.cc:72 msgid "Export memory card 1 to file" -msgstr "" +msgstr "Εξαγωγή της κάρτας μνήμης 1 σε αρχείο" #: src/gui/widgets/memcard_manager.cc:76 msgid "Export memory card 2 to file" -msgstr "" +msgstr "Εξαγωγή της κάρτας μνήμης 2 σε αρχείο" #: src/gui/widgets/memcard_manager.cc:121 msgid "Undo" -msgstr "" +msgstr "Πίσω" #: src/gui/widgets/memcard_manager.cc:141 -#, fuzzy msgid "Undo version: " -msgstr "Έκδοση" +msgstr "" #: src/gui/widgets/memcard_manager.cc:144 msgid "Latest" @@ -2846,7 +2749,8 @@ msgstr "" msgid "Clear Undo buffer" msgstr "" -#. Insert or remove memory cards. Send a SIO IRQ to the emulator if this happens as well. +#. Insert or remove memory cards. Send a SIO IRQ to the emulator if this +#. happens as well. #: src/gui/widgets/memcard_manager.cc:156 msgid "Memory Card 1 inserted" msgstr "Σύνδεση της κάρτας μνήμης 1" @@ -2872,41 +2776,40 @@ msgstr "" #: src/gui/widgets/memcard_manager.cc:182 msgid "Icon size" -msgstr "" +msgstr "Μέγεθος εικονιδίων" #: src/gui/widgets/memcard_manager.cc:183 msgid "Draw Pocketstation icons" -msgstr "" +msgstr "Εμφάνιση εικονιδίων Pocketstation" #: src/gui/widgets/memcard_manager.cc:197 msgid "Block number" -msgstr "" +msgstr "Αριθμός block" #: src/gui/widgets/memcard_manager.cc:198 msgid "Icon" -msgstr "" +msgstr "Εικονίδιο" #: src/gui/widgets/memcard_manager.cc:199 msgid "Title" -msgstr "" +msgstr "Τίτλος" #: src/gui/widgets/memcard_manager.cc:202 -#, fuzzy msgid "Action" -msgstr "Επιλογές" +msgstr "Δράση" #: src/gui/widgets/memcard_manager.cc:220 msgid "Chained block" -msgstr "" +msgstr "Block σε αλυσίδα" #: src/gui/widgets/memcard_manager.cc:225 msgid "Free block" -msgstr "" +msgstr "Ελεύθερο block" #: src/gui/widgets/memcard_manager.cc:238 #, c-format msgid "%s (%dKB)" -msgstr "" +msgstr "%s (%dΚΒ)" #. We have to suffix the action button names with ##number because Imgui #. can't handle multiple buttons with the same name well @@ -2919,18 +2822,16 @@ msgid "Erased file {}({}) off card {}" msgstr "" #: src/gui/widgets/memcard_manager.cc:254 -#, fuzzy msgid "Copy##{}" -msgstr "Αντιγραφή" +msgstr "" #: src/gui/widgets/memcard_manager.cc:264 msgid "Copied file {}({}) from card {} to card {}" msgstr "" #: src/gui/widgets/memcard_manager.cc:276 -#, fuzzy msgid "Move##{}" -msgstr "Αφαίρεση##" +msgstr "" #: src/gui/widgets/memcard_manager.cc:287 msgid "Moved file {}({}) from card {} to card {}" @@ -2945,34 +2846,31 @@ msgid "Copy icon##{}" msgstr "" #: src/gui/widgets/memcard_manager.cc:316 -#, fuzzy msgid "Memory Card 1" -msgstr "Σύνδεση της κάρτας μνήμης 1" +msgstr "Κάρτα Μνήμης 1" #: src/gui/widgets/memcard_manager.cc:320 -#, fuzzy msgid "Memory Card 2" -msgstr "Σύνδεση της κάρτας μνήμης 2" +msgstr "Κάρτα Μνήμης 2" #: src/gui/widgets/memcard_manager.h:76 -#, fuzzy msgid "Import Memory Card file" -msgstr "Σύνδεση της κάρτας μνήμης 1" +msgstr "Εισαγωγή αρχείου κάρτας μνήμης" #: src/gui/widgets/memcard_manager.h:78 -#, fuzzy msgid "Export Memory Card file" -msgstr "Σύνδεση της κάρτας μνήμης 1" +msgstr "Εξαγωγή αρχείου κάρτας μνήμης" #: src/gui/widgets/memory_observer.cc:97 msgid "Plain search" -msgstr "" +msgstr "Απλή αναζήτηση" #: src/gui/widgets/memory_observer.cc:98 msgid "Pattern" msgstr "" -#: src/gui/widgets/memory_observer.cc:99 src/gui/widgets/memory_observer.cc:288 +#: src/gui/widgets/memory_observer.cc:99 +#: src/gui/widgets/memory_observer.cc:288 msgid "Hex" msgstr "" @@ -2996,9 +2894,8 @@ msgstr "" #: src/gui/widgets/memory_observer.cc:184 #: src/gui/widgets/memory_observer.cc:373 #: src/gui/widgets/memory_observer.cc:438 -#, fuzzy msgid "Show in memory editor##{}" -msgstr "Προβολή επεξεργαστή Lua" +msgstr "" #: src/gui/widgets/memory_observer.cc:197 msgid "Delta-over-time search" @@ -3023,14 +2920,12 @@ msgid "Value" msgstr "" #: src/gui/widgets/memory_observer.cc:294 -#, fuzzy msgid "Value type" -msgstr "Προβολή types" +msgstr "" #: src/gui/widgets/memory_observer.cc:309 -#, fuzzy msgid "Scan type" -msgstr "Προβολή types" +msgstr "" #: src/gui/widgets/memory_observer.cc:324 msgid "Display as fixed-point values" @@ -3045,29 +2940,24 @@ msgid "Scanned value" msgstr "" #: src/gui/widgets/memory_observer.cc:332 -#, fuzzy msgid "Read breakpoint" -msgstr "Προσθήκη Breakpoint" +msgstr "" #: src/gui/widgets/memory_observer.cc:333 -#, fuzzy msgid "Write breakpoint" -msgstr "Προσθήκη Breakpoint" +msgstr "" #: src/gui/widgets/memory_observer.cc:362 -#, fuzzy msgid "Freeze##{}" -msgstr "Ενεργοποίηση##" +msgstr "" #: src/gui/widgets/memory_observer.cc:379 -#, fuzzy msgid "Add read breakpoint##{}" -msgstr "Προσθήκη Breakpoint" +msgstr "" #: src/gui/widgets/memory_observer.cc:385 -#, fuzzy msgid "Add write breakpoint##{}" -msgstr "Προσθήκη Breakpoint" +msgstr "" #: src/gui/widgets/memory_observer.cc:398 msgid "Pattern search" @@ -3098,18 +2988,16 @@ msgid "Step" msgstr "" #: src/gui/widgets/named_savestates.cc:80 -#, fuzzy msgid "Filename: " -msgstr "Όνομα αρχείου" +msgstr "" #: src/gui/widgets/named_savestates.cc:111 msgid "Enter the name of your save state here" msgstr "" #: src/gui/widgets/named_savestates.cc:139 -#, fuzzy msgid "Create save" -msgstr "Αυτόματη αποθήκευση" +msgstr "" #. The save state exists #: src/gui/widgets/named_savestates.cc:145 @@ -3117,18 +3005,16 @@ msgid "Overwrite save" msgstr "" #: src/gui/widgets/named_savestates.cc:149 -#, fuzzy msgid "Load save" -msgstr "Αυτόματη αποθήκευση" +msgstr "" #: src/gui/widgets/named_savestates.cc:155 -#, fuzzy msgid "Delete save" -msgstr "Αυτόματη αποθήκευση" +msgstr "" #: src/gui/widgets/pio-cart.cc:36 msgid "ROM" -msgstr "" +msgstr "ROM" #: src/gui/widgets/pio-cart.cc:47 msgid "On/Off Switch:" @@ -3143,14 +3029,12 @@ msgid "On" msgstr "" #: src/gui/widgets/registers.cc:34 -#, fuzzy msgid "Context##{}" -msgstr "Αντιγραφή" +msgstr "" #: src/gui/widgets/registers.cc:36 -#, fuzzy msgid "Go to in Assembly" -msgstr "Ένδειξη Assembly" +msgstr "" #: src/gui/widgets/registers.cc:42 msgid "Copy Value" @@ -3166,9 +3050,8 @@ msgid "Edit value of {}" msgstr "Επεξεργασία τιμής του {}" #: src/gui/widgets/registers.cc:104 src/gui/widgets/registers.cc:200 -#, fuzzy msgid "Show fixed point" -msgstr "Προβολή Breakpoints" +msgstr "" #: src/gui/widgets/registers.cc:286 msgid "Misc" @@ -3192,9 +3075,8 @@ msgid "Pixel Shader compilation error: {}\n" msgstr "" #: src/gui/widgets/shader-editor.cc:365 -#, fuzzy msgid "Link error: {}\n" -msgstr "Σφάλμα link:\n" +msgstr "" #: src/gui/widgets/shader-editor.cc:377 msgid "Missing attribute {} in shader program" @@ -3209,9 +3091,8 @@ msgid "Show all" msgstr "" #: src/gui/widgets/shader-editor.cc:496 -#, fuzzy msgid "Configure shader" -msgstr "Ρυθμίσεις" +msgstr "" #: src/gui/widgets/shader-editor.cc:521 msgid "Vertex Shader" @@ -3222,14 +3103,12 @@ msgid "Pixel Shader" msgstr "" #: src/gui/widgets/shader-editor.cc:533 -#, fuzzy msgid "Lua Invoker" -msgstr "Προβολή Lua" +msgstr "" #: src/gui/widgets/sio1.cc:142 -#, fuzzy msgid "Edit" -msgstr "Επεξεργασία##{}" +msgstr "" #: src/gui/widgets/sio1.cc:148 msgid "Bit" @@ -3263,39 +3142,35 @@ msgid "Log reads and writes##{}{}" msgstr "" #: src/gui/widgets/typed_debugger.cc:292 -#, fuzzy msgid "Add read breakpoint##{}{}" -msgstr "Προσθήκη Breakpoint" +msgstr "" #: src/gui/widgets/typed_debugger.cc:295 -#, fuzzy msgid "ReadPause" -msgstr "Παύση" +msgstr "" #: src/gui/widgets/typed_debugger.cc:299 -#, fuzzy msgid "Add write breakpoint##{}{}" -msgstr "Προσθήκη Breakpoint" +msgstr "" #: src/gui/widgets/typed_debugger.cc:302 -#, fuzzy msgid "WritePause" -msgstr "Παύση" +msgstr "" #. Name. #: src/gui/widgets/typed_debugger.cc:309 msgid "Display log entries##{}{}" msgstr "" -#: src/gui/widgets/typed_debugger.cc:336 src/gui/widgets/typed_debugger.cc:1067 -#, fuzzy +#: src/gui/widgets/typed_debugger.cc:336 +#: src/gui/widgets/typed_debugger.cc:1067 msgid "Re-enable##{}" -msgstr "Ενεργοποίηση##" +msgstr "" -#: src/gui/widgets/typed_debugger.cc:337 src/gui/widgets/typed_debugger.cc:1068 -#, fuzzy +#: src/gui/widgets/typed_debugger.cc:337 +#: src/gui/widgets/typed_debugger.cc:1068 msgid "Disable##{}" -msgstr "Απενεργοποίηση##" +msgstr "" #. Name. #: src/gui/widgets/typed_debugger.cc:384 @@ -3304,9 +3179,8 @@ msgstr "" #: src/gui/widgets/typed_debugger.cc:416 src/gui/widgets/typed_debugger.cc:461 #: src/gui/widgets/typed_debugger.cc:488 -#, fuzzy msgid "Show in memory editor##{}{}" -msgstr "Προβολή επεξεργαστή Lua" +msgstr "" #: src/gui/widgets/typed_debugger.cc:434 msgid "Add to Watch tab##{}{}" @@ -3323,11 +3197,7 @@ msgstr "" #: src/gui/widgets/typed_debugger.cc:652 msgid "" -"Data types can be imported from Ghidra using tools/ghidra_scripts/" -"export_redux.py, which will generate a redux_data_types.txt file in its " -"folder, or from any text file where each line specifies the data type's name " -"and fields, separated by semi-colons; fields are specified in type-name-size " -"tuples whose elements are separated by commas.\n" +"Data types can be imported from Ghidra using tools/ghidra_scripts/export_redux.py, which will generate a redux_data_types.txt file in its folder, or from any text file where each line specifies the data type's name and fields, separated by semi-colons; fields are specified in type-name-size tuples whose elements are separated by commas.\n" "\n" "For example:\n" msgstr "" @@ -3346,11 +3216,7 @@ msgstr "" #: src/gui/widgets/typed_debugger.cc:688 msgid "" -"Functions can be imported from Ghidra using tools/ghidra_scripts/" -"export_redux.py, which will generate a redux_funcs.txt file in its folder, " -"or from any text file where each line specifies the function address, name " -"and arguments, separated by semi-colons; arguments are specified in type-" -"name-size tuples whose elements are separated by commas.\n" +"Functions can be imported from Ghidra using tools/ghidra_scripts/export_redux.py, which will generate a redux_funcs.txt file in its folder, or from any text file where each line specifies the function address, name and arguments, separated by semi-colons; arguments are specified in type-name-size tuples whose elements are separated by commas.\n" "\n" "For example:\n" msgstr "" @@ -3384,14 +3250,12 @@ msgid "{}[{}]" msgstr "" #: src/gui/widgets/typed_debugger.cc:836 src/gui/widgets/typed_debugger.cc:883 -#, fuzzy msgid "Clear breakpoints" -msgstr "Breakpoints" +msgstr "" #: src/gui/widgets/typed_debugger.cc:845 -#, fuzzy msgid "Restore disabled instructions" -msgstr "Συνδυασμός ψευδο-εντολών" +msgstr "" #: src/gui/widgets/typed_debugger.cc:858 msgid "WatchTable" @@ -3400,35 +3264,31 @@ msgstr "" #: src/gui/widgets/typed_debugger.cc:859 src/gui/widgets/typed_debugger.cc:905 #: src/gui/widgets/typed_debugger.cc:962 msgid "Name" -msgstr "" +msgstr "Όνομα" #: src/gui/widgets/typed_debugger.cc:860 src/gui/widgets/typed_debugger.cc:906 msgid "Type" -msgstr "" +msgstr "Τύπος" #: src/gui/widgets/typed_debugger.cc:861 src/gui/widgets/typed_debugger.cc:907 -#, fuzzy msgid "Size" msgstr "Μέγεθος" #: src/gui/widgets/typed_debugger.cc:877 src/gui/widgets/typed_debugger.cc:960 -#, fuzzy msgid "Functions" -msgstr "Επιλογές" +msgstr "Συναρτήσεις" #: src/gui/widgets/typed_debugger.cc:878 -#, fuzzy msgid "Clear log" -msgstr "Εκκαθάριση" +msgstr "" #: src/gui/widgets/typed_debugger.cc:892 msgid "Restore disabled functions" msgstr "" #: src/gui/widgets/typed_debugger.cc:904 -#, fuzzy msgid "FunctionBreakpoints" -msgstr "Breakpoints" +msgstr "" #: src/gui/widgets/typed_debugger.cc:917 msgid "{}\t(called from {}\t@ {:#x})##{}" @@ -3439,9 +3299,8 @@ msgid "Toggle" msgstr "" #: src/gui/widgets/typed_debugger.cc:979 -#, fuzzy msgid "Add breakpoint##{}" -msgstr "Προσθήκη Breakpoint" +msgstr "" #: src/gui/widgets/vram-viewer.cc:390 msgid "VRAM Shader Editor" @@ -3517,7 +3376,7 @@ msgstr "" #: src/spu/cfg.cc:48 msgid "Device" -msgstr "" +msgstr "Συσκευή" #: src/spu/cfg.cc:57 msgid "Use Null Sync" @@ -3627,24 +3486,21 @@ msgstr "" #: src/spu/cfg.cc:90 msgid "" -"Activates SPU IRQs based on writes to the decode/capture buffer. This option " -"is necessary for some games." +"Activates SPU IRQs based on writes to the decode/capture buffer. This option" +" is necessary for some games." msgstr "" #: src/spu/debug.cc:62 -#, fuzzy msgid "SPU Debug" -msgstr "Παύση GPU dump" +msgstr "" #: src/spu/debug.cc:84 -#, fuzzy msgid "Mute all" -msgstr "Απενεργοποίηση ήχου" +msgstr "" #: src/spu/debug.cc:90 -#, fuzzy msgid "Unmute all" -msgstr "Ενεργοποιημένο" +msgstr "" #: src/spu/debug.cc:104 msgid "ADSR channel info" @@ -3705,9 +3561,8 @@ msgid "" msgstr "" #: src/spu/debug.cc:159 -#, fuzzy msgid "Spu states" -msgstr "Αποθήκευση κατάστασης" +msgstr "" #: src/spu/debug.cc:160 msgid "" @@ -3716,280 +3571,3 @@ msgid "" "Stat:\n" "Spu mem:" msgstr "" - -#, c-format -#~ msgid "Error decoding audio frame\n" -#~ msgstr " Πρόβλημα στην αποκωδικοποίηση καρέ ήχου\n" - -#, c-format -#~ msgid "Could not find %s stream in input file\n" -#~ msgstr "Αδυναμία εύρεσης της ροής %sστο αρχείο εισόδου\n" - -#, c-format -#~ msgid "Failed to find %s codec\n" -#~ msgstr "Αδυναμία εύρεσης του κωδικοποιητή %s\n" - -#, c-format -#~ msgid "Failed to open %s codec\n" -#~ msgstr "Αδυναμία ανοίγματος του κωδικοποιητή 1%s\n" - -#, c-format -#~ msgid "Could not open source file %s\n" -#~ msgstr "Αδυναμία ανοίγματος αρχείου πηγαίου κώδικα %s\n" - -#, c-format -#~ msgid "Could not find stream information\n" -#~ msgstr "Αδυναμία εύρεσης πληροφοριών stream\n" - -#, c-format -#~ msgid "Could not find audio stream in the input, aborting\n" -#~ msgstr "Αδυναμία ανοίγματος ροής ήχου, διακοπή\n" - -#, c-format -#~ msgid "Could not find audio codec for the input, aborting\n" -#~ msgstr "Αδυναμία εύρεσης κωδικοποιητή ήχου για είσοδο, διακοπή\n" - -#, c-format -#~ msgid "Could not allocate frame\n" -#~ msgstr "Αδυναμία εκχώρησης καρέ\n" - -#, c-format -#~ msgid "Could not allocate memory to decode CDDA TRACK: %s\n" -#~ msgstr "" -#~ "Αδυναμία εκχώρησης μνήμης για την αποκωδικοποίηση κομματιού CDDA: %s\n" - -#, c-format -#~ msgid "Buffer overflow..." -#~ msgstr "Υπερχείληση προσωρινής μνήμης..." - -#, c-format -#~ msgid "Actual %i vs. %i estimated\n" -#~ msgstr "Πραγματικο %i. Αναμενόμενο: %i \n" - -#, c-format -#~ msgid "OK\n" -#~ msgstr "ΟΚ\n" - -#, c-format -#~ msgid "Could not load cheats from: %s\n" -#~ msgstr "Αδυναμία φόρτωσης cheats από: %s\n" - -#, c-format -#~ msgid "Cheats loaded from: %s\n" -#~ msgstr "Φορτώθηκαν cheats από: 1%s\n" - -#, c-format -#~ msgid "Cheats saved to: %s\n" -#~ msgstr "Αποθήκευση cheats σε: %s\n" - -#~ msgid "(Untitled)" -#~ msgstr "(Χωρίς τίτλο)`" - -#~ msgid "Start GPU dump" -#~ msgstr "Έναρξη GPU dump" - -#~ msgid "Stop GPU dump" -#~ msgstr "Παύση GPU dump" - -#~ msgid " Date & Time" -#~ msgstr "Ημερομηνία και ώρα" - -#~ msgid "Add one entry" -#~ msgstr "Προσθήκη καταχώρησης" - -#~ msgid "Advanced BIOS patching" -#~ msgstr "Προχωρημένη τροποποίηση BIOS" - -#~ msgid "Auto reload" -#~ msgstr "Αυτόματη επαναφόρτωση" - -#~ msgid "BIOS entry point: %s\n" -#~ msgstr "Σημέιο έναρξης BIOS%s\n" - -#~ msgid "Callstack" -#~ msgstr "Στοίβα κλήσεων" - -#~ msgid "Close ISO" -#~ msgstr "Κλείσιμο ISO" - -#~ msgid "Connection closed!\n" -#~ msgstr "Η σύνδεση έκλεισε!\n" - -#~ msgid "DWARF##{}{:08x}" -#~ msgstr "DWARF##{}{:08x}" - -#~ msgid "Dwarf" -#~ msgstr "Dwarf" - -#, fuzzy -#~ msgid "Edit value of pc" -#~ msgstr "Επεξεργασία τιμής του {}" - -#, fuzzy -#~ msgid "Edit##pc" -#~ msgstr "Επεξεργασία##{}" - -#~ msgid "Files" -#~ msgstr "Αρχεία" - -#~ msgid "Home" -#~ msgstr "Αρχική" - -#~ msgid "Invalid PPF patch: %s.\n" -#~ msgstr "Μη έγκυρο patch PPF: %s.\n" - -#~ msgid "Load Size" -#~ msgstr "Φόρτωση μεγέθους" - -#~ msgid "Loaded PPF %d.0 patch: %s.\n" -#~ msgstr "Φορτώθηκε το αρχείο PPF %d. 0 patch: %s.\n" - -#~ msgid "Move down" -#~ msgstr "Κίνηση κάτω" - -#~ msgid "Move up" -#~ msgstr "Κίνηση πάνω" - -#~ msgid "Open ISO" -#~ msgstr "Άνοιγμα ISO" - -#~ msgid "Order by" -#~ msgstr "Ταξινόμηση ανά" - -#~ msgid "Remove" -#~ msgstr "Αφαίρεση" - -#~ msgid "Remove breakpoint from here" -#~ msgstr "Αφαίρεση breakpoint από εδώ" - -#~ msgid "Roots" -#~ msgstr "Ρίζες" - -#~ msgid "Set Breakpoint here" -#~ msgstr "Προσθήκη Breakpoint εδώ" - -#~ msgid "Show raw DWARF info" -#~ msgstr "Προβολή πληροφοριών DWARF" - -#~ msgid "Show types" -#~ msgstr "Προβολή types" - -#~ msgid "Source" -#~ msgstr "Πηγή" - -#~ msgid "Unsupported PPF version (%d).\n" -#~ msgstr "Μη-υποστηριγμένη έκδοση PPF (%d).\n" - -#~ msgid "^ Date & Time" -#~ msgstr "^ Ημερομηνία και ώρα" - -#~ msgid "^ File" -#~ msgstr "^ Αρχείο" - -#~ msgid "^ Size" -#~ msgstr "^ Μέγεθος" - -#~ msgid "v Date & Time" -#~ msgstr "v Ημερομηνία και ώρα" - -#~ msgid "v File" -#~ msgstr "v Αρχείο" - -#~ msgid "v Size" -#~ msgstr "v Μέγεθος" - -#~ msgid "Big Endian" -#~ msgstr "Big Endian" - -#~ msgid "CDDA" -#~ msgstr "CDDA" - -#~ msgid "Disabled" -#~ msgstr "Απενεργοποιημένο" - -#~ msgid "Little Endian" -#~ msgstr "Little Endian" - -#~ msgid "Always enable SIO IRQ" -#~ msgstr "Πάντα να είναι ενεργοποιημένες οι SIO IRQ" - -#~ msgid "Change streaming pitch" -#~ msgstr "Αλλαγή χροιάς streaming" - -#~ msgid "Error initializing GPU plugin: %d" -#~ msgstr "Αδυναμία αρχικοποίησης του πρόσθετου GPU: %d" - -#~ msgid "Error initializing SIO1 plugin: %d" -#~ msgstr "Πρόβλημα στην αρχικοποίηση του πρόσθετου SIO1: 1%d" - -#~ msgid "Error initializing SPU plugin: %d" -#~ msgstr "Αδυναμία αρχικοποίησης πρόσθετου SPU: %d" - -#~ msgid "Error loading %s: %s" -#~ msgstr "Αδυναμία φόρτωσης %s: %s" - -#~ msgid "Error opening file: %s.\n" -#~ msgstr "Πρόβλημα στο άνοιγμα αρχείου: %s.\n" - -#~ msgid "Generates IRQs when buffers are decoded." -#~ msgstr "Παραγωγή IRQs οταν αποκοδικοποιούνται τα buffers" - -#~ msgid "ImGui Themes" -#~ msgstr "Στυλ ImGui" - -#~ msgid "Lua Source" -#~ msgstr "Πηγή Lua" - -#~ msgid "Plugins loaded.\n" -#~ msgstr "Τα πρόσθετα φορτώθηκαν\n" - -#~ msgid "Read Half" -#~ msgstr "Ανάγνωση Halfword" - -#~ msgid "Read Word" -#~ msgstr "Ανάγνωση Word" - -#~ msgid "Show all breakpoints" -#~ msgstr "Προβολή όλων των Breakpoints" - -#~ msgid "Show byte read BPs " -#~ msgstr "Ένδειξη BPs για την ανάγνωση byte" - -#~ msgid "Show byte write BPs " -#~ msgstr "Προβολή BPs γραφής byte" - -#~ msgid "Show exec BPs" -#~ msgstr "Προβολή BPs εκτέλεσης" - -#~ msgid "Show half read BPs " -#~ msgstr "Προβολή BPs ανάγνωσης halfword" - -#~ msgid "Show half write BPs " -#~ msgstr "Προβολή BPs γραφής halfword" - -#~ msgid "Show no breakpoints" -#~ msgstr "Απενεργοποίση προβολής breakpoints" - -#~ msgid "Show word read BPs " -#~ msgstr "Προβολή BPs ανάγνωσης word" - -#~ msgid "Show word write BPs " -#~ msgstr "Προβολή BPs γραφής word" - -#~ msgid "Theme selector" -#~ msgstr "Επιλογή στυλ" - -#~ msgid "This file does not appear to be a valid PSX file.\n" -#~ msgstr "Αυτό το αρχείο δεν φαίνεται να είναι έγκυρο αρχείο PSX\n" - -#~ msgid "Write Half" -#~ msgstr "Γραφή Halfword" - -#~ msgid "Write Word" -#~ msgstr "Γραφή Word" - -#~ msgid "ng Load Bin file: [0x%08x] : %s\n" -#~ msgstr "Φόρτωμα αρχείου Bin:[0x%08x]: %s\n" - -#~ msgid "ok Load Bin file: [0x%08x] : %s\n" -#~ msgstr "Επιτυχία φόρτωσης αρχείου Bin:[0x%08x]: %s\n" From de0499ba17e87b84e675305b267742a4ea065498 Mon Sep 17 00:00:00 2001 From: emoose <1755499+emoose@users.noreply.github.com> Date: Thu, 2 May 2024 03:12:06 +0100 Subject: [PATCH 03/53] psyq-obj-parser: add `INC_SLD_LINENUM_BY_WORD` opcode --- tools/psyq-obj-parser/psyq-obj-parser.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/psyq-obj-parser/psyq-obj-parser.cc b/tools/psyq-obj-parser/psyq-obj-parser.cc index 0b21faf09..b27fac307 100644 --- a/tools/psyq-obj-parser/psyq-obj-parser.cc +++ b/tools/psyq-obj-parser/psyq-obj-parser.cc @@ -55,6 +55,7 @@ enum class PsyqOpcode : uint8_t { UNINITIALIZED = 48, INC_SLD_LINENUM = 50, INC_SLD_LINENUM_BY_BYTE = 52, + INC_SLD_LINENUM_BY_WORD = 54, SET_SLD_LINENUM = 56, SET_SLD_LINENUM_FILE = 58, END_SLD = 60, @@ -480,6 +481,13 @@ std::unique_ptr PsyqLnkFile::parse(PCSX::IO file, bool break; } + case (uint8_t)PsyqOpcode::INC_SLD_LINENUM_BY_WORD: { + uint16_t offset = file->read(); + uint16_t _word = file->read(); + vprint("INC_SLD_LINENUM_BY_WORD offset {}, _word {}\n", offset, _word); + + break; + } case (uint8_t)PsyqOpcode::SET_SLD_LINENUM: { uint16_t offset = file->read(); uint32_t lineNum = file->read(); From 0d224b62e7d1fe0ff00e989666dd3e769930e4e2 Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Tue, 7 May 2024 18:39:41 -0700 Subject: [PATCH 04/53] Revert "Updating readme links." This reverts commit c7606ae005a19d93dd52b01c62ce23bb50887397. Until we can migrate AppDistrib away from Dedibox / Scaleway, since their support is apparently abysmal. --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 481822a08..03879b782 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ |Platform|Build status|Download| |--------|------------|--------| -|Windows x64 build|[![Windows x64 CI](https://dev.azure.com/grumpycoders/pcsx-redux/_apis/build/status/grumpycoders.pcsx-redux?branchName=main)](https://dev.azure.com/grumpycoders/pcsx-redux/_build/latest?definitionId=1&branchName=main)|[Windows Intel 64-bits](https://distrib.app/pub/org/pcsx-redux/project/dev-win-x64)| -|Linux x64 build|[![Linux x64 CI](https://github.com/grumpycoders/pcsx-redux/workflows/Linux%20CI/badge.svg?branch=main)](https://github.com/grumpycoders/pcsx-redux/actions?query=workflow%3A%22Linux+CI%22+branch%3Amain)|[Linux Intel 64-bits (AppImage)](https://distrib.app/pub/org/pcsx-redux/project/dev-linux-x64)| -|MacOS x64 build|[![MacOS x64 CI](https://github.com/grumpycoders/pcsx-redux/workflows/macOS%20CI/badge.svg?branch=main)](https://github.com/grumpycoders/pcsx-redux/actions?query=workflow%3A%22macOS+CI%22+branch%3Amain)|[MacOS Intel](https://distrib.app/pub/org/pcsx-redux/project/dev-macos-x64)| +|Windows build|[![Build Status](https://dev.azure.com/grumpycoders/pcsx-redux/_apis/build/status/grumpycoders.pcsx-redux?branchName=main)](https://dev.azure.com/grumpycoders/pcsx-redux/_build/latest?definitionId=1&branchName=main)|[Windows Intel 64-bits](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-win64/distribution_groups/public)| +|Linux build|[![Linux CI](https://github.com/grumpycoders/pcsx-redux/workflows/Linux%20CI/badge.svg?branch=main)](https://github.com/grumpycoders/pcsx-redux/actions?query=workflow%3A%22Linux+CI%22+branch%3Amain)|[Linux Intel 64-bits (AppImage)](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-linux64/distribution_groups/public)| +|MacOS build|[![MacOS CI](https://github.com/grumpycoders/pcsx-redux/workflows/macOS%20CI/badge.svg?branch=main)](https://github.com/grumpycoders/pcsx-redux/actions?query=workflow%3A%22macOS+CI%22+branch%3Amain)|[MacOS](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-macos/distribution_groups/public)| To discuss this emulator specifically, please join our Discord server: @@ -34,10 +34,10 @@ The [tools](tools) directory contains a few tools that can be used to work with ## Where? |Download page| |--------| -|[Windows Intel 64-bits](https://distrib.app/pub/org/pcsx-redux/project/dev-win-x64)| -|[Windows Intel 64-bits CLI](https://distrib.app/pub/org/pcsx-redux/project/dev-win-cli-x64)| -|[Linux Intel 64-bits (AppImage)](https://distrib.app/pub/org/pcsx-redux/project/dev-linux-x64)| -|[MacOS Intel](https://distrib.app/pub/org/pcsx-redux/project/dev-macos-x64)| +|[Windows Intel 64-bits](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-win64/distribution_groups/public)| +|[Windows Intel 64-bits CLI](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-win64-cli/distribution_groups/public)| +|[Linux Intel 64-bits (AppImage)](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-linux64/distribution_groups/public)| +|[MacOS](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-macos/distribution_groups/public)| ### Note: The macOS version of PCSX-Redux is not currently signed with a developer certificate so you may see a security warning when opening the application. From 99667427b8ac42f8947857c7a12ec90378dde9de Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Tue, 7 May 2024 19:41:53 -0700 Subject: [PATCH 05/53] Flipping appcenter & appdistrib to re-arrange priorities. --- .github/workflows/linux-build.yml | 2 +- .github/workflows/macos-build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 46e847046..9fe11c0d2 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -64,5 +64,5 @@ jobs: git config --global --add safe.directory /__w/pcsx-redux/pcsx-redux export BUILD=`git rev-parse HEAD | cut -c 1-8` zip PCSX-Redux-$BUILD-linux-x86_64.zip *.AppImage - npx @appdistrib/cli -m AppDir/usr/share/pcsx-redux/resources/version.json upload PCSX-Redux-$BUILD-linux-x86_64.zip npx appcenter-cli distribute release -b $BUILD -f PCSX-Redux-$BUILD-linux-x86_64.zip -g public -a grumpycoders/pcsx-redux-linux64 --disable-telemetry + npx @appdistrib/cli -m AppDir/usr/share/pcsx-redux/resources/version.json upload PCSX-Redux-$BUILD-linux-x86_64.zip diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 603603006..e785ae72f 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -148,5 +148,5 @@ jobs: APPDISTRIB_PROJECT: dev-macos-x64 APPCENTER_ACCESS_TOKEN: ${{ secrets.MACOS_APPCENTER_ACCESS_TOKEN }} run: | - npx @appdistrib/cli -m version.json upload PCSX-Redux-$BUILD-Intel.dmg npx appcenter-cli distribute release -n 0 -b $BUILD -f PCSX-Redux-$BUILD-Intel.dmg -g 'Public' -a grumpycoders/pcsx-redux-macos --disable-telemetry + npx @appdistrib/cli -m version.json upload PCSX-Redux-$BUILD-Intel.dmg From 0aab5b03fcb65aaf5e89aac9b8678fbbaf2ad403 Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Tue, 7 May 2024 21:02:06 -0700 Subject: [PATCH 06/53] Upgrading gcc/gdb. --- tools/linux-mips/spawn-compiler.sh | 6 ++-- tools/macos-mips/mipsel-none-elf-gcc.rb | 4 +-- .../scripts/mipsel-none-elf-gcc.rb | 4 +-- .../scripts/mipsel-none-elf-gdb.rb | 31 +++++++++++++++++++ tools/win32-gdb/Dockerfile | 16 +++++----- tools/win32-mips/Dockerfile | 22 ++++++------- 6 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 tools/vscode-extension/scripts/mipsel-none-elf-gdb.rb diff --git a/tools/linux-mips/spawn-compiler.sh b/tools/linux-mips/spawn-compiler.sh index ff27210d1..a74cbda8f 100755 --- a/tools/linux-mips/spawn-compiler.sh +++ b/tools/linux-mips/spawn-compiler.sh @@ -21,9 +21,9 @@ make make install-strip cd .. -wget https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.gz -tar xvfz gcc-13.2.0.tar.gz -cd gcc-13.2.0 +wget https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.gz +tar xvfz gcc-14.1.0.tar.gz +cd gcc-14.1.0 ./contrib/download_prerequisites mkdir build cd build diff --git a/tools/macos-mips/mipsel-none-elf-gcc.rb b/tools/macos-mips/mipsel-none-elf-gcc.rb index 0198c8cd8..42ef6663a 100644 --- a/tools/macos-mips/mipsel-none-elf-gcc.rb +++ b/tools/macos-mips/mipsel-none-elf-gcc.rb @@ -1,8 +1,8 @@ class MipselNoneElfGcc < Formula desc "The GNU compiler collection for mipsel" homepage "https://gcc.gnu.org" - url "https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz" - sha256 "e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da" + url "https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.xz" + sha256 "e283c654987afe3de9d8080bc0bd79534b5ca0d681a73a11ff2b5d3767426840" depends_on "gmp" depends_on "mipsel-none-elf-binutils" diff --git a/tools/vscode-extension/scripts/mipsel-none-elf-gcc.rb b/tools/vscode-extension/scripts/mipsel-none-elf-gcc.rb index 0198c8cd8..42ef6663a 100644 --- a/tools/vscode-extension/scripts/mipsel-none-elf-gcc.rb +++ b/tools/vscode-extension/scripts/mipsel-none-elf-gcc.rb @@ -1,8 +1,8 @@ class MipselNoneElfGcc < Formula desc "The GNU compiler collection for mipsel" homepage "https://gcc.gnu.org" - url "https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz" - sha256 "e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da" + url "https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.xz" + sha256 "e283c654987afe3de9d8080bc0bd79534b5ca0d681a73a11ff2b5d3767426840" depends_on "gmp" depends_on "mipsel-none-elf-binutils" diff --git a/tools/vscode-extension/scripts/mipsel-none-elf-gdb.rb b/tools/vscode-extension/scripts/mipsel-none-elf-gdb.rb new file mode 100644 index 000000000..22d5909b0 --- /dev/null +++ b/tools/vscode-extension/scripts/mipsel-none-elf-gdb.rb @@ -0,0 +1,31 @@ +class MipselNoneElfGdb < Formula + desc "GDB: The GNU Project Debugger compiled for Mips" + homepage "https://sourceware.org/gdb/" + url "https://ftp.gnu.org/gnu/gdb/gdb-14.2.tar.xz" + sha256 "2d4dd8061d8ded12b6c63f55e45344881e8226105f4d2a9b234040efa5ce7772" + + # inspired by https://github.com/orgs/Homebrew/discussions/1114#discussioncomment-8863715 + + depends_on "texinfo" => :build + depends_on "gmp" + depends_on "mpfr" + depends_on "python@3.10" + + def install + mkdir "mipsel-none-elf-gdb-build" do + system "../configure", "--target=mipsel-none-elf", + "--prefix=#{prefix}", + "--enable-tui=yes", + "--without-isl", + "--disable-werror" + system "make" + system "make", "install" + end + end + + # not sure what to test... + # test do + # assert_match "f()", shell_output("#{bin}/mipsel-none-elf-c++filt _Z1fv") + # end + +end diff --git a/tools/win32-gdb/Dockerfile b/tools/win32-gdb/Dockerfile index e5a20575a..30b196116 100644 --- a/tools/win32-gdb/Dockerfile +++ b/tools/win32-gdb/Dockerfile @@ -1,6 +1,6 @@ # escape=` -# Dockerfile to generate the Windows gdb-multiarch-14.1.zip package. +# Dockerfile to generate the Windows gdb-multiarch-14.2.zip package. FROM mcr.microsoft.com/windows/servercore:ltsc2022 WORKDIR C:\windows\temp @@ -45,23 +45,23 @@ RUN C:\msys64\usr\bin\bash.exe -l -c 'pacman -S --needed --noconfirm mingw-w64-x RUN C:\msys64\usr\bin\bash.exe -l -c 'pacman -S --needed --noconfirm mingw-w64-x86_64-python mingw-w64-x86_64-readline' RUN C:\msys64\usr\bin\bash.exe -l -c 'pacman -Scc --noconfirm' -ARG GDB=https://ftp.gnu.org/gnu/gdb/gdb-14.1.tar.xz +ARG GDB=https://ftp.gnu.org/gnu/gdb/gdb-14.2.tar.xz RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` - Invoke-WebRequest $env:GDB -OutFile "C:\Windows\Temp\gdb-14.1.tar.xz"; ` - Start-Process -FilePath "C:\7-Zip\7z.exe" -ArgumentList e, "C:\Windows\Temp\gdb-14.1.tar.xz", `-oC:\Windows\Temp\ -NoNewWindow -PassThru -Wait; ` - Start-Process -FilePath "C:\7-Zip\7z.exe" -ArgumentList x, "C:\Windows\Temp\gdb-14.1.tar", `-oC:\ -NoNewWindow -PassThru -Wait; ` + Invoke-WebRequest $env:GDB -OutFile "C:\Windows\Temp\gdb-14.2.tar.xz"; ` + Start-Process -FilePath "C:\7-Zip\7z.exe" -ArgumentList e, "C:\Windows\Temp\gdb-14.2.tar.xz", `-oC:\Windows\Temp\ -NoNewWindow -PassThru -Wait; ` + Start-Process -FilePath "C:\7-Zip\7z.exe" -ArgumentList x, "C:\Windows\Temp\gdb-14.2.tar", `-oC:\ -NoNewWindow -PassThru -Wait; ` Remove-Item @('C:\Windows\Temp\*', 'C:\Users\*\Appdata\Local\Temp\*') -Force -Recurse; ENV MSYSTEM MINGW64 -RUN C:\msys64\usr\bin\bash.exe -l -c 'mkdir /BUILD && cd /BUILD && /c/gdb-14.1/configure --disable-gdbtk --disable-shared --disable-readline --with-system-readline --with-expat --with-system-zlib --without-guile --without-babeltrace --enable-tui --with-lzma --without-python --with-xxhash --with-mpfr=/mingw64 --enable-64-bit-bfd --enable-targets=all --disable-sim --prefix=/DIST || (cat /BUILD/config.log && exit 1)' +RUN C:\msys64\usr\bin\bash.exe -l -c 'mkdir /BUILD && cd /BUILD && /c/gdb-14.2/configure --disable-gdbtk --disable-shared --disable-readline --with-system-readline --with-expat --with-system-zlib --without-guile --without-babeltrace --enable-tui --with-lzma --without-python --with-xxhash --with-mpfr=/mingw64 --enable-64-bit-bfd --enable-targets=all --disable-sim --prefix=/DIST || (cat /BUILD/config.log && exit 1)' RUN C:\msys64\usr\bin\bash.exe -l -c 'LOADLIBES=-lws2_32\ -lbcrypt make -C /BUILD all' RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /BUILD install-strip' RUN C:\msys64\usr\bin\bash.exe -l -c 'cd /DIST/bin && ldd *.exe | cut -f2 -d\> | cut -f2 -d\ | grep mingw64 | while read f ; do cp $f . ; done' -RUN C:\msys64\usr\bin\bash.exe -l -c 'cp /c/gdb-14.1/COPYING* /DIST' +RUN C:\msys64\usr\bin\bash.exe -l -c 'cp /c/gdb-14.2/COPYING* /DIST' RUN C:\msys64\usr\bin\bash.exe -l -c 'cp /DIST/bin/gdb.exe /DIST/bin/gdb-multiarch.exe' -RUN C:\msys64\usr\bin\bash.exe -l -c 'cd /DIST && zip /c/gdb-multiarch-14.1.zip . -r' +RUN C:\msys64\usr\bin\bash.exe -l -c 'cd /DIST && zip /c/gdb-multiarch-14.2.zip . -r' CMD C:\msys64\usr\bin\bash.exe -l diff --git a/tools/win32-mips/Dockerfile b/tools/win32-mips/Dockerfile index 81985faad..01572581f 100644 --- a/tools/win32-mips/Dockerfile +++ b/tools/win32-mips/Dockerfile @@ -1,6 +1,6 @@ # escape=` -# Dockerfile to generate the Windows g++-mipsel-none-elf-13.2.0.zip package. +# Dockerfile to generate the Windows g++-mipsel-none-elf-14.1.0.zip package. FROM mcr.microsoft.com/windows/servercore:ltsc2019 WORKDIR C:\windows\temp @@ -46,7 +46,7 @@ RUN C:\msys64\usr\bin\bash.exe -l -c 'pacman -S --needed --noconfirm mingw-w64-x RUN C:\msys64\usr\bin\bash.exe -l -c 'pacman -Scc --noconfirm' ARG BINUTILS=https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz -ARG GCC=https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz +ARG GCC=https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.xz RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` Invoke-WebRequest $env:BINUTILS -OutFile "C:\Windows\Temp\binutils-2.42.tar.xz"; ` @@ -55,9 +55,9 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl Remove-Item @('C:\Windows\Temp\*', 'C:\Users\*\Appdata\Local\Temp\*') -Force -Recurse; RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` - Invoke-WebRequest $env:GCC -OutFile "C:\Windows\Temp\gcc-13.2.0.tar.xz"; ` - Start-Process -FilePath "C:\7-Zip\7z.exe" -ArgumentList e, "C:\Windows\Temp\gcc-13.2.0.tar.xz", `-y, `-oC:\Windows\Temp\ -NoNewWindow -PassThru -Wait; ` - Start-Process -FilePath "C:\7-Zip\7z.exe" -ArgumentList x, "C:\Windows\Temp\gcc-13.2.0.tar", `-y, `-oC:\ -NoNewWindow -PassThru -Wait; ` + Invoke-WebRequest $env:GCC -OutFile "C:\Windows\Temp\gcc-14.1.0.tar.xz"; ` + Start-Process -FilePath "C:\7-Zip\7z.exe" -ArgumentList e, "C:\Windows\Temp\gcc-14.1.0.tar.xz", `-y, `-oC:\Windows\Temp\ -NoNewWindow -PassThru -Wait; ` + Start-Process -FilePath "C:\7-Zip\7z.exe" -ArgumentList x, "C:\Windows\Temp\gcc-14.1.0.tar", `-y, `-oC:\ -NoNewWindow -PassThru -Wait; ` Remove-Item @('C:\Windows\Temp\*', 'C:\Users\*\Appdata\Local\Temp\*') -Force -Recurse; ENV MSYSTEM MINGW64 @@ -70,16 +70,16 @@ RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/binutils-2.42 all -j8' RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/binutils-2.42 install-strip' RUN C:\msys64\usr\bin\bash.exe -l -c 'cp /c/binutils-2.42/COPYING* /DIST' -RUN C:\msys64\usr\bin\bash.exe -l -c 'mkdir /c/gcc-13.2.0/build && cd /c/gcc-13.2.0/build && ../configure --target=mipsel-none-elf --without-isl --disable-nls --disable-threads --disable-shared --disable-libssp --disable-libstdcxx-pch --disable-libgomp --disable-werror --without-headers --disable-hosted-libstdcxx --with-as=/DIST/bin/mipsel-none-elf-as --with-ld=/DIST/bin/mipsel-none-elf-ld --enable-languages=c,c++ --prefix=/DIST || (cat /BUILD/config.log && exit 1)' -RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/gcc-13.2.0/build all-gcc -j4' -RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/gcc-13.2.0/build all-target-libgcc -j4' -RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/gcc-13.2.0/build all-target-libstdc++-v3 -j4' -RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/gcc-13.2.0/build install-strip-gcc install-strip-target-libgcc install-strip-target-libstdc++-v3' +RUN C:\msys64\usr\bin\bash.exe -l -c 'mkdir /c/gcc-14.1.0/build && cd /c/gcc-14.1.0/build && ../configure --target=mipsel-none-elf --without-isl --disable-nls --disable-threads --disable-shared --disable-libssp --disable-libstdcxx-pch --disable-libgomp --disable-werror --without-headers --disable-hosted-libstdcxx --with-as=/DIST/bin/mipsel-none-elf-as --with-ld=/DIST/bin/mipsel-none-elf-ld --enable-languages=c,c++ --prefix=/DIST || (cat /BUILD/config.log && exit 1)' +RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/gcc-14.1.0/build all-gcc -j4' +RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/gcc-14.1.0/build all-target-libgcc -j4' +RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/gcc-14.1.0/build all-target-libstdc++-v3 -j4' +RUN C:\msys64\usr\bin\bash.exe -l -c 'make -C /c/gcc-14.1.0/build install-strip-gcc install-strip-target-libgcc install-strip-target-libstdc++-v3' RUN C:\msys64\usr\bin\bash.exe -l -c 'for t in cat cp echo mkdir rm touch which ; do cp /usr/bin/$t.exe /DIST/bin ; done' RUN C:\msys64\usr\bin\bash.exe -l -c 'cp /mingw64/bin/mingw32-make.exe /DIST/bin/make.exe' RUN C:\msys64\usr\bin\bash.exe -l -c 'cd /DIST && find . -name *.exe | while read bin ; do ldd $bin | cut -f2 -d\> | cut -f2 -d\ | grep -v /c/Windows/S | while read f ; do cp $f $(dirname $bin) ; done ; done || true' -RUN C:\msys64\usr\bin\bash.exe -l -c 'cd /DIST && zip /c/g++-mipsel-none-elf-13.2.0.zip . -r' +RUN C:\msys64\usr\bin\bash.exe -l -c 'cd /DIST && zip /c/g++-mipsel-none-elf-14.1.0.zip . -r' CMD C:\msys64\usr\bin\bash.exe -l From de92daa23f381a891fd811c93ff3462c088c0f02 Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Wed, 8 May 2024 20:49:09 -0700 Subject: [PATCH 07/53] Fixing OpenBIOS compilation with gcc 14.1. --- src/mips/common/hardware/irq.h | 33 ++++++++++++++++--------- src/mips/openbios/card/device.c | 2 +- src/mips/openbios/cdrom/cdrom.c | 8 +++--- src/mips/openbios/handlers/irq.c | 22 ++++++++--------- src/mips/openbios/main/main.c | 6 +++-- src/mips/openbios/patches/hash.c | 3 ++- src/mips/openbios/patches/hash.h | 2 +- src/mips/openbios/patches/patch_pad_1.c | 4 +-- src/mips/openbios/patches/patch_pad_2.c | 4 +-- src/mips/openbios/patches/patches.c | 4 +-- src/mips/openbios/patches/send_pad_1.c | 2 +- src/mips/openbios/patches/send_pad_2.c | 2 +- src/mips/openbios/tty/tty.c | 14 +++++------ 13 files changed, 59 insertions(+), 47 deletions(-) diff --git a/src/mips/common/hardware/irq.h b/src/mips/common/hardware/irq.h index 02327b8e2..a0436ef79 100644 --- a/src/mips/common/hardware/irq.h +++ b/src/mips/common/hardware/irq.h @@ -29,15 +29,26 @@ SOFTWARE. #include enum IRQ { - IRQ_VBLANK = 1 << 0, - IRQ_GPU = 1 << 1, - IRQ_CDROM = 1 << 2, - IRQ_DMA = 1 << 3, - IRQ_TIMER0 = 1 << 4, - IRQ_TIMER1 = 1 << 5, - IRQ_TIMER2 = 1 << 6, - IRQ_CONTROLLER = 1 << 7, - IRQ_SIO = 1 << 8, - IRQ_SPU = 1 << 9, - IRQ_PIO = 1 << 10, + IRQ_VBLANK_NUMBER = 0, + IRQ_VBLANK = 1 << IRQ_VBLANK_NUMBER, + IRQ_GPU_NUMBER = 1, + IRQ_GPU = 1 << IRQ_GPU_NUMBER, + IRQ_CDROM_NUMBER = 2, + IRQ_CDROM = 1 << IRQ_CDROM_NUMBER, + IRQ_DMA_NUMBER = 3, + IRQ_DMA = 1 << IRQ_DMA_NUMBER, + IRQ_TIMER0_NUMBER = 4, + IRQ_TIMER0 = 1 << IRQ_TIMER0_NUMBER, + IRQ_TIMER1_NUMBER = 5, + IRQ_TIMER1 = 1 << IRQ_TIMER1_NUMBER, + IRQ_TIMER2_NUMBER = 6, + IRQ_TIMER2 = 1 << IRQ_TIMER2_NUMBER, + IRQ_CONTROLLER_NUMBER = 7, + IRQ_CONTROLLER = 1 << IRQ_CONTROLLER_NUMBER, + IRQ_SIO_NUMBER = 8, + IRQ_SIO = 1 << IRQ_SIO_NUMBER, + IRQ_SPU_NUMBER = 9, + IRQ_SPU = 1 << IRQ_SPU_NUMBER, + IRQ_PIO_NUMBER = 10, + IRQ_PIO = 1 << IRQ_PIO_NUMBER, }; diff --git a/src/mips/openbios/card/device.c b/src/mips/openbios/card/device.c index fdced37fb..1c807b42c 100644 --- a/src/mips/openbios/card/device.c +++ b/src/mips/openbios/card/device.c @@ -630,7 +630,7 @@ static const struct Device s_cardDevice = { .flags = 0x14, .blockSize = 0x80, .desc = "MEMORY CARD", - .init = psxdummy, + .init = (void (*)())psxdummy, .open = dev_bu_open, .action = psxdummy, .close = dev_bu_close, diff --git a/src/mips/openbios/cdrom/cdrom.c b/src/mips/openbios/cdrom/cdrom.c index b3ac04afa..2f3698dfa 100644 --- a/src/mips/openbios/cdrom/cdrom.c +++ b/src/mips/openbios/cdrom/cdrom.c @@ -53,8 +53,7 @@ void initializeCDRomHandlersAndEvents() { static void initializeSoftwareAndHardware() { initializeCDRomHandlersAndEvents(); - while (!syscall_cdromInnerInit()) - ; + while (!syscall_cdromInnerInit()); } void initCDRom() { @@ -78,8 +77,7 @@ int cdromBlockGetStatus() { uint8_t status; int cyclesToWait = 9; - while (!syscall_cdromGetStatus(&status) && (--cyclesToWait > 0)) - ; + while (!syscall_cdromGetStatus(&status) && (--cyclesToWait > 0)); if (cyclesToWait < 1) { syscall_exception(0x44, 0x1f); return -1; @@ -101,7 +99,7 @@ static const struct Device s_cdromDevice = { .flags = 0x14, .blockSize = 0x800, .desc = "CD-ROM", - .init = psxdummy, + .init = (void (*)())psxdummy, .open = dev_cd_open, .action = psxdummy, .close = psxdummy, diff --git a/src/mips/openbios/handlers/irq.c b/src/mips/openbios/handlers/irq.c index 466a7d410..0361cdf42 100644 --- a/src/mips/openbios/handlers/irq.c +++ b/src/mips/openbios/handlers/irq.c @@ -77,48 +77,48 @@ static __attribute__((section(".ramtext"))) int IRQVerifier(void) { // guaranteed to not lose any IRQs. if ((IMASK & IREG & IRQ_CDROM) != 0) { deliverEvent(EVENT_CDROM, 0x1000); - if (s_IRQsAutoAck[IRQ_CDROM]) IREG &= ~IRQ_CDROM; + if (s_IRQsAutoAck[IRQ_CDROM_NUMBER]) IREG &= ~IRQ_CDROM; } if ((IMASK & IREG & IRQ_SPU) != 0) { deliverEvent(EVENT_SPU, 0x1000); - if (s_IRQsAutoAck[IRQ_SPU]) IREG &= ~IRQ_SPU; + if (s_IRQsAutoAck[IRQ_SPU_NUMBER]) IREG &= ~IRQ_SPU; } if ((IMASK & IREG & IRQ_GPU) != 0) { deliverEvent(EVENT_GPU, 0x1000); - if (s_IRQsAutoAck[IRQ_GPU]) IREG &= ~IRQ_GPU; + if (s_IRQsAutoAck[IRQ_GPU_NUMBER]) IREG &= ~IRQ_GPU; } if ((IMASK & IREG & IRQ_PIO) != 0) { deliverEvent(EVENT_PIO, 0x1000); - if (s_IRQsAutoAck[IRQ_PIO]) IREG &= ~IRQ_PIO; + if (s_IRQsAutoAck[IRQ_PIO_NUMBER]) IREG &= ~IRQ_PIO; } if ((IMASK & IREG & IRQ_SIO) != 0) { deliverEvent(EVENT_SIO, 0x1000); - if (s_IRQsAutoAck[IRQ_SIO]) IREG &= ~IRQ_SIO; + if (s_IRQsAutoAck[IRQ_SIO_NUMBER]) IREG &= ~IRQ_SIO; } if ((IMASK & IREG & IRQ_VBLANK) != 0) { deliverEvent(EVENT_VBLANK, 0x1000); - if (s_IRQsAutoAck[IRQ_VBLANK]) IREG &= ~IRQ_VBLANK; + if (s_IRQsAutoAck[IRQ_VBLANK_NUMBER]) IREG &= ~IRQ_VBLANK; } if ((IMASK & IREG & IRQ_TIMER0) != 0) { deliverEvent(EVENT_RTC0, 0x1000); - if (s_IRQsAutoAck[IRQ_TIMER0]) IREG &= ~IRQ_TIMER0; + if (s_IRQsAutoAck[IRQ_TIMER0_NUMBER]) IREG &= ~IRQ_TIMER0; } if ((IMASK & IREG & IRQ_TIMER1) != 0) { deliverEvent(EVENT_RTC1, 0x1000); - if (s_IRQsAutoAck[IRQ_TIMER1]) IREG &= ~IRQ_TIMER1; + if (s_IRQsAutoAck[IRQ_TIMER1_NUMBER]) IREG &= ~IRQ_TIMER1; } if ((IMASK & IREG & IRQ_TIMER2) != 0) { // Keeping this copy/paste mistake this way to avoid breaking stuff. deliverEvent(EVENT_RTC1, 0x1000); - if (s_IRQsAutoAck[IRQ_TIMER2]) IREG &= ~IRQ_TIMER2; + if (s_IRQsAutoAck[IRQ_TIMER2_NUMBER]) IREG &= ~IRQ_TIMER2; } if ((IMASK & IREG & IRQ_CONTROLLER) != 0) { deliverEvent(EVENT_CONTROLLER, 0x1000); - if (s_IRQsAutoAck[IRQ_CONTROLLER]) IREG &= ~IRQ_CONTROLLER; + if (s_IRQsAutoAck[IRQ_CONTROLLER_NUMBER]) IREG &= ~IRQ_CONTROLLER; } if ((IMASK & IREG & IRQ_DMA) != 0) { deliverEvent(EVENT_DMA, 0x1000); - if (s_IRQsAutoAck[IRQ_DMA]) IREG &= ~IRQ_DMA; + if (s_IRQsAutoAck[IRQ_DMA_NUMBER]) IREG &= ~IRQ_DMA; } return 0; } diff --git a/src/mips/openbios/main/main.c b/src/mips/openbios/main/main.c index 0385446cf..cda784153 100644 --- a/src/mips/openbios/main/main.c +++ b/src/mips/openbios/main/main.c @@ -28,6 +28,7 @@ SOFTWARE. #include #include +#include #include #include "common/hardware/cop0.h" @@ -130,7 +131,8 @@ static char s_binaryPath[128]; // the tabulation character ('\t', or character 9) or a space. // Last but not least, the retail bios will screw things up // fairly badly if the file isn't terminated using CRLFs. -static void findWordItem(const char *systemCnf, uint32_t *item, const char *name) { +static void findWordItem(const char *systemCnf, void *item_, const char *name) { + uint32_t *item = (uint32_t *)item_; char c; const unsigned size = strlen(name); while (strncmp(systemCnf, name, size) != 0) { @@ -378,7 +380,7 @@ static void boot(char *systemCnfPath, char *binaryPath) { psxprintf("EXEC:PC0(%08x) T_ADDR(%08x) T_SIZE(%08x)\n", s_binaryInfo.pc, s_binaryInfo.text_addr, s_binaryInfo.text_size); psxprintf("boot address : %08x %08x\nExecute !\n\n", s_binaryInfo.pc, s_configuration.stackBase); - s_binaryInfo.stack_start = s_configuration.stackBase; + s_binaryInfo.stack_start = (uintptr_t)s_configuration.stackBase; s_binaryInfo.stack_size = 0; // the original format string says S_SIZE(%08), which is obviously wrong... psxprintf(" S_ADDR(%08x) S_SIZE(%08x)\n", s_configuration.stackBase, 0); diff --git a/src/mips/openbios/patches/hash.c b/src/mips/openbios/patches/hash.c index 088120ff6..a7b7f056b 100644 --- a/src/mips/openbios/patches/hash.c +++ b/src/mips/openbios/patches/hash.c @@ -37,7 +37,8 @@ static inline uint32_t hashone(uint32_t a) { return a; } -uint32_t patch_hash(const uint32_t* ptr, uint8_t* maskPtr, unsigned len) { +uint32_t patch_hash(const uint32_t* ptr, const void* maskPtr_, unsigned len) { + const uint8_t* maskPtr = (const uint8_t*)maskPtr_; uint32_t hash = 0x5810d659; uint32_t mask = 1; diff --git a/src/mips/openbios/patches/hash.h b/src/mips/openbios/patches/hash.h index bf21df953..d90f1e1c1 100644 --- a/src/mips/openbios/patches/hash.h +++ b/src/mips/openbios/patches/hash.h @@ -28,4 +28,4 @@ SOFTWARE. #include -uint32_t patch_hash(const uint32_t* ptr, uint8_t* mask, unsigned len); +uint32_t patch_hash(const uint32_t* ptr, const void* mask, unsigned len); diff --git a/src/mips/openbios/patches/patch_pad_1.c b/src/mips/openbios/patches/patch_pad_1.c index 495572bc3..abae27e53 100644 --- a/src/mips/openbios/patches/patch_pad_1.c +++ b/src/mips/openbios/patches/patch_pad_1.c @@ -99,13 +99,13 @@ enum patch_behavior patch_pad_1_execute(uint32_t *ra) { ptr <<= 16; addend = ra[4] & 0xffff; ptr += addend; - *((uint32_t *)ptr) = patch_startPad; + *((uint32_t *)ptr) = (uint32_t)patch_startPad; ptr = ra[6] & 0xffff; ptr <<= 16; addend = ra[7] & 0xffff; ptr += addend; - *((uint32_t *)ptr) = patch_stopPad; + *((uint32_t *)ptr) = (uint32_t)patch_stopPad; ra[2] = 11 | 0x10000000; ra[3] = 0; diff --git a/src/mips/openbios/patches/patch_pad_2.c b/src/mips/openbios/patches/patch_pad_2.c index c9079d6df..405f9b26f 100644 --- a/src/mips/openbios/patches/patch_pad_2.c +++ b/src/mips/openbios/patches/patch_pad_2.c @@ -98,13 +98,13 @@ enum patch_behavior patch_pad_2_execute(uint32_t *ra) { ptr <<= 16; addend = ra[3] & 0xffff; ptr += addend; - *((uint32_t *)ptr) = patch_startPad; + *((uint32_t *)ptr) = (uint32_t)patch_startPad; ptr = ra[4] & 0xffff; ptr <<= 16; addend = ra[7] & 0xffff; ptr += addend; - *((uint32_t *)ptr) = patch_stopPad; + *((uint32_t *)ptr) = (uint32_t)patch_stopPad; ra[2] = 10 | 0x10000000; ra[3] = 0; diff --git a/src/mips/openbios/patches/patches.c b/src/mips/openbios/patches/patches.c index ac2f36822..8f3cd57cc 100644 --- a/src/mips/openbios/patches/patches.c +++ b/src/mips/openbios/patches/patches.c @@ -169,9 +169,9 @@ void patch_hook(uint32_t* ra, enum patch_table table) { // already patched, bail out if ((ra[0] == 0) && (ra[1] == 0) && (ra[3] == 0)) return; - uint32_t* hash_mask = NULL; + const uint32_t* hash_mask = NULL; - struct patch* patches = NULL; + const struct patch* patches = NULL; unsigned size = 0; char t = 'x'; switch (table) { diff --git a/src/mips/openbios/patches/send_pad_1.c b/src/mips/openbios/patches/send_pad_1.c index 7ee707b0d..70808f5f5 100644 --- a/src/mips/openbios/patches/send_pad_1.c +++ b/src/mips/openbios/patches/send_pad_1.c @@ -116,7 +116,7 @@ enum patch_behavior send_pad_1_execute(uint32_t* ra) { ptr <<= 16; addend = ra[8] & 0xffff; ptr += addend; - *((uint32_t*)ptr) = patch_setPadOutputData; + *((uint32_t*)ptr) = (uint32_t)patch_setPadOutputData; ra[2] = 15 | 0x10000000; ra[3] = 0; diff --git a/src/mips/openbios/patches/send_pad_2.c b/src/mips/openbios/patches/send_pad_2.c index 29de76d8e..bcfc4463b 100644 --- a/src/mips/openbios/patches/send_pad_2.c +++ b/src/mips/openbios/patches/send_pad_2.c @@ -115,7 +115,7 @@ enum patch_behavior send_pad_2_execute(uint32_t* ra) { ptr <<= 16; addend = ra[7] & 0xffff; ptr += addend; - *((uint32_t*)ptr) = patch_setPadOutputData; + *((uint32_t*)ptr) = (uint32_t)patch_setPadOutputData; ra[2] = 12 | 0x10000000; ra[3] = 0; diff --git a/src/mips/openbios/tty/tty.c b/src/mips/openbios/tty/tty.c index b2cf88093..a20796943 100644 --- a/src/mips/openbios/tty/tty.c +++ b/src/mips/openbios/tty/tty.c @@ -60,12 +60,12 @@ static const struct Device s_ttyDevice = { .write = psxdummy, .erase = psxdummy, .undelete = psxdummy, - .firstFile = psxdummy, - .nextFile = psxdummy, + .firstFile = (struct DirEntry * (*)(struct File *, const char *, struct DirEntry *)) psxdummy, + .nextFile = (struct DirEntry * (*)(struct File *, struct DirEntry *)) psxdummy, .format = psxdummy, .chdir = psxdummy, .rename = psxdummy, - .deinit = psxdummy, + .deinit = (void (*)())psxdummy, .check = psxdummy, }; @@ -76,7 +76,7 @@ static const struct Device s_dummyDevice = { .flags = 1, .blockSize = 1, .desc = "CONSOLE", - .init = psxdummy, + .init = (void (*)()) psxdummy, .open = psxdummy, .action = psxdummy, .close = psxdummy, @@ -85,12 +85,12 @@ static const struct Device s_dummyDevice = { .write = psxdummy, .erase = psxdummy, .undelete = psxdummy, - .firstFile = psxdummy, - .nextFile = psxdummy, + .firstFile = (struct DirEntry * (*)(struct File *, const char *, struct DirEntry *)) psxdummy, + .nextFile = (struct DirEntry * (*)(struct File *, struct DirEntry *)) psxdummy, .format = psxdummy, .chdir = psxdummy, .rename = psxdummy, - .deinit = psxdummy, + .deinit = (void (*)())psxdummy, .check = psxdummy, }; From 642479b966c21327e8e528a929615b580ac70a16 Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Wed, 8 May 2024 20:49:21 -0700 Subject: [PATCH 08/53] Upgrading docker image to 2022. --- tools/win32-mips/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/win32-mips/Dockerfile b/tools/win32-mips/Dockerfile index 01572581f..f7335228c 100644 --- a/tools/win32-mips/Dockerfile +++ b/tools/win32-mips/Dockerfile @@ -2,7 +2,7 @@ # Dockerfile to generate the Windows g++-mipsel-none-elf-14.1.0.zip package. -FROM mcr.microsoft.com/windows/servercore:ltsc2019 +FROM mcr.microsoft.com/windows/servercore:ltsc2022 WORKDIR C:\windows\temp SHELL ["powershell", "-command"] From 5d8ad946948649212068a73cd888daaddeb19b29 Mon Sep 17 00:00:00 2001 From: nicolasnoble Date: Thu, 9 May 2024 04:32:18 +0000 Subject: [PATCH 09/53] [Chores] Format code --- src/core/pad.cc | 2 +- src/mips/openbios/cdrom/cdrom.c | 6 ++++-- src/mips/openbios/tty/tty.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/pad.cc b/src/core/pad.cc index e9319aa51..1d8d2ffe7 100644 --- a/src/core/pad.cc +++ b/src/core/pad.cc @@ -482,7 +482,7 @@ void PadsImpl::reset() { } void PadsImpl::Pad::reset() { - //m_analogMode = false; + // m_analogMode = false; m_configMode = false; m_cmd = magic_enum::enum_integer(PadCommands::Idle); m_bufferLen = 0; diff --git a/src/mips/openbios/cdrom/cdrom.c b/src/mips/openbios/cdrom/cdrom.c index 2f3698dfa..4d39a8a7b 100644 --- a/src/mips/openbios/cdrom/cdrom.c +++ b/src/mips/openbios/cdrom/cdrom.c @@ -53,7 +53,8 @@ void initializeCDRomHandlersAndEvents() { static void initializeSoftwareAndHardware() { initializeCDRomHandlersAndEvents(); - while (!syscall_cdromInnerInit()); + while (!syscall_cdromInnerInit()) + ; } void initCDRom() { @@ -77,7 +78,8 @@ int cdromBlockGetStatus() { uint8_t status; int cyclesToWait = 9; - while (!syscall_cdromGetStatus(&status) && (--cyclesToWait > 0)); + while (!syscall_cdromGetStatus(&status) && (--cyclesToWait > 0)) + ; if (cyclesToWait < 1) { syscall_exception(0x44, 0x1f); return -1; diff --git a/src/mips/openbios/tty/tty.c b/src/mips/openbios/tty/tty.c index a20796943..abc9014d5 100644 --- a/src/mips/openbios/tty/tty.c +++ b/src/mips/openbios/tty/tty.c @@ -76,7 +76,7 @@ static const struct Device s_dummyDevice = { .flags = 1, .blockSize = 1, .desc = "CONSOLE", - .init = (void (*)()) psxdummy, + .init = (void (*)())psxdummy, .open = psxdummy, .action = psxdummy, .close = psxdummy, From 0ded6c7f3f84b5627d3954410b3d8cd1f34fe5a7 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Boric Date: Mon, 13 May 2024 16:24:50 +0200 Subject: [PATCH 10/53] psyq-obj-parser: fix HI16 relocations with large addends --- tools/psyq-obj-parser/psyq-obj-parser.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/psyq-obj-parser/psyq-obj-parser.cc b/tools/psyq-obj-parser/psyq-obj-parser.cc index b27fac307..f306e0a80 100644 --- a/tools/psyq-obj-parser/psyq-obj-parser.cc +++ b/tools/psyq-obj-parser/psyq-obj-parser.cc @@ -1214,8 +1214,8 @@ bool PsyqLnkFile::Relocation::generateElf(ElfRelocationPass pass, const std::str if (symbolOffset & 0x8000) { hi += 1; } - sectionData[offset + 0] = (uint8_t)(hi >> 8); - sectionData[offset + 1] = (uint8_t)(hi >> 0); + sectionData[offset + 0] = (uint8_t)(hi >> 0); + sectionData[offset + 1] = (uint8_t)(hi >> 8); break; } case PsyqRelocType::LO16: { From db1b99a16e2ed677931a04584d9d4a0df9f52a8e Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Wed, 15 May 2024 21:18:40 -0700 Subject: [PATCH 11/53] Revert "Revert "Updating readme links."" This reverts commit 0d224b62e7d1fe0ff00e989666dd3e769930e4e2. --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 03879b782..481822a08 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ |Platform|Build status|Download| |--------|------------|--------| -|Windows build|[![Build Status](https://dev.azure.com/grumpycoders/pcsx-redux/_apis/build/status/grumpycoders.pcsx-redux?branchName=main)](https://dev.azure.com/grumpycoders/pcsx-redux/_build/latest?definitionId=1&branchName=main)|[Windows Intel 64-bits](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-win64/distribution_groups/public)| -|Linux build|[![Linux CI](https://github.com/grumpycoders/pcsx-redux/workflows/Linux%20CI/badge.svg?branch=main)](https://github.com/grumpycoders/pcsx-redux/actions?query=workflow%3A%22Linux+CI%22+branch%3Amain)|[Linux Intel 64-bits (AppImage)](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-linux64/distribution_groups/public)| -|MacOS build|[![MacOS CI](https://github.com/grumpycoders/pcsx-redux/workflows/macOS%20CI/badge.svg?branch=main)](https://github.com/grumpycoders/pcsx-redux/actions?query=workflow%3A%22macOS+CI%22+branch%3Amain)|[MacOS](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-macos/distribution_groups/public)| +|Windows x64 build|[![Windows x64 CI](https://dev.azure.com/grumpycoders/pcsx-redux/_apis/build/status/grumpycoders.pcsx-redux?branchName=main)](https://dev.azure.com/grumpycoders/pcsx-redux/_build/latest?definitionId=1&branchName=main)|[Windows Intel 64-bits](https://distrib.app/pub/org/pcsx-redux/project/dev-win-x64)| +|Linux x64 build|[![Linux x64 CI](https://github.com/grumpycoders/pcsx-redux/workflows/Linux%20CI/badge.svg?branch=main)](https://github.com/grumpycoders/pcsx-redux/actions?query=workflow%3A%22Linux+CI%22+branch%3Amain)|[Linux Intel 64-bits (AppImage)](https://distrib.app/pub/org/pcsx-redux/project/dev-linux-x64)| +|MacOS x64 build|[![MacOS x64 CI](https://github.com/grumpycoders/pcsx-redux/workflows/macOS%20CI/badge.svg?branch=main)](https://github.com/grumpycoders/pcsx-redux/actions?query=workflow%3A%22macOS+CI%22+branch%3Amain)|[MacOS Intel](https://distrib.app/pub/org/pcsx-redux/project/dev-macos-x64)| To discuss this emulator specifically, please join our Discord server: @@ -34,10 +34,10 @@ The [tools](tools) directory contains a few tools that can be used to work with ## Where? |Download page| |--------| -|[Windows Intel 64-bits](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-win64/distribution_groups/public)| -|[Windows Intel 64-bits CLI](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-win64-cli/distribution_groups/public)| -|[Linux Intel 64-bits (AppImage)](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-linux64/distribution_groups/public)| -|[MacOS](https://install.appcenter.ms/orgs/grumpycoders/apps/pcsx-redux-macos/distribution_groups/public)| +|[Windows Intel 64-bits](https://distrib.app/pub/org/pcsx-redux/project/dev-win-x64)| +|[Windows Intel 64-bits CLI](https://distrib.app/pub/org/pcsx-redux/project/dev-win-cli-x64)| +|[Linux Intel 64-bits (AppImage)](https://distrib.app/pub/org/pcsx-redux/project/dev-linux-x64)| +|[MacOS Intel](https://distrib.app/pub/org/pcsx-redux/project/dev-macos-x64)| ### Note: The macOS version of PCSX-Redux is not currently signed with a developer certificate so you may see a security warning when opening the application. From eaf8717c18eaabe2da1f0c6e49699765d9613fc6 Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 07:55:21 +0200 Subject: [PATCH 12/53] SPU debugger: render channels as 1 column --- src/spu/debug.cc | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index ca864bd25..190ce70c5 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -65,20 +65,17 @@ void PCSX::SPU::impl::debug() { } { ImGui::BeginChild("##debugSPUleft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0), true); - ImGui::Columns(2); - for (unsigned i = 0; i < MAXCHAN / 2; i++) { - for (unsigned j = 0; j < 2; j++) { - unsigned ch = j * MAXCHAN / 2 + i; - std::string label1 = "##Channel" + std::to_string(ch); - std::string label2 = "##Mute" + std::to_string(ch); - std::string label3 = "Ch" + std::to_string(ch); - ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f); - ImGui::SameLine(); - ImGui::Checkbox(label2.c_str(), &s_chan[ch].data.get().value); - ImGui::SameLine(); - if (ImGui::RadioButton(label3.c_str(), m_selectedChannel == ch)) m_selectedChannel = ch; - ImGui::NextColumn(); - } + ImGui::Columns(1); + for (unsigned i = 0; i < MAXCHAN; i++) { + const unsigned ch = i; + std::string label1 = "##Channel" + std::to_string(ch); + std::string label2 = "##Mute" + std::to_string(ch); + std::string label3 = "Ch" + std::to_string(ch); + ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f); + ImGui::SameLine(); + ImGui::Checkbox(label2.c_str(), &s_chan[ch].data.get().value); + ImGui::SameLine(); + if (ImGui::RadioButton(label3.c_str(), m_selectedChannel == ch)) m_selectedChannel = ch; } ImGui::Columns(1); if (ImGui::Button(_("Mute all"), ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0))) { From e2b4f78b8abae2cc31e62bb51f90581291d75509 Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 08:59:25 +0200 Subject: [PATCH 13/53] SPU debugger: use one variable for channel index --- src/spu/debug.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 190ce70c5..d8a7fbe54 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -66,8 +66,7 @@ void PCSX::SPU::impl::debug() { { ImGui::BeginChild("##debugSPUleft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0), true); ImGui::Columns(1); - for (unsigned i = 0; i < MAXCHAN; i++) { - const unsigned ch = i; + for (unsigned ch = 0; ch < MAXCHAN; ch++) { std::string label1 = "##Channel" + std::to_string(ch); std::string label2 = "##Mute" + std::to_string(ch); std::string label3 = "Ch" + std::to_string(ch); From 34391e2111622d7cacfa8f182059fcc6c319e62d Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 09:03:00 +0200 Subject: [PATCH 14/53] SPU debugger: add textboxes for tagging channels --- src/spu/debug.cc | 8 +++++++- src/spu/interface.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index d8a7fbe54..df5e4dab4 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -67,10 +67,16 @@ void PCSX::SPU::impl::debug() { ImGui::BeginChild("##debugSPUleft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0), true); ImGui::Columns(1); for (unsigned ch = 0; ch < MAXCHAN; ch++) { + std::string label0 = "##Tag" + std::to_string(ch); std::string label1 = "##Channel" + std::to_string(ch); std::string label2 = "##Mute" + std::to_string(ch); std::string label3 = "Ch" + std::to_string(ch); - ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f); + constexpr int widthTag = 75; + ImGui::PushItemWidth(widthTag); + ImGui::InputText(label0.c_str(), m_channelTag[ch], CHANNEL_TAG, ImGuiInputTextFlags_None); + ImGui::PopItemWidth(); + ImGui::SameLine(); + ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, ImVec2(-widthTag * 2, 0)); ImGui::SameLine(); ImGui::Checkbox(label2.c_str(), &s_chan[ch].data.get().value); ImGui::SameLine(); diff --git a/src/spu/interface.h b/src/spu/interface.h index 8c2f971f8..d17440ed8 100644 --- a/src/spu/interface.h +++ b/src/spu/interface.h @@ -290,6 +290,8 @@ class impl final : public SPUInterface { static const unsigned DEBUG_SAMPLES = 1024; enum { EMPTY = 0, DATA, NOISE, FMOD1, FMOD2, IRQ, MUTED } m_channelDebugTypes[MAXCHAN][DEBUG_SAMPLES]; float m_channelDebugData[MAXCHAN][DEBUG_SAMPLES]; + static constexpr unsigned CHANNEL_TAG = 32; + char m_channelTag[MAXCHAN][CHANNEL_TAG] = {}; unsigned m_currentDebugSample = 0; }; From d635e3d27bb16616544e3a4171d7600e3a00527f Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 09:18:02 +0200 Subject: [PATCH 15/53] SPU debugger: no need to show 'Ch' 24 times on screen --- src/spu/debug.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index df5e4dab4..875c82dca 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -70,7 +70,7 @@ void PCSX::SPU::impl::debug() { std::string label0 = "##Tag" + std::to_string(ch); std::string label1 = "##Channel" + std::to_string(ch); std::string label2 = "##Mute" + std::to_string(ch); - std::string label3 = "Ch" + std::to_string(ch); + std::string label3 = std::to_string(ch); constexpr int widthTag = 75; ImGui::PushItemWidth(widthTag); ImGui::InputText(label0.c_str(), m_channelTag[ch], CHANNEL_TAG, ImGuiInputTextFlags_None); From 110566b7d8c25f3e51298f5609c064434a95550c Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 15:56:03 +0200 Subject: [PATCH 16/53] SPU debugger: add M/S buttons to channels --- src/spu/debug.cc | 64 +++++++++++++++++++++++++++++++++++++++++++++++ src/spu/freeze.cc | 1 + src/spu/spu.cc | 3 ++- src/spu/types.h | 6 +++-- 4 files changed, 71 insertions(+), 3 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 875c82dca..0fa14a843 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -81,6 +81,70 @@ void PCSX::SPU::impl::debug() { ImGui::Checkbox(label2.c_str(), &s_chan[ch].data.get().value); ImGui::SameLine(); if (ImGui::RadioButton(label3.c_str(), m_selectedChannel == ch)) m_selectedChannel = ch; + + /* M/S buttons (mono/solo) */ + + const auto buttonSize = ImVec2(ImGui::GetTextLineHeightWithSpacing(), 0); + const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); + auto& dataThis = s_chan[ch].data; + auto& muteThis = dataThis.get().value; + auto& soloThis = dataThis.get().value; + + ImGui::SameLine(); + ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); + std::string muteLabel = "M##" + std::to_string(ch); + if (ImGui::Button(muteLabel.c_str(), buttonSize)) { + muteThis = !muteThis; + if (muteThis) { + soloThis = false; + } + } + + ImGui::SameLine(); + ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); + std::string soloLabel = "S##" + std::to_string(ch); + if (ImGui::Button(soloLabel.c_str(), buttonSize)) { + soloThis = !soloThis; + if (soloThis) { + muteThis = false; + } + for (unsigned i = 0; i < MAXCHAN; i++) { + if (i == ch) { + continue; + } + auto& dataOther = s_chan[i].data; + auto& muteOther = dataOther.get().value; + auto& soloOther = dataOther.get().value; + if (soloThis) { + // multi/single solo + if (ImGui::GetIO().KeyShift) { + if (soloOther == false) { + muteOther = true; + } + } else { + muteOther = true; + soloOther = false; + } + } else { + // mute this to keep solo ones correct + if (std::ranges::any_of(s_chan, s_chan + MAXCHAN, [](const SPUCHAN& c) { + return c.data.get().value; + })) { + muteThis = true; + } + } + } + + // no more solo channels -> ensure none are muted + if (std::ranges::all_of(s_chan, [](const SPUCHAN& c) { + return c.data.get().value == false; + })) { + std::ranges::for_each(s_chan, s_chan + MAXCHAN, [](SPUCHAN& c) { + c.data.get().value = false; + }); + } + } + ImGui::PopStyleColor(2); } ImGui::Columns(1); if (ImGui::Button(_("Mute all"), ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0))) { diff --git a/src/spu/freeze.cc b/src/spu/freeze.cc index eddc11fea..8cca1a4b5 100644 --- a/src/spu/freeze.cc +++ b/src/spu/freeze.cc @@ -128,6 +128,7 @@ void PCSX::SPU::impl::load(const SaveStates::SPU &spu) { restorePtr(s_chan[i].pCurr, data.get()); restorePtr(s_chan[i].pLoop, data.get()); s_chan[i].data.get().value = false; + s_chan[i].data.get().value = false; s_chan[i].data.get().value = 0; } diff --git a/src/spu/spu.cc b/src/spu/spu.cc index f128796a3..eb18836eb 100644 --- a/src/spu/spu.cc +++ b/src/spu/spu.cc @@ -694,7 +694,7 @@ void PCSX::SPU::impl::MainThread() { ////////////////////////////////////////////// // ok, left/right sound volume (psx volume goes from 0 ... 0x3fff) - if (pChannel->data.get().value) + if (pChannel->data.get().value && !pChannel->data.get().value) pChannel->data.get().value = 0; // debug mute else { SSumL[ns] += (pChannel->data.get().value * @@ -958,6 +958,7 @@ void PCSX::SPU::impl::SetupStreams() { // s_chan[i].hMutex=CreateMutex(NULL,FALSE,NULL); s_chan[i].ADSRX.get().value = 0xf << 27; // -> init sustain s_chan[i].data.get().value = false; + s_chan[i].data.get().value = false; s_chan[i].data.get().value = 0; s_chan[i].pLoop = spuMemC; s_chan[i].pStart = spuMemC; diff --git a/src/spu/types.h b/src/spu/types.h index a06917b31..d89ee21af 100644 --- a/src/spu/types.h +++ b/src/spu/types.h @@ -125,11 +125,13 @@ typedef Protobuf::Field Noise; typedef Protobuf::Field FMod; // another reverb helper typedef Protobuf::Field RVBNum; -// skip id 31 +// solo mode +typedef Protobuf::Field Solo; +// skip id 32 typedef Protobuf::Message + RVBNum, Solo> Data; } // namespace Chan From ea8f6593db5617d95db209cbd77eca96cc22908f Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:37:54 +0200 Subject: [PATCH 17/53] SPU debugger: move info button to the very end --- src/spu/debug.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 0fa14a843..1df8506a2 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -79,8 +79,6 @@ void PCSX::SPU::impl::debug() { ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, ImVec2(-widthTag * 2, 0)); ImGui::SameLine(); ImGui::Checkbox(label2.c_str(), &s_chan[ch].data.get().value); - ImGui::SameLine(); - if (ImGui::RadioButton(label3.c_str(), m_selectedChannel == ch)) m_selectedChannel = ch; /* M/S buttons (mono/solo) */ @@ -145,6 +143,9 @@ void PCSX::SPU::impl::debug() { } } ImGui::PopStyleColor(2); + + ImGui::SameLine(); + if (ImGui::RadioButton(label3.c_str(), m_selectedChannel == ch)) m_selectedChannel = ch; } ImGui::Columns(1); if (ImGui::Button(_("Mute all"), ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0))) { From 87aded9a26d7ef77ad7e8dfc3aeac7c69a6667ae Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:38:16 +0200 Subject: [PATCH 18/53] SPU debugger: slightly enlarge tag input --- src/spu/debug.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 1df8506a2..ce8ad7219 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -71,7 +71,7 @@ void PCSX::SPU::impl::debug() { std::string label1 = "##Channel" + std::to_string(ch); std::string label2 = "##Mute" + std::to_string(ch); std::string label3 = std::to_string(ch); - constexpr int widthTag = 75; + constexpr int widthTag = 100; ImGui::PushItemWidth(widthTag); ImGui::InputText(label0.c_str(), m_channelTag[ch], CHANNEL_TAG, ImGuiInputTextFlags_None); ImGui::PopItemWidth(); From c7df5074ae4395a3f4b158336f01dbc2afa2b475 Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:39:55 +0200 Subject: [PATCH 19/53] SPU debugger: account for radio button in plot --- src/spu/debug.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index ce8ad7219..d59e75ed8 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -72,11 +72,13 @@ void PCSX::SPU::impl::debug() { std::string label2 = "##Mute" + std::to_string(ch); std::string label3 = std::to_string(ch); constexpr int widthTag = 100; + constexpr int widthInf = 75; ImGui::PushItemWidth(widthTag); ImGui::InputText(label0.c_str(), m_channelTag[ch], CHANNEL_TAG, ImGuiInputTextFlags_None); ImGui::PopItemWidth(); ImGui::SameLine(); - ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, ImVec2(-widthTag * 2, 0)); + constexpr ImVec2 plotSize(-widthTag - widthInf, 0); + ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); ImGui::SameLine(); ImGui::Checkbox(label2.c_str(), &s_chan[ch].data.get().value); From 9e37a2856d930ef8f696699790283e04b707c0bd Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:43:49 +0200 Subject: [PATCH 20/53] SPU debugger: add hint to tag input --- src/spu/debug.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index d59e75ed8..bdf0f6184 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -74,7 +74,8 @@ void PCSX::SPU::impl::debug() { constexpr int widthTag = 100; constexpr int widthInf = 75; ImGui::PushItemWidth(widthTag); - ImGui::InputText(label0.c_str(), m_channelTag[ch], CHANNEL_TAG, ImGuiInputTextFlags_None); + std::string tagHint = "Channel " + std::to_string(ch); + ImGui::InputTextWithHint(label0.c_str(), tagHint.c_str(), m_channelTag[ch], CHANNEL_TAG); ImGui::PopItemWidth(); ImGui::SameLine(); constexpr ImVec2 plotSize(-widthTag - widthInf, 0); From ae4615f60d65bba0071bac486b96f7eb81a246df Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:47:13 +0200 Subject: [PATCH 21/53] SPU debugger: remove obsolete mute checkbox --- src/spu/debug.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index bdf0f6184..dfd91affa 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -69,7 +69,6 @@ void PCSX::SPU::impl::debug() { for (unsigned ch = 0; ch < MAXCHAN; ch++) { std::string label0 = "##Tag" + std::to_string(ch); std::string label1 = "##Channel" + std::to_string(ch); - std::string label2 = "##Mute" + std::to_string(ch); std::string label3 = std::to_string(ch); constexpr int widthTag = 100; constexpr int widthInf = 75; @@ -80,8 +79,6 @@ void PCSX::SPU::impl::debug() { ImGui::SameLine(); constexpr ImVec2 plotSize(-widthTag - widthInf, 0); ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); - ImGui::SameLine(); - ImGui::Checkbox(label2.c_str(), &s_chan[ch].data.get().value); /* M/S buttons (mono/solo) */ From 15f1f5ec5bce08960301f9d73b7b101b909812b4 Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:47:29 +0200 Subject: [PATCH 22/53] SPU debugger: adjust plot width one more time --- src/spu/debug.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index dfd91affa..2f85bd0b4 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -71,7 +71,7 @@ void PCSX::SPU::impl::debug() { std::string label1 = "##Channel" + std::to_string(ch); std::string label3 = std::to_string(ch); constexpr int widthTag = 100; - constexpr int widthInf = 75; + constexpr int widthInf = 40; ImGui::PushItemWidth(widthTag); std::string tagHint = "Channel " + std::to_string(ch); ImGui::InputTextWithHint(label0.c_str(), tagHint.c_str(), m_channelTag[ch], CHANNEL_TAG); From 2b8f7678d2ef318319f0d4f14595734e0fad53c2 Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:52:44 +0200 Subject: [PATCH 23/53] SPU debugger: cleanup info label --- src/spu/debug.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 2f85bd0b4..76c0b6f76 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -69,7 +69,6 @@ void PCSX::SPU::impl::debug() { for (unsigned ch = 0; ch < MAXCHAN; ch++) { std::string label0 = "##Tag" + std::to_string(ch); std::string label1 = "##Channel" + std::to_string(ch); - std::string label3 = std::to_string(ch); constexpr int widthTag = 100; constexpr int widthInf = 40; ImGui::PushItemWidth(widthTag); @@ -144,8 +143,11 @@ void PCSX::SPU::impl::debug() { } ImGui::PopStyleColor(2); + const auto infoLabel = std::to_string(ch) + "##Info" + std::to_string(ch); ImGui::SameLine(); - if (ImGui::RadioButton(label3.c_str(), m_selectedChannel == ch)) m_selectedChannel = ch; + if (ImGui::RadioButton(infoLabel.c_str(), m_selectedChannel == ch)) { + m_selectedChannel = ch; + } } ImGui::Columns(1); if (ImGui::Button(_("Mute all"), ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0))) { From 9af95bee17dde28aced637a35f01a610cdc71bc4 Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:54:06 +0200 Subject: [PATCH 24/53] SPU debugger: cleanup plot label --- src/spu/debug.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 76c0b6f76..441f9ed30 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -68,16 +68,17 @@ void PCSX::SPU::impl::debug() { ImGui::Columns(1); for (unsigned ch = 0; ch < MAXCHAN; ch++) { std::string label0 = "##Tag" + std::to_string(ch); - std::string label1 = "##Channel" + std::to_string(ch); constexpr int widthTag = 100; constexpr int widthInf = 40; ImGui::PushItemWidth(widthTag); std::string tagHint = "Channel " + std::to_string(ch); ImGui::InputTextWithHint(label0.c_str(), tagHint.c_str(), m_channelTag[ch], CHANNEL_TAG); ImGui::PopItemWidth(); - ImGui::SameLine(); + + const auto plotLabel = "##Channel" + std::to_string(ch); constexpr ImVec2 plotSize(-widthTag - widthInf, 0); - ImGui::PlotHistogram(label1.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); + ImGui::SameLine(); + ImGui::PlotHistogram(plotLabel.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); /* M/S buttons (mono/solo) */ From 46e984f51124e8c41a5e4cd096ed90cbd62de3a9 Mon Sep 17 00:00:00 2001 From: aybe Date: Thu, 16 May 2024 17:55:01 +0200 Subject: [PATCH 25/53] SPU debugger: cleanup tag stuff --- src/spu/debug.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 441f9ed30..fe027fe3f 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -67,12 +67,13 @@ void PCSX::SPU::impl::debug() { ImGui::BeginChild("##debugSPUleft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0), true); ImGui::Columns(1); for (unsigned ch = 0; ch < MAXCHAN; ch++) { - std::string label0 = "##Tag" + std::to_string(ch); constexpr int widthTag = 100; constexpr int widthInf = 40; + + const auto tagLabel = "##Tag" + std::to_string(ch); + const auto tagHint = "Channel " + std::to_string(ch); ImGui::PushItemWidth(widthTag); - std::string tagHint = "Channel " + std::to_string(ch); - ImGui::InputTextWithHint(label0.c_str(), tagHint.c_str(), m_channelTag[ch], CHANNEL_TAG); + ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), m_channelTag[ch], CHANNEL_TAG); ImGui::PopItemWidth(); const auto plotLabel = "##Channel" + std::to_string(ch); From 87818efdd0e2ec19e166a06ffaf2bc141dce7471 Mon Sep 17 00:00:00 2001 From: aybe Date: Fri, 17 May 2024 09:43:09 +0200 Subject: [PATCH 26/53] SPU debugger: add shift behavior for mute buttons --- src/spu/debug.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index fe027fe3f..7c0ea29b8 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -97,6 +97,14 @@ void PCSX::SPU::impl::debug() { if (muteThis) { soloThis = false; } + if (ImGui::GetIO().KeyShift) { + std::ranges::for_each(s_chan, s_chan + MAXCHAN, [muteThis](SPUCHAN& c) { + c.data.get().value = muteThis; + if (muteThis) { + c.data.get().value = false; + } + }); + } } ImGui::SameLine(); From 464b955892a8e4681104857536eb425539009d4c Mon Sep 17 00:00:00 2001 From: aybe Date: Fri, 17 May 2024 18:34:33 +0200 Subject: [PATCH 27/53] SPU debugger: use nested tables to show all channels --- src/spu/debug.cc | 548 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 464 insertions(+), 84 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 7c0ea29b8..e97b11794 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -21,6 +21,92 @@ #include "imgui.h" #include "spu/interface.h" +struct Grid { + static constexpr auto FlagsColumn = ImGuiTableColumnFlags_NoResize | ImGuiTableColumnFlags_WidthFixed; + + static constexpr auto FlagsRow = ImGuiTableRowFlags_None; + + static constexpr auto FlagsTable = + ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable; + + static constexpr auto FlagsTableOuter = FlagsTable | ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_ScrollX; + static constexpr auto FlagsTableInner = FlagsTable | ImGuiTableFlags_Borders; + + static constexpr auto WidthGeneralIndex = 22.0f; + static constexpr auto WidthGeneralOn = 30.0f; + static constexpr auto WidthGeneralTag = 120.0f; + static constexpr auto WidthGeneralOff = 30.0f; + static constexpr auto WidthGeneralMute = 45.0f; + static constexpr auto WidthGeneralSolo = 45.0f; + static constexpr auto WidthGeneralNoise = 70.0f; + static constexpr auto WidthGeneralFMod = 70.0f; + static constexpr auto WidthGeneralPlot = 150.0f; + static constexpr auto WidthGeneral = + WidthGeneralIndex + + WidthGeneralTag + + WidthGeneralOn + + WidthGeneralOff + + WidthGeneralMute + + WidthGeneralSolo + + WidthGeneralNoise + + WidthGeneralFMod + + WidthGeneralPlot; + + static constexpr auto WidthFrequencyActive = 70.0f; + static constexpr auto WidthFrequencyUsed = 70.0f; + static constexpr auto WidthFrequency = + WidthFrequencyActive + + WidthFrequencyUsed; + + static constexpr auto WidthPositionStart = 120.0f; + static constexpr auto WidthPositionCurrent = 120.0f; + static constexpr auto WidthPositionLoop = 120.0f; + static constexpr auto WidthPosition = + WidthPositionStart + + WidthPositionCurrent + + WidthPositionLoop; + + static constexpr auto WidthVolumeL = 70.0f; + static constexpr auto WidthVolumeR = 70.0f; + static constexpr auto WidthVolume = + WidthVolumeL + + WidthVolumeR; + + static constexpr auto WidthAdsrA = 70.0f; + static constexpr auto WidthAdsrD = 70.0f; + static constexpr auto WidthAdsrS = 70.0f; + static constexpr auto WidthAdsrR = 70.0f; + static constexpr auto WidthAdsr = + WidthAdsrA + + WidthAdsrD + + WidthAdsrS + + WidthAdsrR; + + static constexpr auto WidthAdsrSustainLevel = 70.0f; + static constexpr auto WidthAdsrSustainIncrease = 70.0f; + static constexpr auto WidthAdsrSustain = + WidthAdsrSustainLevel + + WidthAdsrSustainIncrease; + + static constexpr auto WidthAdsrVolumeCurrent = 70.0f; + static constexpr auto WidthAdsrVolumeEnvelope = 80.0f; + static constexpr auto WidthAdsrVolume = + WidthAdsrVolumeCurrent + + WidthAdsrVolumeEnvelope; + + static constexpr auto WidthReverbAllowed = 70.0f; + static constexpr auto WidthReverbActive = 70.0f; + static constexpr auto WidthReverbNumber = 70.0f; + static constexpr auto WidthReverbOffset = 70.0f; + static constexpr auto WidthReverbRepeat = 70.0f; + static constexpr auto WidthReverb = + WidthReverbAllowed + + WidthReverbActive + + WidthReverbNumber + + WidthReverbOffset + + WidthReverbRepeat; +}; + void PCSX::SPU::impl::debug() { auto delta = std::chrono::steady_clock::now() - m_lastUpdated; using namespace std::chrono_literals; @@ -63,116 +149,410 @@ void PCSX::SPU::impl::debug() { ImGui::End(); return; } - { - ImGui::BeginChild("##debugSPUleft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0), true); - ImGui::Columns(1); - for (unsigned ch = 0; ch < MAXCHAN; ch++) { - constexpr int widthTag = 100; - constexpr int widthInf = 40; - const auto tagLabel = "##Tag" + std::to_string(ch); - const auto tagHint = "Channel " + std::to_string(ch); - ImGui::PushItemWidth(widthTag); - ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), m_channelTag[ch], CHANNEL_TAG); - ImGui::PopItemWidth(); + if (ImGui::CollapsingHeader("Channels", ImGuiTreeNodeFlags_DefaultOpen)) { + const auto style = ImGui::GetStyle(); + const auto rowHeight = ImGui::GetFrameHeightWithSpacing(); + const auto headerHeight = ImGui::GetTextLineHeightWithSpacing(); + const auto tableHeight = rowHeight * MAXCHAN + headerHeight * 2 + 4 + style.ScrollbarSize; - const auto plotLabel = "##Channel" + std::to_string(ch); - constexpr ImVec2 plotSize(-widthTag - widthInf, 0); - ImGui::SameLine(); - ImGui::PlotHistogram(plotLabel.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); + // BUG ImGui hides last column border when scrolling (off by 1px) + if (ImGui::BeginTable("SpuChannels", 8, Grid::FlagsTableOuter, ImVec2(0, tableHeight))) { + constexpr auto fix = 2; // BUG ImGui may screw up last column width + constexpr auto pad = 18; + ImGui::TableSetupColumn("General", Grid::FlagsColumn, Grid::WidthGeneral + pad * fix); + ImGui::TableSetupColumn("Frequency", Grid::FlagsColumn, Grid::WidthFrequency + pad); + ImGui::TableSetupColumn("Position", Grid::FlagsColumn, Grid::WidthPosition + pad); + ImGui::TableSetupColumn("Volume", Grid::FlagsColumn, Grid::WidthVolume + pad); + ImGui::TableSetupColumn("ADSR", Grid::FlagsColumn, Grid::WidthAdsr + pad * fix); + ImGui::TableSetupColumn("ADSR Sustain", Grid::FlagsColumn, Grid::WidthAdsrSustain + pad); + ImGui::TableSetupColumn("ADSR Volume", Grid::FlagsColumn, Grid::WidthAdsrVolume + pad); + ImGui::TableSetupColumn("Reverb", Grid::FlagsColumn, Grid::WidthReverb + pad * fix); + ImGui::TableHeadersRow(); - /* M/S buttons (mono/solo) */ + ImGui::TableNextColumn(); + if (ImGui::BeginTable("TableGeneral", 9, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("#", Grid::FlagsColumn, Grid::WidthGeneralIndex); + ImGui::TableSetupColumn("Tag", Grid::FlagsColumn, Grid::WidthGeneralTag); + ImGui::TableSetupColumn("On", Grid::FlagsColumn, Grid::WidthGeneralOn); + ImGui::TableSetupColumn("Off", Grid::FlagsColumn, Grid::WidthGeneralOff); + ImGui::TableSetupColumn("Mute", Grid::FlagsColumn, Grid::WidthGeneralMute); + ImGui::TableSetupColumn("Solo", Grid::FlagsColumn, Grid::WidthGeneralSolo); + ImGui::TableSetupColumn("Noise", Grid::FlagsColumn, Grid::WidthGeneralNoise); + ImGui::TableSetupColumn("FMod", Grid::FlagsColumn, Grid::WidthGeneralFMod); + ImGui::TableSetupColumn("Plot", Grid::FlagsColumn, Grid::WidthGeneralPlot); - const auto buttonSize = ImVec2(ImGui::GetTextLineHeightWithSpacing(), 0); - const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); - auto& dataThis = s_chan[ch].data; - auto& muteThis = dataThis.get().value; - auto& soloThis = dataThis.get().value; + ImGui::TableHeadersRow(); + for (auto i = 0u; i < MAXCHAN; ++i) { + const auto& data = s_chan[i].data; - ImGui::SameLine(); - ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); - std::string muteLabel = "M##" + std::to_string(ch); - if (ImGui::Button(muteLabel.c_str(), buttonSize)) { - muteThis = !muteThis; - if (muteThis) { - soloThis = false; - } - if (ImGui::GetIO().KeyShift) { - std::ranges::for_each(s_chan, s_chan + MAXCHAN, [muteThis](SPUCHAN& c) { - c.data.get().value = muteThis; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%02i", i); + + ImGui::TableNextColumn(); + ImGui::PushItemWidth(Grid::WidthGeneralTag); + const auto tagLabel = "##SpuChannelTag" + std::to_string(i); + const auto tagHint = "Channel " + std::to_string(i); + ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), m_channelTag[i], CHANNEL_TAG); + ImGui::PopItemWidth(); + + ImGui::TableNextColumn(); + ImGui::BeginDisabled(); + auto bit1 = data.get().value; + ImGui::Checkbox("", &bit1); + ImGui::EndDisabled(); + + ImGui::TableNextColumn(); + auto bit2 = data.get().value; + ImGui::BeginDisabled(); + ImGui::Checkbox("", &bit2); + ImGui::EndDisabled(); + + const auto ch = std::to_string(i); + const auto buttonSize = ImVec2(rowHeight, 0); + const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); + auto& dataThis = s_chan[i].data; + auto& muteThis = dataThis.get().value; + auto& soloThis = dataThis.get().value; + + ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); + std::string muteLabel = "M##SpuMute" + ch; + ImGui::TableNextColumn(); + const auto muteSize = ImVec2( + (Grid::WidthGeneralMute - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); + ImGui::Dummy(muteSize); + ImGui::SameLine(); + if (ImGui::Button(muteLabel.c_str(), buttonSize)) { + muteThis = !muteThis; if (muteThis) { - c.data.get().value = false; + soloThis = false; } - }); - } - } - - ImGui::SameLine(); - ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); - std::string soloLabel = "S##" + std::to_string(ch); - if (ImGui::Button(soloLabel.c_str(), buttonSize)) { - soloThis = !soloThis; - if (soloThis) { - muteThis = false; - } - for (unsigned i = 0; i < MAXCHAN; i++) { - if (i == ch) { - continue; - } - auto& dataOther = s_chan[i].data; - auto& muteOther = dataOther.get().value; - auto& soloOther = dataOther.get().value; - if (soloThis) { - // multi/single solo if (ImGui::GetIO().KeyShift) { - if (soloOther == false) { - muteOther = true; + std::ranges::for_each(s_chan, s_chan + MAXCHAN, [muteThis](SPUCHAN& c) { + c.data.get().value = muteThis; + if (muteThis) { + c.data.get().value = false; + } + }); + } + } + ImGui::PopStyleColor(); + + ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); + std::string soloLabel = "S##SpuSolo" + ch; + ImGui::TableNextColumn(); + const auto soloSize = ImVec2( + (Grid::WidthGeneralSolo - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); + ImGui::Dummy(soloSize); + ImGui::SameLine(); + if (ImGui::Button(soloLabel.c_str(), buttonSize)) { + soloThis = !soloThis; + if (soloThis) { + muteThis = false; + } + for (unsigned j = 0; j < MAXCHAN; j++) { + if (j == i) { + continue; + } + auto& dataOther = s_chan[j].data; + auto& muteOther = dataOther.get().value; + auto& soloOther = dataOther.get().value; + if (soloThis) { + // multi/single solo + if (ImGui::GetIO().KeyShift) { + if (soloOther == false) { + muteOther = true; + } + } else { + muteOther = true; + soloOther = false; + } + } else { + // mute this to keep solo ones correct + if (std::ranges::any_of(s_chan, s_chan + MAXCHAN, [](const SPUCHAN& c) { + return c.data.get().value; + })) { + muteThis = true; + } } - } else { - muteOther = true; - soloOther = false; } - } else { - // mute this to keep solo ones correct - if (std::ranges::any_of(s_chan, s_chan + MAXCHAN, [](const SPUCHAN& c) { - return c.data.get().value; + + // no more solo channels -> ensure none are muted + if (std::ranges::all_of(s_chan, [](const SPUCHAN& c) { + return c.data.get().value == false; })) { - muteThis = true; + std::ranges::for_each(s_chan, s_chan + MAXCHAN, [](SPUCHAN& c) { + c.data.get().value = false; + }); } } + ImGui::PopStyleColor(); + + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + + ImGui::TableNextColumn(); + constexpr auto plotSize = ImVec2(Grid::WidthGeneralPlot - pad, 0); + ImGui::PlotHistogram("", m_channelDebugData[i], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); } + ImGui::EndTable(); + } - // no more solo channels -> ensure none are muted - if (std::ranges::all_of(s_chan, [](const SPUCHAN& c) { - return c.data.get().value == false; - })) { - std::ranges::for_each(s_chan, s_chan + MAXCHAN, [](SPUCHAN& c) { - c.data.get().value = false; - }); + ImGui::TableNextColumn(); + if (ImGui::BeginTable("TableFrequency", 2, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthFrequencyActive); + ImGui::TableSetupColumn("Used", Grid::FlagsColumn, Grid::WidthFrequencyUsed); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < MAXCHAN; ++i) { + const auto& data = s_chan[i].data; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); } + ImGui::EndTable(); } - ImGui::PopStyleColor(2); - const auto infoLabel = std::to_string(ch) + "##Info" + std::to_string(ch); - ImGui::SameLine(); - if (ImGui::RadioButton(infoLabel.c_str(), m_selectedChannel == ch)) { - m_selectedChannel = ch; + ImGui::TableNextColumn(); + if (ImGui::BeginTable("TablePosition", 3, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Start", Grid::FlagsColumn, Grid::WidthPositionStart); + ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthPositionCurrent); + ImGui::TableSetupColumn("Loop", Grid::FlagsColumn, Grid::WidthPositionLoop); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < MAXCHAN; ++i) { + const auto& chan = s_chan[i]; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", static_cast(chan.pStart - spuMemC)); + ImGui::TableNextColumn(); + ImGui::Text("%i", static_cast(chan.pCurr - spuMemC)); + ImGui::TableNextColumn(); + ImGui::Text("%i", static_cast(chan.pLoop - spuMemC)); + } + ImGui::EndTable(); + } + + ImGui::TableNextColumn(); + if (ImGui::BeginTable("TableVolume", 2, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("L", Grid::FlagsColumn, Grid::WidthVolumeL); + ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthVolumeR); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < MAXCHAN; ++i) { + const auto& data = s_chan[i].data; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + } + ImGui::EndTable(); } + + ImGui::TableNextColumn(); + if (ImGui::BeginTable("TableAdsr", 4, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("A", Grid::FlagsColumn, Grid::WidthAdsrA); + ImGui::TableSetupColumn("D", Grid::FlagsColumn, Grid::WidthAdsrD); + ImGui::TableSetupColumn("S", Grid::FlagsColumn, Grid::WidthAdsrS); + ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthAdsrR); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < MAXCHAN; ++i) { + const auto& data = s_chan[i].ADSRX; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value ^ 0x7F); + ImGui::TableNextColumn(); + ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value ^ 0x7F); + ImGui::TableNextColumn(); + ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); + } + ImGui::EndTable(); + } + + ImGui::TableNextColumn(); + if (ImGui::BeginTable("TableAdsrSustain", 2, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Level", Grid::FlagsColumn, Grid::WidthAdsrSustainLevel); + ImGui::TableSetupColumn("Increase", Grid::FlagsColumn, Grid::WidthAdsrSustainIncrease); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < MAXCHAN; ++i) { + const auto& data = s_chan[i].ADSRX; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value >> 27); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + } + ImGui::EndTable(); + } + + ImGui::TableNextColumn(); + if (ImGui::BeginTable("TableAdsrVolume", 2, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthAdsrVolumeCurrent); + ImGui::TableSetupColumn("Envelope", Grid::FlagsColumn, Grid::WidthAdsrVolumeEnvelope); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < MAXCHAN; ++i) { + const auto& data = s_chan[i].ADSRX; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%08X", data.get().value); + } + ImGui::EndTable(); + } + + ImGui::TableNextColumn(); + if (ImGui::BeginTable("TableReverb", 5, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Allowed", Grid::FlagsColumn, Grid::WidthReverbAllowed); + ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthReverbActive); + ImGui::TableSetupColumn("Number", Grid::FlagsColumn, Grid::WidthReverbNumber); + ImGui::TableSetupColumn("Offset", Grid::FlagsColumn, Grid::WidthReverbOffset); + ImGui::TableSetupColumn("Repeat", Grid::FlagsColumn, Grid::WidthReverbRepeat); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < MAXCHAN; ++i) { + const auto& data = s_chan[i].data; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + } + ImGui::EndTable(); + } + ImGui::EndTable(); } - ImGui::Columns(1); - if (ImGui::Button(_("Mute all"), ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0))) { - for (unsigned ch = 0; ch < MAXCHAN; ch++) { - s_chan[ch].data.get().value = true; + ImGui::Text("Tip: hold 'Shift' key to group mute/solo actions."); + } + + ImGui::BeginChild("##debugSPUleft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0), true); + ImGui::Columns(1); + for (unsigned ch = 0; ch < MAXCHAN; ch++) { + constexpr int widthTag = 100; + constexpr int widthInf = 40; + + const auto tagLabel = "##Tag" + std::to_string(ch); + const auto tagHint = "Channel " + std::to_string(ch); + ImGui::PushItemWidth(widthTag); + ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), m_channelTag[ch], CHANNEL_TAG); + ImGui::PopItemWidth(); + + const auto plotLabel = "##Channel" + std::to_string(ch); + constexpr ImVec2 plotSize(-widthTag - widthInf, 0); + ImGui::SameLine(); + ImGui::PlotHistogram(plotLabel.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); + + /* M/S buttons (mono/solo) */ + + const auto buttonSize = ImVec2(ImGui::GetTextLineHeightWithSpacing(), 0); + const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); + auto& dataThis = s_chan[ch].data; + auto& muteThis = dataThis.get().value; + auto& soloThis = dataThis.get().value; + + ImGui::SameLine(); + ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); + std::string muteLabel = "M##" + std::to_string(ch); + if (ImGui::Button(muteLabel.c_str(), buttonSize)) { + muteThis = !muteThis; + if (muteThis) { + soloThis = false; + } + if (ImGui::GetIO().KeyShift) { + std::ranges::for_each(s_chan, s_chan + MAXCHAN, [muteThis](SPUCHAN& c) { + c.data.get().value = muteThis; + if (muteThis) { + c.data.get().value = false; + } + }); } } + ImGui::SameLine(); - if (ImGui::Button(_("Unmute all"), ImVec2(-1, 0))) { - for (unsigned ch = 0; ch < MAXCHAN; ch++) { - s_chan[ch].data.get().value = false; + ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); + std::string soloLabel = "S##" + std::to_string(ch); + if (ImGui::Button(soloLabel.c_str(), buttonSize)) { + soloThis = !soloThis; + if (soloThis) { + muteThis = false; + } + for (unsigned i = 0; i < MAXCHAN; i++) { + if (i == ch) { + continue; + } + auto& dataOther = s_chan[i].data; + auto& muteOther = dataOther.get().value; + auto& soloOther = dataOther.get().value; + if (soloThis) { + // multi/single solo + if (ImGui::GetIO().KeyShift) { + if (soloOther == false) { + muteOther = true; + } + } else { + muteOther = true; + soloOther = false; + } + } else { + // mute this to keep solo ones correct + if (std::ranges::any_of(s_chan, s_chan + MAXCHAN, [](const SPUCHAN& c) { + return c.data.get().value; + })) { + muteThis = true; + } + } + } + + // no more solo channels -> ensure none are muted + if (std::ranges::all_of(s_chan, [](const SPUCHAN& c) { + return c.data.get().value == false; + })) { + std::ranges::for_each(s_chan, s_chan + MAXCHAN, [](SPUCHAN& c) { + c.data.get().value = false; + }); } } - ImGui::EndChild(); + ImGui::PopStyleColor(2); + + const auto infoLabel = std::to_string(ch) + "##Info" + std::to_string(ch); + ImGui::SameLine(); + if (ImGui::RadioButton(infoLabel.c_str(), m_selectedChannel == ch)) { + m_selectedChannel = ch; + } + } + ImGui::Columns(1); + if (ImGui::Button(_("Mute all"), ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0))) { + for (unsigned ch = 0; ch < MAXCHAN; ch++) { + s_chan[ch].data.get().value = true; + } + } + ImGui::SameLine(); + if (ImGui::Button(_("Unmute all"), ImVec2(-1, 0))) { + for (unsigned ch = 0; ch < MAXCHAN; ch++) { + s_chan[ch].data.get().value = false; + } } + ImGui::EndChild(); ImGui::SameLine(); { auto ch = s_chan[m_selectedChannel]; From 02ee8389792d2c0ff6438e95c83c77cecf7b790a Mon Sep 17 00:00:00 2001 From: aybe Date: Sat, 18 May 2024 18:15:33 +0200 Subject: [PATCH 28/53] SPU debugger: re-implement SPU/XA sections as tables too --- src/spu/debug.cc | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index e97b11794..c784685ae 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -150,6 +150,46 @@ void PCSX::SPU::impl::debug() { return; } + { + constexpr auto simpleTableFlags = ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_NoHostExtendX; + constexpr auto simpleTableWidth = 150; + + if (ImGui::CollapsingHeader("SPU")) { + if (ImGui::BeginTable("SpuBase", 4, simpleTableFlags)) { + ImGui::TableSetupColumn("IRQ", 0, simpleTableWidth); + ImGui::TableSetupColumn("CTRL", 0, simpleTableWidth); + ImGui::TableSetupColumn("STAT", 0, simpleTableWidth); + ImGui::TableSetupColumn("MEM", 0, simpleTableWidth); + ImGui::TableHeadersRow(); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%08X", static_cast(pSpuIrq ? -1 : pSpuIrq - spuMemC)); + ImGui::TableNextColumn(); ImGui::Text("%04X", spuCtrl); + ImGui::TableNextColumn(); ImGui::Text("%04X", spuStat); + ImGui::TableNextColumn(); ImGui::Text("%i", spuAddr); + // @formatter:on + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("XA")) { + if (ImGui::BeginTable("SpuXa", 5, simpleTableFlags)) { + ImGui::TableSetupColumn("Frequency", 0, simpleTableWidth); + ImGui::TableSetupColumn("Stereo", 0, simpleTableWidth); + ImGui::TableSetupColumn("Samples", 0, simpleTableWidth); + ImGui::TableSetupColumn("Volume L", 0, simpleTableWidth); + ImGui::TableSetupColumn("Volume R", 0, simpleTableWidth); + ImGui::TableHeadersRow(); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->freq : 0); + ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->stereo : 0); + ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->nsamples : 0); + ImGui::TableNextColumn(); ImGui::Text("%i", iLeftXAVol); + ImGui::TableNextColumn(); ImGui::Text("%i", iRightXAVol); + // @formatter:on + ImGui::EndTable(); + } + } + } + if (ImGui::CollapsingHeader("Channels", ImGuiTreeNodeFlags_DefaultOpen)) { const auto style = ImGui::GetStyle(); const auto rowHeight = ImGui::GetFrameHeightWithSpacing(); From 5392874832428fe2bdf09b0fccafc520a130318b Mon Sep 17 00:00:00 2001 From: aybe Date: Sat, 18 May 2024 18:17:09 +0200 Subject: [PATCH 29/53] SPU debugger: remove older design --- src/spu/debug.cc | 180 ----------------------------------------------- 1 file changed, 180 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index c784685ae..9ca108ad0 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -485,185 +485,5 @@ void PCSX::SPU::impl::debug() { ImGui::Text("Tip: hold 'Shift' key to group mute/solo actions."); } - ImGui::BeginChild("##debugSPUleft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0), true); - ImGui::Columns(1); - for (unsigned ch = 0; ch < MAXCHAN; ch++) { - constexpr int widthTag = 100; - constexpr int widthInf = 40; - - const auto tagLabel = "##Tag" + std::to_string(ch); - const auto tagHint = "Channel " + std::to_string(ch); - ImGui::PushItemWidth(widthTag); - ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), m_channelTag[ch], CHANNEL_TAG); - ImGui::PopItemWidth(); - - const auto plotLabel = "##Channel" + std::to_string(ch); - constexpr ImVec2 plotSize(-widthTag - widthInf, 0); - ImGui::SameLine(); - ImGui::PlotHistogram(plotLabel.c_str(), m_channelDebugData[ch], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); - - /* M/S buttons (mono/solo) */ - - const auto buttonSize = ImVec2(ImGui::GetTextLineHeightWithSpacing(), 0); - const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); - auto& dataThis = s_chan[ch].data; - auto& muteThis = dataThis.get().value; - auto& soloThis = dataThis.get().value; - - ImGui::SameLine(); - ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); - std::string muteLabel = "M##" + std::to_string(ch); - if (ImGui::Button(muteLabel.c_str(), buttonSize)) { - muteThis = !muteThis; - if (muteThis) { - soloThis = false; - } - if (ImGui::GetIO().KeyShift) { - std::ranges::for_each(s_chan, s_chan + MAXCHAN, [muteThis](SPUCHAN& c) { - c.data.get().value = muteThis; - if (muteThis) { - c.data.get().value = false; - } - }); - } - } - - ImGui::SameLine(); - ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); - std::string soloLabel = "S##" + std::to_string(ch); - if (ImGui::Button(soloLabel.c_str(), buttonSize)) { - soloThis = !soloThis; - if (soloThis) { - muteThis = false; - } - for (unsigned i = 0; i < MAXCHAN; i++) { - if (i == ch) { - continue; - } - auto& dataOther = s_chan[i].data; - auto& muteOther = dataOther.get().value; - auto& soloOther = dataOther.get().value; - if (soloThis) { - // multi/single solo - if (ImGui::GetIO().KeyShift) { - if (soloOther == false) { - muteOther = true; - } - } else { - muteOther = true; - soloOther = false; - } - } else { - // mute this to keep solo ones correct - if (std::ranges::any_of(s_chan, s_chan + MAXCHAN, [](const SPUCHAN& c) { - return c.data.get().value; - })) { - muteThis = true; - } - } - } - - // no more solo channels -> ensure none are muted - if (std::ranges::all_of(s_chan, [](const SPUCHAN& c) { - return c.data.get().value == false; - })) { - std::ranges::for_each(s_chan, s_chan + MAXCHAN, [](SPUCHAN& c) { - c.data.get().value = false; - }); - } - } - ImGui::PopStyleColor(2); - - const auto infoLabel = std::to_string(ch) + "##Info" + std::to_string(ch); - ImGui::SameLine(); - if (ImGui::RadioButton(infoLabel.c_str(), m_selectedChannel == ch)) { - m_selectedChannel = ch; - } - } - ImGui::Columns(1); - if (ImGui::Button(_("Mute all"), ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0))) { - for (unsigned ch = 0; ch < MAXCHAN; ch++) { - s_chan[ch].data.get().value = true; - } - } - ImGui::SameLine(); - if (ImGui::Button(_("Unmute all"), ImVec2(-1, 0))) { - for (unsigned ch = 0; ch < MAXCHAN; ch++) { - s_chan[ch].data.get().value = false; - } - } - ImGui::EndChild(); - ImGui::SameLine(); - { - auto ch = s_chan[m_selectedChannel]; - auto ADSRX = ch.ADSRX; - - ImGui::BeginChild("##debugSPUright", ImVec2(0, 0), true); - { - ImGui::TextUnformatted(_("ADSR channel info")); - ImGui::Columns(2); - { - ImGui::TextUnformatted(_("Attack:\nDecay:\nSustain:\nRelease:")); - ImGui::SameLine(); - ImGui::Text("%i\n%i\n%i\n%i", ADSRX.get().value ^ 0x7f, - (ADSRX.get().value ^ 0x1f) / 4, ADSRX.get().value ^ 0x7f, - (ADSRX.get().value ^ 0x1f) / 4); - } - ImGui::NextColumn(); - { - ImGui::TextUnformatted(_("Sustain level:\nSustain inc:\nCurr adsr vol:\nRaw enveloppe")); - ImGui::SameLine(); - ImGui::Text("%i\n%i\n%i\n%08x", ADSRX.get().value >> 27, - ADSRX.get().value, ADSRX.get().value, - ADSRX.get().value); - } - ImGui::Columns(1); - ImGui::Separator(); - ImGui::TextUnformatted(_("Generic channel info")); - ImGui::Columns(2); - { - ImGui::TextUnformatted( - _("On:\nStop:\nNoise:\nFMod:\nReverb:\nRvb active:\nRvb number:\nRvb offset:\nRvb repeat:")); - ImGui::SameLine(); - ImGui::Text("%i\n%i\n%i\n%i\n%i\n%i\n%i\n%i\n%i", ch.data.get().value, - ch.data.get().value, ch.data.get().value, - ch.data.get().value, ch.data.get().value, - ch.data.get().value, ch.data.get().value, - ch.data.get().value, ch.data.get().value); - } - ImGui::NextColumn(); - { - ImGui::TextUnformatted( - _("Start pos:\nCurr pos:\nLoop pos:\n\nRight vol:\nLeft vol:\n\nAct freq:\nUsed freq:")); - ImGui::SameLine(); - ImGui::Text("%li\n%li\n%li\n\n%6i %04x\n%6i %04x\n\n%i\n%i", ch.pStart - spuMemC, ch.pCurr - spuMemC, - ch.pLoop - spuMemC, ch.data.get().value, - ch.data.get().value, ch.data.get().value, - ch.data.get().value, ch.data.get().value, - ch.data.get().value); - } - ImGui::Columns(1); - ImGui::BeginChild("##debugSPUXA", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 0), true); - { - ImGui::TextUnformatted("XA"); - ImGui::TextUnformatted(_("Freq:\nStereo:\nSamples:\nVolume:\n")); - ImGui::SameLine(); - ImGui::Text("%i\n%i\n%i\n%5i %5i", xapGlobal ? xapGlobal->freq : 0, xapGlobal ? xapGlobal->stereo : 0, - xapGlobal ? xapGlobal->nsamples : 0, iLeftXAVol, iRightXAVol); - } - ImGui::EndChild(); - ImGui::SameLine(); - ImGui::BeginChild("##debugSPUstate", ImVec2(0, 0), true); - { - ImGui::TextUnformatted(_("Spu states")); - ImGui::TextUnformatted(_("Irq addr:\nCtrl:\nStat:\nSpu mem:")); - ImGui::SameLine(); - ImGui::Text("%li\n%04x\n%04x\n%i", pSpuIrq ? -1 : pSpuIrq - spuMemC, spuCtrl, spuStat, spuAddr); - } - ImGui::EndChild(); - } - ImGui::EndChild(); - } - ImGui::End(); } From 496dbec559dd96a2e57cbbff1e59ec153756588b Mon Sep 17 00:00:00 2001 From: aybe Date: Sat, 18 May 2024 18:19:50 +0200 Subject: [PATCH 30/53] SPU debugger: expand headers by default --- src/spu/debug.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 9ca108ad0..7175f99c9 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -154,7 +154,7 @@ void PCSX::SPU::impl::debug() { constexpr auto simpleTableFlags = ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_NoHostExtendX; constexpr auto simpleTableWidth = 150; - if (ImGui::CollapsingHeader("SPU")) { + if (ImGui::CollapsingHeader("SPU", ImGuiTreeNodeFlags_DefaultOpen)) { if (ImGui::BeginTable("SpuBase", 4, simpleTableFlags)) { ImGui::TableSetupColumn("IRQ", 0, simpleTableWidth); ImGui::TableSetupColumn("CTRL", 0, simpleTableWidth); @@ -170,7 +170,7 @@ void PCSX::SPU::impl::debug() { ImGui::EndTable(); } } - if (ImGui::CollapsingHeader("XA")) { + if (ImGui::CollapsingHeader("XA", ImGuiTreeNodeFlags_DefaultOpen)) { if (ImGui::BeginTable("SpuXa", 5, simpleTableFlags)) { ImGui::TableSetupColumn("Frequency", 0, simpleTableWidth); ImGui::TableSetupColumn("Stereo", 0, simpleTableWidth); From 0cc5314e00f2fd9785c20ccf138957e61a8e8eea Mon Sep 17 00:00:00 2001 From: aybe Date: Sat, 18 May 2024 18:23:08 +0200 Subject: [PATCH 31/53] SPU debugger: remove tip because it doesn't look that great --- src/spu/debug.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 7175f99c9..734e40221 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -482,7 +482,6 @@ void PCSX::SPU::impl::debug() { } ImGui::EndTable(); } - ImGui::Text("Tip: hold 'Shift' key to group mute/solo actions."); } ImGui::End(); From 7872d2c92584a344a70e958c7b91bfc7940bc13e Mon Sep 17 00:00:00 2001 From: aybe Date: Sat, 18 May 2024 20:01:09 +0200 Subject: [PATCH 32/53] SPU debugger: fix terrible UX, disable resize/reorder for inner tables This is the simplest and most effective fix, anything else is just unreliable. --- src/spu/debug.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 734e40221..86b4cc398 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -30,7 +30,7 @@ struct Grid { ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable; static constexpr auto FlagsTableOuter = FlagsTable | ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_ScrollX; - static constexpr auto FlagsTableInner = FlagsTable | ImGuiTableFlags_Borders; + static constexpr auto FlagsTableInner = ImGuiTableFlags_Borders; static constexpr auto WidthGeneralIndex = 22.0f; static constexpr auto WidthGeneralOn = 30.0f; From e3c92af227fa5beaecc44e08e83cd36392278142 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 14:01:23 +0200 Subject: [PATCH 33/53] SPU debugger: try fix std::ranges::for_each for macos-build-and-test --- src/spu/debug.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 86b4cc398..b50097343 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -271,7 +271,7 @@ void PCSX::SPU::impl::debug() { soloThis = false; } if (ImGui::GetIO().KeyShift) { - std::ranges::for_each(s_chan, s_chan + MAXCHAN, [muteThis](SPUCHAN& c) { + std::for_each(s_chan, s_chan + MAXCHAN, [muteThis](SPUCHAN& c) { c.data.get().value = muteThis; if (muteThis) { c.data.get().value = false; @@ -324,7 +324,7 @@ void PCSX::SPU::impl::debug() { if (std::ranges::all_of(s_chan, [](const SPUCHAN& c) { return c.data.get().value == false; })) { - std::ranges::for_each(s_chan, s_chan + MAXCHAN, [](SPUCHAN& c) { + std::for_each(s_chan, s_chan + MAXCHAN, [](SPUCHAN& c) { c.data.get().value = false; }); } From 3b3c3d1e83763f828c3b2300054126b1e266861e Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 14:23:51 +0200 Subject: [PATCH 34/53] SPU debugger: try address cyclomatic complexity checks (test) --- src/spu/debug.cc | 55 +++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index b50097343..e4a881c87 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -107,6 +107,36 @@ struct Grid { WidthReverbRepeat; }; +using namespace PCSX::SPU; +using SPU_CHANNELS = SPUCHAN(&)[impl::MAXCHAN + 1]; + +void DrawTableReverb(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { + if (ImGui::BeginTable("TableReverb", 5, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Allowed", Grid::FlagsColumn, Grid::WidthReverbAllowed); + ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthReverbActive); + ImGui::TableSetupColumn("Number", Grid::FlagsColumn, Grid::WidthReverbNumber); + ImGui::TableSetupColumn("Offset", Grid::FlagsColumn, Grid::WidthReverbOffset); + ImGui::TableSetupColumn("Repeat", Grid::FlagsColumn, Grid::WidthReverbRepeat); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < channelsCount; ++i) { + const auto& data = channels[i].data; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + } + ImGui::EndTable(); + } +} + void PCSX::SPU::impl::debug() { auto delta = std::chrono::steady_clock::now() - m_lastUpdated; using namespace std::chrono_literals; @@ -456,30 +486,7 @@ void PCSX::SPU::impl::debug() { } ImGui::TableNextColumn(); - if (ImGui::BeginTable("TableReverb", 5, Grid::FlagsTableInner)) { - ImGui::TableSetupColumn("Allowed", Grid::FlagsColumn, Grid::WidthReverbAllowed); - ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthReverbActive); - ImGui::TableSetupColumn("Number", Grid::FlagsColumn, Grid::WidthReverbNumber); - ImGui::TableSetupColumn("Offset", Grid::FlagsColumn, Grid::WidthReverbOffset); - ImGui::TableSetupColumn("Repeat", Grid::FlagsColumn, Grid::WidthReverbRepeat); - ImGui::TableHeadersRow(); - for (auto i = 0u; i < MAXCHAN; ++i) { - const auto& data = s_chan[i].data; - ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - } - ImGui::EndTable(); - } + DrawTableReverb(s_chan, MAXCHAN, rowHeight); ImGui::EndTable(); } } From 90df2ce0458f365071347e3fc9bce657f9a5a07f Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 14:33:36 +0200 Subject: [PATCH 35/53] SPU debugger: try address cyclomatic complexity checks (more) --- src/spu/debug.cc | 225 ++++++++++++++++++++++++++--------------------- 1 file changed, 126 insertions(+), 99 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index e4a881c87..971d12fd8 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -110,6 +110,126 @@ struct Grid { using namespace PCSX::SPU; using SPU_CHANNELS = SPUCHAN(&)[impl::MAXCHAN + 1]; +void DrawTable(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { +} + +void DrawTableFrequency(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { + if (ImGui::BeginTable("TableFrequency", 2, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthFrequencyActive); + ImGui::TableSetupColumn("Used", Grid::FlagsColumn, Grid::WidthFrequencyUsed); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < channelsCount; ++i) { + const auto& data = channels[i].data; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + } + ImGui::EndTable(); + } +} + +void DrawTablePosition(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight, const uint8_t* spuMemC) { + if (ImGui::BeginTable("TablePosition", 3, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Start", Grid::FlagsColumn, Grid::WidthPositionStart); + ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthPositionCurrent); + ImGui::TableSetupColumn("Loop", Grid::FlagsColumn, Grid::WidthPositionLoop); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < channelsCount; ++i) { + const auto& chan = channels[i]; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", static_cast(chan.pStart - spuMemC)); + ImGui::TableNextColumn(); + ImGui::Text("%i", static_cast(chan.pCurr - spuMemC)); + ImGui::TableNextColumn(); + ImGui::Text("%i", static_cast(chan.pLoop - spuMemC)); + } + ImGui::EndTable(); + } +} + +void DrawTableVolume(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { + if (ImGui::BeginTable("TableVolume", 2, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("L", Grid::FlagsColumn, Grid::WidthVolumeL); + ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthVolumeR); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < channelsCount; ++i) { + const auto& data = channels[i].data; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + } + ImGui::EndTable(); + } +} + +void DrawTableAdsr(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { + if (ImGui::BeginTable("TableAdsr", 4, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("A", Grid::FlagsColumn, Grid::WidthAdsrA); + ImGui::TableSetupColumn("D", Grid::FlagsColumn, Grid::WidthAdsrD); + ImGui::TableSetupColumn("S", Grid::FlagsColumn, Grid::WidthAdsrS); + ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthAdsrR); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < channelsCount; ++i) { + const auto& data = channels[i].ADSRX; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value ^ 0x7F); + ImGui::TableNextColumn(); + ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value ^ 0x7F); + ImGui::TableNextColumn(); + ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); + } + ImGui::EndTable(); + } +} + +void DrawTableAdsrSustain(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { + if (ImGui::BeginTable("TableAdsrSustain", 2, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Level", Grid::FlagsColumn, Grid::WidthAdsrSustainLevel); + ImGui::TableSetupColumn("Increase", Grid::FlagsColumn, Grid::WidthAdsrSustainIncrease); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < channelsCount; ++i) { + const auto& data = channels[i].ADSRX; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value >> 27); + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + } + ImGui::EndTable(); + } +} + +void DrawTableAdsrVolume(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { + if (ImGui::BeginTable("TableAdsrVolume", 2, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthAdsrVolumeCurrent); + ImGui::TableSetupColumn("Envelope", Grid::FlagsColumn, Grid::WidthAdsrVolumeEnvelope); + ImGui::TableHeadersRow(); + for (auto i = 0u; i < channelsCount; ++i) { + const auto& data = channels[i].ADSRX; + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); + ImGui::Text("%08X", data.get().value); + } + ImGui::EndTable(); + } +} + void DrawTableReverb(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { if (ImGui::BeginTable("TableReverb", 5, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Allowed", Grid::FlagsColumn, Grid::WidthReverbAllowed); @@ -375,115 +495,22 @@ void PCSX::SPU::impl::debug() { } ImGui::TableNextColumn(); - if (ImGui::BeginTable("TableFrequency", 2, Grid::FlagsTableInner)) { - ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthFrequencyActive); - ImGui::TableSetupColumn("Used", Grid::FlagsColumn, Grid::WidthFrequencyUsed); - ImGui::TableHeadersRow(); - for (auto i = 0u; i < MAXCHAN; ++i) { - const auto& data = s_chan[i].data; - ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - } - ImGui::EndTable(); - } + DrawTableFrequency(s_chan, MAXCHAN, rowHeight); ImGui::TableNextColumn(); - if (ImGui::BeginTable("TablePosition", 3, Grid::FlagsTableInner)) { - ImGui::TableSetupColumn("Start", Grid::FlagsColumn, Grid::WidthPositionStart); - ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthPositionCurrent); - ImGui::TableSetupColumn("Loop", Grid::FlagsColumn, Grid::WidthPositionLoop); - ImGui::TableHeadersRow(); - for (auto i = 0u; i < MAXCHAN; ++i) { - const auto& chan = s_chan[i]; - ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", static_cast(chan.pStart - spuMemC)); - ImGui::TableNextColumn(); - ImGui::Text("%i", static_cast(chan.pCurr - spuMemC)); - ImGui::TableNextColumn(); - ImGui::Text("%i", static_cast(chan.pLoop - spuMemC)); - } - ImGui::EndTable(); - } + DrawTablePosition(s_chan, MAXCHAN, rowHeight, spuMemC); ImGui::TableNextColumn(); - if (ImGui::BeginTable("TableVolume", 2, Grid::FlagsTableInner)) { - ImGui::TableSetupColumn("L", Grid::FlagsColumn, Grid::WidthVolumeL); - ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthVolumeR); - ImGui::TableHeadersRow(); - for (auto i = 0u; i < MAXCHAN; ++i) { - const auto& data = s_chan[i].data; - ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - } - ImGui::EndTable(); - } + DrawTableVolume(s_chan, MAXCHAN, rowHeight); ImGui::TableNextColumn(); - if (ImGui::BeginTable("TableAdsr", 4, Grid::FlagsTableInner)) { - ImGui::TableSetupColumn("A", Grid::FlagsColumn, Grid::WidthAdsrA); - ImGui::TableSetupColumn("D", Grid::FlagsColumn, Grid::WidthAdsrD); - ImGui::TableSetupColumn("S", Grid::FlagsColumn, Grid::WidthAdsrS); - ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthAdsrR); - ImGui::TableHeadersRow(); - for (auto i = 0u; i < MAXCHAN; ++i) { - const auto& data = s_chan[i].ADSRX; - ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value ^ 0x7F); - ImGui::TableNextColumn(); - ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value ^ 0x7F); - ImGui::TableNextColumn(); - ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); - } - ImGui::EndTable(); - } + DrawTableAdsr(s_chan, MAXCHAN, rowHeight); ImGui::TableNextColumn(); - if (ImGui::BeginTable("TableAdsrSustain", 2, Grid::FlagsTableInner)) { - ImGui::TableSetupColumn("Level", Grid::FlagsColumn, Grid::WidthAdsrSustainLevel); - ImGui::TableSetupColumn("Increase", Grid::FlagsColumn, Grid::WidthAdsrSustainIncrease); - ImGui::TableHeadersRow(); - for (auto i = 0u; i < MAXCHAN; ++i) { - const auto& data = s_chan[i].ADSRX; - ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value >> 27); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - } - ImGui::EndTable(); - } + DrawTableAdsrSustain(s_chan, MAXCHAN, rowHeight); ImGui::TableNextColumn(); - if (ImGui::BeginTable("TableAdsrVolume", 2, Grid::FlagsTableInner)) { - ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthAdsrVolumeCurrent); - ImGui::TableSetupColumn("Envelope", Grid::FlagsColumn, Grid::WidthAdsrVolumeEnvelope); - ImGui::TableHeadersRow(); - for (auto i = 0u; i < MAXCHAN; ++i) { - const auto& data = s_chan[i].ADSRX; - ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%08X", data.get().value); - } - ImGui::EndTable(); - } + DrawTableAdsrVolume(s_chan, MAXCHAN, rowHeight); ImGui::TableNextColumn(); DrawTableReverb(s_chan, MAXCHAN, rowHeight); From bd70f265612929ec4fb06ce97d4dab1fe0a0b5ae Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 15:09:13 +0200 Subject: [PATCH 36/53] SPU debugger: try address cyclomatic complexity checks (more) --- src/spu/debug.cc | 278 +++++++++++++++++++++++--------------------- src/spu/interface.h | 6 +- 2 files changed, 150 insertions(+), 134 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 971d12fd8..c904b7706 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -110,9 +110,154 @@ struct Grid { using namespace PCSX::SPU; using SPU_CHANNELS = SPUCHAN(&)[impl::MAXCHAN + 1]; +using SPU_CHANNELS_TAGS = char (&)[impl::MAXCHAN][impl::CHANNEL_TAG]; +using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; void DrawTable(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { } +void DrawTableGeneral( + SPU_CHANNELS& channels, + size_t channelsCount, + const float rowHeight, + SPU_CHANNELS_TAGS& tags, + SPU_CHANNELS_PLOT& plot, + float padding) { + if (ImGui::BeginTable("TableGeneral", 9, Grid::FlagsTableInner)) { + ImGui::TableSetupColumn("#", Grid::FlagsColumn, Grid::WidthGeneralIndex); + ImGui::TableSetupColumn("Tag", Grid::FlagsColumn, Grid::WidthGeneralTag); + ImGui::TableSetupColumn("On", Grid::FlagsColumn, Grid::WidthGeneralOn); + ImGui::TableSetupColumn("Off", Grid::FlagsColumn, Grid::WidthGeneralOff); + ImGui::TableSetupColumn("Mute", Grid::FlagsColumn, Grid::WidthGeneralMute); + ImGui::TableSetupColumn("Solo", Grid::FlagsColumn, Grid::WidthGeneralSolo); + ImGui::TableSetupColumn("Noise", Grid::FlagsColumn, Grid::WidthGeneralNoise); + ImGui::TableSetupColumn("FMod", Grid::FlagsColumn, Grid::WidthGeneralFMod); + ImGui::TableSetupColumn("Plot", Grid::FlagsColumn, Grid::WidthGeneralPlot); + + ImGui::TableHeadersRow(); + for (auto i = 0u; i < channelsCount; ++i) { + const auto& data = channels[i].data; + + ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text("%02i", i); + + ImGui::TableNextColumn(); + ImGui::PushItemWidth(Grid::WidthGeneralTag); + const auto tagLabel = "##SpuChannelTag" + std::to_string(i); + const auto tagHint = "Channel " + std::to_string(i); + ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), tags[i], impl::CHANNEL_TAG); + ImGui::PopItemWidth(); + + ImGui::TableNextColumn(); + ImGui::BeginDisabled(); + auto bit1 = data.get().value; + ImGui::Checkbox("", &bit1); + ImGui::EndDisabled(); + + ImGui::TableNextColumn(); + auto bit2 = data.get().value; + ImGui::BeginDisabled(); + ImGui::Checkbox("", &bit2); + ImGui::EndDisabled(); + + const auto ch = std::to_string(i); + const auto buttonSize = ImVec2(rowHeight, 0); + const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); + auto& dataThis = channels[i].data; + auto& muteThis = dataThis.get().value; + auto& soloThis = dataThis.get().value; + + const auto style = ImGui::GetStyle(); + + ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); + std::string muteLabel = "M##SpuMute" + ch; + ImGui::TableNextColumn(); + const auto muteSize = ImVec2( + (Grid::WidthGeneralMute - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); + ImGui::Dummy(muteSize); + ImGui::SameLine(); + if (ImGui::Button(muteLabel.c_str(), buttonSize)) { + muteThis = !muteThis; + if (muteThis) { + soloThis = false; + } + if (ImGui::GetIO().KeyShift) { + std::for_each(channels, channels + channelsCount, [muteThis](SPUCHAN& c) { + c.data.get().value = muteThis; + if (muteThis) { + c.data.get().value = false; + } + }); + } + } + ImGui::PopStyleColor(); + + ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); + std::string soloLabel = "S##SpuSolo" + ch; + ImGui::TableNextColumn(); + const auto soloSize = ImVec2( + (Grid::WidthGeneralSolo - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); + ImGui::Dummy(soloSize); + ImGui::SameLine(); + if (ImGui::Button(soloLabel.c_str(), buttonSize)) { + soloThis = !soloThis; + if (soloThis) { + muteThis = false; + } + for (unsigned j = 0; j < channelsCount; j++) { + if (j == i) { + continue; + } + auto& dataOther = channels[j].data; + auto& muteOther = dataOther.get().value; + auto& soloOther = dataOther.get().value; + if (soloThis) { + // multi/single solo + if (ImGui::GetIO().KeyShift) { + if (soloOther == false) { + muteOther = true; + } + } else { + muteOther = true; + soloOther = false; + } + } else { + // mute this to keep solo ones correct + if (std::ranges::any_of(channels, channels + channelsCount, [](const SPUCHAN& c) { + return c.data.get().value; + })) { + muteThis = true; + } + } + } + + // no more solo channels -> ensure none are muted + if (std::ranges::all_of(channels, [](const SPUCHAN& c) { + return c.data.get().value == false; + })) { + std::for_each(channels, channels + channelsCount, [](SPUCHAN& c) { + c.data.get().value = false; + }); + } + } + ImGui::PopStyleColor(); + + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + + ImGui::TableNextColumn(); + ImGui::Text("%i", data.get().value); + + ImGui::TableNextColumn(); + const auto plotSize = ImVec2(Grid::WidthGeneralPlot - padding, 0); + ImGui::PlotHistogram("", plot[i], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); + } + ImGui::EndTable(); + } +} + void DrawTableFrequency(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { if (ImGui::BeginTable("TableFrequency", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthFrequencyActive); @@ -361,138 +506,7 @@ void PCSX::SPU::impl::debug() { ImGui::TableHeadersRow(); ImGui::TableNextColumn(); - if (ImGui::BeginTable("TableGeneral", 9, Grid::FlagsTableInner)) { - ImGui::TableSetupColumn("#", Grid::FlagsColumn, Grid::WidthGeneralIndex); - ImGui::TableSetupColumn("Tag", Grid::FlagsColumn, Grid::WidthGeneralTag); - ImGui::TableSetupColumn("On", Grid::FlagsColumn, Grid::WidthGeneralOn); - ImGui::TableSetupColumn("Off", Grid::FlagsColumn, Grid::WidthGeneralOff); - ImGui::TableSetupColumn("Mute", Grid::FlagsColumn, Grid::WidthGeneralMute); - ImGui::TableSetupColumn("Solo", Grid::FlagsColumn, Grid::WidthGeneralSolo); - ImGui::TableSetupColumn("Noise", Grid::FlagsColumn, Grid::WidthGeneralNoise); - ImGui::TableSetupColumn("FMod", Grid::FlagsColumn, Grid::WidthGeneralFMod); - ImGui::TableSetupColumn("Plot", Grid::FlagsColumn, Grid::WidthGeneralPlot); - - ImGui::TableHeadersRow(); - for (auto i = 0u; i < MAXCHAN; ++i) { - const auto& data = s_chan[i].data; - - ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%02i", i); - - ImGui::TableNextColumn(); - ImGui::PushItemWidth(Grid::WidthGeneralTag); - const auto tagLabel = "##SpuChannelTag" + std::to_string(i); - const auto tagHint = "Channel " + std::to_string(i); - ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), m_channelTag[i], CHANNEL_TAG); - ImGui::PopItemWidth(); - - ImGui::TableNextColumn(); - ImGui::BeginDisabled(); - auto bit1 = data.get().value; - ImGui::Checkbox("", &bit1); - ImGui::EndDisabled(); - - ImGui::TableNextColumn(); - auto bit2 = data.get().value; - ImGui::BeginDisabled(); - ImGui::Checkbox("", &bit2); - ImGui::EndDisabled(); - - const auto ch = std::to_string(i); - const auto buttonSize = ImVec2(rowHeight, 0); - const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); - auto& dataThis = s_chan[i].data; - auto& muteThis = dataThis.get().value; - auto& soloThis = dataThis.get().value; - - ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); - std::string muteLabel = "M##SpuMute" + ch; - ImGui::TableNextColumn(); - const auto muteSize = ImVec2( - (Grid::WidthGeneralMute - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); - ImGui::Dummy(muteSize); - ImGui::SameLine(); - if (ImGui::Button(muteLabel.c_str(), buttonSize)) { - muteThis = !muteThis; - if (muteThis) { - soloThis = false; - } - if (ImGui::GetIO().KeyShift) { - std::for_each(s_chan, s_chan + MAXCHAN, [muteThis](SPUCHAN& c) { - c.data.get().value = muteThis; - if (muteThis) { - c.data.get().value = false; - } - }); - } - } - ImGui::PopStyleColor(); - - ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); - std::string soloLabel = "S##SpuSolo" + ch; - ImGui::TableNextColumn(); - const auto soloSize = ImVec2( - (Grid::WidthGeneralSolo - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); - ImGui::Dummy(soloSize); - ImGui::SameLine(); - if (ImGui::Button(soloLabel.c_str(), buttonSize)) { - soloThis = !soloThis; - if (soloThis) { - muteThis = false; - } - for (unsigned j = 0; j < MAXCHAN; j++) { - if (j == i) { - continue; - } - auto& dataOther = s_chan[j].data; - auto& muteOther = dataOther.get().value; - auto& soloOther = dataOther.get().value; - if (soloThis) { - // multi/single solo - if (ImGui::GetIO().KeyShift) { - if (soloOther == false) { - muteOther = true; - } - } else { - muteOther = true; - soloOther = false; - } - } else { - // mute this to keep solo ones correct - if (std::ranges::any_of(s_chan, s_chan + MAXCHAN, [](const SPUCHAN& c) { - return c.data.get().value; - })) { - muteThis = true; - } - } - } - - // no more solo channels -> ensure none are muted - if (std::ranges::all_of(s_chan, [](const SPUCHAN& c) { - return c.data.get().value == false; - })) { - std::for_each(s_chan, s_chan + MAXCHAN, [](SPUCHAN& c) { - c.data.get().value = false; - }); - } - } - ImGui::PopStyleColor(); - - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - - ImGui::TableNextColumn(); - constexpr auto plotSize = ImVec2(Grid::WidthGeneralPlot - pad, 0); - ImGui::PlotHistogram("", m_channelDebugData[i], DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); - } - ImGui::EndTable(); - } + DrawTableGeneral(s_chan, MAXCHAN, rowHeight, m_channelTag, m_channelDebugData, pad); ImGui::TableNextColumn(); DrawTableFrequency(s_chan, MAXCHAN, rowHeight); diff --git a/src/spu/interface.h b/src/spu/interface.h index d17440ed8..77643ab6a 100644 --- a/src/spu/interface.h +++ b/src/spu/interface.h @@ -66,6 +66,10 @@ class impl final : public SPUInterface { // num of channels static const size_t MAXCHAN = 24; + // number of characters for a channel tag + static constexpr unsigned CHANNEL_TAG = 32; + // number of samples for debugger wave plot + static const unsigned DEBUG_SAMPLES = 1024; uint32_t getFrameCount() override { return m_audioOut.getFrameCount(); } @@ -287,10 +291,8 @@ class impl final : public SPUInterface { // debug window unsigned m_selectedChannel = 0; std::chrono::time_point m_lastUpdated; - static const unsigned DEBUG_SAMPLES = 1024; enum { EMPTY = 0, DATA, NOISE, FMOD1, FMOD2, IRQ, MUTED } m_channelDebugTypes[MAXCHAN][DEBUG_SAMPLES]; float m_channelDebugData[MAXCHAN][DEBUG_SAMPLES]; - static constexpr unsigned CHANNEL_TAG = 32; char m_channelTag[MAXCHAN][CHANNEL_TAG] = {}; unsigned m_currentDebugSample = 0; }; From b195dd5e6a8aa007975075d5537c608ef3b7327e Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 15:16:29 +0200 Subject: [PATCH 37/53] SPU debugger: try address cyclomatic complexity checks (more) --- src/spu/debug.cc | 61 +++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index c904b7706..34dbd40cd 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -115,6 +115,37 @@ using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; void DrawTable(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { } +void DrawTableGeneralIndex(const unsigned channel) +{ + ImGui::AlignTextToFramePadding(); + ImGui::Text("%02i", channel); +} + +void DrawTableGeneralTag(const unsigned channel, SPU_CHANNELS_TAGS &tags) +{ + ImGui::PushItemWidth(Grid::WidthGeneralTag); + const auto tagLabel = "##SpuChannelTag" + std::to_string(channel); + const auto tagHint = "Channel " + std::to_string(channel); + ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), tags[channel], impl::CHANNEL_TAG); + ImGui::PopItemWidth(); +} + +void DrawTableGeneralOn(const Chan::Data& data) +{ + ImGui::BeginDisabled(); + auto bit1 = data.get().value; + ImGui::Checkbox("", &bit1); + ImGui::EndDisabled(); +} + +void DrawTableGeneralOff(const Chan::Data& data) +{ + auto bit2 = data.get().value; + ImGui::BeginDisabled(); + ImGui::Checkbox("", &bit2); + ImGui::EndDisabled(); +} + void DrawTableGeneral( SPU_CHANNELS& channels, size_t channelsCount, @@ -138,30 +169,12 @@ void DrawTableGeneral( const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text("%02i", i); - - ImGui::TableNextColumn(); - ImGui::PushItemWidth(Grid::WidthGeneralTag); - const auto tagLabel = "##SpuChannelTag" + std::to_string(i); - const auto tagHint = "Channel " + std::to_string(i); - ImGui::InputTextWithHint(tagLabel.c_str(), tagHint.c_str(), tags[i], impl::CHANNEL_TAG); - ImGui::PopItemWidth(); - - ImGui::TableNextColumn(); - ImGui::BeginDisabled(); - auto bit1 = data.get().value; - ImGui::Checkbox("", &bit1); - ImGui::EndDisabled(); - - ImGui::TableNextColumn(); - auto bit2 = data.get().value; - ImGui::BeginDisabled(); - ImGui::Checkbox("", &bit2); - ImGui::EndDisabled(); - + // @formatter:off + ImGui::TableNextColumn(); DrawTableGeneralIndex(i); + ImGui::TableNextColumn(); DrawTableGeneralTag(i, tags); + ImGui::TableNextColumn(); DrawTableGeneralOn(data); + ImGui::TableNextColumn(); DrawTableGeneralOff(data); + // @formatter:on const auto ch = std::to_string(i); const auto buttonSize = ImVec2(rowHeight, 0); const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); From c9f7b3110bcfc8b14bddbc18cd1d3e0c51b8e935 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 15:24:19 +0200 Subject: [PATCH 38/53] SPU debugger: try address cyclomatic complexity checks (more) --- src/spu/debug.cc | 183 ++++++++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 83 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 34dbd40cd..be55d0dfc 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -146,6 +146,99 @@ void DrawTableGeneralOff(const Chan::Data& data) ImGui::EndDisabled(); } +void DrawTableGeneralMute(SPU_CHANNELS channels, size_t channelsCount, const std::string ch, const ImVec2 buttonSize, const ImVec4 buttonTint, bool& muteThis, bool& soloThis, const ImGuiStyle style) +{ + ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); + std::string muteLabel = "M##SpuMute" + ch; + const auto muteSize = ImVec2( + (Grid::WidthGeneralMute - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); + ImGui::Dummy(muteSize); + ImGui::SameLine(); + if (ImGui::Button(muteLabel.c_str(), buttonSize)) { + muteThis = !muteThis; + if (muteThis) { + soloThis = false; + } + if (ImGui::GetIO().KeyShift) { + std::for_each(channels, channels + channelsCount, [muteThis](SPUCHAN& c) { + c.data.get().value = muteThis; + if (muteThis) { + c.data.get().value = false; + } + }); + } + } + ImGui::PopStyleColor(); +} + +void DrawTableGeneralSolo(SPU_CHANNELS channels, size_t channelsCount, unsigned i, const std::string ch, const ImVec2 buttonSize, const ImVec4 buttonTint, bool& muteThis, bool& soloThis, const ImGuiStyle style) +{ + ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); + std::string soloLabel = "S##SpuSolo" + ch; + const auto soloSize = ImVec2( + (Grid::WidthGeneralSolo - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); + ImGui::Dummy(soloSize); + ImGui::SameLine(); + if (ImGui::Button(soloLabel.c_str(), buttonSize)) { + soloThis = !soloThis; + if (soloThis) { + muteThis = false; + } + for (unsigned j = 0; j < channelsCount; j++) { + if (j == i) { + continue; + } + auto& dataOther = channels[j].data; + auto& muteOther = dataOther.get().value; + auto& soloOther = dataOther.get().value; + if (soloThis) { + // multi/single solo + if (ImGui::GetIO().KeyShift) { + if (soloOther == false) { + muteOther = true; + } + } else { + muteOther = true; + soloOther = false; + } + } else { + // mute this to keep solo ones correct + if (std::ranges::any_of(channels, channels + channelsCount, [](const SPUCHAN& c) { + return c.data.get().value; + })) { + muteThis = true; + } + } + } + + // no more solo channels -> ensure none are muted + if (std::ranges::all_of(channels, [](const SPUCHAN& c) { + return c.data.get().value == false; + })) { + std::for_each(channels, channels + channelsCount, [](SPUCHAN& c) { + c.data.get().value = false; + }); + } + } + ImGui::PopStyleColor(); +} + +void DrawTableGeneralNoise(const Chan::Data& data) +{ + ImGui::Text("%i", data.get().value); +} + +void DrawTableGeneralFMod(const Chan::Data& data) +{ + ImGui::Text("%i", data.get().value); +} + +void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, float padding, unsigned i) +{ + const auto plotSize = ImVec2(Grid::WidthGeneralPlot - padding, 0); + ImGui::PlotHistogram("", plot[i], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); +} + void DrawTableGeneral( SPU_CHANNELS& channels, size_t channelsCount, @@ -183,89 +276,13 @@ void DrawTableGeneral( auto& soloThis = dataThis.get().value; const auto style = ImGui::GetStyle(); - - ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); - std::string muteLabel = "M##SpuMute" + ch; - ImGui::TableNextColumn(); - const auto muteSize = ImVec2( - (Grid::WidthGeneralMute - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); - ImGui::Dummy(muteSize); - ImGui::SameLine(); - if (ImGui::Button(muteLabel.c_str(), buttonSize)) { - muteThis = !muteThis; - if (muteThis) { - soloThis = false; - } - if (ImGui::GetIO().KeyShift) { - std::for_each(channels, channels + channelsCount, [muteThis](SPUCHAN& c) { - c.data.get().value = muteThis; - if (muteThis) { - c.data.get().value = false; - } - }); - } - } - ImGui::PopStyleColor(); - - ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); - std::string soloLabel = "S##SpuSolo" + ch; - ImGui::TableNextColumn(); - const auto soloSize = ImVec2( - (Grid::WidthGeneralSolo - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); - ImGui::Dummy(soloSize); - ImGui::SameLine(); - if (ImGui::Button(soloLabel.c_str(), buttonSize)) { - soloThis = !soloThis; - if (soloThis) { - muteThis = false; - } - for (unsigned j = 0; j < channelsCount; j++) { - if (j == i) { - continue; - } - auto& dataOther = channels[j].data; - auto& muteOther = dataOther.get().value; - auto& soloOther = dataOther.get().value; - if (soloThis) { - // multi/single solo - if (ImGui::GetIO().KeyShift) { - if (soloOther == false) { - muteOther = true; - } - } else { - muteOther = true; - soloOther = false; - } - } else { - // mute this to keep solo ones correct - if (std::ranges::any_of(channels, channels + channelsCount, [](const SPUCHAN& c) { - return c.data.get().value; - })) { - muteThis = true; - } - } - } - - // no more solo channels -> ensure none are muted - if (std::ranges::all_of(channels, [](const SPUCHAN& c) { - return c.data.get().value == false; - })) { - std::for_each(channels, channels + channelsCount, [](SPUCHAN& c) { - c.data.get().value = false; - }); - } - } - ImGui::PopStyleColor(); - - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - - ImGui::TableNextColumn(); - const auto plotSize = ImVec2(Grid::WidthGeneralPlot - padding, 0); - ImGui::PlotHistogram("", plot[i], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); + // @formatter:off + ImGui::TableNextColumn(); DrawTableGeneralMute(channels, channelsCount, ch, buttonSize, buttonTint, muteThis, soloThis, style); + ImGui::TableNextColumn(); DrawTableGeneralSolo(channels, channelsCount, i, ch, buttonSize, buttonTint, muteThis, soloThis, style); + ImGui::TableNextColumn(); DrawTableGeneralNoise(data); + ImGui::TableNextColumn(); DrawTableGeneralFMod(data); + ImGui::TableNextColumn(); DrawTableGeneralPlot(plot, padding, i); + // @formatter:on } ImGui::EndTable(); } From 0c249f41a169b6f849fa6a92b2adcd70fd747788 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 15:38:01 +0200 Subject: [PATCH 39/53] SPU debugger: try address cyclomatic complexity checks (more) --- src/spu/debug.cc | 113 ++++++++++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 51 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index be55d0dfc..e3aa15d23 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -112,6 +112,66 @@ using SPU_CHANNELS = SPUCHAN(&)[impl::MAXCHAN + 1]; using SPU_CHANNELS_TAGS = char (&)[impl::MAXCHAN][impl::CHANNEL_TAG]; using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; + +void HandleChannelMute(SPU_CHANNELS channels, size_t channelsCount, bool& muteThis, bool& soloThis) +{ + muteThis = !muteThis; + if (muteThis) { + soloThis = false; + } + if (ImGui::GetIO().KeyShift) { + std::for_each(channels, channels + channelsCount, [muteThis](SPUCHAN& c) { + c.data.get().value = muteThis; + if (muteThis) { + c.data.get().value = false; + } + }); + } +} + +void HandleChannelSolo(SPU_CHANNELS channels, size_t channelsCount, unsigned i, bool& muteThis, bool& soloThis) +{ + soloThis = !soloThis; + if (soloThis) { + muteThis = false; + } + for (unsigned j = 0; j < channelsCount; j++) { + if (j == i) { + continue; + } + auto& dataOther = channels[j].data; + auto& muteOther = dataOther.get().value; + auto& soloOther = dataOther.get().value; + if (soloThis) { + // multi/single solo + if (ImGui::GetIO().KeyShift) { + if (soloOther == false) { + muteOther = true; + } + } else { + muteOther = true; + soloOther = false; + } + } else { + // mute this to keep solo ones correct + if (std::ranges::any_of(channels, channels + channelsCount, [](const SPUCHAN& c) { + return c.data.get().value; + })) { + muteThis = true; + } + } + } + + // no more solo channels -> ensure none are muted + if (std::ranges::all_of(channels, [](const SPUCHAN& c) { + return c.data.get().value == false; + })) { + std::for_each(channels, channels + channelsCount, [](SPUCHAN& c) { + c.data.get().value = false; + }); + } +} + void DrawTable(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { } @@ -155,18 +215,7 @@ void DrawTableGeneralMute(SPU_CHANNELS channels, size_t channelsCount, const std ImGui::Dummy(muteSize); ImGui::SameLine(); if (ImGui::Button(muteLabel.c_str(), buttonSize)) { - muteThis = !muteThis; - if (muteThis) { - soloThis = false; - } - if (ImGui::GetIO().KeyShift) { - std::for_each(channels, channels + channelsCount, [muteThis](SPUCHAN& c) { - c.data.get().value = muteThis; - if (muteThis) { - c.data.get().value = false; - } - }); - } + HandleChannelMute(channels, channelsCount, muteThis, soloThis); } ImGui::PopStyleColor(); } @@ -180,45 +229,7 @@ void DrawTableGeneralSolo(SPU_CHANNELS channels, size_t channelsCount, unsigned ImGui::Dummy(soloSize); ImGui::SameLine(); if (ImGui::Button(soloLabel.c_str(), buttonSize)) { - soloThis = !soloThis; - if (soloThis) { - muteThis = false; - } - for (unsigned j = 0; j < channelsCount; j++) { - if (j == i) { - continue; - } - auto& dataOther = channels[j].data; - auto& muteOther = dataOther.get().value; - auto& soloOther = dataOther.get().value; - if (soloThis) { - // multi/single solo - if (ImGui::GetIO().KeyShift) { - if (soloOther == false) { - muteOther = true; - } - } else { - muteOther = true; - soloOther = false; - } - } else { - // mute this to keep solo ones correct - if (std::ranges::any_of(channels, channels + channelsCount, [](const SPUCHAN& c) { - return c.data.get().value; - })) { - muteThis = true; - } - } - } - - // no more solo channels -> ensure none are muted - if (std::ranges::all_of(channels, [](const SPUCHAN& c) { - return c.data.get().value == false; - })) { - std::for_each(channels, channels + channelsCount, [](SPUCHAN& c) { - c.data.get().value = false; - }); - } + HandleChannelSolo(channels, channelsCount, i, muteThis, soloThis); } ImGui::PopStyleColor(); } From 2c75cb1b0ecb469d5df6ee3e1ce3f62d67084b79 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 15:52:40 +0200 Subject: [PATCH 40/53] SPU debugger: try address cyclomatic complexity checks (more) --- src/spu/debug.cc | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index e3aa15d23..1029f3d8a 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -129,6 +129,28 @@ void HandleChannelMute(SPU_CHANNELS channels, size_t channelsCount, bool& muteTh } } +void HandleChannelSoloMute(SPU_CHANNELS channels, size_t channelsCount, bool& muteThis, bool& soloThis, bool& muteOther, bool& soloOther) +{ + if (soloThis) { + // multi/single solo + if (ImGui::GetIO().KeyShift) { + if (soloOther == false) { + muteOther = true; + } + } else { + muteOther = true; + soloOther = false; + } + } else { + // mute this to keep solo ones correct + if (std::ranges::any_of(channels, channels + channelsCount, [](const SPUCHAN& c) { + return c.data.get().value; + })) { + muteThis = true; + } + } +} + void HandleChannelSolo(SPU_CHANNELS channels, size_t channelsCount, unsigned i, bool& muteThis, bool& soloThis) { soloThis = !soloThis; @@ -142,24 +164,7 @@ void HandleChannelSolo(SPU_CHANNELS channels, size_t channelsCount, unsigned i, auto& dataOther = channels[j].data; auto& muteOther = dataOther.get().value; auto& soloOther = dataOther.get().value; - if (soloThis) { - // multi/single solo - if (ImGui::GetIO().KeyShift) { - if (soloOther == false) { - muteOther = true; - } - } else { - muteOther = true; - soloOther = false; - } - } else { - // mute this to keep solo ones correct - if (std::ranges::any_of(channels, channels + channelsCount, [](const SPUCHAN& c) { - return c.data.get().value; - })) { - muteThis = true; - } - } + HandleChannelSoloMute(channels, channelsCount, muteThis, soloThis, muteOther, soloOther); } // no more solo channels -> ensure none are muted From bb49d80966659bd68a246542cfc2931a05e5d0c3 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 16:54:44 +0200 Subject: [PATCH 41/53] SPU debugger: try address cyclomatic complexity checks (more) --- src/spu/debug.cc | 92 ++++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 1029f3d8a..4a069f5eb 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -110,11 +110,12 @@ struct Grid { using namespace PCSX::SPU; using SPU_CHANNELS = SPUCHAN(&)[impl::MAXCHAN + 1]; +constexpr auto SPU_CHANNELS_SIZE = impl::MAXCHAN; using SPU_CHANNELS_TAGS = char (&)[impl::MAXCHAN][impl::CHANNEL_TAG]; using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; -void HandleChannelMute(SPU_CHANNELS channels, size_t channelsCount, bool& muteThis, bool& soloThis) -{ +void HandleChannelMute( + SPU_CHANNELS& channels, const unsigned channelsCount, bool& muteThis, bool& soloThis) { muteThis = !muteThis; if (muteThis) { soloThis = false; @@ -129,8 +130,8 @@ void HandleChannelMute(SPU_CHANNELS channels, size_t channelsCount, bool& muteTh } } -void HandleChannelSoloMute(SPU_CHANNELS channels, size_t channelsCount, bool& muteThis, bool& soloThis, bool& muteOther, bool& soloOther) -{ +void HandleChannelSoloMute( + SPU_CHANNELS& channels, const unsigned channelsCount, bool& muteThis, bool& soloThis, bool& muteOther, bool& soloOther) { if (soloThis) { // multi/single solo if (ImGui::GetIO().KeyShift) { @@ -151,8 +152,8 @@ void HandleChannelSoloMute(SPU_CHANNELS channels, size_t channelsCount, bool& mu } } -void HandleChannelSolo(SPU_CHANNELS channels, size_t channelsCount, unsigned i, bool& muteThis, bool& soloThis) -{ +void HandleChannelSolo( + SPU_CHANNELS& channels, const unsigned channelsCount, unsigned i, bool& muteThis, bool& soloThis) { soloThis = !soloThis; if (soloThis) { muteThis = false; @@ -211,32 +212,51 @@ void DrawTableGeneralOff(const Chan::Data& data) ImGui::EndDisabled(); } -void DrawTableGeneralMute(SPU_CHANNELS channels, size_t channelsCount, const std::string ch, const ImVec2 buttonSize, const ImVec4 buttonTint, bool& muteThis, bool& soloThis, const ImGuiStyle style) -{ - ImGui::PushStyleColor(ImGuiCol_Button, muteThis ? ImVec4(0.6f, 0.0f, 0.0f, 1.0f) : buttonTint); - std::string muteLabel = "M##SpuMute" + ch; - const auto muteSize = ImVec2( - (Grid::WidthGeneralMute - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); - ImGui::Dummy(muteSize); +ImVec4 GetMuteSoloButtonTint(const bool down, const ImVec4& downTint) { + return down ? downTint : ImGui::GetStyleColorVec4(ImGuiCol_Button); +} + +bool& GetChannelMute(SPU_CHANNELS& channels, const unsigned channelIndex) { + return channels[channelIndex].data.get().value; +} + +bool& GetChannelSolo(SPU_CHANNELS& channels, const unsigned channelIndex) { + return channels[channelIndex].data.get().value; +} + +struct MSButton { + const char* Text; + const ImVec4 Tint; + const float Size; +}; + +bool DrawMuteSoloButton(const unsigned channel, const MSButton& button, const bool& active) { + const auto size = ImVec2(ImGui::GetFrameHeightWithSpacing(), 0); + const auto temp = ImVec2((button.Size - size.x) * 0.5f - ImGui::GetStyle().FramePadding.x * 2.0f, 0); + ImGui::Dummy(temp); ImGui::SameLine(); - if (ImGui::Button(muteLabel.c_str(), buttonSize)) { - HandleChannelMute(channels, channelsCount, muteThis, soloThis); - } + const auto tint = GetMuteSoloButtonTint(active, button.Tint); + ImGui::PushStyleColor(ImGuiCol_Button, tint); + const auto text = button.Text + std::to_string(channel); + const auto pressed = ImGui::Button(text.c_str(), size); ImGui::PopStyleColor(); + return pressed; } -void DrawTableGeneralSolo(SPU_CHANNELS channels, size_t channelsCount, unsigned i, const std::string ch, const ImVec2 buttonSize, const ImVec4 buttonTint, bool& muteThis, bool& soloThis, const ImGuiStyle style) -{ - ImGui::PushStyleColor(ImGuiCol_Button, soloThis ? ImVec4(0.0f, 0.6f, 0.0f, 1.0f) : buttonTint); - std::string soloLabel = "S##SpuSolo" + ch; - const auto soloSize = ImVec2( - (Grid::WidthGeneralSolo - buttonSize.x) * 0.5f - style.FramePadding.x * 2.0f, 0); - ImGui::Dummy(soloSize); - ImGui::SameLine(); - if (ImGui::Button(soloLabel.c_str(), buttonSize)) { - HandleChannelSolo(channels, channelsCount, i, muteThis, soloThis); +void DrawTableGeneralMute(SPU_CHANNELS channels, const unsigned channel, const MSButton& button) { + auto& mute = GetChannelMute(channels, channel); + auto& solo = GetChannelSolo(channels, channel); + if (DrawMuteSoloButton(channel, button, mute)) { + HandleChannelMute(channels, SPU_CHANNELS_SIZE, mute, solo); + } +} + +void DrawTableGeneralSolo(SPU_CHANNELS channels, const unsigned channel, const MSButton& button) { + auto& mute = GetChannelMute(channels, channel); + auto& solo = GetChannelSolo(channels, channel); + if (DrawMuteSoloButton(channel, button, solo)) { + HandleChannelSolo(channels, SPU_CHANNELS_SIZE, channel, mute, solo); } - ImGui::PopStyleColor(); } void DrawTableGeneralNoise(const Chan::Data& data) @@ -278,23 +298,17 @@ void DrawTableGeneral( const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); + + constexpr auto mute = MSButton{"M##SpuMute", ImVec4(0.6f, 0.0f, 0.0f, 1.0f), Grid::WidthGeneralMute}; + constexpr auto solo = MSButton{"S##SpuSolo", ImVec4(0.0f, 0.6f, 0.0f, 1.0f), Grid::WidthGeneralSolo}; + // @formatter:off ImGui::TableNextColumn(); DrawTableGeneralIndex(i); ImGui::TableNextColumn(); DrawTableGeneralTag(i, tags); ImGui::TableNextColumn(); DrawTableGeneralOn(data); ImGui::TableNextColumn(); DrawTableGeneralOff(data); - // @formatter:on - const auto ch = std::to_string(i); - const auto buttonSize = ImVec2(rowHeight, 0); - const auto buttonTint = ImGui::GetStyleColorVec4(ImGuiCol_Button); - auto& dataThis = channels[i].data; - auto& muteThis = dataThis.get().value; - auto& soloThis = dataThis.get().value; - - const auto style = ImGui::GetStyle(); - // @formatter:off - ImGui::TableNextColumn(); DrawTableGeneralMute(channels, channelsCount, ch, buttonSize, buttonTint, muteThis, soloThis, style); - ImGui::TableNextColumn(); DrawTableGeneralSolo(channels, channelsCount, i, ch, buttonSize, buttonTint, muteThis, soloThis, style); + ImGui::TableNextColumn(); DrawTableGeneralMute(channels, i, mute); + ImGui::TableNextColumn(); DrawTableGeneralSolo(channels, i, solo); ImGui::TableNextColumn(); DrawTableGeneralNoise(data); ImGui::TableNextColumn(); DrawTableGeneralFMod(data); ImGui::TableNextColumn(); DrawTableGeneralPlot(plot, padding, i); From 2feeeb6b78bde6b33c6d472bfc0cc921301adc2e Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 19:26:47 +0200 Subject: [PATCH 42/53] SPU debugger: run code cleanup --- src/spu/debug.cc | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 4a069f5eb..f2b75c764 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -181,14 +181,12 @@ void HandleChannelSolo( void DrawTable(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { } -void DrawTableGeneralIndex(const unsigned channel) -{ +void DrawTableGeneralIndex(const unsigned channel) { ImGui::AlignTextToFramePadding(); ImGui::Text("%02i", channel); } -void DrawTableGeneralTag(const unsigned channel, SPU_CHANNELS_TAGS &tags) -{ +void DrawTableGeneralTag(const unsigned channel, SPU_CHANNELS_TAGS& tags) { ImGui::PushItemWidth(Grid::WidthGeneralTag); const auto tagLabel = "##SpuChannelTag" + std::to_string(channel); const auto tagHint = "Channel " + std::to_string(channel); @@ -196,16 +194,14 @@ void DrawTableGeneralTag(const unsigned channel, SPU_CHANNELS_TAGS &tags) ImGui::PopItemWidth(); } -void DrawTableGeneralOn(const Chan::Data& data) -{ +void DrawTableGeneralOn(const Chan::Data& data) { ImGui::BeginDisabled(); auto bit1 = data.get().value; ImGui::Checkbox("", &bit1); ImGui::EndDisabled(); } -void DrawTableGeneralOff(const Chan::Data& data) -{ +void DrawTableGeneralOff(const Chan::Data& data) { auto bit2 = data.get().value; ImGui::BeginDisabled(); ImGui::Checkbox("", &bit2); @@ -259,18 +255,15 @@ void DrawTableGeneralSolo(SPU_CHANNELS channels, const unsigned channel, const M } } -void DrawTableGeneralNoise(const Chan::Data& data) -{ +void DrawTableGeneralNoise(const Chan::Data& data) { ImGui::Text("%i", data.get().value); } -void DrawTableGeneralFMod(const Chan::Data& data) -{ +void DrawTableGeneralFMod(const Chan::Data& data) { ImGui::Text("%i", data.get().value); } -void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, float padding, unsigned i) -{ +void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, float padding, unsigned i) { const auto plotSize = ImVec2(Grid::WidthGeneralPlot - padding, 0); ImGui::PlotHistogram("", plot[i], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); } @@ -462,7 +455,7 @@ void DrawTableReverb(SPU_CHANNELS& channels, size_t channelsCount, const float r } } -void PCSX::SPU::impl::debug() { +void impl::debug() { auto delta = std::chrono::steady_clock::now() - m_lastUpdated; using namespace std::chrono_literals; while (delta >= 50ms) { @@ -472,7 +465,7 @@ void PCSX::SPU::impl::debug() { if (!s_chan[ch].data.get().value) { m_channelDebugTypes[ch][m_currentDebugSample] = EMPTY; m_channelDebugData[ch][m_currentDebugSample] = 0.0f; - }; + } if (s_chan[ch].data.get().value) { m_channelDebugTypes[ch][m_currentDebugSample] = IRQ; m_channelDebugData[ch][m_currentDebugSample] = 0.0f; @@ -493,7 +486,7 @@ void PCSX::SPU::impl::debug() { } m_channelDebugData[ch][m_currentDebugSample] = - fabsf((float)s_chan[ch].data.get().value / 32768.0f); + fabsf(static_cast(s_chan[ch].data.get().value) / 32768.0f); } if (++m_currentDebugSample == DEBUG_SAMPLES) m_currentDebugSample = 0; } From 94f865560e360984034d524ef44ae61a83293f5f Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 19:33:52 +0200 Subject: [PATCH 43/53] SPU debugger: DRY channel count --- src/spu/debug.cc | 69 ++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index f2b75c764..20897d00b 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -115,13 +115,13 @@ using SPU_CHANNELS_TAGS = char (&)[impl::MAXCHAN][impl::CHANNEL_TAG]; using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; void HandleChannelMute( - SPU_CHANNELS& channels, const unsigned channelsCount, bool& muteThis, bool& soloThis) { + SPU_CHANNELS& channels, bool& muteThis, bool& soloThis) { muteThis = !muteThis; if (muteThis) { soloThis = false; } if (ImGui::GetIO().KeyShift) { - std::for_each(channels, channels + channelsCount, [muteThis](SPUCHAN& c) { + std::for_each(channels, channels + SPU_CHANNELS_SIZE, [muteThis](SPUCHAN& c) { c.data.get().value = muteThis; if (muteThis) { c.data.get().value = false; @@ -131,7 +131,7 @@ void HandleChannelMute( } void HandleChannelSoloMute( - SPU_CHANNELS& channels, const unsigned channelsCount, bool& muteThis, bool& soloThis, bool& muteOther, bool& soloOther) { + SPU_CHANNELS& channels, bool& muteThis, bool& soloThis, bool& muteOther, bool& soloOther) { if (soloThis) { // multi/single solo if (ImGui::GetIO().KeyShift) { @@ -144,7 +144,7 @@ void HandleChannelSoloMute( } } else { // mute this to keep solo ones correct - if (std::ranges::any_of(channels, channels + channelsCount, [](const SPUCHAN& c) { + if (std::ranges::any_of(channels, channels + SPU_CHANNELS_SIZE, [](const SPUCHAN& c) { return c.data.get().value; })) { muteThis = true; @@ -153,32 +153,32 @@ void HandleChannelSoloMute( } void HandleChannelSolo( - SPU_CHANNELS& channels, const unsigned channelsCount, unsigned i, bool& muteThis, bool& soloThis) { + SPU_CHANNELS& channels, unsigned i, bool& muteThis, bool& soloThis) { soloThis = !soloThis; if (soloThis) { muteThis = false; } - for (unsigned j = 0; j < channelsCount; j++) { + for (unsigned j = 0; j < SPU_CHANNELS_SIZE; j++) { if (j == i) { continue; } auto& dataOther = channels[j].data; auto& muteOther = dataOther.get().value; auto& soloOther = dataOther.get().value; - HandleChannelSoloMute(channels, channelsCount, muteThis, soloThis, muteOther, soloOther); + HandleChannelSoloMute(channels, muteThis, soloThis, muteOther, soloOther); } // no more solo channels -> ensure none are muted if (std::ranges::all_of(channels, [](const SPUCHAN& c) { return c.data.get().value == false; })) { - std::for_each(channels, channels + channelsCount, [](SPUCHAN& c) { + std::for_each(channels, channels + SPU_CHANNELS_SIZE, [](SPUCHAN& c) { c.data.get().value = false; }); } } -void DrawTable(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { +void DrawTable(SPU_CHANNELS& channels, size_t SPU_CHANNELS_SIZE, const float rowHeight) { } void DrawTableGeneralIndex(const unsigned channel) { @@ -243,7 +243,7 @@ void DrawTableGeneralMute(SPU_CHANNELS channels, const unsigned channel, const M auto& mute = GetChannelMute(channels, channel); auto& solo = GetChannelSolo(channels, channel); if (DrawMuteSoloButton(channel, button, mute)) { - HandleChannelMute(channels, SPU_CHANNELS_SIZE, mute, solo); + HandleChannelMute(channels, mute, solo); } } @@ -251,7 +251,7 @@ void DrawTableGeneralSolo(SPU_CHANNELS channels, const unsigned channel, const M auto& mute = GetChannelMute(channels, channel); auto& solo = GetChannelSolo(channels, channel); if (DrawMuteSoloButton(channel, button, solo)) { - HandleChannelSolo(channels, SPU_CHANNELS_SIZE, channel, mute, solo); + HandleChannelSolo(channels, channel, mute, solo); } } @@ -270,7 +270,6 @@ void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, float padding, unsigned i) { void DrawTableGeneral( SPU_CHANNELS& channels, - size_t channelsCount, const float rowHeight, SPU_CHANNELS_TAGS& tags, SPU_CHANNELS_PLOT& plot, @@ -287,7 +286,7 @@ void DrawTableGeneral( ImGui::TableSetupColumn("Plot", Grid::FlagsColumn, Grid::WidthGeneralPlot); ImGui::TableHeadersRow(); - for (auto i = 0u; i < channelsCount; ++i) { + for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); @@ -311,12 +310,12 @@ void DrawTableGeneral( } } -void DrawTableFrequency(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { +void DrawTableFrequency(SPU_CHANNELS& channels, const float rowHeight) { if (ImGui::BeginTable("TableFrequency", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthFrequencyActive); ImGui::TableSetupColumn("Used", Grid::FlagsColumn, Grid::WidthFrequencyUsed); ImGui::TableHeadersRow(); - for (auto i = 0u; i < channelsCount; ++i) { + for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); ImGui::TableNextColumn(); @@ -329,13 +328,13 @@ void DrawTableFrequency(SPU_CHANNELS& channels, size_t channelsCount, const floa } } -void DrawTablePosition(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight, const uint8_t* spuMemC) { +void DrawTablePosition(SPU_CHANNELS& channels, const float rowHeight, const uint8_t* spuMemC) { if (ImGui::BeginTable("TablePosition", 3, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Start", Grid::FlagsColumn, Grid::WidthPositionStart); ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthPositionCurrent); ImGui::TableSetupColumn("Loop", Grid::FlagsColumn, Grid::WidthPositionLoop); ImGui::TableHeadersRow(); - for (auto i = 0u; i < channelsCount; ++i) { + for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& chan = channels[i]; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); ImGui::TableNextColumn(); @@ -350,12 +349,12 @@ void DrawTablePosition(SPU_CHANNELS& channels, size_t channelsCount, const float } } -void DrawTableVolume(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { +void DrawTableVolume(SPU_CHANNELS& channels, const float rowHeight) { if (ImGui::BeginTable("TableVolume", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("L", Grid::FlagsColumn, Grid::WidthVolumeL); ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthVolumeR); ImGui::TableHeadersRow(); - for (auto i = 0u; i < channelsCount; ++i) { + for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); ImGui::TableNextColumn(); @@ -368,14 +367,14 @@ void DrawTableVolume(SPU_CHANNELS& channels, size_t channelsCount, const float r } } -void DrawTableAdsr(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { +void DrawTableAdsr(SPU_CHANNELS& channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsr", 4, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("A", Grid::FlagsColumn, Grid::WidthAdsrA); ImGui::TableSetupColumn("D", Grid::FlagsColumn, Grid::WidthAdsrD); ImGui::TableSetupColumn("S", Grid::FlagsColumn, Grid::WidthAdsrS); ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthAdsrR); ImGui::TableHeadersRow(); - for (auto i = 0u; i < channelsCount; ++i) { + for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].ADSRX; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); ImGui::TableNextColumn(); @@ -392,12 +391,12 @@ void DrawTableAdsr(SPU_CHANNELS& channels, size_t channelsCount, const float row } } -void DrawTableAdsrSustain(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { +void DrawTableAdsrSustain(SPU_CHANNELS& channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsrSustain", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Level", Grid::FlagsColumn, Grid::WidthAdsrSustainLevel); ImGui::TableSetupColumn("Increase", Grid::FlagsColumn, Grid::WidthAdsrSustainIncrease); ImGui::TableHeadersRow(); - for (auto i = 0u; i < channelsCount; ++i) { + for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].ADSRX; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); ImGui::TableNextColumn(); @@ -410,12 +409,12 @@ void DrawTableAdsrSustain(SPU_CHANNELS& channels, size_t channelsCount, const fl } } -void DrawTableAdsrVolume(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { +void DrawTableAdsrVolume(SPU_CHANNELS& channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsrVolume", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthAdsrVolumeCurrent); ImGui::TableSetupColumn("Envelope", Grid::FlagsColumn, Grid::WidthAdsrVolumeEnvelope); ImGui::TableHeadersRow(); - for (auto i = 0u; i < channelsCount; ++i) { + for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].ADSRX; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); ImGui::TableNextColumn(); @@ -428,7 +427,7 @@ void DrawTableAdsrVolume(SPU_CHANNELS& channels, size_t channelsCount, const flo } } -void DrawTableReverb(SPU_CHANNELS& channels, size_t channelsCount, const float rowHeight) { +void DrawTableReverb(SPU_CHANNELS& channels, const float rowHeight) { if (ImGui::BeginTable("TableReverb", 5, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Allowed", Grid::FlagsColumn, Grid::WidthReverbAllowed); ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthReverbActive); @@ -436,7 +435,7 @@ void DrawTableReverb(SPU_CHANNELS& channels, size_t channelsCount, const float r ImGui::TableSetupColumn("Offset", Grid::FlagsColumn, Grid::WidthReverbOffset); ImGui::TableSetupColumn("Repeat", Grid::FlagsColumn, Grid::WidthReverbRepeat); ImGui::TableHeadersRow(); - for (auto i = 0u; i < channelsCount; ++i) { + for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); ImGui::TableNextColumn(); @@ -559,28 +558,28 @@ void impl::debug() { ImGui::TableHeadersRow(); ImGui::TableNextColumn(); - DrawTableGeneral(s_chan, MAXCHAN, rowHeight, m_channelTag, m_channelDebugData, pad); + DrawTableGeneral(s_chan, rowHeight, m_channelTag, m_channelDebugData, pad); ImGui::TableNextColumn(); - DrawTableFrequency(s_chan, MAXCHAN, rowHeight); + DrawTableFrequency(s_chan, rowHeight); ImGui::TableNextColumn(); - DrawTablePosition(s_chan, MAXCHAN, rowHeight, spuMemC); + DrawTablePosition(s_chan, rowHeight, spuMemC); ImGui::TableNextColumn(); - DrawTableVolume(s_chan, MAXCHAN, rowHeight); + DrawTableVolume(s_chan, rowHeight); ImGui::TableNextColumn(); - DrawTableAdsr(s_chan, MAXCHAN, rowHeight); + DrawTableAdsr(s_chan, rowHeight); ImGui::TableNextColumn(); - DrawTableAdsrSustain(s_chan, MAXCHAN, rowHeight); + DrawTableAdsrSustain(s_chan, rowHeight); ImGui::TableNextColumn(); - DrawTableAdsrVolume(s_chan, MAXCHAN, rowHeight); + DrawTableAdsrVolume(s_chan, rowHeight); ImGui::TableNextColumn(); - DrawTableReverb(s_chan, MAXCHAN, rowHeight); + DrawTableReverb(s_chan, rowHeight); ImGui::EndTable(); } } From 2d877f66ac6cc3d5c11d43c440f42f3f79bede22 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 19:34:50 +0200 Subject: [PATCH 44/53] SPU debugger: SPU_CHANNELS is already a reference --- src/spu/debug.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 20897d00b..3036dca97 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -115,7 +115,7 @@ using SPU_CHANNELS_TAGS = char (&)[impl::MAXCHAN][impl::CHANNEL_TAG]; using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; void HandleChannelMute( - SPU_CHANNELS& channels, bool& muteThis, bool& soloThis) { + SPU_CHANNELS channels, bool& muteThis, bool& soloThis) { muteThis = !muteThis; if (muteThis) { soloThis = false; @@ -131,7 +131,7 @@ void HandleChannelMute( } void HandleChannelSoloMute( - SPU_CHANNELS& channels, bool& muteThis, bool& soloThis, bool& muteOther, bool& soloOther) { + SPU_CHANNELS channels, bool& muteThis, bool& soloThis, bool& muteOther, bool& soloOther) { if (soloThis) { // multi/single solo if (ImGui::GetIO().KeyShift) { @@ -153,7 +153,7 @@ void HandleChannelSoloMute( } void HandleChannelSolo( - SPU_CHANNELS& channels, unsigned i, bool& muteThis, bool& soloThis) { + SPU_CHANNELS channels, unsigned i, bool& muteThis, bool& soloThis) { soloThis = !soloThis; if (soloThis) { muteThis = false; @@ -178,7 +178,7 @@ void HandleChannelSolo( } } -void DrawTable(SPU_CHANNELS& channels, size_t SPU_CHANNELS_SIZE, const float rowHeight) { +void DrawTable(SPU_CHANNELS channels, size_t SPU_CHANNELS_SIZE, const float rowHeight) { } void DrawTableGeneralIndex(const unsigned channel) { @@ -212,11 +212,11 @@ ImVec4 GetMuteSoloButtonTint(const bool down, const ImVec4& downTint) { return down ? downTint : ImGui::GetStyleColorVec4(ImGuiCol_Button); } -bool& GetChannelMute(SPU_CHANNELS& channels, const unsigned channelIndex) { +bool& GetChannelMute(SPU_CHANNELS channels, const unsigned channelIndex) { return channels[channelIndex].data.get().value; } -bool& GetChannelSolo(SPU_CHANNELS& channels, const unsigned channelIndex) { +bool& GetChannelSolo(SPU_CHANNELS channels, const unsigned channelIndex) { return channels[channelIndex].data.get().value; } @@ -269,10 +269,10 @@ void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, float padding, unsigned i) { } void DrawTableGeneral( - SPU_CHANNELS& channels, + SPU_CHANNELS channels, const float rowHeight, - SPU_CHANNELS_TAGS& tags, - SPU_CHANNELS_PLOT& plot, + SPU_CHANNELS_TAGS tags, + SPU_CHANNELS_PLOT plot, float padding) { if (ImGui::BeginTable("TableGeneral", 9, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("#", Grid::FlagsColumn, Grid::WidthGeneralIndex); @@ -310,7 +310,7 @@ void DrawTableGeneral( } } -void DrawTableFrequency(SPU_CHANNELS& channels, const float rowHeight) { +void DrawTableFrequency(SPU_CHANNELS channels, const float rowHeight) { if (ImGui::BeginTable("TableFrequency", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthFrequencyActive); ImGui::TableSetupColumn("Used", Grid::FlagsColumn, Grid::WidthFrequencyUsed); @@ -328,7 +328,7 @@ void DrawTableFrequency(SPU_CHANNELS& channels, const float rowHeight) { } } -void DrawTablePosition(SPU_CHANNELS& channels, const float rowHeight, const uint8_t* spuMemC) { +void DrawTablePosition(SPU_CHANNELS channels, const float rowHeight, const uint8_t* spuMemC) { if (ImGui::BeginTable("TablePosition", 3, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Start", Grid::FlagsColumn, Grid::WidthPositionStart); ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthPositionCurrent); @@ -349,7 +349,7 @@ void DrawTablePosition(SPU_CHANNELS& channels, const float rowHeight, const uint } } -void DrawTableVolume(SPU_CHANNELS& channels, const float rowHeight) { +void DrawTableVolume(SPU_CHANNELS channels, const float rowHeight) { if (ImGui::BeginTable("TableVolume", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("L", Grid::FlagsColumn, Grid::WidthVolumeL); ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthVolumeR); @@ -367,7 +367,7 @@ void DrawTableVolume(SPU_CHANNELS& channels, const float rowHeight) { } } -void DrawTableAdsr(SPU_CHANNELS& channels, const float rowHeight) { +void DrawTableAdsr(SPU_CHANNELS channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsr", 4, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("A", Grid::FlagsColumn, Grid::WidthAdsrA); ImGui::TableSetupColumn("D", Grid::FlagsColumn, Grid::WidthAdsrD); @@ -391,7 +391,7 @@ void DrawTableAdsr(SPU_CHANNELS& channels, const float rowHeight) { } } -void DrawTableAdsrSustain(SPU_CHANNELS& channels, const float rowHeight) { +void DrawTableAdsrSustain(SPU_CHANNELS channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsrSustain", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Level", Grid::FlagsColumn, Grid::WidthAdsrSustainLevel); ImGui::TableSetupColumn("Increase", Grid::FlagsColumn, Grid::WidthAdsrSustainIncrease); @@ -409,7 +409,7 @@ void DrawTableAdsrSustain(SPU_CHANNELS& channels, const float rowHeight) { } } -void DrawTableAdsrVolume(SPU_CHANNELS& channels, const float rowHeight) { +void DrawTableAdsrVolume(SPU_CHANNELS channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsrVolume", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthAdsrVolumeCurrent); ImGui::TableSetupColumn("Envelope", Grid::FlagsColumn, Grid::WidthAdsrVolumeEnvelope); @@ -427,7 +427,7 @@ void DrawTableAdsrVolume(SPU_CHANNELS& channels, const float rowHeight) { } } -void DrawTableReverb(SPU_CHANNELS& channels, const float rowHeight) { +void DrawTableReverb(SPU_CHANNELS channels, const float rowHeight) { if (ImGui::BeginTable("TableReverb", 5, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Allowed", Grid::FlagsColumn, Grid::WidthReverbAllowed); ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthReverbActive); From 6ba21c64a928ea0666c21f4336ffc0293b6937cd Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 19:55:23 +0200 Subject: [PATCH 45/53] SPU debugger: DRY GetChannel* --- src/spu/debug.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 3036dca97..60be9ed62 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -114,6 +114,19 @@ constexpr auto SPU_CHANNELS_SIZE = impl::MAXCHAN; using SPU_CHANNELS_TAGS = char (&)[impl::MAXCHAN][impl::CHANNEL_TAG]; using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; +template +T& GetChannelData(SPU_CHANNELS channels, const unsigned channel) { + return channels[channel].data.get(); +} + +bool& GetChannelMute(SPU_CHANNELS channels, const unsigned channel) { + return GetChannelData(channels, channel).value; +} + +bool& GetChannelSolo(SPU_CHANNELS channels, const unsigned channel) { + return GetChannelData(channels, channel).value; +} + void HandleChannelMute( SPU_CHANNELS channels, bool& muteThis, bool& soloThis) { muteThis = !muteThis; @@ -212,14 +225,6 @@ ImVec4 GetMuteSoloButtonTint(const bool down, const ImVec4& downTint) { return down ? downTint : ImGui::GetStyleColorVec4(ImGuiCol_Button); } -bool& GetChannelMute(SPU_CHANNELS channels, const unsigned channelIndex) { - return channels[channelIndex].data.get().value; -} - -bool& GetChannelSolo(SPU_CHANNELS channels, const unsigned channelIndex) { - return channels[channelIndex].data.get().value; -} - struct MSButton { const char* Text; const ImVec4 Tint; From 81880f65afc9a1b96a8536516027ef8ffdf03284 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 19:55:51 +0200 Subject: [PATCH 46/53] SPU debugger: make HandleChannelSoloMute < 4 params --- src/spu/debug.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 60be9ed62..11f06bc0a 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -144,8 +144,12 @@ void HandleChannelMute( } void HandleChannelSoloMute( - SPU_CHANNELS channels, bool& muteThis, bool& soloThis, bool& muteOther, bool& soloOther) { - if (soloThis) { + SPU_CHANNELS channels, const unsigned channel1, const unsigned channel2) { + + auto &muteOther = GetChannelMute(channels, channel2); + auto &soloOther = GetChannelSolo(channels, channel2); + + if (GetChannelSolo(channels, channel1)) { // multi/single solo if (ImGui::GetIO().KeyShift) { if (soloOther == false) { @@ -160,7 +164,7 @@ void HandleChannelSoloMute( if (std::ranges::any_of(channels, channels + SPU_CHANNELS_SIZE, [](const SPUCHAN& c) { return c.data.get().value; })) { - muteThis = true; + GetChannelMute(channels, channel1) = true; } } } @@ -178,7 +182,7 @@ void HandleChannelSolo( auto& dataOther = channels[j].data; auto& muteOther = dataOther.get().value; auto& soloOther = dataOther.get().value; - HandleChannelSoloMute(channels, muteThis, soloThis, muteOther, soloOther); + HandleChannelSoloMute(channels, muteThis, soloThis); } // no more solo channels -> ensure none are muted From 225595097a2f1b0e6a406b02a93c736de64848cc Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 20:05:51 +0200 Subject: [PATCH 47/53] SPU debugger: make DrawTableGeneral = 4 params --- src/spu/debug.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 11f06bc0a..6990ef1c8 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -114,6 +114,9 @@ constexpr auto SPU_CHANNELS_SIZE = impl::MAXCHAN; using SPU_CHANNELS_TAGS = char (&)[impl::MAXCHAN][impl::CHANNEL_TAG]; using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; +constexpr auto TableColumnFix = 2; // fixes ImGui possibly screwing last column width +constexpr auto TablePadding = 18; // inner padding to make it look neat + template T& GetChannelData(SPU_CHANNELS channels, const unsigned channel) { return channels[channel].data.get(); @@ -272,8 +275,8 @@ void DrawTableGeneralFMod(const Chan::Data& data) { ImGui::Text("%i", data.get().value); } -void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, float padding, unsigned i) { - const auto plotSize = ImVec2(Grid::WidthGeneralPlot - padding, 0); +void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, unsigned i) { + constexpr auto plotSize = ImVec2(Grid::WidthGeneralPlot - TablePadding, 0); ImGui::PlotHistogram("", plot[i], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); } @@ -281,8 +284,7 @@ void DrawTableGeneral( SPU_CHANNELS channels, const float rowHeight, SPU_CHANNELS_TAGS tags, - SPU_CHANNELS_PLOT plot, - float padding) { + SPU_CHANNELS_PLOT plot) { if (ImGui::BeginTable("TableGeneral", 9, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("#", Grid::FlagsColumn, Grid::WidthGeneralIndex); ImGui::TableSetupColumn("Tag", Grid::FlagsColumn, Grid::WidthGeneralTag); @@ -312,7 +314,7 @@ void DrawTableGeneral( ImGui::TableNextColumn(); DrawTableGeneralSolo(channels, i, solo); ImGui::TableNextColumn(); DrawTableGeneralNoise(data); ImGui::TableNextColumn(); DrawTableGeneralFMod(data); - ImGui::TableNextColumn(); DrawTableGeneralPlot(plot, padding, i); + ImGui::TableNextColumn(); DrawTableGeneralPlot(plot, i); // @formatter:on } ImGui::EndTable(); @@ -554,20 +556,18 @@ void impl::debug() { // BUG ImGui hides last column border when scrolling (off by 1px) if (ImGui::BeginTable("SpuChannels", 8, Grid::FlagsTableOuter, ImVec2(0, tableHeight))) { - constexpr auto fix = 2; // BUG ImGui may screw up last column width - constexpr auto pad = 18; - ImGui::TableSetupColumn("General", Grid::FlagsColumn, Grid::WidthGeneral + pad * fix); - ImGui::TableSetupColumn("Frequency", Grid::FlagsColumn, Grid::WidthFrequency + pad); - ImGui::TableSetupColumn("Position", Grid::FlagsColumn, Grid::WidthPosition + pad); - ImGui::TableSetupColumn("Volume", Grid::FlagsColumn, Grid::WidthVolume + pad); - ImGui::TableSetupColumn("ADSR", Grid::FlagsColumn, Grid::WidthAdsr + pad * fix); - ImGui::TableSetupColumn("ADSR Sustain", Grid::FlagsColumn, Grid::WidthAdsrSustain + pad); - ImGui::TableSetupColumn("ADSR Volume", Grid::FlagsColumn, Grid::WidthAdsrVolume + pad); - ImGui::TableSetupColumn("Reverb", Grid::FlagsColumn, Grid::WidthReverb + pad * fix); + ImGui::TableSetupColumn("General", Grid::FlagsColumn, Grid::WidthGeneral + TablePadding * TableColumnFix); + ImGui::TableSetupColumn("Frequency", Grid::FlagsColumn, Grid::WidthFrequency + TablePadding); + ImGui::TableSetupColumn("Position", Grid::FlagsColumn, Grid::WidthPosition + TablePadding); + ImGui::TableSetupColumn("Volume", Grid::FlagsColumn, Grid::WidthVolume + TablePadding); + ImGui::TableSetupColumn("ADSR", Grid::FlagsColumn, Grid::WidthAdsr + TablePadding * TableColumnFix); + ImGui::TableSetupColumn("ADSR Sustain", Grid::FlagsColumn, Grid::WidthAdsrSustain + TablePadding); + ImGui::TableSetupColumn("ADSR Volume", Grid::FlagsColumn, Grid::WidthAdsrVolume + TablePadding); + ImGui::TableSetupColumn("Reverb", Grid::FlagsColumn, Grid::WidthReverb + TablePadding * TableColumnFix); ImGui::TableHeadersRow(); ImGui::TableNextColumn(); - DrawTableGeneral(s_chan, rowHeight, m_channelTag, m_channelDebugData, pad); + DrawTableGeneral(s_chan, rowHeight, m_channelTag, m_channelDebugData); ImGui::TableNextColumn(); DrawTableFrequency(s_chan, rowHeight); From 3e4d64f0829fc17dc6b2206d136c94ed3aac30cc Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 20:54:20 +0200 Subject: [PATCH 48/53] SPU debugger: fix casts/formatting/names --- src/spu/debug.cc | 184 ++++++++++++++++++++--------------------------- 1 file changed, 78 insertions(+), 106 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 6990ef1c8..58fa2e2bd 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -108,30 +108,29 @@ struct Grid { }; using namespace PCSX::SPU; -using SPU_CHANNELS = SPUCHAN(&)[impl::MAXCHAN + 1]; - constexpr auto SPU_CHANNELS_SIZE = impl::MAXCHAN; -using SPU_CHANNELS_TAGS = char (&)[impl::MAXCHAN][impl::CHANNEL_TAG]; -using SPU_CHANNELS_PLOT = float (&)[impl::MAXCHAN][impl::DEBUG_SAMPLES]; +using SPU_CHANNELS_INFO = SPUCHAN(&)[SPU_CHANNELS_SIZE + 1]; +using SPU_CHANNELS_TAGS = char (&)[SPU_CHANNELS_SIZE][impl::CHANNEL_TAG]; +using SPU_CHANNELS_PLOT = float (&)[SPU_CHANNELS_SIZE][impl::DEBUG_SAMPLES]; constexpr auto TableColumnFix = 2; // fixes ImGui possibly screwing last column width -constexpr auto TablePadding = 18; // inner padding to make it look neat +constexpr auto TablePadding = 18; // inner padding to make it look neat template -T& GetChannelData(SPU_CHANNELS channels, const unsigned channel) { +T& GetChannelData(SPU_CHANNELS_INFO channels, const size_t channel) { return channels[channel].data.get(); } -bool& GetChannelMute(SPU_CHANNELS channels, const unsigned channel) { +bool& GetChannelMute(SPU_CHANNELS_INFO channels, const size_t channel) { return GetChannelData(channels, channel).value; } -bool& GetChannelSolo(SPU_CHANNELS channels, const unsigned channel) { +bool& GetChannelSolo(SPU_CHANNELS_INFO channels, const size_t channel) { return GetChannelData(channels, channel).value; } void HandleChannelMute( - SPU_CHANNELS channels, bool& muteThis, bool& soloThis) { + SPU_CHANNELS_INFO channels, bool& muteThis, bool& soloThis) { muteThis = !muteThis; if (muteThis) { soloThis = false; @@ -147,10 +146,9 @@ void HandleChannelMute( } void HandleChannelSoloMute( - SPU_CHANNELS channels, const unsigned channel1, const unsigned channel2) { - - auto &muteOther = GetChannelMute(channels, channel2); - auto &soloOther = GetChannelSolo(channels, channel2); + SPU_CHANNELS_INFO channels, const size_t channel1, const size_t channel2) { + auto& muteOther = GetChannelMute(channels, channel2); + auto& soloOther = GetChannelSolo(channels, channel2); if (GetChannelSolo(channels, channel1)) { // multi/single solo @@ -173,19 +171,15 @@ void HandleChannelSoloMute( } void HandleChannelSolo( - SPU_CHANNELS channels, unsigned i, bool& muteThis, bool& soloThis) { + SPU_CHANNELS_INFO channels, const size_t channel, bool& muteThis, bool& soloThis) { soloThis = !soloThis; if (soloThis) { muteThis = false; } - for (unsigned j = 0; j < SPU_CHANNELS_SIZE; j++) { - if (j == i) { - continue; + for (auto j = 0u; j < SPU_CHANNELS_SIZE; j++) { + if (j != channel) { + HandleChannelSoloMute(channels, muteThis, soloThis); } - auto& dataOther = channels[j].data; - auto& muteOther = dataOther.get().value; - auto& soloOther = dataOther.get().value; - HandleChannelSoloMute(channels, muteThis, soloThis); } // no more solo channels -> ensure none are muted @@ -198,15 +192,12 @@ void HandleChannelSolo( } } -void DrawTable(SPU_CHANNELS channels, size_t SPU_CHANNELS_SIZE, const float rowHeight) { -} - -void DrawTableGeneralIndex(const unsigned channel) { +void DrawTableGeneralIndex(const size_t channel) { ImGui::AlignTextToFramePadding(); - ImGui::Text("%02i", channel); + ImGui::Text("%02i", static_cast(channel)); } -void DrawTableGeneralTag(const unsigned channel, SPU_CHANNELS_TAGS& tags) { +void DrawTableGeneralTag(const size_t channel, SPU_CHANNELS_TAGS& tags) { ImGui::PushItemWidth(Grid::WidthGeneralTag); const auto tagLabel = "##SpuChannelTag" + std::to_string(channel); const auto tagHint = "Channel " + std::to_string(channel); @@ -234,11 +225,11 @@ ImVec4 GetMuteSoloButtonTint(const bool down, const ImVec4& downTint) { struct MSButton { const char* Text; - const ImVec4 Tint; - const float Size; + ImVec4 Tint; + float Size; }; -bool DrawMuteSoloButton(const unsigned channel, const MSButton& button, const bool& active) { +bool DrawMuteSoloButton(const size_t channel, const MSButton& button, const bool& active) { const auto size = ImVec2(ImGui::GetFrameHeightWithSpacing(), 0); const auto temp = ImVec2((button.Size - size.x) * 0.5f - ImGui::GetStyle().FramePadding.x * 2.0f, 0); ImGui::Dummy(temp); @@ -251,7 +242,7 @@ bool DrawMuteSoloButton(const unsigned channel, const MSButton& button, const bo return pressed; } -void DrawTableGeneralMute(SPU_CHANNELS channels, const unsigned channel, const MSButton& button) { +void DrawTableGeneralMute(SPU_CHANNELS_INFO channels, const size_t channel, const MSButton& button) { auto& mute = GetChannelMute(channels, channel); auto& solo = GetChannelSolo(channels, channel); if (DrawMuteSoloButton(channel, button, mute)) { @@ -259,7 +250,7 @@ void DrawTableGeneralMute(SPU_CHANNELS channels, const unsigned channel, const M } } -void DrawTableGeneralSolo(SPU_CHANNELS channels, const unsigned channel, const MSButton& button) { +void DrawTableGeneralSolo(SPU_CHANNELS_INFO channels, const size_t channel, const MSButton& button) { auto& mute = GetChannelMute(channels, channel); auto& solo = GetChannelSolo(channels, channel); if (DrawMuteSoloButton(channel, button, solo)) { @@ -275,13 +266,13 @@ void DrawTableGeneralFMod(const Chan::Data& data) { ImGui::Text("%i", data.get().value); } -void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, unsigned i) { +void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, size_t channel) { constexpr auto plotSize = ImVec2(Grid::WidthGeneralPlot - TablePadding, 0); - ImGui::PlotHistogram("", plot[i], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); + ImGui::PlotHistogram("", plot[channel], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize); } void DrawTableGeneral( - SPU_CHANNELS channels, + SPU_CHANNELS_INFO channels, const float rowHeight, SPU_CHANNELS_TAGS tags, SPU_CHANNELS_PLOT plot) { @@ -321,7 +312,7 @@ void DrawTableGeneral( } } -void DrawTableFrequency(SPU_CHANNELS channels, const float rowHeight) { +void DrawTableFrequency(SPU_CHANNELS_INFO channels, const float rowHeight) { if (ImGui::BeginTable("TableFrequency", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthFrequencyActive); ImGui::TableSetupColumn("Used", Grid::FlagsColumn, Grid::WidthFrequencyUsed); @@ -329,17 +320,17 @@ void DrawTableFrequency(SPU_CHANNELS channels, const float rowHeight) { for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + // @formatter:on } ImGui::EndTable(); } } -void DrawTablePosition(SPU_CHANNELS channels, const float rowHeight, const uint8_t* spuMemC) { +void DrawTablePosition(SPU_CHANNELS_INFO channels, const float rowHeight, const uint8_t* spuMemC) { if (ImGui::BeginTable("TablePosition", 3, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Start", Grid::FlagsColumn, Grid::WidthPositionStart); ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthPositionCurrent); @@ -348,19 +339,18 @@ void DrawTablePosition(SPU_CHANNELS channels, const float rowHeight, const uint8 for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& chan = channels[i]; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", static_cast(chan.pStart - spuMemC)); - ImGui::TableNextColumn(); - ImGui::Text("%i", static_cast(chan.pCurr - spuMemC)); - ImGui::TableNextColumn(); - ImGui::Text("%i", static_cast(chan.pLoop - spuMemC)); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", static_cast(chan.pStart - spuMemC)); + ImGui::TableNextColumn(); ImGui::Text("%i", static_cast(chan.pCurr - spuMemC)); + ImGui::TableNextColumn(); ImGui::Text("%i", static_cast(chan.pLoop - spuMemC)); + // @formatter:on } ImGui::EndTable(); } } -void DrawTableVolume(SPU_CHANNELS channels, const float rowHeight) { +void DrawTableVolume(SPU_CHANNELS_INFO channels, const float rowHeight) { if (ImGui::BeginTable("TableVolume", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("L", Grid::FlagsColumn, Grid::WidthVolumeL); ImGui::TableSetupColumn("R", Grid::FlagsColumn, Grid::WidthVolumeR); @@ -368,17 +358,17 @@ void DrawTableVolume(SPU_CHANNELS channels, const float rowHeight) { for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + // @formatter:on } ImGui::EndTable(); } } -void DrawTableAdsr(SPU_CHANNELS channels, const float rowHeight) { +void DrawTableAdsr(SPU_CHANNELS_INFO channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsr", 4, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("A", Grid::FlagsColumn, Grid::WidthAdsrA); ImGui::TableSetupColumn("D", Grid::FlagsColumn, Grid::WidthAdsrD); @@ -388,21 +378,19 @@ void DrawTableAdsr(SPU_CHANNELS channels, const float rowHeight) { for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].ADSRX; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value ^ 0x7F); - ImGui::TableNextColumn(); - ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value ^ 0x7F); - ImGui::TableNextColumn(); - ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value ^ 0x7F); + ImGui::TableNextColumn(); ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value ^ 0x7F); + ImGui::TableNextColumn(); ImGui::Text("%i", (data.get().value ^ 0x1F) / 4); + // @formatter:on } ImGui::EndTable(); } } -void DrawTableAdsrSustain(SPU_CHANNELS channels, const float rowHeight) { +void DrawTableAdsrSustain(SPU_CHANNELS_INFO channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsrSustain", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Level", Grid::FlagsColumn, Grid::WidthAdsrSustainLevel); ImGui::TableSetupColumn("Increase", Grid::FlagsColumn, Grid::WidthAdsrSustainIncrease); @@ -410,17 +398,17 @@ void DrawTableAdsrSustain(SPU_CHANNELS channels, const float rowHeight) { for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].ADSRX; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value >> 27); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value >> 27); + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + // @formatter:on } ImGui::EndTable(); } } -void DrawTableAdsrVolume(SPU_CHANNELS channels, const float rowHeight) { +void DrawTableAdsrVolume(SPU_CHANNELS_INFO channels, const float rowHeight) { if (ImGui::BeginTable("TableAdsrVolume", 2, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Current", Grid::FlagsColumn, Grid::WidthAdsrVolumeCurrent); ImGui::TableSetupColumn("Envelope", Grid::FlagsColumn, Grid::WidthAdsrVolumeEnvelope); @@ -428,17 +416,17 @@ void DrawTableAdsrVolume(SPU_CHANNELS channels, const float rowHeight) { for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].ADSRX; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%08X", data.get().value); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); ImGui::Text("%08X", data.get().value); + // @formatter:on } ImGui::EndTable(); } } -void DrawTableReverb(SPU_CHANNELS channels, const float rowHeight) { +void DrawTableReverb(SPU_CHANNELS_INFO channels, const float rowHeight) { if (ImGui::BeginTable("TableReverb", 5, Grid::FlagsTableInner)) { ImGui::TableSetupColumn("Allowed", Grid::FlagsColumn, Grid::WidthReverbAllowed); ImGui::TableSetupColumn("Active", Grid::FlagsColumn, Grid::WidthReverbActive); @@ -449,17 +437,14 @@ void DrawTableReverb(SPU_CHANNELS channels, const float rowHeight) { for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) { const auto& data = channels[i].data; ImGui::TableNextRow(Grid::FlagsRow, rowHeight); - ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); - ImGui::TableNextColumn(); - ImGui::Text("%i", data.get().value); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + ImGui::TableNextColumn(); ImGui::Text("%i", data.get().value); + // @formatter:on } ImGui::EndTable(); } @@ -520,7 +505,7 @@ void impl::debug() { ImGui::TableSetupColumn("MEM", 0, simpleTableWidth); ImGui::TableHeadersRow(); // @formatter:off - ImGui::TableNextColumn(); ImGui::Text("%08X", static_cast(pSpuIrq ? -1 : pSpuIrq - spuMemC)); + ImGui::TableNextColumn(); ImGui::Text("%08X", static_cast(pSpuIrq ? -1 : pSpuIrq - spuMemC)); ImGui::TableNextColumn(); ImGui::Text("%04X", spuCtrl); ImGui::TableNextColumn(); ImGui::Text("%04X", spuStat); ImGui::TableNextColumn(); ImGui::Text("%i", spuAddr); @@ -566,29 +551,16 @@ void impl::debug() { ImGui::TableSetupColumn("Reverb", Grid::FlagsColumn, Grid::WidthReverb + TablePadding * TableColumnFix); ImGui::TableHeadersRow(); - ImGui::TableNextColumn(); - DrawTableGeneral(s_chan, rowHeight, m_channelTag, m_channelDebugData); - - ImGui::TableNextColumn(); - DrawTableFrequency(s_chan, rowHeight); - - ImGui::TableNextColumn(); - DrawTablePosition(s_chan, rowHeight, spuMemC); - - ImGui::TableNextColumn(); - DrawTableVolume(s_chan, rowHeight); - - ImGui::TableNextColumn(); - DrawTableAdsr(s_chan, rowHeight); - - ImGui::TableNextColumn(); - DrawTableAdsrSustain(s_chan, rowHeight); - - ImGui::TableNextColumn(); - DrawTableAdsrVolume(s_chan, rowHeight); - - ImGui::TableNextColumn(); - DrawTableReverb(s_chan, rowHeight); + // @formatter:off + ImGui::TableNextColumn(); DrawTableGeneral(s_chan, rowHeight, m_channelTag, m_channelDebugData); + ImGui::TableNextColumn(); DrawTableFrequency(s_chan, rowHeight); + ImGui::TableNextColumn(); DrawTablePosition(s_chan, rowHeight, spuMemC); + ImGui::TableNextColumn(); DrawTableVolume(s_chan, rowHeight); + ImGui::TableNextColumn(); DrawTableAdsr(s_chan, rowHeight); + ImGui::TableNextColumn(); DrawTableAdsrSustain(s_chan, rowHeight); + ImGui::TableNextColumn(); DrawTableAdsrVolume(s_chan, rowHeight); + ImGui::TableNextColumn(); DrawTableReverb(s_chan, rowHeight); + // @formatter:on ImGui::EndTable(); } } From e848dd935bb90d96acefa100f6b1bed921d063a1 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 21:02:42 +0200 Subject: [PATCH 49/53] SPU debugger: extract DrawSectionChannels --- src/spu/debug.cc | 67 ++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 58fa2e2bd..90e1ebe0c 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -450,6 +450,41 @@ void DrawTableReverb(SPU_CHANNELS_INFO channels, const float rowHeight) { } } +void DrawSectionChannels( + SPU_CHANNELS_INFO channels, SPU_CHANNELS_TAGS tags, SPU_CHANNELS_PLOT plot, const uint8_t* spuMemC) { + if (ImGui::CollapsingHeader("Channels", ImGuiTreeNodeFlags_DefaultOpen)) { + const auto style = ImGui::GetStyle(); + const auto rowHeight = ImGui::GetFrameHeightWithSpacing(); + const auto headerHeight = ImGui::GetTextLineHeightWithSpacing(); + const auto tableHeight = rowHeight * SPU_CHANNELS_SIZE + headerHeight * 2 + 4 + style.ScrollbarSize; + + // BUG ImGui hides last column border when scrolling (off by 1px) + if (ImGui::BeginTable("SpuChannels", 8, Grid::FlagsTableOuter, ImVec2(0, tableHeight))) { + ImGui::TableSetupColumn("General", Grid::FlagsColumn, Grid::WidthGeneral + TablePadding * TableColumnFix); + ImGui::TableSetupColumn("Frequency", Grid::FlagsColumn, Grid::WidthFrequency + TablePadding); + ImGui::TableSetupColumn("Position", Grid::FlagsColumn, Grid::WidthPosition + TablePadding); + ImGui::TableSetupColumn("Volume", Grid::FlagsColumn, Grid::WidthVolume + TablePadding); + ImGui::TableSetupColumn("ADSR", Grid::FlagsColumn, Grid::WidthAdsr + TablePadding * TableColumnFix); + ImGui::TableSetupColumn("ADSR Sustain", Grid::FlagsColumn, Grid::WidthAdsrSustain + TablePadding); + ImGui::TableSetupColumn("ADSR Volume", Grid::FlagsColumn, Grid::WidthAdsrVolume + TablePadding); + ImGui::TableSetupColumn("Reverb", Grid::FlagsColumn, Grid::WidthReverb + TablePadding * TableColumnFix); + ImGui::TableHeadersRow(); + + // @formatter:off + ImGui::TableNextColumn(); DrawTableGeneral(channels, rowHeight, tags, plot); + ImGui::TableNextColumn(); DrawTableFrequency(channels, rowHeight); + ImGui::TableNextColumn(); DrawTablePosition(channels, rowHeight, spuMemC); + ImGui::TableNextColumn(); DrawTableVolume(channels, rowHeight); + ImGui::TableNextColumn(); DrawTableAdsr(channels, rowHeight); + ImGui::TableNextColumn(); DrawTableAdsrSustain(channels, rowHeight); + ImGui::TableNextColumn(); DrawTableAdsrVolume(channels, rowHeight); + ImGui::TableNextColumn(); DrawTableReverb(channels, rowHeight); + // @formatter:on + ImGui::EndTable(); + } + } +} + void impl::debug() { auto delta = std::chrono::steady_clock::now() - m_lastUpdated; using namespace std::chrono_literals; @@ -533,37 +568,7 @@ void impl::debug() { } } - if (ImGui::CollapsingHeader("Channels", ImGuiTreeNodeFlags_DefaultOpen)) { - const auto style = ImGui::GetStyle(); - const auto rowHeight = ImGui::GetFrameHeightWithSpacing(); - const auto headerHeight = ImGui::GetTextLineHeightWithSpacing(); - const auto tableHeight = rowHeight * MAXCHAN + headerHeight * 2 + 4 + style.ScrollbarSize; - - // BUG ImGui hides last column border when scrolling (off by 1px) - if (ImGui::BeginTable("SpuChannels", 8, Grid::FlagsTableOuter, ImVec2(0, tableHeight))) { - ImGui::TableSetupColumn("General", Grid::FlagsColumn, Grid::WidthGeneral + TablePadding * TableColumnFix); - ImGui::TableSetupColumn("Frequency", Grid::FlagsColumn, Grid::WidthFrequency + TablePadding); - ImGui::TableSetupColumn("Position", Grid::FlagsColumn, Grid::WidthPosition + TablePadding); - ImGui::TableSetupColumn("Volume", Grid::FlagsColumn, Grid::WidthVolume + TablePadding); - ImGui::TableSetupColumn("ADSR", Grid::FlagsColumn, Grid::WidthAdsr + TablePadding * TableColumnFix); - ImGui::TableSetupColumn("ADSR Sustain", Grid::FlagsColumn, Grid::WidthAdsrSustain + TablePadding); - ImGui::TableSetupColumn("ADSR Volume", Grid::FlagsColumn, Grid::WidthAdsrVolume + TablePadding); - ImGui::TableSetupColumn("Reverb", Grid::FlagsColumn, Grid::WidthReverb + TablePadding * TableColumnFix); - ImGui::TableHeadersRow(); - - // @formatter:off - ImGui::TableNextColumn(); DrawTableGeneral(s_chan, rowHeight, m_channelTag, m_channelDebugData); - ImGui::TableNextColumn(); DrawTableFrequency(s_chan, rowHeight); - ImGui::TableNextColumn(); DrawTablePosition(s_chan, rowHeight, spuMemC); - ImGui::TableNextColumn(); DrawTableVolume(s_chan, rowHeight); - ImGui::TableNextColumn(); DrawTableAdsr(s_chan, rowHeight); - ImGui::TableNextColumn(); DrawTableAdsrSustain(s_chan, rowHeight); - ImGui::TableNextColumn(); DrawTableAdsrVolume(s_chan, rowHeight); - ImGui::TableNextColumn(); DrawTableReverb(s_chan, rowHeight); - // @formatter:on - ImGui::EndTable(); - } - } + DrawSectionChannels(s_chan, m_channelTag, m_channelDebugData, spuMemC); ImGui::End(); } From 7d89fdc80cfee87dcff6050165e613e8783039df Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 21:45:08 +0200 Subject: [PATCH 50/53] SPU debugger: extract SPU/XA sections --- src/spu/debug.cc | 87 ++++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 90e1ebe0c..39f96e6be 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -116,6 +116,9 @@ using SPU_CHANNELS_PLOT = float (&)[SPU_CHANNELS_SIZE][impl::DEBUG_SAMPLES]; constexpr auto TableColumnFix = 2; // fixes ImGui possibly screwing last column width constexpr auto TablePadding = 18; // inner padding to make it look neat +constexpr auto BasicTableFlags = ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_NoHostExtendX; +constexpr auto BasicTableColumnWidth = 150; + template T& GetChannelData(SPU_CHANNELS_INFO channels, const size_t channel) { return channels[channel].data.get(); @@ -485,6 +488,48 @@ void DrawSectionChannels( } } +void DrawSectionSpu( + const uint16_t spuCtrl, const uint16_t spuStat, const uint32_t spuAddr, + const uint8_t* spuMemC, const uint8_t* pSpuIrq) { + if (ImGui::CollapsingHeader("SPU", ImGuiTreeNodeFlags_DefaultOpen)) { + if (ImGui::BeginTable("SpuBase", 4, BasicTableFlags)) { + ImGui::TableSetupColumn("IRQ", 0, BasicTableColumnWidth); + ImGui::TableSetupColumn("CTRL", 0, BasicTableColumnWidth); + ImGui::TableSetupColumn("STAT", 0, BasicTableColumnWidth); + ImGui::TableSetupColumn("MEM", 0, BasicTableColumnWidth); + ImGui::TableHeadersRow(); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%08X", static_cast(pSpuIrq ? -1 : pSpuIrq - spuMemC)); + ImGui::TableNextColumn(); ImGui::Text("%04X", spuCtrl); + ImGui::TableNextColumn(); ImGui::Text("%04X", spuStat); + ImGui::TableNextColumn(); ImGui::Text("%i", spuAddr); + // @formatter:on + ImGui::EndTable(); + } + } +} + +void DrawSectionXa(const xa_decode_t* xapGlobal, const int iLeftXAVol, const int iRightXAVol) { + if (ImGui::CollapsingHeader("XA", ImGuiTreeNodeFlags_DefaultOpen)) { + if (ImGui::BeginTable("SpuXa", 5, BasicTableFlags)) { + ImGui::TableSetupColumn("Frequency", 0, BasicTableColumnWidth); + ImGui::TableSetupColumn("Stereo", 0, BasicTableColumnWidth); + ImGui::TableSetupColumn("Samples", 0, BasicTableColumnWidth); + ImGui::TableSetupColumn("Volume L", 0, BasicTableColumnWidth); + ImGui::TableSetupColumn("Volume R", 0, BasicTableColumnWidth); + ImGui::TableHeadersRow(); + // @formatter:off + ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->freq : 0); + ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->stereo : 0); + ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->nsamples : 0); + ImGui::TableNextColumn(); ImGui::Text("%i", iLeftXAVol); + ImGui::TableNextColumn(); ImGui::Text("%i", iRightXAVol); + // @formatter:on + ImGui::EndTable(); + } + } +} + void impl::debug() { auto delta = std::chrono::steady_clock::now() - m_lastUpdated; using namespace std::chrono_literals; @@ -528,46 +573,8 @@ void impl::debug() { return; } - { - constexpr auto simpleTableFlags = ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_NoHostExtendX; - constexpr auto simpleTableWidth = 150; - - if (ImGui::CollapsingHeader("SPU", ImGuiTreeNodeFlags_DefaultOpen)) { - if (ImGui::BeginTable("SpuBase", 4, simpleTableFlags)) { - ImGui::TableSetupColumn("IRQ", 0, simpleTableWidth); - ImGui::TableSetupColumn("CTRL", 0, simpleTableWidth); - ImGui::TableSetupColumn("STAT", 0, simpleTableWidth); - ImGui::TableSetupColumn("MEM", 0, simpleTableWidth); - ImGui::TableHeadersRow(); - // @formatter:off - ImGui::TableNextColumn(); ImGui::Text("%08X", static_cast(pSpuIrq ? -1 : pSpuIrq - spuMemC)); - ImGui::TableNextColumn(); ImGui::Text("%04X", spuCtrl); - ImGui::TableNextColumn(); ImGui::Text("%04X", spuStat); - ImGui::TableNextColumn(); ImGui::Text("%i", spuAddr); - // @formatter:on - ImGui::EndTable(); - } - } - if (ImGui::CollapsingHeader("XA", ImGuiTreeNodeFlags_DefaultOpen)) { - if (ImGui::BeginTable("SpuXa", 5, simpleTableFlags)) { - ImGui::TableSetupColumn("Frequency", 0, simpleTableWidth); - ImGui::TableSetupColumn("Stereo", 0, simpleTableWidth); - ImGui::TableSetupColumn("Samples", 0, simpleTableWidth); - ImGui::TableSetupColumn("Volume L", 0, simpleTableWidth); - ImGui::TableSetupColumn("Volume R", 0, simpleTableWidth); - ImGui::TableHeadersRow(); - // @formatter:off - ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->freq : 0); - ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->stereo : 0); - ImGui::TableNextColumn(); ImGui::Text("%i", xapGlobal ? xapGlobal->nsamples : 0); - ImGui::TableNextColumn(); ImGui::Text("%i", iLeftXAVol); - ImGui::TableNextColumn(); ImGui::Text("%i", iRightXAVol); - // @formatter:on - ImGui::EndTable(); - } - } - } - + DrawSectionSpu(spuCtrl, spuStat, spuAddr, spuMemC, pSpuIrq); + DrawSectionXa(xapGlobal, iLeftXAVol, iRightXAVol); DrawSectionChannels(s_chan, m_channelTag, m_channelDebugData, spuMemC); ImGui::End(); From 1e635d0dfde18b8a55285f13af51b7c57e3d5297 Mon Sep 17 00:00:00 2001 From: aybe Date: Sun, 19 May 2024 21:45:52 +0200 Subject: [PATCH 51/53] SPU debugger: fix std::ranges::any/all_of for macos --- src/spu/debug.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 39f96e6be..5dee6dca5 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -165,7 +165,7 @@ void HandleChannelSoloMute( } } else { // mute this to keep solo ones correct - if (std::ranges::any_of(channels, channels + SPU_CHANNELS_SIZE, [](const SPUCHAN& c) { + if (std::any_of(channels, channels + SPU_CHANNELS_SIZE, [](const SPUCHAN& c) { return c.data.get().value; })) { GetChannelMute(channels, channel1) = true; @@ -186,7 +186,7 @@ void HandleChannelSolo( } // no more solo channels -> ensure none are muted - if (std::ranges::all_of(channels, [](const SPUCHAN& c) { + if (std::all_of(channels, channels + SPU_CHANNELS_SIZE, [](const SPUCHAN& c) { return c.data.get().value == false; })) { std::for_each(channels, channels + SPU_CHANNELS_SIZE, [](SPUCHAN& c) { From c24ce5957231c721c30373e66dcc7efd53a9a2d2 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Wed, 22 May 2024 18:12:28 -0700 Subject: [PATCH 52/53] Making all of this code local instead of global. --- src/spu/debug.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/spu/debug.cc b/src/spu/debug.cc index 5dee6dca5..8c2a63f70 100644 --- a/src/spu/debug.cc +++ b/src/spu/debug.cc @@ -107,6 +107,8 @@ struct Grid { WidthReverbRepeat; }; +namespace { + using namespace PCSX::SPU; constexpr auto SPU_CHANNELS_SIZE = impl::MAXCHAN; using SPU_CHANNELS_INFO = SPUCHAN(&)[SPU_CHANNELS_SIZE + 1]; @@ -530,6 +532,8 @@ void DrawSectionXa(const xa_decode_t* xapGlobal, const int iLeftXAVol, const int } } +} + void impl::debug() { auto delta = std::chrono::steady_clock::now() - m_lastUpdated; using namespace std::chrono_literals; From df899791a4a93764ef9fd0468b4cf5bb43c588b2 Mon Sep 17 00:00:00 2001 From: spicyjpeg Date: Wed, 29 May 2024 19:51:04 +0200 Subject: [PATCH 53/53] Add --set-section-alignment to all objcopy commands --- src/mips/openbios/Makefile | 6 +++--- src/mips/shell/Makefile | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mips/openbios/Makefile b/src/mips/openbios/Makefile index 79c460734..8a4e62eeb 100644 --- a/src/mips/openbios/Makefile +++ b/src/mips/openbios/Makefile @@ -116,13 +116,13 @@ include ../common.mk ./psexe_data.o: $(EMBED_PSEXE) cp $(EMBED_PSEXE) psexe.bin - $(PREFIX)-objcopy -I binary --rename-section .data=.rodata,alloc,load,readonly,data,contents -O $(FORMAT) -B mips psexe.bin psexe_data.o + $(PREFIX)-objcopy -I binary --set-section-alignment .data=4 --rename-section .data=.rodata,alloc,load,readonly,data,contents -O $(FORMAT) -B mips psexe.bin psexe_data.o ./font1.o: charset/font1.raw - $(PREFIX)-objcopy -I binary --rename-section .data=.font1,alloc,load,readonly,data,contents -O $(FORMAT) -B mips charset/font1.raw font1.o + $(PREFIX)-objcopy -I binary --set-section-alignment .data=4 --rename-section .data=.font1,alloc,load,readonly,data,contents -O $(FORMAT) -B mips charset/font1.raw font1.o ./font2.o: charset/font2.raw - $(PREFIX)-objcopy -I binary --rename-section .data=.font2,alloc,load,readonly,data,contents -O $(FORMAT) -B mips charset/font2.raw font2.o + $(PREFIX)-objcopy -I binary --set-section-alignment .data=4 --rename-section .data=.font2,alloc,load,readonly,data,contents -O $(FORMAT) -B mips charset/font2.raw font2.o shell: $(MAKE) -C ../shell shell_data.o diff --git a/src/mips/shell/Makefile b/src/mips/shell/Makefile index 2d63fc74d..06199bce6 100644 --- a/src/mips/shell/Makefile +++ b/src/mips/shell/Makefile @@ -25,7 +25,7 @@ spu.c \ include ../common.mk shell_data.o: shell.bin - $(PREFIX)-objcopy -I binary --rename-section .data=.rodata,alloc,load,readonly,data,contents -O $(FORMAT) -B mips $< $@ + $(PREFIX)-objcopy -I binary --set-section-alignment .data=4 --rename-section .data=.rodata,alloc,load,readonly,data,contents -O $(FORMAT) -B mips $< $@ blip.o: blip.hit - $(PREFIX)-objcopy -I binary --rename-section .data=.rodata,alloc,load,readonly,data,contents -O $(FORMAT) -B mips $< $@ + $(PREFIX)-objcopy -I binary --set-section-alignment .data=4 --rename-section .data=.rodata,alloc,load,readonly,data,contents -O $(FORMAT) -B mips $< $@