riccardom patch:

move mmu_select_savetype in MMU.cpp and move save_types to the file of its only user
This commit is contained in:
yabause 2008-11-04 21:30:29 +00:00
parent 532eae0174
commit e2f9a0029c
3 changed files with 20 additions and 16 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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 */