Exemplo n.º 1
0
static void dump_cmd_op(unsigned int op, unsigned int *n, int silent) {
	char buf[16];
	char out[1000];
	const char *pre;
	const char *p = catcmd(op, buf);
	const unsigned int opk = opKIND(op);
	const unsigned int opa = argKIND(op);

	if (strcmp(p, "???") == 0)
		return;
	if (! isRARG(op)) {
		if (opk == KIND_CMON && isNULL(monfuncs[opa].mondcmplx))
			return;
		if (opk == KIND_CDYA && isNULL(dyfuncs[opa].dydcmplx))
			return;
		if (opk == KIND_MON && isNULL(monfuncs[opa].mondreal) && isNULL(monfuncs[opa].monint))
			return ;
		if (opk == KIND_DYA && isNULL(dyfuncs[opa].dydreal) && isNULL(dyfuncs[opa].dydint))
			return ;
	}
	++*n;
	if (silent)
		return;
	pre = "";
	if (opk == KIND_CMON || opk == KIND_CDYA)
		pre = "[cmplx]";
	else if (isRARG(op) && RARG_CMD(op) == RARG_CONST_CMPLX)
		pre = "[cmplx]# ";
	else if (isRARG(op) && RARG_CMD(op) == RARG_CONST)
		pre = "# ";
	else if (isRARG(op) && RARG_CMD(op) == RARG_ALPHA)
		pre = "Alpha ";
	prettify(p, out, 0);
	if (strncmp("[cmplx]", out, 7) == 0 && !(isRARG(op) && RARG_CMD(op) == RARG_ALPHA))
		pre = "";
	printf("%-5u  %04x   %s%s\n", *n, op, pre, out);
}
Exemplo n.º 2
0
	GTA::value::PedSkin^ Ped::Skin::get() {
		NON_EXISTING_CHECK(pSkin);
		if isNULL(pSkin) pSkin = gcnew GTA::value::PedSkin(this);
		return pSkin;
	}
Exemplo n.º 3
0
Arquivo: pretty.c Projeto: BigEd/wp34s
void dump_opcodes(FILE *f) {
	int c, d;
	char cmdname[16];
	char cmdpretty[500];
	const char *p;

	for (c=0; c<65536; c++) {
		if (isDBL(c)) {
			const unsigned int cmd = opDBL(c);
			if ((c & 0xff) != 0)
				continue;
			if (cmd >= num_multicmds)
				continue;
#ifdef INCLUDE_MULTI_DELETE
			if (cmd == DBL_DELPROG)
				continue;
#endif
			xset(cmdname, '\0', 16);
			xcopy(cmdname, multicmds[cmd].cmd, NAME_LEN);
			prettify(cmdname, cmdpretty);
			fprintf(f, "0x%04x\tmult\t%s\n", c, cmdpretty);
		} else if (isRARG(c)) {
			const unsigned int cmd = RARG_CMD(c);
			unsigned int limit;

			if (cmd >= NUM_RARG)
				continue;
#ifdef INCLUDE_MULTI_DELETE
			if (cmd == RARG_DELPROG)
				continue;
#endif
			limit = argcmds[cmd].lim;
			if (cmd != RARG_ALPHA && (c & RARG_IND) != 0)
				continue;
			p = catcmd(c, cmdname);
			if (strcmp(p, "???") == 0)
				continue;
			prettify(p, cmdpretty);
			if (cmd == RARG_ALPHA) {
				if ((c & 0xff) == 0)
					continue;
				if ((c & 0xff) == ' ')
					fprintf(f, "0x%04x\tcmd\t[alpha] [space]\n", c);
				else
					fprintf(f, "0x%04x\tcmd\t[alpha] %s\n", c, cmdpretty);
				continue;
			} else if (cmd == RARG_CONST || cmd == RARG_CONST_CMPLX) {
				fprintf(f, "0x%04x\tcmd\t%s# %s\n", c, cmd == RARG_CONST_CMPLX?"[cmplx]":"", cmdpretty);
				continue;
			} else if (cmd == RARG_CONV) {
				fprintf(f, "0x%04x\tcmd\t%s\n", c, cmdpretty);
				continue;
			} else if (cmd == RARG_CONST_INT) {
				p = prt(c, cmdname);
				if (strcmp(p, "???") != 0)
					fprintf(f, "0x%04x\tcmd\t%s\n", c, p);
				if ((c & 0xff) != 0)
					continue;
				limit = 0;
			}
			if ((c & 0xff) != 0)
				continue;
			fprintf(f, "0x%04x\targ\t%s\tmax=%u", c, cmdpretty, limit);
			if (argcmds[cmd].indirectokay)
				fprintf(f, ",indirect");
			if (argcmds[cmd].stos)
				fprintf(f, ",stostack");
			else if (argcmds[cmd].stckreg)
				fprintf(f, ",stack");
			if (argcmds[cmd].cmplx)
				fprintf(f, ",complex");
			fprintf(f, "\n");
		} else {
			p = catcmd(c, cmdname);
			if (strcmp(p, "???") == 0)
				continue;
			prettify(p, cmdpretty);
			d = argKIND(c);
			switch (opKIND(c)) {
			default:
				break;

			case KIND_MON:
				if (d < num_monfuncs && (! isNULL(monfuncs[d].mondreal) || ! isNULL(monfuncs[d].monint)))
					break;
				continue;

			case KIND_DYA:
				if (d < num_dyfuncs && (! isNULL(dyfuncs[d].dydreal) || ! isNULL(dyfuncs[d].dydint)))
					break;
				continue;

			case KIND_CMON:
				if (d < num_monfuncs && ! isNULL(monfuncs[d].mondcmplx)) {
					if (cmdname[0] == COMPLEX_PREFIX)
						break;
					fprintf(f, "0x%04x\tcmd\t[cmplx]%s\n", c, cmdpretty);
				}
				continue;

			case KIND_CDYA:
				if (d < num_dyfuncs && ! isNULL(dyfuncs[d].dydcmplx)) {
					if (cmdname[0] == COMPLEX_PREFIX)
						break;
					fprintf(f, "0x%04x\tcmd\t[cmplx]%s\n", c, cmdpretty);
				}
				continue;

			case KIND_NIL:
				d = c & 0xff;
				if (d == OP_CLALL || d == OP_RESET) {
					continue;
				}
			}
			fprintf(f, "0x%04x\tcmd\t%s\n", c, cmdpretty);
		}
	}
}