Compare commits

..

4 Commits

Author SHA1 Message Date
CTCaer
4e7e5081a7 Bump Nyx to v1.0.1 2021-02-08 04:01:39 +02:00
CTCaer
fff750e609 bis: Fix BIS write for emuMMC
A last minute cleanup changed the function for writing the changed BIS sectors in emuMMC to a read.

Restore it to a sd card write.
2021-02-08 04:00:11 +02:00
CTCaer
38ce46a158 nyx: Add more info while formatting emuMMC USER 2021-02-08 03:52:23 +02:00
CTCaer
7a27a7b3b5 joycon: Disable regulators before sending the sleep cmd 2021-02-08 03:49:04 +02:00
5 changed files with 26 additions and 12 deletions

View File

@@ -7,5 +7,5 @@ BLVERSION_RSVD := 0
# Nyx Version.
NYXVERSION_MAJOR := 1
NYXVERSION_MINOR := 0
NYXVERSION_HOTFX := 0
NYXVERSION_HOTFX := 1
NYXVERSION_RSVD := 0

View File

@@ -694,9 +694,15 @@ retry:
void jc_deinit()
{
// Disable power.
jc_power_supply(UART_B, false);
jc_power_supply(UART_C, false);
// Turn off Joy-Con detect.
gpio_config(GPIO_PORT_G, GPIO_PIN_0, GPIO_MODE_SPIO);
gpio_config(GPIO_PORT_D, GPIO_PIN_1, GPIO_MODE_SPIO);
// Send sleep command.
u8 data = HCI_STATE_SLEEP;
if (jc_r.connected && !(jc_r.type & JC_ID_HORI))
@@ -709,9 +715,6 @@ void jc_deinit()
jc_send_hid_cmd(UART_C, JC_HID_SUBCMD_HCI_STATE, &data, 1);
jc_rcv_pkt(&jc_l);
}
jc_power_supply(UART_B, false);
jc_power_supply(UART_C, false);
}
static void jc_init_conn(joycon_ctxt_t *jc)

View File

@@ -651,6 +651,8 @@ static int _dump_emummc_raw_part(emmc_tool_gui_t *gui, int active_part, int part
if (resized_count)
{
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, "Done!\n");
// Calculate USER size and set it for FatFS.
u32 user_sectors = resized_count - user_offset - 33;
disk_set_info(DRIVE_EMU, SET_SECTOR_COUNT, &user_sectors);
@@ -662,7 +664,7 @@ static int _dump_emummc_raw_part(emmc_tool_gui_t *gui, int active_part, int part
strcpy(user_part.name, "USER");
nx_emmc_bis_init(&user_part, true, sd_sector_off);
s_printf(gui->txt_buf, "\nFormatting USER...\n");
s_printf(gui->txt_buf, "Formatting USER... \n");
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
manual_system_maintenance(true);
@@ -676,17 +678,18 @@ static int _dump_emummc_raw_part(emmc_tool_gui_t *gui, int active_part, int part
if (mkfs_error)
{
s_printf(gui->txt_buf, "#FF0000 USER format failed (%d)...#\nPlease try again...\n", mkfs_error);
s_printf(gui->txt_buf, "#FF0000 Failed (%d)!#\nPlease try again...\n", mkfs_error);
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
return 0;
}
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, "Done!\n");
// Flush BIS cache, deinit, clear BIS keys slots and reinstate SBK.
nx_emmc_bis_end();
hos_bis_keys_clear();
s_printf(gui->txt_buf, "Writing new GPT...\n");
s_printf(gui->txt_buf, "Writing new GPT... ");
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
manual_system_maintenance(true);
@@ -706,7 +709,7 @@ static int _dump_emummc_raw_part(emmc_tool_gui_t *gui, int active_part, int part
if (gpt_entry_idx >= gpt_main.header.num_part_ents)
{
s_printf(gui->txt_buf, "#FF0000 No USER partition...#\nPlease try again...\n");
s_printf(gui->txt_buf, "\n#FF0000 No USER partition...#\nPlease try again...\n");
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
return 0;

View File

@@ -1621,9 +1621,16 @@ static lv_res_t _create_mbox_partitioning_next(lv_obj_t *btn)
s_printf(txt_buf, "#FFDD00 Warning: This will partition the SD Card!#\n\n");
if (part_info.backup_possible)
strcat(txt_buf, "#C7EA46 Your files will be backed up and restored!#\n#FFDD00Any other partition will be wiped!#");
{
strcat(txt_buf, "#C7EA46 Your files will be backed up and restored!#\n"
"#FFDD00 Any other partition will be wiped!#");
}
else
strcat(txt_buf, "#FFDD00 Your files will be wiped!#\n#FFDD00 Use USB UMS to copy them over!#");
{
strcat(txt_buf, "#FFDD00 Your files will be wiped!#\n"
"#FFDD00 Any other partition will be also wiped!#\n"
"#FFDD00 Use USB UMS to copy them over!#");
}
lv_label_set_text(lbl_status, txt_buf);
@@ -1909,7 +1916,8 @@ static void create_mbox_check_files_total_size()
else
{
lv_mbox_set_text(mbox,
"#FFDD00 The SD Card cannot be backed up!#\n\n"
"#FFDD00 The SD Card cannot be backed up!#\n"
"#FFDD00 Any other partition will be also wiped!#\n\n"
"You will be asked to back up your files later via UMS.");
}

View File

@@ -167,7 +167,7 @@ static int nx_emmc_bis_write_block(u32 sector, u32 count, void *buff, bool flush
if (!emu_offset)
res = nx_emmc_part_write(&emmc_storage, system_part, sector, count, bis_cache->dma_buff);
else
res = sdmmc_storage_read(&sd_storage, emu_offset + system_part->lba_start + sector, count, bis_cache->dma_buff);
res = sdmmc_storage_write(&sd_storage, emu_offset + system_part->lba_start + sector, count, bis_cache->dma_buff);
if (!res)
return 1; // R/W error.