1 #include "load/load-util.h"
2 #include "term/screen-processor.h"
4 #include "locale/japanese.h"
7 FILE *loading_savefile;
8 byte load_xor_byte; // Old "encryption" byte.
9 u32b v_check = 0L; // Simple "checksum" on the actual values.
10 u32b x_check = 0L; // Simple "checksum" on the encoded bytes.
22 * @brief ゲームスクリーンにメッセージを表示する / Hack -- Show information on the screen, one line at a time.
26 * Avoid the top two lines, to avoid interference with "msg_print()".
28 void load_note(concptr msg)
30 static TERM_LEN y = 2;
39 * @brief ロードファイルポインタから1バイトを読み込む
42 * The following functions are used to load the basic building blocks
43 * of savefiles. They also maintain the "checksum" info for 2.7.0+
47 byte c = getc(loading_savefile) & 0xFF;
48 byte v = c ^ load_xor_byte;
52 x_check += load_xor_byte;
57 * @brief ロードファイルポインタから1バイトを読み込んでポインタに渡す
61 void rd_byte(byte *ip) { *ip = sf_get(); }
64 * @brief ロードファイルポインタから符号なし16bit値を読み込んでポインタに渡す
68 void rd_u16b(u16b *ip)
71 (*ip) |= ((u16b)(sf_get()) << 8);
75 * @brief ロードファイルポインタから符号つき16bit値を読み込んでポインタに渡す
79 void rd_s16b(s16b *ip) { rd_u16b((u16b *)ip); }
82 * @brief ロードファイルポインタから符号なし32bit値を読み込んでポインタに渡す
86 void rd_u32b(u32b *ip)
89 (*ip) |= ((u32b)(sf_get()) << 8);
90 (*ip) |= ((u32b)(sf_get()) << 16);
91 (*ip) |= ((u32b)(sf_get()) << 24);
95 * @brief ロードファイルポインタから符号つき32bit値を読み込んでポインタに渡す
99 void rd_s32b(s32b *ip) { rd_u32b((u32b *)ip); }
102 * @brief ロードファイルポインタから文字列を読み込んでポインタに渡す / Hack -- read a string
103 * @param str 読み込みポインタ
104 * @param max 最大読み取りバイト数
107 void rd_string(char *str, int max)
109 for (int i = 0; TRUE; i++) {
121 switch (kanji_code) {
135 byte code = codeconv(str);
137 /* 漢字コードが判明したら、それを記録 */
150 * @brief ロードファイルポインタを指定バイト分飛ばして進める / Hack -- strip some bytes
154 void strip_bytes(int n)