diff --git a/src/flashcart/ed64/ed64.c b/src/flashcart/ed64/ed64.c index aaff0260..4e235b5d 100644 --- a/src/flashcart/ed64/ed64.c +++ b/src/flashcart/ed64/ed64.c @@ -37,13 +37,11 @@ static flashcart_err_t ed64_init (void) { FIL lrp_fil; UINT lrp_br; TCHAR lrp_path[1024]; - lrp_path[0] = '\0'; - if (f_open(&lrp_fil, LAST_SAVE_FILE_PATH, FA_READ) != FR_OK) { return FLASHCART_ERR_LOAD; } - if (f_read(&lrp_fil, lrp_path, 1024, &lrp_br) != FR_OK) { + if (f_read(&lrp_fil, lrp_path, sizeof(&lrp_fil) + 1, &lrp_br) != FR_OK) { f_close(&lrp_fil); return FLASHCART_ERR_LOAD; } diff --git a/src/flashcart/ed64/ed64_ll.c b/src/flashcart/ed64/ed64_ll.c index a897299b..b8c27780 100644 --- a/src/flashcart/ed64/ed64_ll.c +++ b/src/flashcart/ed64/ed64_ll.c @@ -215,22 +215,22 @@ void PI_SafeDMAFromCart(void *dest, void *src, u32 size) { #include "types.h" int getSRAM( uint8_t *buffer, int size){ - while (dma_busy()) ; + dma_wait(); IO_WRITE(PI_BSD_DOM2_LAT_REG, 0x05); IO_WRITE(PI_BSD_DOM2_PWD_REG, 0x0C); IO_WRITE(PI_BSD_DOM2_PGS_REG, 0x0D); IO_WRITE(PI_BSD_DOM2_RLS_REG, 0x02); - while (dma_busy()) ; + dma_wait(); PI_Init(); - while (dma_busy()) ; + dma_wait(); PI_DMAFromSRAM(buffer, 0, size) ; - while (dma_busy()) ; + dma_wait(); IO_WRITE(PI_BSD_DOM2_LAT_REG, 0x40); IO_WRITE(PI_BSD_DOM2_PWD_REG, 0x12); @@ -263,7 +263,7 @@ int setSRAM( uint8_t *buffer, int size){ PI_Init(); data_cache_hit_writeback_invalidate(buffer,size); - while (dma_busy()); + dma_wait(); PI_DMAToSRAM(buffer, 0, size); data_cache_hit_writeback_invalidate(buffer,size);