当前位置: 首页>>代码示例>>C++>>正文


C++ poke函数代码示例

本文整理汇总了C++中poke函数的典型用法代码示例。如果您正苦于以下问题:C++ poke函数的具体用法?C++ poke怎么用?C++ poke使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了poke函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: atl

 static void atl(int s, int, BS &b) {
     if (b.gen() > 4)
         return;
     /* Last move used is here not to take "special occurence" moves */
     poke(b,s)["ChoiceMemory"] = poke(b,s)["LastMoveUsed"];
 }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:6,代码来源:items.cpp

示例2: poke

void PokeEdit::changeItem(const QString &itemName)
{
    int itemNum = ItemInfo::Number(itemName);
    poke().item() = itemNum;
    if (poke().num() == Pokemon::Giratina && itemNum == Item::GriseousOrb && PokemonInfo::Released(Pokemon::Giratina_O, poke().gen())) {
        setNum(Pokemon::Giratina_O); 
    } else if (poke().num() == Pokemon::Giratina_O && itemNum != Item::GriseousOrb) {
        setNum(Pokemon::Giratina); 
    } else if (itemNum == Item::GriseousOrb && poke().gen() <= 4 && poke().num().pokenum != Pokemon::Giratina) {
        poke().item() = 0;
    }
    if (poke().num().pokenum == Pokemon::Arceus) {
        int subnum = ItemInfo::isPlate(itemNum) ? ItemInfo::PlateType(itemNum) : 0;
        setNum(Pokemon::uniqueId(poke().num().pokenum, subnum));
    }
    if (poke().num().pokenum == Pokemon::Genesect) {
        int subnum = ItemInfo::isDrive(itemNum) ? ItemInfo::DriveForme(itemNum) : 0;
        setNum(Pokemon::uniqueId(poke().num().pokenum, subnum));
    }
    if (itemNum != ItemInfo::StoneForForme(poke().num())) {
        if (PokemonInfo::IsMegaEvo(poke().num()) && !PokeEdit::hackMons) {
            setNum(Pokemon::uniqueId(poke().num().pokenum,0));
        }
    }
    updateItemSprite(poke().item());
    emit itemChanged();
}
开发者ID:BakedCoder,项目名称:pokemon-online,代码行数:27,代码来源:pokeedit.cpp

示例3: do_call

