1 #include "save/save-util.h"
3 FILE *saving_savefile; /* Current save "file" */
4 byte save_xor_byte; /* Simple encryption */
5 u32b v_stamp = 0L; /* A simple "checksum" on the actual values */
6 u32b x_stamp = 0L; /* A simple "checksum" on the encoded bytes */
9 * @brief 1バイトをファイルに書き込む / These functions place information into a savefile a byte at a time
13 static void sf_put(byte v)
15 /* Encode the value, write a character */
17 (void)putc((int)save_xor_byte, saving_savefile);
19 /* Maintain the checksum info */
21 x_stamp += save_xor_byte;
25 * @brief 1バイトをファイルに書き込む(sf_put()の糖衣)
29 void wr_byte(byte v) { sf_put(v); }
32 * @brief 符号なし16ビットをファイルに書き込む
33 * @param v 書き込む符号なし16bit値
38 wr_byte((byte)(v & 0xFF));
39 wr_byte((byte)((v >> 8) & 0xFF));
43 * @brief 符号あり16ビットをファイルに書き込む
44 * @param v 書き込む符号あり16bit値
47 void wr_s16b(s16b v) { wr_u16b((u16b)v); }
50 * @brief 符号なし32ビットをファイルに書き込む
51 * @param v 書き込む符号なし32bit値
56 wr_byte((byte)(v & 0xFF));
57 wr_byte((byte)((v >> 8) & 0xFF));
58 wr_byte((byte)((v >> 16) & 0xFF));
59 wr_byte((byte)((v >> 24) & 0xFF));
63 * @brief 符号あり32ビットをファイルに書き込む
64 * @param v 書き込む符号あり32bit値
67 void wr_s32b(s32b v) { wr_u32b((u32b)v); }
70 * @brief 文字列をファイルに書き込む
74 void wr_string(concptr str)