Example #1
0
DRESULT disk_read (BYTE drv, BYTE *buff, DWORD sector, BYTE count)
{
	u32 *buffer = malloca(count * s_size, 0x40);

	if(USBStorage_Read_Sectors(sector, count, buffer) != 1)
	{
		dbgprintf("FFS:Failed to read from USB device... Sector: %d Count: %d dst: %p\n", sector, count, buff);
		return RES_ERROR;
	}

	memcpy(buff, buffer, count * s_size);
	free(buffer);

	return RES_OK;
}
Example #2
0
s32 USBStorage_Read_Sectors_2(u32 sector, u32 numSectors, void *buffer){
	return USBStorage_Read_Sectors(2, sector, numSectors, buffer);
}