本文整理汇总了C++中wr_byte函数的典型用法代码示例。如果您正苦于以下问题:C++ wr_byte函数的具体用法?C++ wr_byte怎么用?C++ wr_byte使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wr_byte函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wr_misc
void wr_misc(void)
{
int i;
/* Write the "object seeds" */
wr_u32b(seed_flavor);
wr_byte(NUM_TOWNS);
for (i = 0; i < NUM_TOWNS; i++)
wr_u32b(seed_town[i]);
/* Special stuff */
wr_u16b(p_ptr->quests);
wr_u32b(p_ptr->score);
wr_u16b(p_ptr->total_winner);
wr_u16b(p_ptr->noscore);
/* Write death */
wr_byte(p_ptr->is_dead);
/* Write feeling */
wr_byte((byte) feeling);
/* Turn of last "feeling" */
wr_byte(do_feeling);
/* Current turn */
wr_s32b(turn);
}
示例2: wr_object_memory
/**
* Write object memory, including flag sizes and other constants.
*/
void wr_object_memory(void)
{
int k_idx;
wr_u16b(z_info->k_max);
wr_byte(OF_SIZE);
wr_byte(CF_SIZE);
wr_byte(IF_SIZE);
wr_byte(MAX_P_RES);
wr_byte(A_MAX);
wr_byte(MAX_P_BONUS);
wr_byte(MAX_P_SLAY);
wr_byte(MAX_P_BRAND);
for (k_idx = 0; k_idx < z_info->k_max; k_idx++)
{
byte tmp8u = 0;
object_kind *k_ptr = &k_info[k_idx];
if (k_ptr->aware) tmp8u |= 0x01;
if (k_ptr->tried) tmp8u |= 0x02;
if (k_ptr->known_effect) tmp8u |= 0x04;
if (k_ptr->squelch) tmp8u |= 0x08;
wr_byte(tmp8u);
tmp8u = 0;
if (k_ptr->everseen) tmp8u |= 0x01;
wr_byte(tmp8u);
/* Expansion */
wr_u32b(0);
}
}
示例3: wr_stores
void wr_stores(void)
{
int i;
wr_u16b(MAX_STORES);
for (i = 0; i < MAX_STORES; i++)
{
const struct store *st_ptr = &stores[i];
int j;
/* XXX Old values */
wr_u32b(0L);
wr_s16b(0);
/* Save the current owner */
wr_byte(st_ptr->owner->oidx);
/* Save the stock size */
wr_byte(st_ptr->stock_num);
/* XXX Old values */
wr_s16b(0);
wr_s16b(0);
/* Save the stock */
for (j = 0; j < st_ptr->stock_num; j++)
wr_item(&st_ptr->stock[j]);
}
}
示例4: wr_string
void wr_string(cptr str)
{
while (*str)
{
wr_byte(*str);
str++;
}
wr_byte(*str);
}
示例5: wr_string
void wr_string(const char *str)
{
while (*str)
{
wr_byte(*str);
str++;
}
wr_byte(*str);
}
示例6: wr_options
/*
* Write the "options"
*/
void wr_options(void)
{
int i, k;
u32b window_flag[ANGBAND_TERM_MAX];
u32b window_mask[ANGBAND_TERM_MAX];
/* Special Options */
wr_byte(op_ptr->delay_factor);
wr_byte(op_ptr->hitpoint_warn);
wr_u16b(lazymove_delay);
/* Normal options */
for (i = 0; i < OPT_MAX; i++) {
const char *name = option_name(i);
if (!name)
continue;
wr_string(name);
wr_byte(op_ptr->opt[i]);
}
/* Sentinel */
wr_byte(0);
/*** Window options ***/
/* Reset */
for (i = 0; i < ANGBAND_TERM_MAX; i++)
{
/* Flags */
window_flag[i] = op_ptr->window_flag[i];
/* Mask */
window_mask[i] = 0L;
/* Build the mask */
for (k = 0; k < 32; k++)
{
/* Set mask */
if (window_flag_desc[k])
{
window_mask[i] |= (1L << k);
}
}
}
/* Dump the flags */
for (i = 0; i < ANGBAND_TERM_MAX; i++) wr_u32b(window_flag[i]);
/* Dump the masks */
for (i = 0; i < ANGBAND_TERM_MAX; i++) wr_u32b(window_mask[i]);
}
示例7: wr_trap
/**
* Write a trap record
*/
static void wr_trap(trap_type * t_ptr)
{
size_t i;
wr_byte(t_ptr->t_idx);
wr_byte(t_ptr->fy);
wr_byte(t_ptr->fx);
wr_byte(t_ptr->xtra);
for (i = 0; i < TRF_SIZE; i++)
wr_byte(t_ptr->flags[i]);
}
示例8: wr_player_spells
void wr_player_spells(void)
{
int i;
wr_u16b(PY_MAX_SPELLS);
for (i = 0; i < PY_MAX_SPELLS; i++)
wr_byte(p_ptr->spell_flags[i]);
for (i = 0; i < PY_MAX_SPELLS; i++)
wr_byte(p_ptr->spell_order[i]);
}
示例9: wr_quests
void wr_quests(void)
{
int i;
u16b tmp16u;
/* Hack -- Dump the quests */
tmp16u = MAX_Q_IDX;
wr_u16b(tmp16u);
for (i = 0; i < tmp16u; i++) {
wr_u16b((u16b) q_list[i].stage);
wr_byte(0);
wr_byte(0);
}
}
示例10: wr_stores
/**
* Write a "store" record
*/
void wr_stores(void)
{
int i;
wr_byte(MAX_STORES);
wr_byte(STORE_INVEN_MAX);
wr_byte(STORE_CHOICES);
for (i = 0; i < MAX_STORES; i++)
{
const store_type *st_ptr = &store[i];
int j;
/* Save the "open" counter */
wr_u32b(st_ptr->store_open);
/* Save the "insults" */
wr_s16b(st_ptr->insult_cur);
/* Save the current owner*/
wr_byte(st_ptr->owner);
/* Save the stock size */
wr_byte((byte)st_ptr->stock_num);
/* Save the "haggle" info */
wr_s16b(st_ptr->good_buy);
wr_s16b(st_ptr->bad_buy);
/* Save the stock */
for (j = 0; j < st_ptr->stock_num; j++)
{
/* Save each item in stock */
wr_item(&st_ptr->stock[j]);
}
/* Save the ordered stock */
if (st_ptr->type == STORE_MERCH)
/* Look at the ordered slots */
for (j = STORE_INVEN_MAX; j < STORE_CHOICES; j++)
{
/* Save the table entry */
wr_s16b(st_ptr->table[j]);
}
/* Expansion */
wr_u32b(0);
}
}
示例11: wr_inventory
void wr_inventory(void)
{
int i;
wr_byte(ALL_INVEN_TOTAL);
/* Write the inventory */
for (i = 0; i < ALL_INVEN_TOTAL; i++) {
object_type *o_ptr = &p_ptr->inventory[i];
/* Skip non-objects */
if (!o_ptr->k_idx)
continue;
/* Dump index */
wr_u16b((u16b) i);
/* Dump object */
wr_item(o_ptr);
}
/* Add a sentinel */
wr_u16b(0xFFFF);
/* Expansion */
wr_u32b(0);
}
示例12: wr_data_B
unsigned int wr_data_B(int dev, unsigned int addr, char data)
{
wr_cmd(dev, addr, XFL_CMD_PROGRAM_SETUP);
wr_byte(dev, addr, data);
return flash_wt_rdy(dev, addr);
}
示例13: wr_store
/*!
* @brief 店舗情報を書き込む / Write a "store" record
* @param st_ptr 店舗情報の参照ポインタ
* @return なし
*/
static void wr_store(store_type *st_ptr)
{
int j;
/* Save the "open" counter */
wr_u32b(st_ptr->store_open);
/* Save the "insults" */
wr_s16b(st_ptr->insult_cur);
/* Save the current owner */
wr_byte(st_ptr->owner);
/* Save the stock size */
wr_s16b(st_ptr->stock_num);
/* Save the "haggle" info */
wr_s16b(st_ptr->good_buy);
wr_s16b(st_ptr->bad_buy);
wr_s32b(st_ptr->last_visit);
/* Save the stock */
for (j = 0; j < st_ptr->stock_num; j++)
{
/* Save each item in stock */
wr_item(&st_ptr->stock[j]);
}
}
示例14: wr_artifacts
void wr_artifacts(void)
{
int i;
u16b tmp16u;
/* Hack -- Dump the artifacts */
tmp16u = z_info->a_max;
wr_u16b(tmp16u);
for (i = 0; i < tmp16u; i++)
{
artifact_type *a_ptr = &a_info[i];
wr_byte(a_ptr->created);
wr_byte(a_ptr->seen);
wr_byte(a_ptr->everseen);
wr_byte(0);
}
}
示例15: wr_xtra
/*
* Write an "xtra" record
*/
static void wr_xtra(int k_idx)
{
byte tmp8u = 0;
object_kind *k_ptr = &k_info[k_idx];
if (k_ptr->aware) tmp8u |= 0x01;
if (k_ptr->tried) tmp8u |= 0x02;
if (k_ptr->everseen) tmp8u |= 0x08;
wr_byte(tmp8u);
/*write the squelch settings*/
tmp8u = k_ptr->squelch;
wr_byte(tmp8u);
}