Lines Matching refs:offset

149 SDK_INLINE u32 CARDi_GetHashSectorIndex(const CARDRomHashContext *context, u32 offset)  in CARDi_GetHashSectorIndex()  argument
151 offset -= context->area_ntr.offset; in CARDi_GetHashSectorIndex()
152 if (offset >= context->area_ntr.length) in CARDi_GetHashSectorIndex()
154 offset += (context->area_ntr.offset - context->area_ltd.offset); in CARDi_GetHashSectorIndex()
155 if (offset < context->area_ltd.length) in CARDi_GetHashSectorIndex()
157 offset += context->area_ntr.length; in CARDi_GetHashSectorIndex()
164 return offset / context->bytes_per_sector; in CARDi_GetHashSectorIndex()
180 u32 offset = 0; in CARDi_StartLoading() local
190 u32 pos = block->offset; in CARDi_StartLoading()
195 offset = pos - mod; in CARDi_StartLoading()
203 offset = sector->offset; in CARDi_StartLoading()
211 if ((*context->ReadAsync)(context->userdata, buffer, offset, length) == 0) in CARDi_StartLoading()
213 (void)(*context->ReadSync)(context->userdata, buffer, offset, length); in CARDi_StartLoading()
317 …loading->offset = context->sector_hash.offset + index * (CARD_ROM_HASH_SIZE * context->sectors_per… in CARDi_TouchRomHashBlock()
344 static void* CARDi_TouchRomHashSector(CARDRomHashContext *context, u32 offset) in CARDi_TouchRomHashSector() argument
349 u32 index = CARDi_GetHashSectorIndex(context, offset); in CARDi_TouchRomHashSector()
375 loading->offset = MATH_ROUNDDOWN(offset, context->bytes_per_sector); in CARDi_TouchRomHashSector()
466 …->ReadSync)(context->userdata, context->master_hash, context->block_hash.offset, context->block_ha… in CARD_InitRomHashContext()
515 static void CARDi_ReadRomHashImageDirect(CARDRomHashContext *context, void *buffer, u32 offset, u32… in CARDi_ReadRomHashImageDirect() argument
519 u32 position = offset; in CARDi_ReadRomHashImageDirect()
520 u32 end = length + offset; in CARDi_ReadRomHashImageDirect()
582 static void CARDi_ReadRomHashImageCaching(CARDRomHashContext *context, void *buffer, u32 offset, u3… in CARDi_ReadRomHashImageCaching() argument
587 void *image = CARDi_TouchRomHashSector(context, offset); in CARDi_ReadRomHashImageCaching()
592 u32 mod = offset - MATH_ROUNDDOWN(offset, max); in CARDi_ReadRomHashImageCaching()
597 offset += len; in CARDi_ReadRomHashImageCaching()
605 u32 hit = MATH_ROUNDDOWN(offset, context->bytes_per_sector); in CARDi_ReadRomHashImageCaching()
609 if (hit >= offset + length) in CARDi_ReadRomHashImageCaching()
679 void CARD_ReadRomHashImage(CARDRomHashContext *context, void *buffer, u32 offset, u32 length) in CARD_ReadRomHashImage() argument
696 const u32 headlen = (u32)((context->bytes_per_sector - offset) & sectmask); in CARD_ReadRomHashImage()
701 CARDi_ReadRomHashImageCaching(context, buffer, offset, headlen); in CARD_ReadRomHashImage()
702 offset += headlen; in CARD_ReadRomHashImage()
709 CARDi_ReadRomHashImageDirect(context, buffer, offset, bodylen); in CARD_ReadRomHashImage()
710 offset += bodylen; in CARD_ReadRomHashImage()
716 CARDi_ReadRomHashImageCaching(context, buffer, offset, length); in CARD_ReadRomHashImage()