mirror of
https://github.com/lesserkuma/GBA_MultiMenu.git
synced 2026-08-23 00:54:39 -05:00
-
This commit is contained in:
@@ -301,16 +301,16 @@ IWRAM_CODE u8 BootGame(ItemConfig config, FlashStatus status)
|
||||
FlashEraseSector((_flash_save_block_offset + status.last_boot_save_index) * _flash_sector_size);
|
||||
FlashWriteData((_flash_save_block_offset + status.last_boot_save_index) * _flash_sector_size, SRAM_SIZE);
|
||||
}
|
||||
|
||||
// Save status to flash
|
||||
status.last_boot_save_index = config.save_index;
|
||||
status.last_boot_save_type = config.save_type;
|
||||
memset((void *)data_buffer, 0, 0x1000);
|
||||
memcpy(data_buffer, &status, sizeof(status));
|
||||
FlashEraseSector(_flash_status_block_offset * flash_sector_size);
|
||||
FlashWriteData(_flash_status_block_offset * flash_sector_size, 0x1000);
|
||||
}
|
||||
|
||||
// Save status to flash
|
||||
status.last_boot_save_index = config.save_index;
|
||||
status.last_boot_save_type = config.save_type;
|
||||
memset((void *)data_buffer, 0, 0x1000);
|
||||
memcpy(data_buffer, &status, sizeof(status));
|
||||
FlashEraseSector(_flash_status_block_offset * flash_sector_size);
|
||||
FlashWriteData(_flash_status_block_offset * flash_sector_size, 0x1000);
|
||||
|
||||
// Disable SRAM access
|
||||
*(vu8 *)MAPPER_CONFIG4 = 0;
|
||||
|
||||
|
||||
@@ -233,13 +233,15 @@ int main(void) {
|
||||
sFlashStatus.last_boot_menu_index = page_active * 8 + cursor_pos;
|
||||
if (!show_credits && !show_debug) {
|
||||
LoadFont(0);
|
||||
if (sFlashStatus.battery_present == 1) {
|
||||
DrawText(5, SCREEN_HEIGHT - sFontSpecs.max_height - 3 - FontMarginBottom, ALIGN_LEFT, u"Loading… Don't turn off the power!", 48, font, (void*)AGB_VRAM+0xA000, FALSE);
|
||||
}
|
||||
DrawText(5, SCREEN_HEIGHT - sFontSpecs.max_height - 3 - FontMarginBottom, ALIGN_LEFT, u"Loading… Don't turn off the power!", 48, font, (void*)AGB_VRAM+0xA000, FALSE);
|
||||
REG_DISPCNT ^= 0x0010;
|
||||
dmaCopy((void*)AGB_VRAM+0xA000, (void*)AGB_VRAM, SCREEN_WIDTH * SCREEN_HEIGHT);
|
||||
REG_DISPCNT ^= 0x0010;
|
||||
}
|
||||
if (kHeld & KEY_SELECT) {
|
||||
// Skips reading latest save data from SRAM
|
||||
sFlashStatus.last_boot_save_type = SRAM_NONE;
|
||||
}
|
||||
u8 error_code = BootGame(sItemConfig, sFlashStatus);
|
||||
boot_failed = error_code;
|
||||
redraw_items = 0xFF;
|
||||
|
||||
Reference in New Issue
Block a user