|
|
| version 1.4, 2004/02/18 20:11:37 | version 1.8, 2005/03/19 18:54:58 |
|---|---|
| Line 7 | Line 7 |
| #include "sstpres.h" | #include "sstpres.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "bios.h" | |
| #include "sound.h" | #include "sound.h" |
| #include "fmboard.h" | #include "fmboard.h" |
| #include "np2info.h" | #include "np2info.h" |
| static char cr[] = "\\n"; | static const OEMCHAR cr[] = OEMTEXT("\\n"); |
| // ---- np2info extend | // ---- np2info extend |
| static const char str_jwinclr[] = | static const OEMCHAR str_jwinclr[] = |
| "256色\0ハイカラー\0フルカラー\0トゥルーカラー"; | OEMTEXT("256色\0ハイカラー\0フルカラー\0トゥルーカラー"); |
| static const char str_jwinmode[] = | static const OEMCHAR str_jwinmode[] = |
| " (窓モード)\0 (フルスクリーン)"; | OEMTEXT(" (窓モード)\0 (フルスクリーン)"); |
| static void info_progtitle(char *str, int maxlen, NP2INFOEX *ex) { | static void info_progtitle(OEMCHAR *str, int maxlen, const NP2INFOEX *ex) { |
| milstr_ncpy(str, np2oscfg.titles, maxlen); | milstr_ncpy(str, np2oscfg.titles, maxlen); |
| } | } |
| static void info_jsound(char *str, int maxlen, NP2INFOEX *ex) { | static void info_jsound(OEMCHAR *str, int maxlen, const NP2INFOEX *ex) { |
| const char *p; | const OEMCHAR *p; |
| switch(usesound) { | switch(usesound) { |
| case 0x01: | case 0x01: |
| p = "14ボード"; | p = OEMTEXT("14ボード"); |
| break; | break; |
| case 0x02: | case 0x02: |
| p = "26音源"; | p = OEMTEXT("26音源"); |
| break; | break; |
| case 0x04: | case 0x04: |
| p = "86音源"; | p = OEMTEXT("86音源"); |
| break; | break; |
| case 0x06: | case 0x06: |
| p = "2枚刺し"; | p = OEMTEXT("2枚刺し"); |
| break; | break; |
| case 0x08: | case 0x08: |
| p = "118音源"; | p = OEMTEXT("118音源"); |
| break; | break; |
| case 0x14: | case 0x14: |
| p = "86音源(ちびおと付)"; | p = OEMTEXT("86音源(ちびおと付)"); |
| break; | break; |
| case 0x20: | case 0x20: |
| p = "スピークボード"; | p = OEMTEXT("スピークボード"); |
| break; | break; |
| case 0x40: | case 0x40: |
| p = "スパークボード"; | p = OEMTEXT("スパークボード"); |
| break; | break; |
| case 0x80: | case 0x80: |
| p = "AMD-98"; | p = OEMTEXT("AMD-98"); |
| break; | break; |
| default: | default: |
| p = "なし"; | p = OEMTEXT("なし"); |
| break; | break; |
| } | } |
| milstr_ncpy(str, p, maxlen); | milstr_ncpy(str, p, maxlen); |
| } | } |
| static void info_jdisp(char *str, int maxlen, NP2INFOEX *ex) { | static void info_jdisp(OEMCHAR *str, int maxlen, const NP2INFOEX *ex) { |
| UINT bpp; | UINT bpp; |
| Line 88 static void info_jdisp(char *str, int ma | Line 87 static void info_jdisp(char *str, int ma |
| (void)ex; | (void)ex; |
| } | } |
| static void info_jbios(char *str, int maxlen, NP2INFOEX *ex) { | static void info_jbios(OEMCHAR *str, int maxlen, const NP2INFOEX *ex) { |
| str[0] = '\0'; | str[0] = '\0'; |
| if (biosrom) { | if (pccore.rom & PCROM_BIOS) { |
| milstr_ncat(str, str_biosrom, maxlen); | milstr_ncat(str, str_biosrom, maxlen); |
| } | } |
| if (soundrom.name[0]) { | if (soundrom.name[0]) { |
| if (str[0]) { | if (str[0]) { |
| milstr_ncat(str, "と", maxlen); | milstr_ncat(str, OEMTEXT("と"), maxlen); |
| } | } |
| milstr_ncat(str, soundrom.name, maxlen); | milstr_ncat(str, soundrom.name, maxlen); |
| } | } |
| if (str[0] == '\0') { | if (str[0] == '\0') { |
| milstr_ncat(str, "なし", maxlen); | milstr_ncat(str, OEMTEXT("なし"), maxlen); |
| } | } |
| } | } |
| static void info_jrhythm(char *str, int maxlen, NP2INFOEX *ex) { | static void info_jrhythm(OEMCHAR *str, int maxlen, const NP2INFOEX *ex) { |
| const char *p; | const OEMCHAR *p; |
| char jrhythmstr[16]; | OEMCHAR jrhythmstr[16]; |
| UINT exist; | UINT exist; |
| UINT i; | UINT i; |
| if (!(usesound & 0x6c)) { | if (!(usesound & 0x6c)) { |
| p = "不要やで"; | p = OEMTEXT("不要やで"); |
| } | } |
| else { | else { |
| exist = rhythm_getcaps(); | exist = rhythm_getcaps(); |
| if (exist == 0) { | if (exist == 0) { |
| p = "用意されてないんか…"; | p = OEMTEXT("用意されてないんか…"); |
| } | } |
| else if (exist == 0x3f) { | else if (exist == 0x3f) { |
| p = "全部あるで"; | p = OEMTEXT("全部あるで"); |
| } | } |
| else { | else { |
| milstr_ncpy(jrhythmstr, "BSCHTRや", sizeof(jrhythmstr)); | milstr_ncpy(jrhythmstr, OEMTEXT("BSCHTRや"), NELEMENTS(jrhythmstr)); |
| for (i=0; i<6; i++) { | for (i=0; i<6; i++) { |
| if (!(exist & (1 << i))) { | if (!(exist & (1 << i))) { |
| jrhythmstr[i] = '_'; | jrhythmstr[i] = '_'; |
| Line 137 const char *p; | Line 136 const char *p; |
| } | } |
| typedef struct { | typedef struct { |
| char key[8]; | OEMCHAR key[8]; |
| void (*proc)(char *str, int maxlen, NP2INFOEX *ex); | void (*proc)(OEMCHAR *str, int maxlen, const NP2INFOEX *ex); |
| } INFOPROC; | } INFOPROC; |
| static const INFOPROC infoproc[] = { | static const INFOPROC infoproc[] = { |
| {"PROG", info_progtitle}, | {OEMTEXT("PROG"), info_progtitle}, |
| {"JSND", info_jsound}, | {OEMTEXT("JSND"), info_jsound}, |
| {"JBIOS", info_jbios}, | {OEMTEXT("JBIOS"), info_jbios}, |
| {"JDISP", info_jdisp}, | {OEMTEXT("JDISP"), info_jdisp}, |
| {"JRHYTHM", info_jrhythm}}; | {OEMTEXT("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 *inf; |
| const INFOPROC *infterm; | const INFOPROC *infterm; |
| inf = infoproc; | inf = infoproc; |
| infterm = infoproc + (sizeof(infoproc) / sizeof(INFOPROC)); | infterm = infoproc + NELEMENTS(infoproc); |
| while(inf < infterm) { | while(inf < infterm) { |
| if (!milstr_cmp(key, inf->key)) { | if (!milstr_cmp(key, inf->key)) { |
| inf->proc(dst, maxlen, ex); | inf->proc(dst, maxlen, ex); |
| Line 165 const INFOPROC *infterm; | Line 165 const INFOPROC *infterm; |
| return(FALSE); | return(FALSE); |
| } | } |
| static const NP2INFOEX sstpex = {"\\n", sstpext}; | static const NP2INFOEX sstpex = {OEMTEXT("\\n"), sstpext}; |
| // ---- | // ---- |
| static const BYTE prs2[] = {0xaa,0xac,0xae,0xb0,0xb2,0xbe,0xf0,0x9f, | static const UINT8 prs2[] = {0xaa,0xac,0xae,0xb0,0xb2,0xbe,0xf0,0x9f, |
| 0xa1,0xa3,0xa5,0xa7,0xe1,0xe3,0xe5,0xc1, | 0xa1,0xa3,0xa5,0xa7,0xe1,0xe3,0xe5,0xc1, |
| 0xb8,0xa0,0xa2,0xa4,0xa6,0xa8,0xa9,0xab, | 0xb8,0xa0,0xa2,0xa4,0xa6,0xa8,0xa9,0xab, |
| 0xad,0xaf,0xb1,0xb3,0xb5,0xb7,0xb9,0xbb, | 0xad,0xaf,0xb1,0xb3,0xb5,0xb7,0xb9,0xbb, |
| 0xbd,0xbf,0xc2,0xc4,0xc6,0xc8,0xc9,0xca, | 0xbd,0xbf,0xc2,0xc4,0xc6,0xc8,0xc9,0xca, |
| 0xcb,0xcc,0xcd,0xd0,0xd3,0xd6,0xd9,0xdc, | 0xcb,0xcc,0xcd,0xd0,0xd3,0xd6,0xd9,0xdc, |
| 0xdd,0xde,0xdf,0xe0,0xe2,0xe4,0xe6,0xe7, | 0xdd,0xde,0xdf,0xe0,0xe2,0xe4,0xe6,0xe7, |
| 0xe8,0xe9,0xea,0xeb,0xed,0xf1,0xb4,0xb8}; | 0xe8,0xe9,0xea,0xeb,0xed,0xf1,0xb4,0xb8}; |
| #define GETSSTPDAT1(a) { \ | #define GETSSTPDAT1(a) { \ |
| (a) = last; \ | (a) = last; \ |
| Line 188 static const BYTE prs2[] = {0xaa,0xac,0x | Line 188 static const BYTE prs2[] = {0xaa,0xac,0x |
| static char *sstpsolve(char *buf, const unsigned char *dat) { | static char *sstpsolve(char *buf, const unsigned char *dat) { |
| BYTE c; | UINT8 c; |
| BYTE last; | UINT8 last; |
| last = 0x80; | last = 0x80; |
| while(1) { | while(1) { |
| Line 217 static char *sstpsolve(char *buf, const | Line 217 static char *sstpsolve(char *buf, const |
| *buf++ = c; | *buf++ = c; |
| } | } |
| else if (c == 0x7f) { | else if (c == 0x7f) { |
| BYTE ms; | UINT8 ms; |
| GETSSTPDAT1(ms); | GETSSTPDAT1(ms); |
| if (!ms) { | if (!ms) { |
| break; | break; |
| Line 228 static char *sstpsolve(char *buf, const | Line 228 static char *sstpsolve(char *buf, const |
| ms -= 10; | ms -= 10; |
| } | } |
| if (ms) { | if (ms) { |
| wsprintf(buf, "\\w%u", ms); | SPRINTF(buf, "\\w%1u", ms); |
| buf += 3; | buf += 3; |
| } | } |
| } | } |
| else if (c == 0x80) { | else if (c == 0x80) { |
| BYTE c2; | UINT8 c2; |
| GETSSTPDAT1(c2); | GETSSTPDAT1(c2); |
| if (c2) { | if (c2) { |
| *buf++ = c2; | *buf++ = c2; |
| Line 244 static char *sstpsolve(char *buf, const | Line 244 static char *sstpsolve(char *buf, const |
| } | } |
| else if (c >= 0xf0) { | else if (c >= 0xf0) { |
| int i; | int i; |
| const BYTE *p; | const UINT8 *p; |
| i = c - 0xf0; | i = c - 0xf0; |
| if (c == 0xff) { | if (c == 0xff) { |
| BYTE c2; | UINT8 c2; |
| GETSSTPDAT1(c2); | GETSSTPDAT1(c2); |
| if (!c2) { | if (!c2) { |
| break; | break; |
| Line 261 static char *sstpsolve(char *buf, const | Line 261 static char *sstpsolve(char *buf, const |
| buf = sstpsolve(buf, p); | buf = sstpsolve(buf, p); |
| } | } |
| else if ((c >= 0xa0) && (c < 0xe0)) { | else if ((c >= 0xa0) && (c < 0xe0)) { |
| *buf++ = (BYTE)0x82; | *buf++ = (UINT8)0x82; |
| *buf++ = prs2[c-0xa0]; | *buf++ = prs2[c-0xa0]; |
| } | } |
| else { | else { |
| BYTE c2; | UINT8 c2; |
| GETSSTPDAT1(c2); | GETSSTPDAT1(c2); |
| if (c2) { | if (c2) { |
| *buf++ = c; | *buf++ = c; |
| Line 515 void sstpmsg_config(void) { | Line 515 void sstpmsg_config(void) { |
| static char *get_code(char *buf, int *ret) { | static char *get_code(char *buf, int *ret) { |
| int stat; | int stat; |
| stat = 0; | stat = 0; |
| if (!memcmp(buf, "SSTP", 4)) { | if (!memcmp(buf, "SSTP", 4)) { |