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
12 static void sf_put(byte v)
14 /* Encode the value, write a character */
16 (void)putc((int)save_xor_byte, saving_savefile);
18 /* Maintain the checksum info */
20 x_stamp += save_xor_byte;
24 * @brief 1バイトをファイルに書き込む(sf_put()の糖衣)
27 void wr_byte(byte v) { sf_put(v); }
30 * @brief 符号なし16ビットをファイルに書き込む
31 * @param v 書き込む符号なし16bit値
35 wr_byte((byte)(v & 0xFF));
36 wr_byte((byte)((v >> 8) & 0xFF));
40 * @brief 符号あり16ビットをファイルに書き込む
41 * @param v 書き込む符号あり16bit値
43 void wr_s16b(s16b v) { wr_u16b((u16b)v); }
46 * @brief 符号なし32ビットをファイルに書き込む
47 * @param v 書き込む符号なし32bit値
51 wr_byte((byte)(v & 0xFF));
52 wr_byte((byte)((v >> 8) & 0xFF));
53 wr_byte((byte)((v >> 16) & 0xFF));
54 wr_byte((byte)((v >> 24) & 0xFF));
58 * @brief 符号あり32ビットをファイルに書き込む
59 * @param v 書き込む符号あり32bit値
61 void wr_s32b(s32b v) { wr_u32b((u32b)v); }
64 * @brief 文字列をファイルに書き込む
67 void wr_string(concptr str)