Skip to content

Commit 76c22ea

Browse files
authored
Merge pull request #1 from shchmue/master
Add consoleUpdate calls to update framebuffer
2 parents 01e3369 + 60082d9 commit 76c22ea

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

source/console.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ u64 selectFromList(int* selection, StrList* str_list) {
166166
return kDown;
167167
}
168168
kDownPrevious = kDown;
169+
consoleUpdate(NULL);
169170
}
170171

171172
return 0;
@@ -190,16 +191,19 @@ bool userConfirm(const char * msg) {
190191
}
191192

192193
kDownPrevious = kDown;
194+
consoleUpdate(NULL);
193195
}
194196
return false;
195197
}
196198

197199
void printInProgress(const char * msg) {
198200
printf("%s... ", msg);
201+
consoleUpdate(NULL);
199202
}
200203

201204
void printDone() {
202205
printf(CONSOLE_ESC(32m) "Done\n" CONSOLE_ESC(m));
206+
consoleUpdate(NULL);
203207
}
204208

205209
void printBytesAsHex(const u8* bytes, size_t size) {

source/menu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void mainMenu() {
2929
}
3030

3131
if (kDown & KEY_PLUS) break;
32+
consoleUpdate(NULL);
3233
}
3334

3435
freeStrList(main_menu_list);
@@ -124,6 +125,7 @@ u64 patchTextSelect(PatchTextTarget* pchtxt_target) {
124125
*strchr(pchtxt_target->folder_name, '/') = '\0';
125126
break;
126127
}
128+
consoleUpdate(NULL);
127129
}
128130

129131
freeStrList(pchtxt_list);
@@ -148,6 +150,7 @@ u64 patchTextToIPSMenu() {
148150
else
149151
printf(CONSOLE_ESC(31m) "\nFailed: %d\n" CONSOLE_ESC(m), rc);
150152
}
153+
consoleUpdate(NULL);
151154
}
152155
return kDown;
153156
}
@@ -164,6 +167,7 @@ u64 patchTextToggleMenu() {
164167
"Y to Save and Apply Changes to IPS\n"
165168
CONSOLE_ESC(0;32m) "\n\nGreen = Enabled "
166169
CONSOLE_ESC(31m) "Red = Disabled\n" CONSOLE_ESC(m));
170+
consoleUpdate(NULL);
167171

168172
StrList* pchtxt = getStrList();
169173
StrList* patch_str_list = getStrList();

source/patch.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ int patchTarget(const PatchList* pchlist) {
284284
else
285285
printInProgress("\nApplying patches");
286286

287+
consoleUpdate(NULL);
288+
287289
PatchListNode* node = pchlist->first;
288290
size_t cur_ips_buf_offset = IPS_HEAD_LEN;
289291
for (int i = 0; node != NULL; i++) {
@@ -332,6 +334,7 @@ int patchTarget(const PatchList* pchlist) {
332334
}
333335

334336
if (!pchlist->printing_values) printDone();
337+
consoleUpdate(NULL);
335338

336339
char out_file_path[0x100] = {0};
337340
FILE* out;
@@ -370,6 +373,7 @@ int patchTarget(const PatchList* pchlist) {
370373

371374
printf("\nIPS output to\n%s\n", out_file_path);
372375
}
376+
consoleUpdate(NULL);
373377

374378
fclose(out);
375379
free(out_file_buf);
@@ -393,6 +397,7 @@ int patchTextToIPS(PatchTextTarget* pchtxt_target) {
393397
if(rc == -1 || rc == -2) {
394398
printf("Did you forget to include nsobid?\n");
395399
}
400+
consoleUpdate(NULL);
396401

397402
return rc;
398403
}
@@ -490,6 +495,7 @@ int writePchtxtFromStrList(PatchTextTarget* pchtxt_target, StrList* pchtxt,
490495
for (int i = 0; i < pchtxt->size; i++) {
491496
fputs(pchtxt->str_list[i], pchtxt_file);
492497
}
498+
consoleUpdate(NULL);
493499

494500
fclose(pchtxt_file);
495501

0 commit comments

Comments
 (0)