--- np2/win9x/sstpmsg.cpp 2004/02/18 20:11:37 1.4 +++ np2/win9x/sstpmsg.cpp 2005/02/09 20:11:35 1.7 @@ -7,7 +7,6 @@ #include "sstpres.h" #include "pccore.h" #include "iocore.h" -#include "bios.h" #include "sound.h" #include "fmboard.h" #include "np2info.h" @@ -24,12 +23,12 @@ static const char str_jwinmode[] = " (窓モード)\0 (フルスクリーン)"; -static void info_progtitle(char *str, int maxlen, NP2INFOEX *ex) { +static void info_progtitle(char *str, int maxlen, const NP2INFOEX *ex) { milstr_ncpy(str, np2oscfg.titles, maxlen); } -static void info_jsound(char *str, int maxlen, NP2INFOEX *ex) { +static void info_jsound(char *str, int maxlen, const NP2INFOEX *ex) { const char *p; @@ -77,7 +76,7 @@ const char *p; milstr_ncpy(str, p, maxlen); } -static void info_jdisp(char *str, int maxlen, NP2INFOEX *ex) { +static void info_jdisp(char *str, int maxlen, const NP2INFOEX *ex) { UINT bpp; @@ -88,10 +87,10 @@ static void info_jdisp(char *str, int ma (void)ex; } -static void info_jbios(char *str, int maxlen, NP2INFOEX *ex) { +static void info_jbios(char *str, int maxlen, const NP2INFOEX *ex) { str[0] = '\0'; - if (biosrom) { + if (pccore.rom & PCROM_BIOS) { milstr_ncat(str, str_biosrom, maxlen); } if (soundrom.name[0]) { @@ -105,7 +104,7 @@ static void info_jbios(char *str, int ma } } -static void info_jrhythm(char *str, int maxlen, NP2INFOEX *ex) { +static void info_jrhythm(char *str, int maxlen, const NP2INFOEX *ex) { const char *p; char jrhythmstr[16]; @@ -138,7 +137,7 @@ const char *p; typedef struct { char key[8]; - void (*proc)(char *str, int maxlen, NP2INFOEX *ex); + void (*proc)(char *str, int maxlen, const NP2INFOEX *ex); } INFOPROC; static const INFOPROC infoproc[] = { @@ -148,13 +147,14 @@ static const INFOPROC infoproc[] = { {"JDISP", info_jdisp}, {"JRHYTHM", info_jrhythm}}; -static BOOL sstpext(char *dst, const char *key, int maxlen, NP2INFOEX *ex) { +static BOOL sstpext(OEMCHAR *dst, const OEMCHAR *key, int maxlen, + const NP2INFOEX *ex) { const INFOPROC *inf; const INFOPROC *infterm; inf = infoproc; - infterm = infoproc + (sizeof(infoproc) / sizeof(INFOPROC)); + infterm = infoproc + NELEMENTS(infoproc); while(inf < infterm) { if (!milstr_cmp(key, inf->key)) { inf->proc(dst, maxlen, ex); @@ -170,14 +170,14 @@ static const NP2INFOEX sstpex = {"\\n", // ---- -static const BYTE prs2[] = {0xaa,0xac,0xae,0xb0,0xb2,0xbe,0xf0,0x9f, - 0xa1,0xa3,0xa5,0xa7,0xe1,0xe3,0xe5,0xc1, - 0xb8,0xa0,0xa2,0xa4,0xa6,0xa8,0xa9,0xab, - 0xad,0xaf,0xb1,0xb3,0xb5,0xb7,0xb9,0xbb, - 0xbd,0xbf,0xc2,0xc4,0xc6,0xc8,0xc9,0xca, - 0xcb,0xcc,0xcd,0xd0,0xd3,0xd6,0xd9,0xdc, - 0xdd,0xde,0xdf,0xe0,0xe2,0xe4,0xe6,0xe7, - 0xe8,0xe9,0xea,0xeb,0xed,0xf1,0xb4,0xb8}; +static const UINT8 prs2[] = {0xaa,0xac,0xae,0xb0,0xb2,0xbe,0xf0,0x9f, + 0xa1,0xa3,0xa5,0xa7,0xe1,0xe3,0xe5,0xc1, + 0xb8,0xa0,0xa2,0xa4,0xa6,0xa8,0xa9,0xab, + 0xad,0xaf,0xb1,0xb3,0xb5,0xb7,0xb9,0xbb, + 0xbd,0xbf,0xc2,0xc4,0xc6,0xc8,0xc9,0xca, + 0xcb,0xcc,0xcd,0xd0,0xd3,0xd6,0xd9,0xdc, + 0xdd,0xde,0xdf,0xe0,0xe2,0xe4,0xe6,0xe7, + 0xe8,0xe9,0xea,0xeb,0xed,0xf1,0xb4,0xb8}; #define GETSSTPDAT1(a) { \ (a) = last; \ @@ -188,8 +188,8 @@ static const BYTE prs2[] = {0xaa,0xac,0x static char *sstpsolve(char *buf, const unsigned char *dat) { - BYTE c; - BYTE last; + UINT8 c; + UINT8 last; last = 0x80; while(1) { @@ -217,7 +217,7 @@ static char *sstpsolve(char *buf, const *buf++ = c; } else if (c == 0x7f) { - BYTE ms; + UINT8 ms; GETSSTPDAT1(ms); if (!ms) { break; @@ -228,12 +228,12 @@ static char *sstpsolve(char *buf, const ms -= 10; } if (ms) { - wsprintf(buf, "\\w%u", ms); + SPRINTF(buf, "\\w%u", ms); buf += 3; } } else if (c == 0x80) { - BYTE c2; + UINT8 c2; GETSSTPDAT1(c2); if (c2) { *buf++ = c2; @@ -244,10 +244,10 @@ static char *sstpsolve(char *buf, const } else if (c >= 0xf0) { int i; - const BYTE *p; + const UINT8 *p; i = c - 0xf0; if (c == 0xff) { - BYTE c2; + UINT8 c2; GETSSTPDAT1(c2); if (!c2) { break; @@ -261,11 +261,11 @@ static char *sstpsolve(char *buf, const buf = sstpsolve(buf, p); } else if ((c >= 0xa0) && (c < 0xe0)) { - *buf++ = (BYTE)0x82; + *buf++ = (UINT8)0x82; *buf++ = prs2[c-0xa0]; } else { - BYTE c2; + UINT8 c2; GETSSTPDAT1(c2); if (c2) { *buf++ = c;