From 67b6d7123213a3d483e4f8e0e06eb206bfaf0b67 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Fri, 3 Jan 2025 13:16:33 +0900 Subject: [PATCH] Clean up --- src/sys/ags_draw.cpp | 2 -- src/sys/game_id.cpp | 10 ++++------ src/sys/nact.h | 4 ++-- src/sys/nact_sys1.cpp | 46 +++++++++++++++++++++++-------------------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/sys/ags_draw.cpp b/src/sys/ags_draw.cpp index fc6cbf7..2002357 100644 --- a/src/sys/ags_draw.cpp +++ b/src/sys/ags_draw.cpp @@ -142,8 +142,6 @@ void AGS::gcopy(int gsc, int gde, int glx, int gly, int gsw) void AGS::paint(int x, int y, uint8 color) { - if (x < 0 || y < 0) return; - int old_color = vram[0][y][x]; if (old_color == color) return; diff --git a/src/sys/game_id.cpp b/src/sys/game_id.cpp index b2db747..cbf9aad 100644 --- a/src/sys/game_id.cpp +++ b/src/sys/game_id.cpp @@ -8,6 +8,8 @@ #define CRC32_BUNKASAI 0xc80f99b8 // あぶない文化祭前夜 #define CRC32_CRESCENT 0x42351f2c // クレセントムーンがぁる +#define CRC32_RANCE2 0x28f8298f // Rance 2 +#define CRC32_RANCE2_HINT 0x2a85e5fa // Rance 2 ヒントディスク (CRC32 of GDISK.DAT) #define CRC32_DPS 0x69ea4865 // D.P.S. - Dream Program System #define CRC32_DPS_SG 0xab4cda48 // D.P.S. SG #define CRC32_DPS_SG_FAHREN 0xe405d57c // D.P.S. SG - Fahren Fliegen @@ -73,9 +75,6 @@ #define CRC32_NINGYO 0xd491e7ab // 人魚 -蘿子- #define CRC32_MUGENHOUYOU 0xbb27d1ba // 夢幻泡影 -#define CRC32_RANCE2 0x12345678 -#define CRC32_RANCE2_HINT 0x34567890 - namespace { const struct CRCTable { @@ -89,6 +88,8 @@ const struct CRCTable { } crc_table[] = { {GameId::BUNKASAI, "bunkasai", 1, "あぶない文化祭前夜", JAPANESE, CRC32_BUNKASAI}, {GameId::CRESCENT, "crescent", 1, "クレセントムーンがぁる", JAPANESE, CRC32_CRESCENT}, + {GameId::RANCE2, "rance2", 1, "Rance 2 -反逆の少女たち-", JAPANESE, CRC32_RANCE2}, + {GameId::RANCE2_HINT, "rance2_hint", 1, "Rance 2 ヒントディスク", JAPANESE, CRC32_RANCE2_HINT}, {GameId::DPS, "dps", 1, "D.P.S - Dream Program System", JAPANESE, CRC32_DPS}, {GameId::DPS_SG_FAHREN, "dps_sg_fahren", 1, "D.P.S SG - Fahren Fliegen", JAPANESE, CRC32_DPS_SG, CRC32_DPS_SG_FAHREN}, {GameId::DPS_SG_KATEI, "dps_sg_katei", 1, "D.P.S SG - 家庭教師はステキなお仕事", JAPANESE, CRC32_DPS_SG, CRC32_DPS_SG_KATEI}, @@ -146,9 +147,6 @@ const struct CRCTable { {GameId::NINGYO, "ningyo", 3, "人魚 -蘿子-", JAPANESE, CRC32_NINGYO}, {GameId::MUGEN, "mugen", 3, "夢幻泡影", JAPANESE, CRC32_MUGENHOUYOU}, - {GameId::RANCE2, "rance2", 1, "Rance 2", ENGLISH, CRC32_RANCE2}, - {GameId::RANCE2_HINT, "rance2_hint", 1, "Rance 2 Hint Disk", ENGLISH, CRC32_RANCE2_HINT}, - {GameId::UNKNOWN, NULL, 0, NULL, JAPANESE, 0}, }; diff --git a/src/sys/nact.h b/src/sys/nact.h index 5ce3245..eb1991a 100644 --- a/src/sys/nact.h +++ b/src/sys/nact.h @@ -228,8 +228,6 @@ protected: void platform_initialize(); void platform_finalize(); - int last_paint_x = -1, last_paint_y = -1; - public: int mainloop(); void sys_sleep(int ms); @@ -305,6 +303,8 @@ private: // GAKUEN bool enable_graphics = true; + // Rance 2 + int last_paint_x = -1, last_paint_y = -1; }; class NACT_Sys2 final : public NACT { diff --git a/src/sys/nact_sys1.cpp b/src/sys/nact_sys1.cpp index 4bc0581..634db5c 100644 --- a/src/sys/nact_sys1.cpp +++ b/src/sys/nact_sys1.cpp @@ -432,8 +432,10 @@ void NACT_Sys1::cmd_g() } } - last_paint_x = -1; - last_paint_y = -1; + if (game_id.is_rance2()) { + last_paint_x = -1; + last_paint_y = -1; + } } void NACT_Sys1::cmd_h() @@ -543,9 +545,6 @@ void NACT_Sys1::cmd_u() } else { ags->load_cg(page, transparent); } - - last_paint_x = -1; - last_paint_y = -1; } void NACT_Sys1::cmd_v() @@ -706,8 +705,7 @@ void NACT_Sys1::cmd_y() if(param == 1) { ags->box_fill(0, 40, 8, 598, 270, 0); } - } - else if (game_id.is_rance2()) { + } else if (game_id.is_rance2()) { if (param == 0) { // Unknown } @@ -719,19 +717,24 @@ void NACT_Sys1::cmd_y() } } break; - case 12: // Rance 2 / Rance 2 hint disk - // Y 12, 0: is supposed to activate an automatic text - // progression feature, but it doesn't seem to work on the - // PC-98? - case 13: // Rance 2 - // Sets the speed of the auto text progression feature (Y 12). - // The options in Rance 2 are 1 (the fastest), 5, and 10 (the - // slowest). Not available in the Hint Disk. - case 20: // Rance 2 / Rance 2 hint disk - ags->load_cg(param, -1); - - last_paint_x = -1; - last_paint_y = -1; + case 12: + if (game_id.is_rance2()) { + // Y 12, 0: is supposed to activate an automatic text + // progression feature, but it doesn't seem to work on the + // PC-98? + } + break; + case 13: + if (game_id.is_rance2()) { + // Sets the speed of the auto text progression feature (Y 12). + // The options in Rance 2 are 1 (the fastest), 5, and 10 (the + // slowest). Not available in the Hint Disk. + } + break; + case 20: + if (game_id.is_rance2()) { + ags->load_cg(param, -1); + } break; case 130: if (game_id.is(GameId::TENGU)) { @@ -923,7 +926,8 @@ void NACT_Sys1::cmd_z() break; case GameId::RANCE2: case GameId::RANCE2_HINT: - ags->paint(last_paint_x, last_paint_y, 0); + if (last_paint_x != -1) + ags->paint(last_paint_x, last_paint_y, 0); ags->paint(cmd, param, 3); last_paint_x = cmd; last_paint_y = param;