--- np2/x11/ini.c 2003/11/26 14:55:01 1.3 +++ np2/x11/ini.c 2004/01/23 14:35:45 1.9 @@ -315,7 +315,7 @@ iwss_extend: static BOOL read_iniread_flag(const INITBL *p); void -ini_write(const char *path, const char *title, const INITBL *tbl, UINT count) +ini_write(const char *path, const char *title, const INITBL *tbl, UINT count, BOOL create) { char work[512]; const INITBL *p; @@ -323,9 +323,17 @@ ini_write(const char *path, const char * FILEH fh; BOOL set; - fh = file_create(path); - if (fh == FILEH_INVALID) - return; + fh = FILEH_INVALID; + if (!create) { + fh = file_open(path); + if (fh != FILEH_INVALID) + file_seek(fh, 0L, FSEEK_END); + } + if (fh == FILEH_INVALID) { + fh = file_create(path); + if (fh == FILEH_INVALID) + return; + } milstr_ncpy(work, "[", sizeof(work)); milstr_ncat(work, title, sizeof(work)); @@ -421,6 +429,7 @@ static const char ini_title[] = "NekoPro enum { INIRO_STR = INIFLAG_RO | INITYPE_STR, INIRO_BOOL = INIFLAG_RO | INITYPE_BOOL, + INIRO_UINT8 = INIFLAG_RO | INITYPE_UINT8, INIMAX_UINT8 = INIFLAG_MAX | INITYPE_UINT8, INIAND_UINT8 = INIFLAG_AND | INITYPE_UINT8, INIROMAX_SINT32 = INIFLAG_RO | INIFLAG_MAX | INITYPE_SINT32, @@ -439,6 +448,9 @@ static const INITBL iniitem[] = { {"HDfolder", INITYPE_STR, hddfolder, MAX_PATH}, {"bmap_Dir", INITYPE_STR, bmpfilefolder, MAX_PATH}, {"fontfile", INITYPE_STR, np2cfg.fontfile, MAX_PATH}, + {"biospath", INITYPE_STR, np2cfg.biospath, MAX_PATH}, + {"hdrvroot", INIRO_STR, np2cfg.hdrvroot, MAX_PATH}, + {"hdrv_acc", INIRO_UINT8, &np2cfg.hdrvacc, 0}, {"pc_model", INITYPE_STR, &np2cfg.model, sizeof(np2cfg.model)}, @@ -450,8 +462,8 @@ static const INITBL iniitem[] = { {"ExMemory", INIMAX_UINT8, &np2cfg.EXTMEM, 13}, {"ITF_WORK", INIRO_BOOL, &np2cfg.ITF_WORK, 0}, - {"HDD1FILE", INITYPE_STR, np2cfg.hddfile[0], MAX_PATH}, - {"HDD2FILE", INITYPE_STR, np2cfg.hddfile[1], MAX_PATH}, + {"HDD1FILE", INITYPE_STR, np2cfg.sasihdd[0], MAX_PATH}, + {"HDD2FILE", INITYPE_STR, np2cfg.sasihdd[1], MAX_PATH}, {"SampleHz", INITYPE_UINT16, &np2cfg.samplingrate, 0}, {"Latencys", INITYPE_UINT16, &np2cfg.delayms, 0}, @@ -507,7 +519,7 @@ static const INITBL iniitem[] = { {"USE144FD", INITYPE_BOOL, &np2cfg.usefd144, 0}, {"keyboard", INIRO_KB, &np2oscfg.KEYBOARD, 0}, - {"F12_COPY", INITYPE_UINT8, &np2oscfg.F12COPY, 0}, + {"F12_COPY", INITYPE_UINT8, &np2oscfg.F12KEY, 0}, {"Joystick", INITYPE_BOOL, &np2oscfg.JOYPAD1, 0}, {"Joy1_btn", INITYPE_ARGH8, np2oscfg.JOY1BTN, 4}, @@ -525,6 +537,7 @@ static const INITBL iniitem[] = { #endif {"toolwind", INITYPE_BOOL, &np2oscfg.toolwin, 0}, {"keydispl", INITYPE_BOOL, &np2oscfg.keydisp, 0}, + {"jast_snd", INITYPE_BOOL, &np2oscfg.jastsnd, 0}, {"sounddrv", INITYPE_SNDDRV, &np2oscfg.snddrv, 0}, {"audiodev", INITYPE_STR, &np2oscfg.audiodev, MAX_PATH}, @@ -599,5 +612,5 @@ initsave(void) char path[MAX_PATH]; milstr_ncpy(path, modulefile, sizeof(path)); - ini_write(path, ini_title, iniitem, INIITEMS); + ini_write(path, ini_title, iniitem, INIITEMS, TRUE); }