| version 1.1, 2003/10/23 07:20:43 | version 1.11, 2004/01/09 04:36:02 | 
| Line 207  const INITBL *pterm; | Line 207  const INITBL *pterm; | 
 | } | } | 
 | milstr_ncpy(work, "[", sizeof(work)); | milstr_ncpy(work, "[", sizeof(work)); | 
 | milstr_ncat(work, title, sizeof(work)); | milstr_ncat(work, title, sizeof(work)); | 
| milstr_ncat(work, "]\r\n", sizeof(work)); | milstr_ncat(work, "]\r", sizeof(work)); | 
 | file_write(fh, work, strlen(work)); | file_write(fh, work, strlen(work)); | 
 |  |  | 
 | p = tbl; | p = tbl; | 
| Line 230  const INITBL *pterm; | Line 230  const INITBL *pterm; | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_SINT8: | case INITYPE_SINT8: | 
| SPRINTF(work, "%d", *((char *)p->value)); | SPRINTF(work, str_d, *((char *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_SINT16: | case INITYPE_SINT16: | 
| SPRINTF(work, "%d", *((SINT16 *)p->value)); | SPRINTF(work, str_d, *((SINT16 *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_SINT32: | case INITYPE_SINT32: | 
| SPRINTF(work, "%d", *((SINT32 *)p->value)); | SPRINTF(work, str_d, *((SINT32 *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_UINT8: | case INITYPE_UINT8: | 
| SPRINTF(work, "%u", *((BYTE *)p->value)); | SPRINTF(work, str_u, *((BYTE *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_UINT16: | case INITYPE_UINT16: | 
| SPRINTF(work, "%u", *((UINT16 *)p->value)); | SPRINTF(work, str_u, *((UINT16 *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_UINT32: | case INITYPE_UINT32: | 
| SPRINTF(work, "%u", *((UINT32 *)p->value)); | SPRINTF(work, str_u, *((UINT32 *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_HEX8: | case INITYPE_HEX8: | 
| SPRINTF(work, "%x", *((BYTE *)p->value)); | SPRINTF(work, str_x, *((BYTE *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_HEX16: | case INITYPE_HEX16: | 
| SPRINTF(work, "%x", *((UINT16 *)p->value)); | SPRINTF(work, str_x, *((UINT16 *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | case INITYPE_HEX32: | case INITYPE_HEX32: | 
| SPRINTF(work, "%x", *((UINT32 *)p->value)); | SPRINTF(work, str_x, *((UINT32 *)p->value)); | 
 | break; | break; | 
 |  |  | 
 | default: | default: | 
| Line 273  const INITBL *pterm; | Line 273  const INITBL *pterm; | 
 | file_write(fh, p->item, strlen(p->item)); | file_write(fh, p->item, strlen(p->item)); | 
 | file_write(fh, " = ", 3); | file_write(fh, " = ", 3); | 
 | file_write(fh, work, strlen(work)); | file_write(fh, work, strlen(work)); | 
| file_write(fh, "\r\n", 2); | file_write(fh, "\r", 1); | 
 | } | } | 
 | p++; | p++; | 
 | } | } | 
| Line 290  static const char ini_title[] = "NekoPro | Line 290  static const char ini_title[] = "NekoPro | 
 | static const char inifile[] = "np2.cfg"; | static const char inifile[] = "np2.cfg"; | 
 |  |  | 
 | static const INITBL iniitem[] = { | static const INITBL iniitem[] = { | 
 |  | {"windposx", INITYPE_SINT32,    &np2oscfg.posx,                 0}, | 
 |  | {"windposy", INITYPE_SINT32,    &np2oscfg.posy,                 0}, | 
 |  |  | 
 |  | {"pc_model", INITYPE_STR,               &np2cfg.model, | 
 |  | sizeof(np2cfg.model)}, | 
 | {"clk_base", INITYPE_SINT32,    &np2cfg.baseclock,              0}, | {"clk_base", INITYPE_SINT32,    &np2cfg.baseclock,              0}, | 
 | {"clk_mult", INITYPE_SINT32,    &np2cfg.multiple,               0}, | {"clk_mult", INITYPE_SINT32,    &np2cfg.multiple,               0}, | 
 |  |  | 
| Line 301  static const INITBL iniitem[] = { | Line 306  static const INITBL iniitem[] = { | 
 | {"HDD1FILE", INITYPE_STR,               np2cfg.hddfile[0],              MAX_PATH}, | {"HDD1FILE", INITYPE_STR,               np2cfg.hddfile[0],              MAX_PATH}, | 
 | {"HDD2FILE", INITYPE_STR,               np2cfg.hddfile[1],              MAX_PATH}, | {"HDD2FILE", INITYPE_STR,               np2cfg.hddfile[1],              MAX_PATH}, | 
 | {"fontfile", INITYPE_STR,               np2cfg.fontfile,                MAX_PATH}, | {"fontfile", INITYPE_STR,               np2cfg.fontfile,                MAX_PATH}, | 
 |  | {"biospath", INITYPE_STR,               np2cfg.biospath,                MAX_PATH}, | 
 |  | {"hdrvroot", INITYPE_STR,               np2cfg.hdrvroot,                MAX_PATH}, | 
 |  |  | 
 | {"SampleHz", INITYPE_UINT16,    &np2cfg.samplingrate,   0}, | {"SampleHz", INITYPE_UINT16,    &np2cfg.samplingrate,   0}, | 
 | {"Latencys", INITYPE_UINT16,    &np2cfg.delayms,                0}, | {"Latencys", INITYPE_UINT16,    &np2cfg.delayms,                0}, | 
| Line 327  static const INITBL iniitem[] = { | Line 334  static const INITBL iniitem[] = { | 
 | {"Seek_Snd", INITYPE_BOOL,              &np2cfg.MOTOR,                  0}, | {"Seek_Snd", INITYPE_BOOL,              &np2cfg.MOTOR,                  0}, | 
 | {"Seek_Vol", INITYPE_UINT8,             &np2cfg.MOTORVOL,               0}, | {"Seek_Vol", INITYPE_UINT8,             &np2cfg.MOTORVOL,               0}, | 
 |  |  | 
| {"F12_COPY", INITYPE_UINT8,             &np2oscfg.F12COPY,              0}, | {"F11_bind", INITYPE_UINT8,             &np2oscfg.F11KEY,               0}, | 
|  | {"F12_bind", INITYPE_UINT8,             &np2oscfg.F12KEY,               0}, | 
 | {"btnRAPID", INITYPE_BOOL,              &np2cfg.BTN_RAPID,              0}, | {"btnRAPID", INITYPE_BOOL,              &np2cfg.BTN_RAPID,              0}, | 
 | {"btn_MODE", INITYPE_BOOL,              &np2cfg.BTN_MODE,               0}, | {"btn_MODE", INITYPE_BOOL,              &np2cfg.BTN_MODE,               0}, | 
 |  | {"Mouse_sw", INITYPE_BOOL,              &np2oscfg.MOUSE_SW,             0}, | 
 | {"MS_RAPID", INITYPE_BOOL,              &np2cfg.MOUSERAPID,             0}, | {"MS_RAPID", INITYPE_BOOL,              &np2cfg.MOUSERAPID,             0}, | 
 |  |  | 
 | {"VRAMwait", INITYPE_BYTEARG,   np2cfg.wait,                    6}, | {"VRAMwait", INITYPE_BYTEARG,   np2cfg.wait,                    6}, | 
| Line 352  static const INITBL iniitem[] = { | Line 361  static const INITBL iniitem[] = { | 
 | {"pc9861_j", INITYPE_BYTEARG,   np2cfg.pc9861jmp,               6}, | {"pc9861_j", INITYPE_BYTEARG,   np2cfg.pc9861jmp,               6}, | 
 | {"calendar", INITYPE_BOOL,              &np2cfg.calendar,               0}, | {"calendar", INITYPE_BOOL,              &np2cfg.calendar,               0}, | 
 | {"USE144FD", INITYPE_BOOL,              &np2cfg.usefd144,               0}, | {"USE144FD", INITYPE_BOOL,              &np2cfg.usefd144,               0}, | 
 |  | {"e_resume", INITYPE_BOOL,              &np2oscfg.resume,               0}, | 
 |  | {"jast_snd", INITYPE_BOOL,              &np2oscfg.jastsnd,              0},             // ver0.73 | 
 | {"I286SAVE", INITYPE_BOOL,              &np2oscfg.I286SAVE,             0}}; | {"I286SAVE", INITYPE_BOOL,              &np2oscfg.I286SAVE,             0}}; | 
 |  |  | 
 | #define INIITEMS        (sizeof(iniitem) / sizeof(INITBL)) | #define INIITEMS        (sizeof(iniitem) / sizeof(INITBL)) | 
| Line 361  void initload(void) { | Line 372  void initload(void) { | 
 |  |  | 
 | char    path[MAX_PATH]; | char    path[MAX_PATH]; | 
 |  |  | 
| milstr_ncpy(path, file_getcd(inifile), sizeof(path)); | file_cpyname(path, file_getcd(inifile), sizeof(path)); | 
 | ini_read(path, ini_title, iniitem, INIITEMS); | ini_read(path, ini_title, iniitem, INIITEMS); | 
 | } | } | 
 |  |  | 
| Line 369  void initsave(void) { | Line 380  void initsave(void) { | 
 |  |  | 
 | char    path[MAX_PATH]; | char    path[MAX_PATH]; | 
 |  |  | 
| milstr_ncpy(path, file_getcd(inifile), sizeof(path)); | file_cpyname(path, file_getcd(inifile), sizeof(path)); | 
 | ini_write(path, ini_title, iniitem, INIITEMS); | ini_write(path, ini_title, iniitem, INIITEMS); | 
 | } | } | 
 |  |  |