rem: s32 CARD_CreateAsync(u32 chn,const char *filename,u32 size,card_file *file,cardcallback callback)
add: s32 CARD_CreateAsync(s32 chn,const char *filename,u32 size,card_file *file,cardcallback callback)
context: s32 CARD_CreateAsync(u32 chn,const char *filename,u32 size,card_file *file,cardcallback callback){	u32 i;	s32 ret,filenum;	cardcallback cb = NULL;	card_block *card = NULL;	struct card_bat *fatblock = NULL;	struct card_dir *dirblock = NULL;	struct card_direntry *entry = NULL;#ifdef _CARD_DEBUG	printf("CARD_CreateAsync(%d,%s,%d,%p,%p)\n",chn,filename,size,file,callback);#endif	if(strlen(filename)>CARD_FILENAMELEN) return CARD_ERROR_NAMETOOLONG;		if((ret=__card_getcntrlblock(chn,&card))<0) return ret;	if(size<=0 || size%card->sector_size) return CARD_ERROR_FATAL_ERROR;		dirblock = __card_getdirblock(card);	filenum = -1;	entry = dirblock->entries;	for(i=0;i<CARD_MAXFILES;i++) {		if(entry[i].gamecode[0]==0xff) {			if(filenum==-1) filenum = i;		} else if(stricmp(entry[i].filename,filename)==0			&& (card_gamecode[0]!=0xff && memcmp(entry[i].gamecode,card_gamecode,4)==0)			&& (card_company[0]!=0xff && memcmp(entry[i].company,card_company,2)==0)) {			__card_putcntrlblock(card,CARD_ERROR_EXIST);			return CARD_ERROR_EXIST;		}	}	if(filenum==-1) {		__card_putcntrlblock(card,CARD_ERROR_NOENT);		return CARD_ERROR_NOENT;	}	fatblock = __card_getbatblock(card);	if((fatblock->freeblocks*card->sector_size)<size) {		__card_putcntrlblock(card,CARD_ERROR_INSSPACE);		return CARD_ERROR_INSSPACE;	}	cb = callback;	if(!cb) cb = __card_defaultapicallback;	card->card_api_cb = cb;		entry[filenum].length = size/card->sector_size;	memcpy(entry[filenum].filename,filename,CARD_FILENAMELEN);		card->curr_file = file;	file->chn = chn;	file->filenum = filenum;	if((ret=__card_allocblock(chn,(size/card->sector_size),__card_createfatcallback))<0) {		__card_putcntrlblock(card,ret);		return ret;	}		return 0;}