From 7163cf7c2e48ad4889c192f06f5f58f5d9512ebc Mon Sep 17 00:00:00 2001 From: ariahiro64 Date: Sun, 22 Oct 2023 02:12:48 -0400 Subject: [PATCH] dino fix (cubavore still crashes) --- src/flashcart/ed64/ed64.c | 4 ++-- src/flashcart/ed64/ed64_ll.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/flashcart/ed64/ed64.c b/src/flashcart/ed64/ed64.c index 25936578..8d3abf89 100644 --- a/src/flashcart/ed64/ed64.c +++ b/src/flashcart/ed64/ed64.c @@ -129,10 +129,10 @@ static flashcart_err_t ed64_load_rom (char *rom_path, flashcart_progress_callbac ed64_save_type_t type = ed64_ll_get_save_type(); switch (type) { case SAVE_TYPE_SRAM: - rom_size -= KiB(32); + rom_size -= KiB(32) - KiB(16); case SAVE_TYPE_SRAM_128K: case SAVE_TYPE_FLASHRAM: - rom_size -= KiB(128); + rom_size -= KiB(128) - KiB(16); break; default: break; diff --git a/src/flashcart/ed64/ed64_ll.c b/src/flashcart/ed64/ed64_ll.c index 2c00d731..1dd5d7b9 100644 --- a/src/flashcart/ed64/ed64_ll.c +++ b/src/flashcart/ed64/ed64_ll.c @@ -237,7 +237,7 @@ int ed64_ll_get_sram_128 (uint8_t *buffer, int size) { dma_wait(); - pi_dma_from_sram(buffer, 0 - (KiB(64) - size), size) ; + pi_dma_from_sram(buffer, -(size - KiB(16)), size) ; dma_wait(); @@ -324,7 +324,7 @@ int ed64_ll_set_sram_128 (uint8_t *buffer, int size) { data_cache_hit_writeback_invalidate(buffer,size); dma_wait(); - pi_dma_to_sram(buffer, 0 - (KiB(64) - size), size); + pi_dma_to_sram(buffer, -(size - KiB(16)), size); data_cache_hit_writeback_invalidate(buffer,size); //Wait