diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index b5f67e089..2715533fb 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -37,6 +37,17 @@ #include "rtc.h" #include "GPU_osd.h" #include "zero_private.h" +#include "mc.h" + +static const int save_types[6][2] = { + {MC_TYPE_AUTODETECT,1}, + {MC_TYPE_EEPROM1,MC_SIZE_4KBITS}, + {MC_TYPE_EEPROM2,MC_SIZE_64KBITS}, + {MC_TYPE_EEPROM2,MC_SIZE_512KBITS}, + {MC_TYPE_FLASH,MC_SIZE_256KBITS}, + {MC_TYPE_FRAM,MC_SIZE_2MBITS} +}; + #define ROM_MASK 3 @@ -3677,4 +3688,11 @@ void FASTCALL MMU_write8(u32 proc, u32 adr, u8 val) { if(proc==0) _MMU_write8<0ul>(adr,val); else _MMU_write8<1ul>(adr,val); -} +} + +void mmu_select_savetype(int type, int *bmemtype, u32 *bmemsize) { + if (type<0 || type > 5) return; + *bmemtype=save_types[type][0]; + *bmemsize=save_types[type][1]; + mc_realloc(&MMU.bupmem, *bmemtype, *bmemsize); +} diff --git a/desmume/src/MMU.h b/desmume/src/MMU.h index 959d3d8a3..cc03b731d 100644 --- a/desmume/src/MMU.h +++ b/desmume/src/MMU.h @@ -132,12 +132,7 @@ struct armcpu_memory_iface { }; -static void mmu_select_savetype(int type, int *bmemtype, u32 *bmemsize) { - if (type<0 || type > 5) return; - *bmemtype=save_types[type][0]; - *bmemsize=save_types[type][1]; - mc_realloc(&MMU.bupmem, *bmemtype, *bmemsize); -} +void mmu_select_savetype(int type, int *bmemtype, u32 *bmemsize); void MMU_Init(void); void MMU_DeInit(void); diff --git a/desmume/src/mc.h b/desmume/src/mc.h index 04ec6d599..0670830a5 100644 --- a/desmume/src/mc.h +++ b/desmume/src/mc.h @@ -41,15 +41,6 @@ #define MC_SIZE_16MBITS 0x200000 #define MC_SIZE_64MBITS 0x800000 -static int save_types[6][2] = { - {MC_TYPE_AUTODETECT,1}, - {MC_TYPE_EEPROM1,MC_SIZE_4KBITS}, - {MC_TYPE_EEPROM2,MC_SIZE_64KBITS}, - {MC_TYPE_EEPROM2,MC_SIZE_512KBITS}, - {MC_TYPE_FLASH,MC_SIZE_256KBITS}, - {MC_TYPE_FRAM,MC_SIZE_2MBITS} -}; - typedef struct { u8 com; /* persistent command actually handled */