diff --git a/arm9/source/fileOperations.cpp b/arm9/source/fileOperations.cpp index 7ebe039..9a18662 100644 --- a/arm9/source/fileOperations.cpp +++ b/arm9/source/fileOperations.cpp @@ -9,6 +9,7 @@ #include "file_browse.h" #include "font.h" #include "ndsheaderbanner.h" +#include "screenshot.h" #define copyBufSize 0x8000 #define shaChunkSize 0x10000 @@ -218,7 +219,7 @@ int fcopy(const char *sourcePath, const char *destinationPath) { } void changeFileAttribs(const DirEntry *entry) { - int pressed = 0; + int pressed = 0, held = 0; int cursorScreenPos = font->calcHeight(entry->name); uint8_t currentAttribs = FAT_getAttr(entry->name.c_str()); uint8_t newAttribs = currentAttribs; @@ -242,6 +243,7 @@ void changeFileAttribs(const DirEntry *entry) { font->update(true); scanKeys(); + held = keysHeld(); pressed = keysDown(); swiWaitForVBlank(); } while (!(pressed & KEY_UP) && !(pressed & KEY_DOWN) && !(pressed & KEY_RIGHT) && !(pressed & KEY_LEFT) @@ -260,6 +262,8 @@ void changeFileAttribs(const DirEntry *entry) { break; } else if (pressed & (KEY_A | KEY_B)) { break; + } else if (held & KEY_R && pressed & KEY_L) { + screenshot(); } } } diff --git a/arm9/source/file_browse.cpp b/arm9/source/file_browse.cpp index 82c1353..4d66546 100644 --- a/arm9/source/file_browse.cpp +++ b/arm9/source/file_browse.cpp @@ -174,7 +174,7 @@ void showDirectoryContents (const std::vector& dirContents, int fileOf } FileOperation fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) { - int pressed = 0; + int pressed = 0, held = 0; std::vector operations; int optionOffset = 0; std::string fullPath = path + entry->name; @@ -287,9 +287,9 @@ FileOperation fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) { scanKeys(); pressed = keysDownRepeat(); + held = keysHeld(); swiWaitForVBlank(); - } while (!(pressed & KEY_UP) && !(pressed & KEY_DOWN) - && !(pressed & KEY_A) && !(pressed & KEY_B) + } while (!(pressed & (KEY_UP| KEY_DOWN | KEY_A | KEY_B | KEY_L)) #ifdef SCREENSWAP && !(pressed & KEY_TOUCH) #endif @@ -435,6 +435,10 @@ FileOperation fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) { scanKeys(); pressed = keysDownRepeat(); swiWaitForVBlank(); + + if(keysHeld() & KEY_R && pressed & KEY_L) { + screenshot(); + } } while (!(pressed & (KEY_A | KEY_Y | KEY_B | KEY_X))); break; } case FileOperation::none: { @@ -453,6 +457,11 @@ FileOperation fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) { screenSwapped ? lcdMainOnBottom() : lcdMainOnTop(); } #endif + + // Make a screenshot + if ((held & KEY_R) && (pressed & KEY_L)) { + screenshot(); + } } } diff --git a/arm9/source/hexEditor.cpp b/arm9/source/hexEditor.cpp index ac13cde..2e5df35 100644 --- a/arm9/source/hexEditor.cpp +++ b/arm9/source/hexEditor.cpp @@ -46,6 +46,8 @@ u32 jumpToOffset(u32 offset) { cursorPosition--; } else if(pressed & (KEY_A | KEY_B)) { return offset; + } else if(keysHeld() & KEY_R && pressed & KEY_L) { + screenshot(); } } } @@ -79,6 +81,8 @@ u32 search(u32 offset, FILE *file) { break; } else if(pressed & KEY_B) { return offset; + } else if(keysHeld() & KEY_R && pressed & KEY_L) { + screenshot(); } } @@ -160,6 +164,8 @@ u32 search(u32 offset, FILE *file) { if(cursorPosition > strLen * 2 - 1) cursorPosition -= 2; } + } else if(keysHeld() & KEY_R && pressed & KEY_L) { + screenshot(); } } } diff --git a/arm9/source/ndsInfo.cpp b/arm9/source/ndsInfo.cpp index f5bd502..dd0968f 100644 --- a/arm9/source/ndsInfo.cpp +++ b/arm9/source/ndsInfo.cpp @@ -2,6 +2,7 @@ #include "date.h" #include "font.h" +#include "screenshot.h" #include "tonccpy.h" #include @@ -120,6 +121,8 @@ void ndsInfo(const char *path) { lang++; } else if(pressed & KEY_B) { break; + } else if(keysHeld() & KEY_R && pressed & KEY_L) { + screenshot(); } }