--- np2/wince/ini.cpp 2003/11/14 07:37:29 1.2 +++ np2/wince/ini.cpp 2005/02/11 21:17:23 1.15 @@ -183,15 +183,18 @@ static void iniwrsetarg8(char *work, int char tmp[8]; if (arg > 0) { - SPRINTF(tmp, "%.2x", ptr[0]); + OEMSPRINTF(tmp, "%.2x", ptr[0]); milstr_ncpy(work, tmp, size); } for (i=1; ivalue)); + SPRINTF(work, str_d, *((char *)p->value)); break; case INITYPE_SINT16: - SPRINTF(work, "%d", *((SINT16 *)p->value)); + SPRINTF(work, str_d, *((SINT16 *)p->value)); break; case INITYPE_SINT32: - SPRINTF(work, "%d", *((SINT32 *)p->value)); + SPRINTF(work, str_d, *((SINT32 *)p->value)); break; case INITYPE_UINT8: - SPRINTF(work, "%u", *((BYTE *)p->value)); + SPRINTF(work, str_u, *((BYTE *)p->value)); break; case INITYPE_UINT16: - SPRINTF(work, "%u", *((UINT16 *)p->value)); + SPRINTF(work, str_u, *((UINT16 *)p->value)); break; case INITYPE_UINT32: - SPRINTF(work, "%u", *((UINT32 *)p->value)); + SPRINTF(work, str_u, *((UINT32 *)p->value)); break; case INITYPE_HEX8: - SPRINTF(work, "%x", *((BYTE *)p->value)); + SPRINTF(work, str_x, *((BYTE *)p->value)); break; case INITYPE_HEX16: - SPRINTF(work, "%x", *((UINT16 *)p->value)); + SPRINTF(work, str_x, *((UINT16 *)p->value)); break; case INITYPE_HEX32: - SPRINTF(work, "%x", *((UINT32 *)p->value)); + SPRINTF(work, str_x, *((UINT32 *)p->value)); break; default: @@ -283,21 +289,35 @@ const INITBL *pterm; // ---- +#if defined(OSLANG_UTF8) +static const char ini_title[] = "NekoProjectIICE"; +static const char inifile[] = "np2ce.cfg"; +#else static const char ini_title[] = "NekoProjectII"; static const char inifile[] = "np2.cfg"; +#endif static const INITBL iniitem[] = { + {"pc_model", INITYPE_STR, &np2cfg.model, + sizeof(np2cfg.model)}, {"clk_base", INITYPE_SINT32, &np2cfg.baseclock, 0}, {"clk_mult", INITYPE_SINT32, &np2cfg.multiple, 0}, - {"pc_model", INITYPE_UINT8, &np2cfg.model, 0}, {"DIPswtch", INITYPE_BYTEARG, np2cfg.dipsw, 3}, {"MEMswtch", INITYPE_BYTEARG, np2cfg.memsw, 8}, {"ExMemory", INITYPE_UINT8, &np2cfg.EXTMEM, 0}, {"ITF_WORK", INITYPE_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}, +#if defined(SUPPORT_SCSI) + {"SCSIHDD0", INITYPE_STR, np2cfg.scsihdd[0], MAX_PATH}, + {"SCSIHDD1", INITYPE_STR, np2cfg.scsihdd[1], MAX_PATH}, + {"SCSIHDD2", INITYPE_STR, np2cfg.scsihdd[2], MAX_PATH}, + {"SCSIHDD3", INITYPE_STR, np2cfg.scsihdd[3], MAX_PATH}, +#endif + {"fontfile", INITYPE_STR, np2cfg.fontfile, MAX_PATH}, + {"biospath", INITYPE_STR, np2cfg.biospath, MAX_PATH}, {"SampleHz", INITYPE_UINT16, &np2cfg.samplingrate, 0}, {"Latencys", INITYPE_UINT16, &np2cfg.delayms, 0}, @@ -332,8 +352,6 @@ static const INITBL iniitem[] = { {"DispSync", INITYPE_BOOL, &np2cfg.DISPSYNC, 0}, {"Real_Pal", INITYPE_BOOL, &np2cfg.RASTER, 0}, {"RPal_tim", INITYPE_UINT8, &np2cfg.realpal, 0}, - {"s_NOWAIT", INITYPE_BOOL, &np2oscfg.NOWAIT, 0}, - {"SkpFrame", INITYPE_UINT8, &np2oscfg.DRAW_SKIP, 0}, {"uPD72020", INITYPE_BOOL, &np2cfg.uPD72020, 0}, {"GRCG_EGC", INITYPE_UINT8, &np2cfg.grcg, 0}, {"color16b", INITYPE_BOOL, &np2cfg.color16, 0}, @@ -346,24 +364,39 @@ static const INITBL iniitem[] = { {"pc9861_s", INITYPE_BYTEARG, np2cfg.pc9861sw, 3}, {"pc9861_j", INITYPE_BYTEARG, np2cfg.pc9861jmp, 6}, {"calendar", INITYPE_BOOL, &np2cfg.calendar, 0}, - {"USE144FD", INITYPE_BOOL, &np2cfg.usefd144, 0}}; + {"USE144FD", INITYPE_BOOL, &np2cfg.usefd144, 0}, + + // OS°Í¸¡Á + {"s_NOWAIT", INITYPE_BOOL, &np2oscfg.NOWAIT, 0}, + {"SkpFrame", INITYPE_UINT8, &np2oscfg.DRAW_SKIP, 0}, + {"F12_bind", INITYPE_UINT8, &np2oscfg.F12KEY, 0}, + {"e_resume", INITYPE_BOOL, &np2oscfg.resume, 0}, -#define INIITEMS (sizeof(iniitem) / sizeof(INITBL)) +#if !defined(GX_DLL) + {"WindposX", INITYPE_SINT32, &np2oscfg.winx, 0}, + {"WindposY", INITYPE_SINT32, &np2oscfg.winy, 0}, +#endif +#if defined(WIN32_PLATFORM_PSPC) + {"pbindcur", INITYPE_UINT8, &np2oscfg.bindcur, 0}, + {"pbindbtn", INITYPE_UINT8, &np2oscfg.bindbtn, 0}, +#endif + {"jast_snd", INITYPE_BOOL, &np2oscfg.jastsnd, 0}, // ver0.73 +}; void initload(void) { - char path[MAX_PATH]; + OEMCHAR path[MAX_PATH]; - milstr_ncpy(path, file_getcd(inifile), sizeof(path)); - ini_read(path, ini_title, iniitem, INIITEMS); + milstr_ncpy(path, file_getcd(inifile), NELEMENTS(path)); + ini_read(path, ini_title, iniitem, NELEMENTS(iniitem)); } void initsave(void) { - char path[MAX_PATH]; + OEMCHAR path[MAX_PATH]; - milstr_ncpy(path, file_getcd(inifile), sizeof(path)); - ini_write(path, ini_title, iniitem, INIITEMS); + milstr_ncpy(path, file_getcd(inifile), NELEMENTS(path)); + ini_write(path, ini_title, iniitem, NELEMENTS(iniitem)); }