Lines Matching refs:offset

159 SDK_INLINE u32 CARDi_GetHashSectorIndex(const CARDRomHashContext *context, u32 offset)  in CARDi_GetHashSectorIndex()  argument
161 offset -= context->area_ntr.offset; in CARDi_GetHashSectorIndex()
162 if (offset >= context->area_ntr.length) in CARDi_GetHashSectorIndex()
164 offset += (context->area_ntr.offset - context->area_ltd.offset); in CARDi_GetHashSectorIndex()
165 if (offset < context->area_ltd.length) in CARDi_GetHashSectorIndex()
167 offset += context->area_ntr.length; in CARDi_GetHashSectorIndex()
174 return offset / context->bytes_per_sector; in CARDi_GetHashSectorIndex()
190 u32 offset = 0; in CARDi_StartLoading() local
200 u32 pos = block->offset; in CARDi_StartLoading()
205 offset = pos - mod; in CARDi_StartLoading()
213 offset = sector->offset; in CARDi_StartLoading()
221 if ((*context->ReadAsync)(context->userdata, buffer, offset, length) == 0) in CARDi_StartLoading()
223 (void)(*context->ReadSync)(context->userdata, buffer, offset, length); in CARDi_StartLoading()
327 …loading->offset = context->sector_hash.offset + index * (CARD_ROM_HASH_SIZE * context->sectors_per… in CARDi_TouchRomHashBlock()
354 static void* CARDi_TouchRomHashSector(CARDRomHashContext *context, u32 offset) in CARDi_TouchRomHashSector() argument
359 u32 index = CARDi_GetHashSectorIndex(context, offset); in CARDi_TouchRomHashSector()
385 loading->offset = MATH_ROUNDDOWN(offset, context->bytes_per_sector); in CARDi_TouchRomHashSector()
476 …->ReadSync)(context->userdata, context->master_hash, context->block_hash.offset, context->block_ha… in CARD_InitRomHashContext()
525 static void CARDi_ReadRomHashImageDirect(CARDRomHashContext *context, void *buffer, u32 offset, u32… in CARDi_ReadRomHashImageDirect() argument
529 u32 position = offset; in CARDi_ReadRomHashImageDirect()
530 u32 end = length + offset; in CARDi_ReadRomHashImageDirect()
592 static void CARDi_ReadRomHashImageCaching(CARDRomHashContext *context, void *buffer, u32 offset, u3… in CARDi_ReadRomHashImageCaching() argument
597 void *image = CARDi_TouchRomHashSector(context, offset); in CARDi_ReadRomHashImageCaching()
602 u32 mod = offset - MATH_ROUNDDOWN(offset, max); in CARDi_ReadRomHashImageCaching()
607 offset += len; in CARDi_ReadRomHashImageCaching()
615 u32 hit = MATH_ROUNDDOWN(offset, context->bytes_per_sector); in CARDi_ReadRomHashImageCaching()
619 if (hit >= offset + length) in CARDi_ReadRomHashImageCaching()
689 void CARD_ReadRomHashImage(CARDRomHashContext *context, void *buffer, u32 offset, u32 length) in CARD_ReadRomHashImage() argument
706 const u32 headlen = (u32)((context->bytes_per_sector - offset) & sectmask); in CARD_ReadRomHashImage()
711 CARDi_ReadRomHashImageCaching(context, buffer, offset, headlen); in CARD_ReadRomHashImage()
712 offset += headlen; in CARD_ReadRomHashImage()
719 CARDi_ReadRomHashImageDirect(context, buffer, offset, bodylen); in CARD_ReadRomHashImage()
720 offset += bodylen; in CARD_ReadRomHashImage()
726 CARDi_ReadRomHashImageCaching(context, buffer, offset, length); in CARD_ReadRomHashImage()