void
do_call(int *ip)
{
	struct t_proc *ptr;
	int value;

	/* define label */
	labldef(loccnt, 1);

	/* update location counter */
	data_loccnt = loccnt;
	loccnt += 3;

	/* generate code */
	if (pass == LAST_PASS) {
		/* skip spaces */
		while (isspace(prlnbuf[*ip]))
			(*ip)++;

		/* extract name */
		if (!colsym(ip)) {
			if (symbol[0] == 0)
				fatal_error("Syntax error!");
			return;
		}

		/* check end of line */
		check_eol(ip);

		/* lookup proc table */
		if((ptr = proc_look())) {
			/* check banks */
			if (bank == ptr->bank)
				value = ptr->org + 0xA000;
			else {
				/* different */
				if (ptr->call)
					value = ptr->call;
				else {
					/* new call */
					value = call_ptr + 0x8000;
					ptr->call = value;

					/* init */
					if (call_ptr == 0) {
						call_bank = ++max_bank;
					}

					/* install */
					poke(call_ptr++, 0xA8);			// tay
					poke(call_ptr++, 0x43);			// tma #5
					poke(call_ptr++, 0x20);
					poke(call_ptr++, 0x48);			// pha
					poke(call_ptr++, 0xA9);			// lda #...
					poke(call_ptr++, ptr->bank+bank_base);
					poke(call_ptr++, 0x53);			// tam #5
					poke(call_ptr++, 0x20);
					poke(call_ptr++, 0x98);			// tya
					poke(call_ptr++, 0x20);			// jsr ...
					poke(call_ptr++, (ptr->org & 0xFF));
					poke(call_ptr++, (ptr->org >> 8) + 0xA0);
					poke(call_ptr++, 0xA8);			// tay
					poke(call_ptr++, 0x68);			// pla
					poke(call_ptr++, 0x53);			// tam #5
					poke(call_ptr++, 0x20);
					poke(call_ptr++, 0x98);			// tya
					poke(call_ptr++, 0x60);			// rts
				}
			}
		}
		else {
			/* lookup symbol table */
			if ((lablptr = stlook(0)) == NULL) {
				fatal_error("Undefined destination!");
				return;
			}

			/* get symbol value */
			value = lablptr->value;
		}

		/* opcode */
		putbyte(data_loccnt, 0x20);
		putword(data_loccnt+1, value);

		/* output line */
		println();
	}
开发者ID:m6502,项目名称:pceas,代码行数:88,代码来源:proc.c

示例4: updateGender

void PokeEdit::updateGender()
{
    ui->genderSprite->setPixmap(Theme::GenderPicture(poke().gender()));
}
开发者ID:BakedCoder,项目名称:pokemon-online,代码行数:4,代码来源:pokeedit.cpp

示例5: updateGender

void TB_PokemonBody::updateGender()
{
    widget->setGender(poke()->gender());
}
开发者ID:Antar1011,项目名称:pokemon-online-1.0.53,代码行数:4,代码来源:pokebody.cpp

示例6: setItem

void PokeEdit::updateAll()
{
    ui->pokemonSprite->setPixmap(poke().picture());
    ui->nickname->setText(poke().nickname());
    ui->type1->setPixmap(Theme::TypePicture(poke().type1()));
    ui->type2->setPixmap(Theme::TypePicture(poke().type2()));
    ui->speciesLabel->setText(PokemonInfo::Name(poke().num()));
    ui->genderSprite->setPixmap(Theme::GenderPicture(poke().gender()));
    ui->happiness->setValue(poke().happiness());
    ui->nature->setCurrentIndex(poke().nature());
    setItem(poke().item());
    ui->levelSettings->updateAll();
    ui->evbox->updateAll();
    ui->ivbox->updateAll();

    movesModel->setPokemon(poke().num(), poke().gen());

    for (int i = 0; i < 4; i++) {
        if (poke().move(i) != 0) {
            m_moves[i]->setText(MoveInfo::Name(poke().move(i)));
        } else {
            m_moves[i]->clear();
        }
    }

    ui->type2->setVisible(poke().type2() != Type::Curse);
    ui->genderSprite->setVisible(poke().gender() != Pokemon::Neutral);

    bool g1 = poke().gen().num == 1;
    ui->happiness->setVisible(!g1);
    ui->item->setVisible(!g1);
    ui->itemLabel->setVisible(!g1);
    ui->happinessLabel->setVisible(!g1);
    ui->genderSprite->setVisible(!g1);

    bool g2 = poke().gen().num <= 2;
    ui->natureLabel->setVisible(!g2);
    ui->nature->setVisible(!g2);

    updatePluginLayout();
}
开发者ID:BakedCoder,项目名称:pokemon-online,代码行数:41,代码来源:pokeedit.cpp

示例7: us

 static void us(int s, int, BS &b) {
     poke(b,s).remove("ChoiceMemory");
 }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:3,代码来源:items.cpp

示例8: aggregator_schema

void aggregator_schema()
{
	AssocOf(Assoc) aggregator_feed;
	aggregator_feed["#spec"]["description"] = "Stores feeds to be parsed by the aggregator.";
	aggregator_feed["#spec"]["name"] = "aggregator_feed";
	aggregator_feed["fid"]["type"] = "serial";
	aggregator_feed["fid"]["not null"] = _TRUE;
	aggregator_feed["fid"]["description"] = "Primary Key: Unique feed ID.";
	aggregator_feed["title"]["type"] = "varchar";
	aggregator_feed["title"]["length"] = "255";
	aggregator_feed["title"]["not null"] = _TRUE;
	aggregator_feed["title"]["default"] = "";
	aggregator_feed["title"]["description"] = "Title of the feed.";
	aggregator_feed["url"]["type"] = "varchar";
	aggregator_feed["url"]["length"] = "255";
	aggregator_feed["url"]["not null"] = _TRUE;
	aggregator_feed["url"]["default"] = "";
	aggregator_feed["url"]["description"] = "URL to the feed.";
	aggregator_feed["refresh"]["type"] = "int";
	aggregator_feed["refresh"]["not null"] = _TRUE;
	aggregator_feed["refresh"]["default"] = "0";
	aggregator_feed["refresh"]["description"] = "How often to check for new feed items, in seconds.";
	aggregator_feed["livetime"]["type"] = "int";
	aggregator_feed["livetime"]["not null"] = _TRUE;
	aggregator_feed["livetime"]["default"] = "1209600"; // 2 Weeks
	aggregator_feed["livetime"]["description"] = "Live time of the feed, as a Unix timestamp.";
	aggregator_feed["checked"]["type"] = "int";
	aggregator_feed["checked"]["not null"] = _TRUE;
	aggregator_feed["checked"]["default"] = "0";
	aggregator_feed["checked"]["description"] = "Last time feed was checked for new items, as Unix timestamp.";
	aggregator_feed["link"]["type"] = "varchar";
	aggregator_feed["link"]["length"] = "255";
	aggregator_feed["link"]["not null"] = _TRUE;
	aggregator_feed["link"]["default"] = "";
	aggregator_feed["link"]["description"] = "The parent website of the feed; comes from the &lt;link&gt; element in the feed.";
	aggregator_feed["description"]["type"] = "text";
	aggregator_feed["description"]["not null"] = _TRUE;
	aggregator_feed["description"]["size"] = "big";
	aggregator_feed["description"]["description"] = "The parent website's description; comes from the &lt;description&gt; element in the feed.";
	aggregator_feed["image"]["type"] = "text";
	aggregator_feed["image"]["not null"] = _TRUE;
	aggregator_feed["image"]["size"] = "big";
	aggregator_feed["image"]["description"] = "An image representing the feed.";
	aggregator_feed["etag"]["type"] = "varchar";
	aggregator_feed["etag"]["length"] = "255";
	aggregator_feed["etag"]["not null"] = _TRUE;
	aggregator_feed["etag"]["default"] = "";
	aggregator_feed["etag"]["description"] = "Entity tag HTTP response header, used for validating cache.";
	aggregator_feed["modified"]["type"] = "int";
	aggregator_feed["modified"]["not null"] = _TRUE;
	aggregator_feed["modified"]["default"] = "0";
	aggregator_feed["modified"]["description"] = "When the feed was last modified, as a Unix timestamp.";
	aggregator_feed["block"]["type"] = "int";
	aggregator_feed["block"]["not null"] = _TRUE;
	aggregator_feed["block"]["default"] = "0";
	aggregator_feed["block"]["size"] = "tiny";
	aggregator_feed["block"]["description"] = "Number of items to display in the feed's block.";
	aggregator_feed["#primary key"]["fid"] = "fid";
	aggregator_feed["#unique keys"]["url"] = "url";
	aggregator_feed["#unique keys"]["title"] = "title";
	poke( schema, aggregator_feed );

	AssocOf(Assoc) aggregator_item;
	aggregator_item["#spec"]["description"] = "Stores the individual items imported from feeds.";
	aggregator_item["#spec"]["name"] = "aggregator_item";
	aggregator_item["iid"]["type"] = "serial";
	aggregator_item["iid"]["not null"] = _TRUE;
	aggregator_item["iid"]["description"] = "Primary Key: Unique ID for feed item.";
	aggregator_item["fid"]["type"] = "int";
	aggregator_item["fid"]["not null"] = _TRUE;
	aggregator_item["fid"]["default"] = "0";
	aggregator_item["fid"]["description"] = "The {aggregator_feed}.fid to which this item belongs.";
	aggregator_item["title"]["type"] = "varchar";
	aggregator_item["title"]["length"] = "255";
	aggregator_item["title"]["not null"] = _TRUE;
	aggregator_item["title"]["default"] = "";
	aggregator_item["title"]["description"] = "Title of the feed item.";
	aggregator_item["link"]["type"] = "varchar";
	aggregator_item["link"]["length"] = "255";
	aggregator_item["link"]["not null"] = _TRUE;
	aggregator_item["link"]["default"] = "";
	aggregator_item["link"]["description"] = "Link to the feed item.";
	aggregator_item["author"]["type"] = "varchar";
	aggregator_item["author"]["length"] = "255";
	aggregator_item["author"]["not null"] = _TRUE;
	aggregator_item["author"]["default"] = "";
	aggregator_item["author"]["description"] = "Author of the feed item.";
	aggregator_item["description"]["type"] = "text";
	aggregator_item["description"]["not null"] = _TRUE;
	aggregator_item["description"]["size"] = "big";
	aggregator_item["description"]["description"] = "Body of the feed item.";
	aggregator_item["timestamp"]["type"] = "int";
	aggregator_item["timestamp"]["not null"] = _FALSE;
	aggregator_item["timestamp"]["description"] = "Post date of feed item, as a Unix timestamp.";
	aggregator_item["livetime"]["type"] = "int";
	aggregator_item["livetime"]["not null"] = _TRUE;
	aggregator_item["livetime"]["default"] = "1209600"; // 2 Weeks
	aggregator_item["livetime"]["description"] = "Live time of feed item, as a Unix timestamp.";
	aggregator_item["guid"]["type"] = "varchar";
	aggregator_item["guid"]["length"] = "255";
//.........这里部分代码省略.........
开发者ID:idaunis,项目名称:binarytiers,代码行数:101,代码来源:aggregator.cpp

示例9: m2m

 static void m2m(int s, int, BS &b) {
     turn(b,s)["ItemMod2Modifier"] = poke(b,s)["IMMetroCount"];
 }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:3,代码来源:items.cpp

示例10: as

 static void as(int s, int, BS &b) {
     bool used = false;
     if (poke(b,s).contains("AttractedTo")) {
         int seducer = poke(b,s)["AttractedTo"].toInt();
         if (poke(b,seducer).contains("Attracted") && poke(b,seducer)["Attracted"].toInt() == s) {
             removeFunction(poke(b,s), "DetermineAttackPossible", "Attract");
             poke(b,s).remove("AttractedTo");
             used = true;
         }
     }
     if (b.gen() >= 5) {
         if (poke(b,s).contains("Tormented")) {
             removeFunction(poke(b,s), "MovesPossible", "Torment");
             poke(b,s).remove("Tormented");
             used = true;
         }
         if (b.counters(s).hasCounter(BC::Taunt)) {
             removeFunction(poke(b,s), "MovesPossible", "Taunt");
             removeFunction(poke(b,s), "MovePossible", "Taunt");
             b.removeEndTurnEffect(BS::PokeEffect, s, "Taunt");
             used = true;
         }
         if (b.counters(s).hasCounter(BC::Encore)) {
             removeFunction(poke(b,s), "MovesPossible", "Encore");
             b.removeEndTurnEffect(BS::PokeEffect, s, "Encore");
             used = true;
         }
         if (b.counters(s).hasCounter(BC::Disable)) {
             removeFunction(poke(b,s), "MovesPossible", "Disable");
             removeFunction(poke(b,s), "MovePossible", "Disable");
             b.removeEndTurnEffect(BS::PokeEffect, s, "Disable");
             used = true;
         }
         b.counters(s).clear();
     }
     if (used) {
         b.sendItemMessage(7,s);
         b.disposeItem(s);
     }
 }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:40,代码来源:items.cpp

示例11: btl

 static void btl(int s, int, BS &b) {
     if (b.pokenum(s).pokenum == poke(b,s)["ItemArg"].toInt()) {
         tmove(b,s).critRaise += 2;
     }
 }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:5,代码来源:items.cpp

示例12: bpm

 static void bpm(int s, int, BS &b) {
     if (tmove(b,s).category == poke(b,s)["ItemArg"]) {
         b.chainBp(s, 2);
     }
 }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:5,代码来源:items.cpp

示例13: sm

 static void sm(int s, int, BS &b) {
     QString args = poke(b,s)["ItemArg"].toString();
     turn(b,s)["Stat" + args.left(1) + "ItemModifier"] = args.mid(2).toInt();
 }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:4,代码来源:items.cpp

示例14: updateLevel

void TB_PokemonBody::updateLevel()
{
    widget->setLevel(poke()->level());
}
开发者ID:Antar1011,项目名称:pokemon-online-1.0.53,代码行数:4,代码来源:pokebody.cpp

示例15: parse_ihex

/*
 * Parse an Intel HEX image file and invoke the poke() function on the
 * various segments to implement policies such as writing to RAM (with
 * a one or two stage loader setup, depending on the firmware) or to
 * EEPROM (two stages required).
 *
 * image       - the hex image file
 * context     - for use by poke()
 * is_external - if non-null, used to check which segments go into
 *               external memory (writable only by software loader)
 * poke        - called with each memory segment; errors indicated
 *               by returning negative values.
 *
 * Caller is responsible for halting CPU as needed, such as when
 * overwriting a second stage loader.
 */
static int parse_ihex(FILE *image, void *context,
	bool (*is_external)(uint32_t addr, size_t len),
	int (*poke) (void *context, uint32_t addr, bool external,
	const unsigned char *data, size_t len))
{
	unsigned char data[1023];
	uint32_t data_addr = 0;
	size_t data_len = 0;
	int rc;
	int first_line = 1;
	bool external = false;

	/* Read the input file as an IHEX file, and report the memory segments
	 * as we go.  Each line holds a max of 16 bytes, but uploading is
	 * faster (and EEPROM space smaller) if we merge those lines into larger
	 * chunks.  Most hex files keep memory segments together, which makes
	 * such merging all but free.  (But it may still be worth sorting the
	 * hex files to make up for undesirable behavior from tools.)
	 *
	 * Note that EEPROM segments max out at 1023 bytes; the upload protocol
	 * allows segments of up to 64 KBytes (more than a loader could handle).
	 */
	for (;;) {
		char buf[512], *cp;
		char tmp, type;
		size_t len;
		unsigned idx, off;

		cp = fgets(buf, sizeof(buf), image);
		if (cp == NULL) {
			logerror("EOF without EOF record!\n");
			break;
		}

		/* EXTENSION: "# comment-till-end-of-line", for copyrights etc */
		if (buf[0] == '#')
			continue;

		if (buf[0] != ':') {
			logerror("not an ihex record: %s", buf);
			return -2;
		}

		/* ignore any newline */
		cp = strchr(buf, '\n');
		if (cp)
			*cp = 0;

		if (verbose >= 3)
			logerror("** LINE: %s\n", buf);

		/* Read the length field (up to 16 bytes) */
		tmp = buf[3];
		buf[3] = 0;
		len = strtoul(buf+1, NULL, 16);
		buf[3] = tmp;

		/* Read the target offset (address up to 64KB) */
		tmp = buf[7];
		buf[7] = 0;
		off = (int)strtoul(buf+3, NULL, 16);
		buf[7] = tmp;

		/* Initialize data_addr */
		if (first_line) {
			data_addr = off;
			first_line = 0;
		}

		/* Read the record type */
		tmp = buf[9];
		buf[9] = 0;
		type = (char)strtoul(buf+7, NULL, 16);
		buf[9] = tmp;

		/* If this is an EOF record, then make it so. */
		if (type == 1) {
			if (verbose >= 2)
				logerror("EOF on hexfile\n");
			break;
		}

		if (type != 0) {
			logerror("unsupported record type: %u\n", type);
//.........这里部分代码省略.........
开发者ID:Printrbot,项目名称:FirmwareUpdatr,代码行数:101,代码来源:ezusb.c


注:本文中的poke函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。