BRESULT VERMOUTHCL midimod_getfile(MIDIMOD mod, const OEMCHAR *filename, OEMCHAR *path, int size) { PATHLIST p; short attr; if ((filename == NULL) || (filename[0] == '\0') || (path == NULL) || (size == 0)) { goto fpgf_exit; } p = mod->pathlist; while(p) { file_cpyname(path, p->path, size); file_catname(path, filename, size); #if defined(SUPPORT_ARC) attr = arcex_attr(path); #else attr = file_attr(path); #endif if (attr != -1) { return(SUCCESS); } p = p->next; } fpgf_exit: return(FAILURE); }
BOOL dlgs_selectwritenum(HWND hWnd, const FILESEL *item, TCHAR *path, UINT size) { TCHAR *file; TCHAR *p; TCHAR *q; UINT i; BOOL r; if ((item == NULL) || (path == NULL) || (size == 0)) { return(FALSE); } file = (TCHAR *)_MALLOC((size + 16) * sizeof(TCHAR), path); if (file == NULL) { return(FALSE); } p = file_getname(path); milstr_ncpy(file, path, size); file_cutname(file); q = file + lstrlen(file); for (i=0; i<10000; i++) { wsprintf(q, p, i); if (file_attr(file) == (short)-1) { break; } } r = dlgs_selectwritefile(hWnd, item, file, size); if (r) { milstr_ncpy(path, file, size); } _MFREE(file); return(r); }
short file_attr_c(const OEMCHAR *filename) { *curfilep = '\0'; file_catname(curpath, filename, sizeof(curpath)); return file_attr(curpath); }
BRESULT cfgfile_getfile(MIDIMOD mod, const OEMCHAR *filename, OEMCHAR *path, int size) { PATHLIST p; short attr; if ((filename == NULL) || (filename[0] == '\0') || (path == NULL) || (size == 0)) { goto fpgf_exit; } p = mod->pathlist; while(p) { file_cpyname(path, p->path, size); file_catname(path, filename, size); attr = file_attr(path); if (attr != -1) { return(SUCCESS); } p = p->next; } fpgf_exit: return(FAILURE); }
/** * カレント ファイルの属性を得る * @param[in] lpFilename ファイル名 * @return ファイル属性 */ short DOSIOCALL file_attr_c(const OEMCHAR* lpFilename) { return file_attr(file_getcd(lpFilename)); }
void vramdraw_savebmp(int num, const char *dir, const char *name, int pos, const char *credit0, const char *credit1) { int i; char path[MAX_PATH]; char work[32]; BMPDATA inf; VRAMHDL vram; UINT tmp; UINT bmpsize; BMPFILE bf; BMPINFO bi; BYTE *dat; FILEH fh; if ((num < 0) || (num >= GAMECORE_MAXVRAM) || (name == NULL)) { goto vdsb_err1; } if (dir == NULL) { dir = ""; } for (i=0; i<100; i++) { milstr_ncpy(path, dir, sizeof(path)); milstr_ncat(path, name, sizeof(path)); sprintf(work, "%02u.bmp", i); milstr_ncat(path, work, sizeof(path)); if (file_attr(path) == -1) { break; } taskmng_rol(); } if (i >= 100) { goto vdsb_err1; } vram = vram_copy(gamecore.vram[num]); if (vram == NULL) { goto vdsb_err1; } creditmix(vram, pos, credit1, 0x000000); creditmix(vram, pos, credit0, 0xffffff); inf.width = vram->width; inf.height = vram->height; inf.bpp = 24; bmpdata_setinfo(&bi, &inf, TRUE); bmpsize = bmpdata_getdatasize(&bi); ZeroMemory(&bf, sizeof(bf)); bf.bfType[0] = 'B'; bf.bfType[1] = 'M'; tmp = sizeof(BMPFILE) + sizeof(BMPINFO); STOREINTELDWORD(bf.bfOffBits, tmp); tmp += bmpsize; STOREINTELDWORD(bf.bfSize, tmp); dat = bmpdata_bmp24cnv(&bi, vram); if (dat == NULL) { goto vdsb_err2; } fh = file_create(path); if (fh == FILEH_INVALID) { goto vdsb_err3; } file_write(fh, &bf, sizeof(bf)); file_write(fh, &bi, sizeof(bi)); file_write(fh, dat, bmpsize); file_close(fh); vdsb_err3: _MFREE(dat); vdsb_err2: vram_destroy(vram); vdsb_err1: return; }
short DOSIOCALL file_attr_c(const OEMCHAR *path) { file_cpyname(curfilep, path, NELEMENTS(curpath) - (curfilep - curpath)); return(file_attr(curpath)); }
short file_attr_c(const char *path) { *curfilep = '\0'; file_catname(curpath, path, sizeof(curpath)); return(file_attr(curpath)); }
short file_attr_c(const char *path) { file_cpyname(curfilep, path, NELEMENTS(curpath) - (UINT)(curfilep - curpath)); return(file_attr(curpath)); }
/** * Loads font files * @param[in] filename The name of the font file * @param[in] force If this parameter is TRUE, load file always * If this parameter is FALSE, load when font is not ready * @return font type */ UINT8 font_load(const OEMCHAR *filename, BOOL force) { UINT i; const UINT8 *p; UINT8 *q; UINT j; OEMCHAR fname[MAX_PATH]; UINT8 type; UINT8 loading; if (filename) { file_cpyname(fname, filename, NELEMENTS(fname)); } else { fname[0] = '\0'; } type = fonttypecheck(fname); if ((!type) && (!force)) { return(0); } // 外字: font[??560-??57f], font[??d60-??d7f] は削らないように… for (i=0; i<0x80; i++) { q = fontrom + (i << 12); ZeroMemory(q + 0x000, 0x0560 - 0x000); ZeroMemory(q + 0x580, 0x0d60 - 0x580); ZeroMemory(q + 0xd80, 0x1000 - 0xd80); } fontdata_ank8store(fontdata_8, 0, 256); p = fontdata_8; q = fontrom + 0x80000; for (i=0; i<256; i++) { for (j=0; j<8; j++) { q[0] = p[0]; q[1] = p[0]; p += 1; q += 2; } } loading = 0xff; switch(type) { case FONTTYPE_PC98: loading = fontpc98_read(fname, loading); break; case FONTTYPE_V98: loading = fontv98_read(fname, loading); break; case FONTTYPE_PC88: loading = fontpc88_read(fname, loading); break; case FONTTYPE_FM7: loading = fontfm7_read(fname, loading); break; case FONTTYPE_X1: loading = fontx1_read(fname, loading); break; case FONTTYPE_X68: loading = fontx68k_read(fname, loading); break; } loading = fontpc98_read(file_getcd(pc98fontname), loading); loading = fontv98_read(file_getcd(v98fontname), loading); loading = fontpc88_read(file_getcd(pc88ankname), loading); if (loading & FONTLOAD_16) { file_cpyname(fname, file_getcd(fonttmpname), NELEMENTS(fname)); if (file_attr(fname) == -1) { makepc98bmp(fname); } loading = fontpc98_read(fname, loading); } return(type); }