Exemplo n.º 1
0
/****************************************************************************
 * MountMC
 *
 * Mounts the memory card in the given slot.
 * Returns the result of the last attempted CARD_Mount command.
 ***************************************************************************/
static int MountMC(int slot, bool silent)
{
	int ret = -1;
	int tries = 0;

	// Initialize Card System
	SysArea = (u8 *)memalign(32, CARD_WORKAREA);
	memset (SysArea, 0, CARD_WORKAREA);
	CARD_Init ("VBA0", "00");

	// Mount the card
	while(tries < 10 && ret != 0)
	{
		EXI_ProbeReset();
		ret = CARD_Mount (slot, SysArea, NULL);
		VIDEO_WaitVSync();
		tries++;
	}

	if(ret != 0 && !silent)
	{
		if (slot == CARD_SLOTA)
			ErrorPrompt("Unable to mount Slot A Memory Card!");
		else
			ErrorPrompt("Unable to mount Slot B Memory Card!");
	}
	return ret;
}
Exemplo n.º 2
0
Arquivo: mcard.c Projeto: suloku/gcmm
/****************************************************************************
 * MountCard
 *
 * Mounts the memory card in the given slot.
 * CARD_Mount is called for a maximum of 10 tries
 * Returns the result of the last attempted CARD_Mount command.
 ***************************************************************************/
int MountCard(int cslot)
{
	s32 ret = -1;
	int tries = 0;
	int isMounted;

	// Mount the card, try several times as they are tricky
	while ( (tries < 10) && (ret < 0))
	{
		/*** We already initialized the Memory Card subsystem with CARD_Init() in select_memcard_slot(). Let's reset the
		EXI subsystem, just to make sure we have no problems mounting the card ***/
		EXI_ProbeReset();
		CARD_Init (NULL, NULL);
		//Ensure we start in show all files mode
		CARD_SetCompany(NULL);
		CARD_SetGamecode(NULL);		

		/*** Mount the card ***/
		ret = CARD_Mount (cslot, SysArea, card_removed);
		if (ret >= 0) break;

		VIDEO_WaitVSync ();
		tries++;
	}
			/*** Make sure the card is really mounted ***/
	isMounted = CARD_ProbeEx(cslot, &memsize, &sectsize);
	if (memsize > 0 && sectsize > 0)//then we really mounted de card
	{
		return isMounted;
	}
	/*** If this point is reached, something went wrong ***/
	CARD_Unmount(cslot);
	return ret;
}
Exemplo n.º 3
0
/****************************************************************************
 * MountCard
 *
 * Mounts the memory card in the given slot.
 * Returns the result of the last attempted CARD_Mount command.
 ***************************************************************************/
int MountCard(int cslot, bool silent)
{
	int ret = -1;
	int tries = 0;

	// Mount the card
	while ( tries < 10 && ret != 0)
	{
		EXI_ProbeReset ();
		ret = CARD_Mount (cslot, SysArea, NULL);
		VIDEO_WaitVSync ();
		tries++;
	}
	return ret;
}
Exemplo n.º 4
0
/****************************************************************************
 * CardMount
 *
 * libOGC provides the CARD_Mount function, and it should be all you need.
 * However, experience with previous emulators has taught me that you are
 * better off doing a little bit more than that!
 *
 *****************************************************************************/
static int CardMount(int slot)
{
  int tries = 0;
#if defined(HW_DOL)
  *(unsigned long *) (0xCC006800) |= 1 << 13; /*** Disable Encryption ***/
#elif defined(HW_RVL)
  *(unsigned long *) (0xCD006800) |= 1 << 13; /*** Disable Encryption ***/
#endif
  while (tries < 10)
  {
    VIDEO_WaitVSync ();
    if (CARD_Mount(slot, SysArea, NULL) == CARD_ERROR_READY)
      return 1;
    else
      EXI_ProbeReset ();
    tries++;
  }
  return 0;
}
Exemplo n.º 5
0
int MountTheCard()
{
        int tries = 0;
        int CardError;
        while ( tries < 10 )
        {
                 *(unsigned long*)(0xcc006800) |= 1<<13;        /*** Disable Encryption ***/
                uselessinquiry();
                VIDEO_WaitVSync();
                CardError = CARD_Mount(CARDSLOT, SysArea, NULL);        /*** Don't need or want a callback ***/
                if ( CardError == 0 )
                        return 0;
                else {
                        EXI_ProbeReset();
                }
                tries++;
        }

        return 1;
}
Exemplo n.º 6
0
/****************************************************************************
 * MountTheCard
 *
 * libOGC provides the CARD_Mount function, and it should be all you need.
 * However, experience with previous emulators has taught me that you are
 * better off doing a little bit more than that!
 *
 * Function returns TRUE on success.
 *****************************************************************************/
static int MountTheCard (u8 slot)
{
  int tries = 0;
  int CardError;
#if defined(HW_DOL)
  *(unsigned long *) (0xCC006800) |= 1 << 13; /*** Disable Encryption ***/
  uselessinquiry ();
#elif defined(HW_RVL)
  *(unsigned long *) (0xCD006800) |= 1 << 13; /*** Disable Encryption ***/
#endif
  while (tries < 10)
  {
    VIDEO_WaitVSync ();
    CardError = CARD_Mount (slot, SysArea, NULL); /*** Don't need or want a callback ***/
    if (CardError == 0)
      return 1;
    else
      EXI_ProbeReset ();
    tries++;
  }
  return 0;
}