セーブファイル読み込み処理 / Purpose: support for loading savefiles -BEN- [詳細]
#include "angband.h"
マクロ定義 | |
#define | MAX_TRIES 100 |
#define | OLD_MAX_MANE 22 |
#define | RF3_IM_ACID 0x00010000 /* Resist acid a lot */ |
#define | RF3_IM_ELEC 0x00020000 /* Resist elec a lot */ |
#define | RF3_IM_FIRE 0x00040000 /* Resist fire a lot */ |
#define | RF3_IM_COLD 0x00080000 /* Resist cold a lot */ |
#define | RF3_IM_POIS 0x00100000 /* Resist poison a lot */ |
#define | RF3_RES_TELE 0x00200000 /* Resist teleportation */ |
#define | RF3_RES_NETH 0x00400000 /* Resist nether a lot */ |
#define | RF3_RES_WATE 0x00800000 /* Resist water */ |
#define | RF3_RES_PLAS 0x01000000 /* Resist plasma */ |
#define | RF3_RES_NEXU 0x02000000 /* Resist nexus */ |
#define | RF3_RES_DISE 0x04000000 /* Resist disenchantment */ |
#define | RF3_RES_ALL 0x08000000 /* Resist all */ |
#define | MOVE_RF3_TO_RFR(R_PTR, RF3, RFR) |
#define | RF4_BR_TO_RFR(R_PTR, RF4_BR, RFR) |
#define | RF4_BR_LITE 0x00004000 /* Breathe Lite */ |
#define | RF4_BR_DARK 0x00008000 /* Breathe Dark */ |
#define | RF4_BR_CONF 0x00010000 /* Breathe Confusion */ |
#define | RF4_BR_SOUN 0x00020000 /* Breathe Sound */ |
#define | RF4_BR_CHAO 0x00040000 /* Breathe Chaos */ |
#define | RF4_BR_TIME 0x00200000 /* Breathe Time */ |
#define | RF4_BR_INER 0x00400000 /* Breathe Inertia */ |
#define | RF4_BR_GRAV 0x00800000 /* Breathe Gravity */ |
#define | RF4_BR_SHAR 0x01000000 /* Breathe Shards */ |
#define | RF4_BR_WALL 0x04000000 /* Breathe Force */ |
#define | CAVE_TRAP 0x8000 |
#define | OLD_FEAT_INVIS 0x02 |
#define | OLD_FEAT_GLYPH 0x03 |
#define | OLD_FEAT_QUEST_ENTER 0x08 |
#define | OLD_FEAT_QUEST_EXIT 0x09 |
#define | OLD_FEAT_MINOR_GLYPH 0x40 |
#define | OLD_FEAT_BLDG_1 0x81 |
#define | OLD_FEAT_MIRROR 0xc3 |
#define | OLD_QUEST_WATER_CAVE 18 |
#define | QUEST_OLD_CASTLE 27 |
#define | QUEST_ROYAL_CRYPT 28 |
関数 | |
static bool | h_older_than (byte major, byte minor, byte patch, byte extra) |
変愚蛮怒のバージョン比較処理 / This function determines if the version of the savefile currently being read is older than version "major.minor.patch.extra". [詳細] | |
static bool | z_older_than (byte x, byte y, byte z) |
Zangbandのバージョン比較処理 / The above function, adapted for Zangband. [詳細] | |
static void | note (cptr msg) |
ゲームスクリーンにメッセージを表示する / Hack – Show information on the screen, one line at a time. [詳細] | |
static byte | sf_get (void) |
ロードファイルポインタから1バイトを読み込む [詳細] | |
static void | rd_byte (byte *ip) |
ロードファイルポインタから1バイトを読み込んでポインタに渡す [詳細] | |
static void | rd_u16b (u16b *ip) |
ロードファイルポインタから符号なし16bit値を読み込んでポインタに渡す [詳細] | |
static void | rd_s16b (s16b *ip) |
ロードファイルポインタから符号つき16bit値を読み込んでポインタに渡す [詳細] | |
static void | rd_u32b (u32b *ip) |
ロードファイルポインタから符号なし32bit値を読み込んでポインタに渡す [詳細] | |
static void | rd_s32b (s32b *ip) |
ロードファイルポインタから符号つき32bit値を読み込んでポインタに渡す [詳細] | |
static void | rd_string (char *str, int max) |
ロードファイルポインタから文字列を読み込んでポインタに渡す / Hack – read a string [詳細] | |
static void | strip_bytes (int n) |
ロードファイルポインタを指定バイト分飛ばして進める / Hack – strip some bytes [詳細] | |
static void | rd_item_old (object_type *o_ptr) |
アイテムオブジェクト1件を読み込む(変愚ver1.5.0以前) / Read an object (Old method) [詳細] | |
static void | rd_item (object_type *o_ptr) |
アイテムオブジェクトを読み込む(現版) / Read an object (New method) [詳細] | |
static void | rd_monster_old (monster_type *m_ptr) |
モンスターを読み込む(変愚ver1.5.0以前) / Read a monster (Old method) [詳細] | |
static void | rd_monster (monster_type *m_ptr) |
モンスターを読み込む(現版) / Read a monster (New method) [詳細] | |
static void | rd_lore (int r_idx) |
モンスターの思い出を読み込む / Read the monster lore [詳細] | |
static void | home_carry (store_type *st_ptr, object_type *o_ptr) |
店置きのアイテムオブジェクトを読み込む / Add the item "o_ptr" to the inventory of the "Home" [詳細] | |
static errr | rd_store (int town_number, int store_number) |
店舗情報を読み込む / Read a store [詳細] | |
static void | rd_randomizer (void) |
乱数状態を読み込む / Read RNG state (added in 2.8.0) [詳細] | |
static void | rd_options (void) |
ゲームオプションを読み込む / Read options (ignore most pre-2.8.0 options) [詳細] | |
static void | rd_ghost (void) |
ダミー情報スキップ / Hack – strip the "ghost" info [詳細] | |
static void | load_quick_start (void) |
クイックスタート情報を読み込む / Load quick start data [詳細] | |
static void | rd_extra (void) |
その他の情報を読み込む / Read the "extra" information [詳細] | |
static errr | rd_inventory (void) |
プレイヤーの所持品情報を読み込む / Read the player inventory [詳細] | |
static void | rd_messages (void) |
メッセージログを読み込む / Read the saved messages [詳細] | |
static errr | rd_dungeon_old (void) |
メッセージログを読み込む / Read the dungeon (old method) [詳細] | |
static errr | rd_saved_floor (saved_floor_type *sf_ptr) |
保存されたフロアを読み込む / Read the saved floor [詳細] | |
static errr | rd_dungeon (void) |
保存されたフロアを読み込む(現版) / Read the dungeon (new method) [詳細] | |
static errr | rd_savefile_new_aux (void) |
ロード処理全体のサブ関数 / Actually read the savefile [詳細] | |
errr | rd_savefile_new (void) |
ロード処理全体のメイン関数 / Actually read the savefile [詳細] | |
static bool | load_floor_aux (saved_floor_type *sf_ptr) |
保存フロア読み込みのサブ関数 / Actually load and verify a floor save data [詳細] | |
bool | load_floor (saved_floor_type *sf_ptr, u32b mode) |
一時保存フロア情報を読み込む / Attempt to load the temporally saved-floor data [詳細] | |
変数 | |
static FILE * | fff |
static byte | xor_byte |
static u32b | v_check = 0L |
static u32b | x_check = 0L |
static byte | kanji_code = 0 |
セーブファイル読み込み処理 / Purpose: support for loading savefiles -BEN-
This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
This file loads savefiles from Angband 2.7.X and 2.8.X
Ancient savefiles (pre-2.7.0) are loaded by another file.
Note that Angband 2.7.0 through 2.7.3 are now officially obsolete, and savefiles from those versions may not be successfully converted.
We attempt to prevent corrupt savefiles from inducing memory errors.
Note that this file should not use the random number generator, the object flavors, the visual attr/char mappings, or anything else which is initialized after or during the "load character" function.
This file assumes that the monster/object records are initialized to zero, and the race/kind tables have been loaded correctly. The order of object stacks is currently not saved in the savefiles, but the "next" pointers are saved, so all necessary knowledge is present.
We should implement simple "savefile extenders" using some form of "sized" chunks of bytes, with a {size,type,data} format, so everyone can know the size, interested people can know the type, and the actual data is available to the parsing routines that acknowledge the type.
Consider changing the "globe of invulnerability" code so that it takes some form of "maximum damage to protect from" in addition to the existing "number of turns to protect for", and where each hit by a monster will reduce the shield by that amount.
XXX XXX XXX
#define CAVE_TRAP 0x8000 |
#define MAX_TRIES 100 |
#define MOVE_RF3_TO_RFR | ( | R_PTR, | |
RF3, | |||
RFR | |||
) |
#define OLD_FEAT_BLDG_1 0x81 |
#define OLD_FEAT_GLYPH 0x03 |
#define OLD_FEAT_INVIS 0x02 |
#define OLD_FEAT_MINOR_GLYPH 0x40 |
#define OLD_FEAT_MIRROR 0xc3 |
#define OLD_FEAT_QUEST_ENTER 0x08 |
#define OLD_FEAT_QUEST_EXIT 0x09 |
#define OLD_MAX_MANE 22 |
#define OLD_QUEST_WATER_CAVE 18 |
#define QUEST_OLD_CASTLE 27 |
#define QUEST_ROYAL_CRYPT 28 |
#define RF3_IM_ACID 0x00010000 /* Resist acid a lot */ |
#define RF3_IM_COLD 0x00080000 /* Resist cold a lot */ |
#define RF3_IM_ELEC 0x00020000 /* Resist elec a lot */ |
#define RF3_IM_FIRE 0x00040000 /* Resist fire a lot */ |
#define RF3_IM_POIS 0x00100000 /* Resist poison a lot */ |
#define RF3_RES_ALL 0x08000000 /* Resist all */ |
#define RF3_RES_DISE 0x04000000 /* Resist disenchantment */ |
#define RF3_RES_NETH 0x00400000 /* Resist nether a lot */ |
#define RF3_RES_NEXU 0x02000000 /* Resist nexus */ |
#define RF3_RES_PLAS 0x01000000 /* Resist plasma */ |
#define RF3_RES_TELE 0x00200000 /* Resist teleportation */ |
#define RF3_RES_WATE 0x00800000 /* Resist water */ |
#define RF4_BR_CHAO 0x00040000 /* Breathe Chaos */ |
#define RF4_BR_CONF 0x00010000 /* Breathe Confusion */ |
#define RF4_BR_DARK 0x00008000 /* Breathe Dark */ |
#define RF4_BR_GRAV 0x00800000 /* Breathe Gravity */ |
#define RF4_BR_INER 0x00400000 /* Breathe Inertia */ |
#define RF4_BR_LITE 0x00004000 /* Breathe Lite */ |
#define RF4_BR_SHAR 0x01000000 /* Breathe Shards */ |
#define RF4_BR_SOUN 0x00020000 /* Breathe Sound */ |
#define RF4_BR_TIME 0x00200000 /* Breathe Time */ |
#define RF4_BR_TO_RFR | ( | R_PTR, | |
RF4_BR, | |||
RFR | |||
) |
#define RF4_BR_WALL 0x04000000 /* Breathe Force */ |
変愚蛮怒のバージョン比較処理 / This function determines if the version of the savefile currently being read is older than version "major.minor.patch.extra".
major | メジャーバージョン値 |
minor | マイナーバージョン値 |
patch | パッチバージョン値 |
extra | エクストラパージョン値 |
|
static |
店置きのアイテムオブジェクトを読み込む / Add the item "o_ptr" to the inventory of the "Home"
st_ptr | 店舗の参照ポインタ |
o_ptr | アイテムオブジェクト参照ポインタ |
In all cases, return the slot (or -1) where the object was placed
Note that this is a hacked up version of "inven_carry()".
Also note that it may not correctly "adapt" to "knowledge" bacoming known, the player may have to pick stuff up and drop it again.
bool load_floor | ( | saved_floor_type * | sf_ptr, |
u32b | mode | ||
) |
一時保存フロア情報を読み込む / Attempt to load the temporally saved-floor data
sf_ptr | 保存フロア読み込み先 |
mode | オプション |
|
static |
保存フロア読み込みのサブ関数 / Actually load and verify a floor save data
sf_ptr | 保存フロア読み込み先 |
|
static |
クイックスタート情報を読み込む / Load quick start data
|
static |
ゲームスクリーンにメッセージを表示する / Hack – Show information on the screen, one line at a time.
msg | 表示文字列 |
Avoid the top two lines, to avoid interference with "msg_print()".
|
static |
ロードファイルポインタから1バイトを読み込んでポインタに渡す
ip | 読み込みポインタ |
|
static |
保存されたフロアを読み込む(現版) / Read the dungeon (new method)
The monsters/objects must be loaded in the same order that they were stored, since the actual indexes matter.
|
static |
メッセージログを読み込む / Read the dungeon (old method)
The monsters/objects must be loaded in the same order that they were stored, since the actual indexes matter.
|
static |
その他の情報を読み込む / Read the "extra" information
|
static |
ダミー情報スキップ / Hack – strip the "ghost" info
XXX XXX XXX This is such a nasty hack it hurts.
|
static |
プレイヤーの所持品情報を読み込む / Read the player inventory
Note that the inventory changed in Angband 2.7.4. Two extra pack slots were added and the equipment was rearranged. Note that these two features combine when parsing old save-files, in which items from the old "aux" slot are "carried", perhaps into one of the two new "inventory" slots.
Note that the inventory is "re-sorted" later by "dungeon()".
|
static |
アイテムオブジェクトを読み込む(現版) / Read an object (New method)
o_ptr | アイテムオブジェクト保存先ポインタ |
|
static |
アイテムオブジェクト1件を読み込む(変愚ver1.5.0以前) / Read an object (Old method)
o_ptr | アイテムオブジェクト読み取り先ポインタ |
This function attempts to "repair" old savefiles, and to extract the most up to date values for various object fields.
Note that Angband 2.7.9 introduced a new method for object "flags" in which the "flags" on an object are actually extracted when they are needed from the object kind, artifact index, ego-item index, and two special "xtra" fields which are used to encode any "extra" power of certain ego-items. This had the side effect that items imported from pre-2.7.9 savefiles will lose any "extra" powers they may have had, and also, all "uncursed" items will become "cursed" again, including Calris, even if it is being worn at the time. As a complete hack, items which are inscribed with "uncursed" will be "uncursed" when imported from pre-2.7.9 savefiles.
|
static |
モンスターの思い出を読み込む / Read the monster lore
r_idx | 読み込み先モンスターID |
|
static |
メッセージログを読み込む / Read the saved messages
|
static |
モンスターを読み込む(現版) / Read a monster (New method)
m_ptr | モンスター保存先ポインタ |
|
static |
モンスターを読み込む(変愚ver1.5.0以前) / Read a monster (Old method)
m_ptr | モンスター保存先ポインタ |
|
static |
ゲームオプションを読み込む / Read options (ignore most pre-2.8.0 options)
Note that the normal options are now stored as a set of 256 bit flags, plus a set of 256 bit masks to indicate which bit flags were defined at the time the savefile was created. This will allow new options to be added, and old options to be removed, at any time, without hurting old savefiles.
The window options are stored in the same way, but note that each window gets 32 options, and their order is fixed by certain defines.
|
static |
乱数状態を読み込む / Read RNG state (added in 2.8.0)
|
static |
ロードファイルポインタから符号つき16bit値を読み込んでポインタに渡す
ip | 読み込みポインタ |
|
static |
ロードファイルポインタから符号つき32bit値を読み込んでポインタに渡す
ip | 読み込みポインタ |
|
static |
保存されたフロアを読み込む / Read the saved floor
The monsters/objects must be loaded in the same order that they were stored, since the actual indexes matter.
errr rd_savefile_new | ( | void | ) |
ロード処理全体のメイン関数 / Actually read the savefile
|
static |
ロード処理全体のサブ関数 / Actually read the savefile
|
static |
店舗情報を読み込む / Read a store
town_number | 街ID |
store_number | 店舗ID |
|
static |
ロードファイルポインタから文字列を読み込んでポインタに渡す / Hack – read a string
str | 読み込みポインタ |
max | 最大読み取りバイト数 |
|
static |
ロードファイルポインタから符号なし16bit値を読み込んでポインタに渡す
ip | 読み込みポインタ |
|
static |
ロードファイルポインタから符号なし32bit値を読み込んでポインタに渡す
ip | 読み込みポインタ |
|
static |
ロードファイルポインタから1バイトを読み込む
The following functions are used to load the basic building blocks of savefiles. They also maintain the "checksum" info for 2.7.0+
|
static |
ロードファイルポインタを指定バイト分飛ばして進める / Hack – strip some bytes
n | スキップバイト数 |
Zangbandのバージョン比較処理 / The above function, adapted for Zangband.
x | メジャーバージョン値 |
y | マイナーバージョン値 |
z | パッチバージョン値 |
|
static |
|
static |
|
static |
|
static |
|
static |