rem: u32 i,entry_len;
add: s32 i,entry_len;
context: static s32 __card_seek(card_file *file,u32 len,u32 offset,card_block **rcard){	s32 ret;	u32 i,entry_len;	card_block *card = NULL;	struct card_direntry *entry = NULL;	struct card_dir *dirblock = NULL;	struct card_bat *fatblock = NULL;#ifdef _CARD_DEBUG	printf("__card_seek(%d,%p,%d,%d)\n",file->filenum,file,len,offset);#endif	if(file->filenum<0 || file->filenum>=CARD_MAXFILES) return CARD_ERROR_FATAL_ERROR;	if((ret=__card_getcntrlblock(file->chn,&card))<0) return ret;#ifdef _CARD_DEBUG	printf("__card_seek(%d)\n",file->iblock);#endif	if(file->iblock<CARD_SYSAREA || file->iblock>=card->blocks) {		__card_putcntrlblock(card,CARD_ERROR_FATAL_ERROR);		return CARD_ERROR_FATAL_ERROR;	}	dirblock = __card_getdirblock(card);	entry = &dirblock->entries[file->filenum];#ifdef _CARD_DEBUG	printf("__card_seek(%p,%d)\n",entry,file->filenum);#endif	if(entry->gamecode[0]!=0xff) {		entry_len = entry->length*card->sector_size;		if(entry_len<offset || entry_len<(offset+len)) {			__card_putcntrlblock(card,CARD_ERROR_LIMIT);			return CARD_ERROR_LIMIT;		}		card->curr_file = file;		file->len = len;				if(offset<file->offset) {			file->offset = 0;			file->iblock = entry->block;			if(file->iblock<CARD_SYSAREA || file->iblock>=card->blocks) {				__card_putcntrlblock(card,CARD_ERROR_BROKEN);				return CARD_ERROR_BROKEN;			}		}		fatblock = __card_getbatblock(card);		for(i=file->iblock;i<card->blocks && file->offset<(offset&~(card->sector_size-1));i=file->iblock) {			file->offset += card->sector_size;			file->iblock = fatblock->fat[i-CARD_SYSAREA];			if(file->iblock<CARD_SYSAREA || file->iblock>=card->blocks) {				__card_putcntrlblock(card,CARD_ERROR_BROKEN);				return CARD_ERROR_BROKEN;			}		}		file->offset = offset;		*rcard = card;	}	return CARD_ERROR_READY;}