Remove tchar.h shim

This commit is contained in:
kichikuou
2020-02-16 15:57:05 +09:00
parent 1f5449687f
commit 387c5febf2
20 changed files with 129 additions and 138 deletions
-9
View File
@@ -21,15 +21,6 @@
#define SDL_Delay emscripten_sleep
#endif
// tchar.h shim
typedef char _TCHAR;
#ifndef _T
#define _T(s) s
#endif
#define _tcscpy_s strcpy_s
#define _tcslen strlen
#define _stprintf_s sprintf_s
// type definition
typedef uint8_t uint8;
typedef uint16_t uint16;
+10 -10
View File
@@ -11,7 +11,7 @@
#include <emscripten.h>
#endif
_TCHAR g_root[_MAX_PATH];
char g_root[_MAX_PATH];
const char* g_savedir;
void FILEIO::SetSaveDir(const char* savedir)
@@ -21,8 +21,8 @@ void FILEIO::SetSaveDir(const char* savedir)
int FILEIO::StatSavedata(const char* filename, struct stat* buf)
{
_TCHAR path[_MAX_PATH];
_stprintf_s(path, _MAX_PATH, _T("%s%s"), g_savedir ? g_savedir : g_root, filename);
char path[_MAX_PATH];
sprintf_s(path, _MAX_PATH, "%s%s", g_savedir ? g_savedir : g_root, filename);
return stat(path, buf);
}
@@ -40,13 +40,13 @@ FILEIO::~FILEIO(void)
}
}
bool FILEIO::Fopen(const _TCHAR *filename, int mode)
bool FILEIO::Fopen(const char *filename, int mode)
{
mode_ = mode;
_TCHAR path[_MAX_PATH];
_stprintf_s(path, _MAX_PATH, _T("%s%s"),
(g_savedir && mode & FILEIO_SAVEDATA) ? g_savedir : g_root,
filename);
char path[_MAX_PATH];
sprintf_s(path, _MAX_PATH, "%s%s",
(g_savedir && mode & FILEIO_SAVEDATA) ? g_savedir : g_root,
filename);
mode &= ~FILEIO_SAVEDATA;
@@ -56,9 +56,9 @@ bool FILEIO::Fopen(const _TCHAR *filename, int mode)
fp = NULL;
if(mode == FILEIO_READ_BINARY) {
fp = fopen(path, _T("rb"));
fp = fopen(path, "rb");
} else if(mode == FILEIO_WRITE_BINARY) {
fp = fopen(path, _T("wb"));
fp = fopen(path, "wb");
}
return (fp != NULL);
}
+1 -1
View File
@@ -30,7 +30,7 @@ public:
static void SetSaveDir(const char* savedir);
static int StatSavedata(const char* filename, struct stat* buf);
bool Fopen(const _TCHAR *filename, int mode);
bool Fopen(const char *filename, int mode);
void Fclose();
uint32 Fseek(long offset, int origin);
uint32 Ftell();
+8 -8
View File
@@ -18,13 +18,13 @@ int main(int argc, char *argv[])
SDL_Init(SDL_INIT_VIDEO);
// ウィンドウ表示
_TCHAR buf[128];
char buf[128];
#if defined(_SYSTEM1)
_tcscpy_s(buf, 128, _T("Scenario Decoder SYSTEM1"));
strcpy_s(buf, 128, "Scenario Decoder SYSTEM1");
#elif defined(_SYSTEM2)
_tcscpy_s(buf, 128, _T("Scenario Decoder SYSTEM2"));
strcpy_s(buf, 128, "Scenario Decoder SYSTEM2");
#else
_tcscpy_s(buf, 128, _T("Scenario Decoder SYSTEM3"));
strcpy_s(buf, 128, "Scenario Decoder SYSTEM3");
#endif
#ifdef __ANDROID__
@@ -70,14 +70,14 @@ int main(int argc, char *argv[])
FILEIO::SetSaveDir(save_dir);
}
const _TCHAR* title = nact->get_title();
const char* title = nact->get_title();
if (title) {
#if defined(_SYSTEM1)
_stprintf_s(buf, 128, _T("Scenario Decoder SYSTEM1: %s"), title);
sprintf_s(buf, 128, "Scenario Decoder SYSTEM1: %s", title);
#elif defined(_SYSTEM2)
_stprintf_s(buf, 128, _T("Scenario Decoder SYSTEM2: %s"), title);
sprintf_s(buf, 128, "Scenario Decoder SYSTEM2: %s", title);
#else
_stprintf_s(buf, 128, _T("Scenario Decoder SYSTEM3: %s"), title);
sprintf_s(buf, 128, "Scenario Decoder SYSTEM3: %s", title);
#endif
#ifdef __EMSCRIPTEN__
EM_ASM_ARGS({ xsystem35.shell.setWindowTitle(UTF8ToString($0)); }, buf);
+2 -2
View File
@@ -78,7 +78,7 @@ AGS::AGS(NACT* parent, const char* fontfile) : nact(parent)
memset(gaiji, 0, sizeof(gaiji));
FILEIO* fio = new FILEIO();
if(fio->Fopen(_T("GAIJI.DAT"), FILEIO_READ_BINARY)) {
if(fio->Fopen("GAIJI.DAT", FILEIO_READ_BINARY)) {
int d1, d2;
while((d1 = fio->Fgetc()) != EOF) {
d2 = fio->Fgetc();
@@ -108,7 +108,7 @@ AGS::AGS(NACT* parent, const char* fontfile) : nact(parent)
// SYSTEM3 初期化
// ACG.DAT
_tcscpy_s(acg, 16, _T("ACG.DAT"));
strcpy_s(acg, 16, "ACG.DAT");
// パレット
memset(program_palette, 0, sizeof(program_palette));
+2 -2
View File
@@ -70,7 +70,7 @@ private:
void load_pms(uint8* data, int page, int transparent);
#endif
#if defined(_SYSTEM3)
void load_bmp(const _TCHAR *file_path);
void load_bmp(const char *file_path);
#endif
void draw_char(int dest, int dest_x, int dest_y, uint16 code, int size, uint8 color);
@@ -141,7 +141,7 @@ public:
void select_cursor();
// ACG.DAT
_TCHAR acg[16];
char acg[16];
// 画面選択
int src_screen;
+1 -1
View File
@@ -6,7 +6,7 @@
#include "ags.h"
void AGS::load_bmp(const _TCHAR *file_path)
void AGS::load_bmp(const char *file_path)
{
// ヘッダ取得
int sx = 0, sy = 0;
+3 -3
View File
@@ -8,7 +8,7 @@
#include "dri.h"
#include "crc32.h"
extern _TCHAR g_root[_MAX_PATH];
extern char g_root[_MAX_PATH];
void AGS::load_cg(int page, int transparent)
{
@@ -16,12 +16,12 @@ void AGS::load_cg(int page, int transparent)
// あゆみちゃん物語 フルカラー実写版
if(strncmp(acg, "CGA000.BMP", 10) == 0) {
char file_path[_MAX_PATH];
_stprintf_s(file_path, _MAX_PATH, _T("%sCGA%03d.BMP"), g_root, page);
sprintf_s(file_path, _MAX_PATH, "%sCGA%03d.BMP", g_root, page);
load_bmp(file_path);
return;
} else if(strncmp(acg, "CGB000.BMP", 10) == 0) {
char file_path[_MAX_PATH];
_stprintf_s(file_path, _MAX_PATH, _T("%sCGB%03d.BMP"), g_root, page);
sprintf_s(file_path, _MAX_PATH, "%sCGB%03d.BMP", g_root, page);
load_bmp(file_path);
return;
}
+5 -5
View File
@@ -8,15 +8,15 @@
#include "crc32.h"
#include "../fileio.h"
uint8* DRI::load(_TCHAR path[], int page, int* size)
uint8* DRI::load(const char* path, int page, int* size)
{
_TCHAR base_path[_MAX_PATH];
_tcscpy_s(base_path, _MAX_PATH, path);
char base_path[_MAX_PATH];
strcpy_s(base_path, _MAX_PATH, path);
FILEIO* fio = new FILEIO();
// ページの位置を取得
base_path[0] = _T('A');
base_path[0] = 'A';
if(!fio->Fopen(base_path, FILEIO_READ_BINARY)) {
delete fio;
@@ -48,7 +48,7 @@ uint8* DRI::load(_TCHAR path[], int page, int* size)
// A??.DAT以外にリンクされている場合はファイルを開き直す
if(disk_index != 1) {
base_path[0] = _T('A') + disk_index - 1;
base_path[0] = 'A' + disk_index - 1;
fio->Fclose();
if(!fio->Fopen(base_path, FILEIO_READ_BINARY)) {
delete fio;
+1 -1
View File
@@ -15,7 +15,7 @@ public:
DRI() {}
~DRI() {}
uint8* load(_TCHAR path[], int page, int* size);
uint8* load(const char* path, int page, int* size);
uint8* load_mda(uint32 crc32, int page, int* size);
};
+4 -4
View File
@@ -28,8 +28,8 @@ MAKO::MAKO(NACT* parent, const char* playlist) :
if (playlist && load_playlist(playlist))
mix_init_flags |= MIX_INIT_MP3 | MIX_INIT_OGG;
_tcscpy_s(amus, 16, _T("AMUS.DAT"));
_tcscpy_s(amse, 16, _T("AMSE.DAT")); // 実際には使わない
strcpy_s(amus, 16, "AMUS.DAT");
strcpy_s(amse, 16, "AMSE.DAT"); // 実際には使わない
for(int i = 1; i <= 99; i++) {
cd_track[i] = 0;
@@ -143,12 +143,12 @@ void MAKO::play_pcm(int page, bool loop)
int size;
DRI* dri = new DRI();
if((buffer = dri->load(_T("AWAV.DAT"), page, &size)) != NULL) {
if((buffer = dri->load("AWAV.DAT", page, &size)) != NULL) {
// WAV形式 (Only You)
mix_chunk = Mix_LoadWAV_RW(SDL_RWFromConstMem(buffer, size), 1 /* freesrc */);
free(buffer);
Mix_PlayChannel(-1, mix_chunk, loop ? -1 : 0);
} else if((buffer = dri->load(_T("AMSE.DAT"), page, &size)) != NULL) {
} else if((buffer = dri->load("AMSE.DAT", page, &size)) != NULL) {
// AMSE形式 (乙女戦記)
int total = (size - 12) * 2 + 0x24;
int samples = (size - 12) * 2;
+2 -2
View File
@@ -34,8 +34,8 @@ public:
bool check_pcm();
// AMUS.DAT, AMSE.DAT
_TCHAR amus[16];
_TCHAR amse[16];
char amus[16];
char amse[16];
int current_music;
int next_loop; // Y19
+6 -6
View File
@@ -532,12 +532,12 @@ void MAKOMidi::load_mda(int page)
tempo_dif = 0x40;
// MDAデータの読み込み
_TCHAR path[16];
_tcscpy_s(path, 16, amus);
int p = _tcslen(path);
path[p - 3] = _T('M');
path[p - 2] = _T('D');
path[p - 1] = _T('A');
char path[16];
strcpy_s(path, 16, amus);
int p = strlen(path);
path[p - 3] = 'M';
path[p - 2] = 'D';
path[p - 1] = 'A';
DRI* dri = new DRI();
int size;
+2 -2
View File
@@ -10,14 +10,14 @@ class NACT;
class MAKOMidi {
public:
MAKOMidi(NACT* nact, _TCHAR* amus) : nact(nact), amus(amus) {}
MAKOMidi(NACT* nact, char* amus) : nact(nact), amus(amus) {}
bool load_mml(int page);
void load_mda(int page);
std::vector<uint8> generate_smf(int current_max);
private:
NACT* nact;
_TCHAR* amus;
char* amus;
struct MML {
uint8 data[MAX_MMLS];
+10 -10
View File
@@ -30,7 +30,7 @@ NACT::NACT(const char* game_id, const char* font_file, const char* playlist)
// AG00.DAT読み込み
FILEIO* fio = new FILEIO();
if(fio->Fopen(_T("AG00.DAT"), FILEIO_READ_BINARY)) {
if(fio->Fopen("AG00.DAT", FILEIO_READ_BINARY)) {
int d0, d1, d2, d3;
char string[MAX_CAPTION];
fio->Fgets(string);
@@ -51,9 +51,9 @@ NACT::NACT(const char* game_id, const char* font_file, const char* playlist)
// ADISK.DAT
#if defined(_PROG_OMAKE)
_tcscpy_s(adisk, 16, _T("AGAME.DAT"));
strcpy_s(adisk, 16, "AGAME.DAT");
#else
_tcscpy_s(adisk, 16, _T("ADISK.DAT"));
strcpy_s(adisk, 16, "ADISK.DAT");
#endif
// シナリオ管理
@@ -97,13 +97,13 @@ NACT::NACT(const char* game_id, const char* font_file, const char* playlist)
switch (crc32) {
case CRC32_DPS:
text_refresh = false;
_tcscpy_s(tvar[0], 22, _T("カスタム"));
_tcscpy_s(tvar[1], 22, _T("リーナス"));
_tcscpy_s(tvar[2], 22, _T("かつみ"));
_tcscpy_s(tvar[3], 22, _T("由美子"));
_tcscpy_s(tvar[4], 22, _T("いつみ"));
_tcscpy_s(tvar[5], 22, _T("ひとみ"));
_tcscpy_s(tvar[6], 22, _T("真理子"));
strcpy_s(tvar[0], 22, "カスタム");
strcpy_s(tvar[1], 22, "リーナス");
strcpy_s(tvar[2], 22, "かつみ");
strcpy_s(tvar[3], 22, "由美子");
strcpy_s(tvar[4], 22, "いつみ");
strcpy_s(tvar[5], 22, "ひとみ");
strcpy_s(tvar[6], 22, "真理子");
break;
case CRC32_INTRUDER:
menu_max = 11;
+2 -2
View File
@@ -95,7 +95,7 @@ private:
bool post_quit;
// ADISK.DAT, ASLEEP.DAT
_TCHAR adisk[16];
char adisk[16];
// シナリオデータ
uint8* scenario_data;
@@ -242,7 +242,7 @@ public:
void select_sound(int dev);
const char* get_game_id();
const _TCHAR* get_title();
const char* get_title();
bool text_skip_enb; // メッセージスキップ
bool text_wait_enb; // テキスト表示のウェイト有効/無効
+36 -36
View File
@@ -13,43 +13,43 @@ namespace {
const struct CRCTable {
const char* id;
uint32 crc32;
const _TCHAR* title;
const char* title;
} crc_table[] = {
#if defined(_SYSTEM1)
{"crescent", CRC32_CRESCENT, _T("クレセントムーンがぁる")},
{"dps", CRC32_DPS, _T("D.P.S - Dream Program System")},
{"fukei", CRC32_FUKEI, _T("婦警さんVX")},
{"intruder", CRC32_INTRUDER, _T("Intruder -桜屋敷の探索-")},
{"tengu", CRC32_TENGU, _T("あぶないてんぐ伝説")},
{"little_vampire", CRC32_VAMPIRE, _T("Little Vampire")},
{"crescent", CRC32_CRESCENT, "クレセントムーンがぁる"},
{"dps", CRC32_DPS, "D.P.S - Dream Program System"},
{"fukei", CRC32_FUKEI, "婦警さんVX"},
{"intruder", CRC32_INTRUDER, "Intruder -桜屋敷の探索-"},
{"tengu", CRC32_TENGU, "あぶないてんぐ伝説"},
{"little_vampire", CRC32_VAMPIRE, "Little Vampire"},
#elif defined(_SYSTEM2)
{"ayumi_proto", CRC32_AYUMI_PROTO, _T("あゆみちゃん物語 PROTO")},
{"sdps_maria", CRC32_SDPS_MARIA, _T("Super D.P.S")},
{"sdps_tono", CRC32_SDPS_TONO, _T("Super D.P.S")},
{"sdps_kaizoku", CRC32_SDPS_KAIZOKU, _T("Super D.P.S")},
{"prog_fd", CRC32_PROSTUDENTG_FD, _T("prostudent G")},
{"ayumi_proto", CRC32_AYUMI_PROTO, "あゆみちゃん物語 PROTO"},
{"sdps_maria", CRC32_SDPS_MARIA, "Super D.P.S"},
{"sdps_tono", CRC32_SDPS_TONO, "Super D.P.S"},
{"sdps_kaizoku", CRC32_SDPS_KAIZOKU, "Super D.P.S"},
{"prog_fd", CRC32_PROSTUDENTG_FD, "prostudent G"},
#else // System3
{"ambivalenz_fd", CRC32_AMBIVALENZ_FD, _T("AmbivalenZ −二律背反−")},
{"ambivalenz_cd", CRC32_AMBIVALENZ_CD, _T("AmbivalenZ −二律背反−")},
{"dps_all", CRC32_DPSALL, _T("D.P.S. 全部")},
{"funnybee_cd", CRC32_FUNNYBEE_CD, _T("宇宙快盗ファニーBee")},
// {"funnybee_patch", CRC32_FUNNYBEE_PATCH, _T("宇宙快盗ファニーBee")},
{"funnybee_fd", CRC32_FUNNYBEE_FD, _T("宇宙快盗ファニーBee")},
{"onlyyou", CRC32_ONLYYOU, _T("Only You −世紀末のジュリエット達−")},
{"onlyyou_demo", CRC32_ONLYYOU_DEMO, _T("Only You −世紀末のジュリエット達− デモ版")},
{"prog_cd", CRC32_PROSTUDENTG_CD, _T("prostudent G")},
{"rance41", CRC32_RANCE41, _T("ランス 4.1 〜お薬工場を救え!〜")},
{"rance42", CRC32_RANCE42, _T("ランス 4.2 〜エンジェル組〜")},
{"ayumi_cd", CRC32_AYUMI_CD, _T("あゆみちゃん物語")},
{"ayumi_live_256", CRC32_AYUMI_JISSHA_256, _T("あゆみちゃん物語 実写版")},
{"ayumi_live_full", CRC32_AYUMI_JISSHA_FULL, _T("あゆみちゃん物語 フルカラー実写版")},
{"yakata3_cd", CRC32_YAKATA3_CD, _T("アリスの館3")},
{"yakata3_fd", CRC32_YAKATA3_FD, _T("アリスの館3")},
{"hashirionna2", CRC32_HASHIRIONNA2, _T("走り女2")},
{"toushin2_sp", CRC32_TOUSHIN2_SP, _T("闘神都市2 そして、それから…")},
{"otome", CRC32_OTOMESENKI, _T("乙女戦記")},
{"ningyo", CRC32_NINGYO, _T("人魚 -蘿子-")},
{"mugen", CRC32_MUGENHOUYOU, _T("夢幻泡影")},
{"ambivalenz_fd", CRC32_AMBIVALENZ_FD, "AmbivalenZ −二律背反−"},
{"ambivalenz_cd", CRC32_AMBIVALENZ_CD, "AmbivalenZ −二律背反−"},
{"dps_all", CRC32_DPSALL, "D.P.S. 全部"},
{"funnybee_cd", CRC32_FUNNYBEE_CD, "宇宙快盗ファニーBee"},
// {"funnybee_patch", CRC32_FUNNYBEE_PATCH, "宇宙快盗ファニーBee"},
{"funnybee_fd", CRC32_FUNNYBEE_FD, "宇宙快盗ファニーBee"},
{"onlyyou", CRC32_ONLYYOU, "Only You −世紀末のジュリエット達−"},
{"onlyyou_demo", CRC32_ONLYYOU_DEMO, "Only You −世紀末のジュリエット達− デモ版"},
{"prog_cd", CRC32_PROSTUDENTG_CD, "prostudent G"},
{"rance41", CRC32_RANCE41, "ランス 4.1 〜お薬工場を救え!〜"},
{"rance42", CRC32_RANCE42, "ランス 4.2 〜エンジェル組〜"},
{"ayumi_cd", CRC32_AYUMI_CD, "あゆみちゃん物語"},
{"ayumi_live_256", CRC32_AYUMI_JISSHA_256, "あゆみちゃん物語 実写版"},
{"ayumi_live_full", CRC32_AYUMI_JISSHA_FULL, "あゆみちゃん物語 フルカラー実写版"},
{"yakata3_cd", CRC32_YAKATA3_CD, "アリスの館3"},
{"yakata3_fd", CRC32_YAKATA3_FD, "アリスの館3"},
{"hashirionna2", CRC32_HASHIRIONNA2, "走り女2"},
{"toushin2_sp", CRC32_TOUSHIN2_SP, "闘神都市2 そして、それから…"},
{"otome", CRC32_OTOMESENKI, "乙女戦記"},
{"ningyo", CRC32_NINGYO, "人魚 -蘿子-"},
{"mugen", CRC32_MUGENHOUYOU, "夢幻泡影"},
#endif
{NULL, 0, NULL},
};
@@ -67,7 +67,7 @@ uint32 NACT::calc_crc32(const char* game_id)
uint32 crc = 0;
FILEIO* fio = new FILEIO();
if(fio->Fopen(_T("ADISK.DAT"), FILEIO_READ_BINARY)) {
if(fio->Fopen("ADISK.DAT", FILEIO_READ_BINARY)) {
uint32 table[256];
for(int i = 0; i < 256; i++) {
uint32 c = i;
@@ -92,7 +92,7 @@ uint32 NACT::calc_crc32(const char* game_id)
#if defined(_SYSTEM2)
if(crc == CRC32_SDPS) {
// Super D.P.Sの場合はBDISK.DATのCRCを取る
if(fio->Fopen(_T("BDISK.DAT"), FILEIO_READ_BINARY)) {
if(fio->Fopen("BDISK.DAT", FILEIO_READ_BINARY)) {
uint32 table[256];
for(int i = 0; i < 256; i++) {
uint32 c = i;
@@ -133,7 +133,7 @@ const char* NACT::get_game_id()
return NULL;
}
const _TCHAR* NACT::get_title()
const char* NACT::get_title()
{
for (const CRCTable* t = crc_table; t->id; t++) {
if (crc32 == t->crc32)
+6 -6
View File
@@ -944,9 +944,9 @@ void NACT::cmd_l()
if(1 <= index && index <= 26) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
_TCHAR path[_MAX_PATH];
_tcscpy_s(path, _MAX_PATH, _T("ASLEEP_A.DAT"));
path[7] = _T('A') + index - 1;
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 1;
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_READ_BINARY)) {
@@ -1098,9 +1098,9 @@ void NACT::cmd_q()
if(1 <= index && index <= 26) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
_TCHAR path[_MAX_PATH];
_tcscpy_s(path, _MAX_PATH, _T("ASLEEP_A.DAT"));
path[7] = _T('A') + index - 1;
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 1;
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_WRITE_BINARY)) {
+6 -6
View File
@@ -1021,9 +1021,9 @@ void NACT::cmd_l()
if(1 <= index && index <= 26) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
_TCHAR path[_MAX_PATH];
_tcscpy_s(path, _MAX_PATH, _T("ASLEEP_A.DAT"));
path[7] = _T('A') + index - 1;
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 1;
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_READ_BINARY)) {
@@ -1217,9 +1217,9 @@ void NACT::cmd_q()
if(1 <= index && index <= 26) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
_TCHAR path[_MAX_PATH];
_tcscpy_s(path, _MAX_PATH, _T("ASLEEP_A.DAT"));
path[7] = _T('A') + index - 1;
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 1;
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_WRITE_BINARY)) {
+22 -22
View File
@@ -768,7 +768,7 @@ void NACT::cmd_l()
if(index == 0) {
// 特殊セーブ
FILEIO* fio = new FILEIO();
if(fio->Fopen(_T("ASLEEP.DAT"), FILEIO_READ_BINARY | FILEIO_SAVEDATA)) {
if(fio->Fopen("ASLEEP.DAT", FILEIO_READ_BINARY | FILEIO_SAVEDATA)) {
// U01 - U20
for(int i = 21; i <= 40; i++) {
var[i] = fio->Fgetw();
@@ -782,9 +782,9 @@ void NACT::cmd_l()
delete fio;
} else if(1 <= index && index <= 26) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
_TCHAR path[_MAX_PATH];
_tcscpy_s(path, _MAX_PATH, _T("ASLEEP_A.DAT"));
path[7] = _T('A') + index - 1;
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 1;
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_READ_BINARY | FILEIO_SAVEDATA)) {
@@ -875,9 +875,9 @@ void NACT::cmd_l()
delete fio;
} else if(101 <= index && index <= 126) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
_TCHAR path[_MAX_PATH];
_tcscpy_s(path, _MAX_PATH, _T("ASLEEP_A.DAT"));
path[7] = _T('A') + index - 101;
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 101;
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_READ_BINARY | FILEIO_SAVEDATA)) {
@@ -914,13 +914,13 @@ void NACT::cmd_m()
if(1 <= tvar_index && tvar_index <= 10) {
memcpy(tvar[tvar_index - 1], string, 22);
} else if(tvar_index == 31) {
_tcscpy_s(adisk, 16, string);
strcpy_s(adisk, 16, string);
} else if(tvar_index == 32) {
_tcscpy_s(ags->acg, 16, string);
strcpy_s(ags->acg, 16, string);
} else if(tvar_index == 33) {
_tcscpy_s(mako->amus, 16, string);
strcpy_s(mako->amus, 16, string);
} else if(tvar_index == 34) {
_tcscpy_s(mako->amse, 16, string);
strcpy_s(mako->amse, 16, string);
}
}
@@ -1055,7 +1055,7 @@ void NACT::cmd_q()
if(index == 0) {
// 特殊セーブ
FILEIO* fio = new FILEIO();
if(fio->Fopen(_T("ASLEEP.DAT"), FILEIO_WRITE_BINARY | FILEIO_SAVEDATA)) {
if(fio->Fopen("ASLEEP.DAT", FILEIO_WRITE_BINARY | FILEIO_SAVEDATA)) {
// U01 - U20
for(int i = 21; i <= 40; i++) {
fio->Fputw(var[i]);
@@ -1069,9 +1069,9 @@ void NACT::cmd_q()
delete fio;
} else if(1 <= index && index <= 26) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
_TCHAR path[_MAX_PATH];
_tcscpy_s(path, _MAX_PATH, _T("ASLEEP_A.DAT"));
path[7] = _T('A') + index - 1;
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 1;
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_WRITE_BINARY | FILEIO_SAVEDATA)) {
@@ -1591,9 +1591,9 @@ void NACT::cmd_y()
break;
case 239:
{
_TCHAR path[_MAX_PATH];
_tcscpy_s(path, _MAX_PATH, _T("ASLEEP_A.DAT"));
path[7] = _T('A') + param - 1;
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + param - 1;
struct stat statbuf;
if (FILEIO::StatSavedata(path, &statbuf) != -1) {
@@ -1617,11 +1617,11 @@ void NACT::cmd_y()
case 250:
{
#if 0
_TCHAR path[4];
char path[4];
path[0] = g_root[0];
path[1] = _T(':');
path[2] = _T('\\');
path[3] = _T('\0');
path[1] = ':';
path[2] = '\\';
path[3] = '\0';
UINT t = GetDriveType(path);
// フロッピーから起動した場合は0が返る
//RND = (t == DRIVE_REMOVABLE) ? 0 : (t == DRIVE_CDROM) ? 2 : 1;