|
|
| version 1.43, 2005/02/07 14:46:07 | version 1.46, 2005/03/05 06:02:28 |
|---|---|
| Line 96 extern COMMNG cm_mpu98; | Line 96 extern COMMNG cm_mpu98; |
| extern COMMNG cm_rs232c; | extern COMMNG cm_rs232c; |
| typedef struct { | typedef struct { |
| char *buf; | OEMCHAR *buf; |
| int remain; | int remain; |
| } ERR_BUF; | } ERR_BUF; |
| Line 104 typedef struct { | Line 104 typedef struct { |
| // ---- | // ---- |
| // 関数ポインタを intに変更。 | // 関数ポインタを intに変更。 |
| static BOOL proc2num(void *func, const PROCTBL *tbl, int size) { | static BRESULT proc2num(void *func, const PROCTBL *tbl, int size) { |
| int i; | int i; |
| Line 118 static BOOL proc2num(void *func, const P | Line 118 static BOOL proc2num(void *func, const P |
| return(FAILURE); | return(FAILURE); |
| } | } |
| static BOOL num2proc(void *func, const PROCTBL *tbl, int size) { | static BRESULT num2proc(void *func, const PROCTBL *tbl, int size) { |
| int i; | int i; |
| Line 149 typedef struct { | Line 149 typedef struct { |
| NP2FHDR f; | NP2FHDR f; |
| } _SFFILEH, *SFFILEH; | } _SFFILEH, *SFFILEH; |
| static SFFILEH statflag_open(const char *filename, char *err, int errlen) { | static SFFILEH statflag_open(const OEMCHAR *filename, OEMCHAR *err, int errlen) { |
| FILEH fh; | FILEH fh; |
| SFFILEH ret; | SFFILEH ret; |
| Line 261 sfr_err: | Line 261 sfr_err: |
| return(STATFLAG_FAILURE); | return(STATFLAG_FAILURE); |
| } | } |
| static SFFILEH statflag_create(const char *filename) { | static SFFILEH statflag_create(const OEMCHAR *filename) { |
| SFFILEH ret; | SFFILEH ret; |
| FILEH fh; | FILEH fh; |
| Line 355 static void statflag_close(SFFILEH sffh) | Line 355 static void statflag_close(SFFILEH sffh) |
| } | } |
| } | } |
| void statflag_seterr(STFLAGH sfh, const char *str) { | void statflag_seterr(STFLAGH sfh, const OEMCHAR *str) { |
| if ((sfh) && (sfh->errlen)) { | if ((sfh) && (sfh->errlen)) { |
| milstr_ncat(sfh->err, str, sfh->errlen); | milstr_ncat(sfh->err, str, sfh->errlen); |
| Line 928 static int flagload_fm(STFLAGH sfh, cons | Line 928 static int flagload_fm(STFLAGH sfh, cons |
| // ---- disk | // ---- disk |
| typedef struct { | typedef struct { |
| char path[MAX_PATH]; | OEMCHAR path[MAX_PATH]; |
| int readonly; | int readonly; |
| DOSDATE date; | DOSDATE date; |
| DOSTIME time; | DOSTIME time; |
| } STATDISK; | } STATDISK; |
| static const char str_fddx[] = "FDD%u"; | static const OEMCHAR str_fddx[] = OEMTEXT("FDD%u"); |
| static const char str_sasix[] = "SASI%u"; | static const OEMCHAR str_sasix[] = OEMTEXT("SASI%u"); |
| static const char str_scsix[] = "SCSI%u"; | static const OEMCHAR str_scsix[] = OEMTEXT("SCSI%u"); |
| static const char str_updated[] = "%s: updated"; | static const OEMCHAR str_updated[] = OEMTEXT("%s: updated"); |
| static const char str_notfound[] = "%s: not found"; | static const OEMCHAR str_notfound[] = OEMTEXT("%s: not found"); |
| static int disksave(STFLAGH sfh, const char *path, int readonly) { | static int disksave(STFLAGH sfh, const OEMCHAR *path, int readonly) { |
| STATDISK st; | STATDISK st; |
| FILEH fh; | FILEH fh; |
| Line 963 static int flagsave_disk(STFLAGH sfh, co | Line 963 static int flagsave_disk(STFLAGH sfh, co |
| int ret; | int ret; |
| UINT8 i; | UINT8 i; |
| sxsi_flash(); | sxsi_allflash(); |
| ret = STATFLAG_SUCCESS; | ret = STATFLAG_SUCCESS; |
| for (i=0; i<4; i++) { | for (i=0; i<4; i++) { |
| ret |= disksave(sfh, fdd_diskname(i), fdd_diskprotect(i)); | ret |= disksave(sfh, fdd_diskname(i), fdd_diskprotect(i)); |
| } | } |
| for (i=0x00; i<0x02; i++) { | for (i=0x00; i<0x02; i++) { |
| ret |= disksave(sfh, sxsi_getname(i), 0); | ret |= disksave(sfh, sxsi_getfilename(i), 0); |
| } | } |
| for (i=0x20; i<0x24; i++) { | for (i=0x20; i<0x24; i++) { |
| ret |= disksave(sfh, sxsi_getname(i), 0); | ret |= disksave(sfh, sxsi_getfilename(i), 0); |
| } | } |
| (void)tbl; | (void)tbl; |
| return(ret); | return(ret); |
| } | } |
| static int diskcheck(STFLAGH sfh, const char *name) { | static int diskcheck(STFLAGH sfh, const OEMCHAR *name) { |
| int ret; | int ret; |
| FILEH fh; | FILEH fh; |
| STATDISK st; | STATDISK st; |
| char buf[256]; | OEMCHAR buf[256]; |
| DOSDATE date; | DOSDATE date; |
| DOSTIME time; | DOSTIME time; |
| Line 996 static int diskcheck(STFLAGH sfh, const | Line 996 static int diskcheck(STFLAGH sfh, const |
| if ((memcmp(&st.date, &date, sizeof(date))) || | if ((memcmp(&st.date, &date, sizeof(date))) || |
| (memcmp(&st.time, &time, sizeof(time)))) { | (memcmp(&st.time, &time, sizeof(time)))) { |
| ret |= STATFLAG_DISKCHG; | ret |= STATFLAG_DISKCHG; |
| SPRINTF(buf, str_updated, name); | OEMSPRINTF(buf, str_updated, name); |
| statflag_seterr(sfh, buf); | statflag_seterr(sfh, buf); |
| } | } |
| } | } |
| else { | else { |
| ret |= STATFLAG_DISKCHG; | ret |= STATFLAG_DISKCHG; |
| SPRINTF(buf, str_notfound, name); | OEMSPRINTF(buf, str_notfound, name); |
| statflag_seterr(sfh, buf); | statflag_seterr(sfh, buf); |
| } | } |
| } | } |
| Line 1013 static int flagcheck_disk(STFLAGH sfh, c | Line 1013 static int flagcheck_disk(STFLAGH sfh, c |
| int ret; | int ret; |
| int i; | int i; |
| char buf[8]; | OEMCHAR buf[8]; |
| ret = 0; | ret = 0; |
| for (i=0; i<4; i++) { | for (i=0; i<4; i++) { |
| SPRINTF(buf, str_fddx, i+1); | OEMSPRINTF(buf, str_fddx, i+1); |
| ret |= diskcheck(sfh, buf); | ret |= diskcheck(sfh, buf); |
| } | } |
| sxsi_flash(); | sxsi_allflash(); |
| for (i=0; i<2; i++) { | for (i=0; i<2; i++) { |
| SPRINTF(buf, str_sasix, i+1); | OEMSPRINTF(buf, str_sasix, i+1); |
| ret |= diskcheck(sfh, buf); | ret |= diskcheck(sfh, buf); |
| } | } |
| for (i=0; i<4; i++) { | for (i=0; i<4; i++) { |
| SPRINTF(buf, str_scsix, i); | OEMSPRINTF(buf, str_scsix, i); |
| ret |= diskcheck(sfh, buf); | ret |= diskcheck(sfh, buf); |
| } | } |
| (void)tbl; | (void)tbl; |
| Line 1049 static int flagload_disk(STFLAGH sfh, co | Line 1049 static int flagload_disk(STFLAGH sfh, co |
| for (i=0x00; i<0x02; i++) { | for (i=0x00; i<0x02; i++) { |
| ret |= statflag_read(sfh, &st, sizeof(st)); | ret |= statflag_read(sfh, &st, sizeof(st)); |
| if (st.path[0]) { | if (st.path[0]) { |
| sxsi_hddopen(i, st.path); | sxsi_devopen(i, st.path); |
| } | } |
| } | } |
| for (i=0x20; i<0x24; i++) { | for (i=0x20; i<0x24; i++) { |
| ret |= statflag_read(sfh, &st, sizeof(st)); | ret |= statflag_read(sfh, &st, sizeof(st)); |
| if (st.path[0]) { | if (st.path[0]) { |
| sxsi_hddopen(i, st.path); | sxsi_devopen(i, st.path); |
| } | } |
| } | } |
| (void)tbl; | (void)tbl; |
| Line 1173 static int flagcheck_veronly(STFLAGH sfh | Line 1173 static int flagcheck_veronly(STFLAGH sfh |
| // ---- | // ---- |
| int statsave_save(const char *filename) { | int statsave_save(const OEMCHAR *filename) { |
| SFFILEH sffh; | SFFILEH sffh; |
| int ret; | int ret; |
| Line 1256 const SFENTRY *tblterm; | Line 1256 const SFENTRY *tblterm; |
| return(ret); | return(ret); |
| } | } |
| int statsave_check(const char *filename, char *buf, int size) { | int statsave_check(const OEMCHAR *filename, OEMCHAR *buf, int size) { |
| SFFILEH sffh; | SFFILEH sffh; |
| int ret; | int ret; |
| Line 1328 const SFENTRY *tblterm; | Line 1328 const SFENTRY *tblterm; |
| return(ret); | return(ret); |
| } | } |
| int statsave_load(const char *filename) { | int statsave_load(const OEMCHAR *filename) { |
| SFFILEH sffh; | SFFILEH sffh; |
| int ret; | int ret; |
| Line 1353 const SFENTRY *tblterm; | Line 1353 const SFENTRY *tblterm; |
| rs232c_midipanic(); | rs232c_midipanic(); |
| mpu98ii_midipanic(); | mpu98ii_midipanic(); |
| pc9861k_midipanic(); | pc9861k_midipanic(); |
| sxsi_trash(); | sxsi_alltrash(); |
| ret |= flagload_common(&sffh->sfh, np2tbl); | ret |= flagload_common(&sffh->sfh, np2tbl); |