Skip to content

Commit 1175924

Browse files
committed
Logs for ROM/labels loading and reset/cold boot actions
1 parent e66e72b commit 1175924

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/systems/x65.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ bool x65_quickload_xex(x65_t* sys, chips_range_t data) {
444444
ptr += 2;
445445
const uint16_t end_addr = ptr[1] << 8 | ptr[0];
446446
ptr += 2;
447-
LOG_INFO("Loading block: %04X-%04X", start_addr, end_addr);
447+
LOG_INFO("Loading block: $%04X-$%04X", start_addr, end_addr);
448448

449449
data_left = (uint8_t*)data.ptr + data.size - ptr;
450450
if (data_left < (end_addr - start_addr + 1) || start_addr > end_addr) {
@@ -453,7 +453,7 @@ bool x65_quickload_xex(x65_t* sys, chips_range_t data) {
453453
}
454454
if (start_addr == end_addr && start_addr == 0xFFFE) {
455455
load_bank = *ptr++;
456-
LOG_INFO("Loading to bank: %d", load_bank);
456+
LOG_INFO("Loading to bank: $%02X", load_bank);
457457
}
458458
else {
459459
uint16_t addr = start_addr;

src/ui/ui_x65.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "./ui_x65.h"
2+
#include "../log.h"
23

34
#include "imgui.h"
45
#include "IconsLucide.h"
@@ -32,10 +33,12 @@ static void _ui_x65_draw_menu(ui_x65_t* ui) {
3233
ImGui::EndTooltip();
3334
}
3435
if (ImGui::SmallButton(ICON_LC_ROTATE_CCW)) {
36+
LOG_INFO("=== RESET ===");
3537
x65_reset(ui->x65);
3638
ui_dbg_reset(&ui->dbg);
3739
}
3840
if (ImGui::SmallButton(ICON_LC_POWER)) {
41+
LOG_INFO("=== COLD BOOT ===");
3942
ui->boot_cb(ui->x65);
4043
ui_dbg_reboot(&ui->dbg);
4144
}
@@ -45,10 +48,12 @@ static void _ui_x65_draw_menu(ui_x65_t* ui) {
4548
}
4649
ui_snapshot_menus(&ui->snapshot);
4750
if (ImGui::MenuItem(ICON_LC_ROTATE_CCW " Reset")) {
51+
LOG_INFO("=== RESET ===");
4852
x65_reset(ui->x65);
4953
ui_dbg_reset(&ui->dbg);
5054
}
5155
if (ImGui::MenuItem(ICON_LC_POWER " Cold Boot")) {
56+
LOG_INFO("=== COLD BOOT ===");
5257
ui->boot_cb(ui->x65);
5358
ui_dbg_reboot(&ui->dbg);
5459
}

src/x65.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static void app_load_rom_labels(const char* rom_file) {
137137
strcpy(&buf[path_len - 4], ".lbl");
138138

139139
if (access(buf, R_OK) == 0) {
140+
LOG_INFO("Loading labels file: %s", buf);
140141
app_load_labels(buf, true);
141142
}
142143
}
@@ -272,6 +273,7 @@ void app_init(void) {
272273
bool delay_input = false;
273274
if (arguments.rom) {
274275
delay_input = true;
276+
LOG_INFO("Loading ROM: %s", arguments.rom);
275277
fs_load_file_async(FS_CHANNEL_IMAGES, arguments.rom);
276278
app_load_rom_labels(arguments.rom);
277279
}
@@ -482,6 +484,7 @@ static void ui_boot_cb(x65_t* sys) {
482484
x65_desc_t desc = x65_desc(sys->joystick_type);
483485
x65_init(sys, &desc);
484486
if (arguments.rom) {
487+
LOG_INFO("Loading ROM: %s", arguments.rom);
485488
fs_load_file_async(FS_CHANNEL_IMAGES, arguments.rom);
486489
app_load_rom_labels(arguments.rom);
487490
}

0 commit comments

Comments
 (0)