hexsha
stringlengths 40
40
| repo
stringlengths 5
105
| path
stringlengths 3
173
| license
sequence | language
stringclasses 1
value | identifier
stringlengths 1
438
| return_type
stringlengths 1
106
⌀ | original_string
stringlengths 21
40.7k
| original_docstring
stringlengths 18
13.4k
| docstring
stringlengths 11
3.24k
| docstring_tokens
sequence | code
stringlengths 14
20.4k
| code_tokens
sequence | short_docstring
stringlengths 0
4.36k
| short_docstring_tokens
sequence | comment
sequence | parameters
list | docstring_params
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_xor_r32_p32 | void | static void emit_xor_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else if (inst->flags == 0 && (UINT32)param->value == 0xffffffff)
emit_not_r32(dst, reg); // not reg
else
emit_xor_r32_imm(dst, reg, param->value); // xor reg,param
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_xor_r32_m32(dst, reg, MABS(drcbe, param->value)); // xor reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_xor_r32_r32(dst, reg, param->value); // xor reg,param
} | /*-------------------------------------------------
emit_xor_r32_p32 - xor operation to a 32-bit
register from a 32-bit parameter
-------------------------------------------------*/ | xor operation to a 32-bit
register from a 32-bit parameter | [
"xor",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_xor_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else if (inst->flags == 0 && (UINT32)param->value == 0xffffffff)
emit_not_r32(dst, reg);
else
emit_xor_r32_imm(dst, reg, param->value);
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_xor_r32_m32(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_xor_r32_r32(dst, reg, param->value);
} | [
"static",
"void",
"emit_xor_r32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0xffffffff",
")",
"emit_not_r32",
"(",
"dst",
",",
"reg",
")",
";",
"else",
"emit_xor_r32_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_xor_r32_m32",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_xor_r32_r32",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_xor_r32_p32 - xor operation to a 32-bit
register from a 32-bit parameter | [
"emit_xor_r32_p32",
"-",
"xor",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// not reg\r",
"// xor reg,param\r",
"// xor reg,[param]\r",
"// xor reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_xor_m32_p32 | void | static void emit_xor_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else if (inst->flags == 0 && (UINT32)param->value == 0xffffffff)
emit_not_m32(dst, MEMPARAMS); // not [dest]
else
emit_xor_m32_imm(dst, MEMPARAMS, param->value); // xor [dest],param
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r32_p32(drcbe, dst, reg, param); // mov reg,param
emit_xor_m32_r32(dst, MEMPARAMS, reg); // xor [dest],reg
}
} | /*-------------------------------------------------
emit_xor_m32_p32 - xor operation to a 32-bit
memory location from a 32-bit parameter
-------------------------------------------------*/ | xor operation to a 32-bit
memory location from a 32-bit parameter | [
"xor",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_xor_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else if (inst->flags == 0 && (UINT32)param->value == 0xffffffff)
emit_not_m32(dst, MEMPARAMS);
else
emit_xor_m32_imm(dst, MEMPARAMS, param->value);
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r32_p32(drcbe, dst, reg, param);
emit_xor_m32_r32(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_xor_m32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0xffffffff",
")",
"emit_not_m32",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"else",
"emit_xor_m32_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_xor_m32_r32",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_xor_m32_p32 - xor operation to a 32-bit
memory location from a 32-bit parameter | [
"emit_xor_m32_p32",
"-",
"xor",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// not [dest]\r",
"// xor [dest],param\r",
"// mov reg,param\r",
"// xor [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_shl_r32_p32 | void | static void emit_shl_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_shl_r32_imm(dst, reg, param->value); // shl reg,param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_shl_r32_cl(dst, reg); // shl reg,cl
}
} | /*-------------------------------------------------
emit_shl_r32_p32 - shl operation to a 32-bit
register from a 32-bit parameter
-------------------------------------------------*/ | shl operation to a 32-bit
register from a 32-bit parameter | [
"shl",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_shl_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_shl_r32_imm(dst, reg, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_shl_r32_cl(dst, reg);
}
} | [
"static",
"void",
"emit_shl_r32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_shl_r32_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_shl_r32_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_shl_r32_p32 - shl operation to a 32-bit
register from a 32-bit parameter | [
"emit_shl_r32_p32",
"-",
"shl",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// shl reg,param\r",
"// mov ecx,param\r",
"// shl reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_shl_m32_p32 | void | static void emit_shl_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_shl_m32_imm(dst, MEMPARAMS, param->value); // shl [dest],param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_shl_m32_cl(dst, MEMPARAMS); // shl [dest],cl
}
} | /*-------------------------------------------------
emit_shl_m32_p32 - shl operation to a 32-bit
memory location from a 32-bit parameter
-------------------------------------------------*/ | shl operation to a 32-bit
memory location from a 32-bit parameter | [
"shl",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_shl_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_shl_m32_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_shl_m32_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_shl_m32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_shl_m32_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_shl_m32_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_shl_m32_p32 - shl operation to a 32-bit
memory location from a 32-bit parameter | [
"emit_shl_m32_p32",
"-",
"shl",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// shl [dest],param\r",
"// mov ecx,param\r",
"// shl [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_shr_r32_p32 | void | static void emit_shr_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_shr_r32_imm(dst, reg, param->value); // shr reg,param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_shr_r32_cl(dst, reg); // shr reg,cl
}
} | /*-------------------------------------------------
emit_shr_r32_p32 - shr operation to a 32-bit
register from a 32-bit parameter
-------------------------------------------------*/ | shr operation to a 32-bit
register from a 32-bit parameter | [
"shr",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_shr_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_shr_r32_imm(dst, reg, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_shr_r32_cl(dst, reg);
}
} | [
"static",
"void",
"emit_shr_r32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_shr_r32_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_shr_r32_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_shr_r32_p32 - shr operation to a 32-bit
register from a 32-bit parameter | [
"emit_shr_r32_p32",
"-",
"shr",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// shr reg,param\r",
"// mov ecx,param\r",
"// shr reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_shr_m32_p32 | void | static void emit_shr_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_shr_m32_imm(dst, MEMPARAMS, param->value); // shr [dest],param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_shr_m32_cl(dst, MEMPARAMS); // shr [dest],cl
}
} | /*-------------------------------------------------
emit_shr_m32_p32 - shr operation to a 32-bit
memory location from a 32-bit parameter
-------------------------------------------------*/ | shr operation to a 32-bit
memory location from a 32-bit parameter | [
"shr",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_shr_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_shr_m32_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_shr_m32_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_shr_m32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_shr_m32_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_shr_m32_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_shr_m32_p32 - shr operation to a 32-bit
memory location from a 32-bit parameter | [
"emit_shr_m32_p32",
"-",
"shr",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// shr [dest],param\r",
"// mov ecx,param\r",
"// shr [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_sar_r32_p32 | void | static void emit_sar_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_sar_r32_imm(dst, reg, param->value); // sar reg,param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_sar_r32_cl(dst, reg); // sar reg,cl
}
} | /*-------------------------------------------------
emit_sar_r32_p32 - sar operation to a 32-bit
register from a 32-bit parameter
-------------------------------------------------*/ | sar operation to a 32-bit
register from a 32-bit parameter | [
"sar",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_sar_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_sar_r32_imm(dst, reg, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_sar_r32_cl(dst, reg);
}
} | [
"static",
"void",
"emit_sar_r32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_sar_r32_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_sar_r32_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_sar_r32_p32 - sar operation to a 32-bit
register from a 32-bit parameter | [
"emit_sar_r32_p32",
"-",
"sar",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// sar reg,param\r",
"// mov ecx,param\r",
"// sar reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_sar_m32_p32 | void | static void emit_sar_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_sar_m32_imm(dst, MEMPARAMS, param->value); // sar [dest],param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_sar_m32_cl(dst, MEMPARAMS); // sar [dest],cl
}
} | /*-------------------------------------------------
emit_sar_m32_p32 - sar operation to a 32-bit
memory location from a 32-bit parameter
-------------------------------------------------*/ | sar operation to a 32-bit
memory location from a 32-bit parameter | [
"sar",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_sar_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_sar_m32_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_sar_m32_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_sar_m32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_sar_m32_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_sar_m32_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_sar_m32_p32 - sar operation to a 32-bit
memory location from a 32-bit parameter | [
"emit_sar_m32_p32",
"-",
"sar",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// sar [dest],param\r",
"// mov ecx,param\r",
"// sar [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rol_r32_p32 | void | static void emit_rol_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rol_r32_imm(dst, reg, param->value); // rol reg,param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_rol_r32_cl(dst, reg); // rol reg,cl
}
} | /*-------------------------------------------------
emit_rol_r32_p32 - rol operation to a 32-bit
register from a 32-bit parameter
-------------------------------------------------*/ | rol operation to a 32-bit
register from a 32-bit parameter | [
"rol",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_rol_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rol_r32_imm(dst, reg, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_rol_r32_cl(dst, reg);
}
} | [
"static",
"void",
"emit_rol_r32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rol_r32_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_rol_r32_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_rol_r32_p32 - rol operation to a 32-bit
register from a 32-bit parameter | [
"emit_rol_r32_p32",
"-",
"rol",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rol reg,param\r",
"// mov ecx,param\r",
"// rol reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rol_m32_p32 | void | static void emit_rol_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rol_m32_imm(dst, MEMPARAMS, param->value); // rol [dest],param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_rol_m32_cl(dst, MEMPARAMS); // rol [dest],cl
}
} | /*-------------------------------------------------
emit_rol_m32_p32 - rol operation to a 32-bit
memory location from a 32-bit parameter
-------------------------------------------------*/ | rol operation to a 32-bit
memory location from a 32-bit parameter | [
"rol",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_rol_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rol_m32_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_rol_m32_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_rol_m32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rol_m32_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_rol_m32_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_rol_m32_p32 - rol operation to a 32-bit
memory location from a 32-bit parameter | [
"emit_rol_m32_p32",
"-",
"rol",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rol [dest],param\r",
"// mov ecx,param\r",
"// rol [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_ror_r32_p32 | void | static void emit_ror_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_ror_r32_imm(dst, reg, param->value); // ror reg,param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_ror_r32_cl(dst, reg); // ror reg,cl
}
} | /*-------------------------------------------------
emit_ror_r32_p32 - ror operation to a 32-bit
register from a 32-bit parameter
-------------------------------------------------*/ | ror operation to a 32-bit
register from a 32-bit parameter | [
"ror",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_ror_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_ror_r32_imm(dst, reg, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_ror_r32_cl(dst, reg);
}
} | [
"static",
"void",
"emit_ror_r32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_ror_r32_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_ror_r32_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_ror_r32_p32 - ror operation to a 32-bit
register from a 32-bit parameter | [
"emit_ror_r32_p32",
"-",
"ror",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// ror reg,param\r",
"// mov ecx,param\r",
"// ror reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_ror_m32_p32 | void | static void emit_ror_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_ror_m32_imm(dst, MEMPARAMS, param->value); // ror [dest],param
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_ror_m32_cl(dst, MEMPARAMS); // ror [dest],cl
}
} | /*-------------------------------------------------
emit_ror_m32_p32 - ror operation to a 32-bit
memory location from a 32-bit parameter
-------------------------------------------------*/ | ror operation to a 32-bit
memory location from a 32-bit parameter | [
"ror",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_ror_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_ror_m32_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r32_p32(drcbe, dst, REG_ECX, param);
emit_ror_m32_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_ror_m32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_ror_m32_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_ror_m32_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_ror_m32_p32 - ror operation to a 32-bit
memory location from a 32-bit parameter | [
"emit_ror_m32_p32",
"-",
"ror",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// ror [dest],param\r",
"// mov ecx,param\r",
"// ror [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rcl_r32_p32 | void | static void emit_rcl_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rcl_r32_imm(dst, reg, param->value); // rcl reg,param
}
else
{
emit_mov_r32_p32_keepflags(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_rcl_r32_cl(dst, reg); // rcl reg,cl
}
} | /*-------------------------------------------------
emit_rcl_r32_p32 - rcl operation to a 32-bit
register from a 32-bit parameter
-------------------------------------------------*/ | rcl operation to a 32-bit
register from a 32-bit parameter | [
"rcl",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_rcl_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rcl_r32_imm(dst, reg, param->value);
}
else
{
emit_mov_r32_p32_keepflags(drcbe, dst, REG_ECX, param);
emit_rcl_r32_cl(dst, reg);
}
} | [
"static",
"void",
"emit_rcl_r32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rcl_r32_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_rcl_r32_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_rcl_r32_p32 - rcl operation to a 32-bit
register from a 32-bit parameter | [
"emit_rcl_r32_p32",
"-",
"rcl",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rcl reg,param\r",
"// mov ecx,param\r",
"// rcl reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rcl_m32_p32 | void | static void emit_rcl_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rcl_m32_imm(dst, MEMPARAMS, param->value); // rcl [dest],param
}
else
{
emit_mov_r32_p32_keepflags(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_rcl_m32_cl(dst, MEMPARAMS); // rcl [dest],cl
}
} | /*-------------------------------------------------
emit_rcl_m32_p32 - rcl operation to a 32-bit
memory location from a 32-bit parameter
-------------------------------------------------*/ | rcl operation to a 32-bit
memory location from a 32-bit parameter | [
"rcl",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_rcl_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rcl_m32_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r32_p32_keepflags(drcbe, dst, REG_ECX, param);
emit_rcl_m32_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_rcl_m32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rcl_m32_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_rcl_m32_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_rcl_m32_p32 - rcl operation to a 32-bit
memory location from a 32-bit parameter | [
"emit_rcl_m32_p32",
"-",
"rcl",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rcl [dest],param\r",
"// mov ecx,param\r",
"// rcl [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rcr_r32_p32 | void | static void emit_rcr_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rcr_r32_imm(dst, reg, param->value); // rcr reg,param
}
else
{
emit_mov_r32_p32_keepflags(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_rcr_r32_cl(dst, reg); // rcr reg,cl
}
} | /*-------------------------------------------------
emit_rcr_r32_p32 - rcr operation to a 32-bit
register from a 32-bit parameter
-------------------------------------------------*/ | rcr operation to a 32-bit
register from a 32-bit parameter | [
"rcr",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_rcr_r32_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rcr_r32_imm(dst, reg, param->value);
}
else
{
emit_mov_r32_p32_keepflags(drcbe, dst, REG_ECX, param);
emit_rcr_r32_cl(dst, reg);
}
} | [
"static",
"void",
"emit_rcr_r32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rcr_r32_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_rcr_r32_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_rcr_r32_p32 - rcr operation to a 32-bit
register from a 32-bit parameter | [
"emit_rcr_r32_p32",
"-",
"rcr",
"operation",
"to",
"a",
"32",
"-",
"bit",
"register",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rcr reg,param\r",
"// mov ecx,param\r",
"// rcr reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rcr_m32_p32 | void | static void emit_rcr_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rcr_m32_imm(dst, MEMPARAMS, param->value); // rcr [dest],param
}
else
{
emit_mov_r32_p32_keepflags(drcbe, dst, REG_ECX, param); // mov ecx,param
emit_rcr_m32_cl(dst, MEMPARAMS); // rcr [dest],cl
}
} | /*-------------------------------------------------
emit_rcr_m32_p32 - rcr operation to a 32-bit
memory location from a 32-bit parameter
-------------------------------------------------*/ | rcr operation to a 32-bit
memory location from a 32-bit parameter | [
"rcr",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_rcr_m32_p32(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rcr_m32_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r32_p32_keepflags(drcbe, dst, REG_ECX, param);
emit_rcr_m32_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_rcr_m32_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rcr_m32_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r32_p32_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"REG_ECX",
",",
"param",
")",
";",
"emit_rcr_m32_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_rcr_m32_p32 - rcr operation to a 32-bit
memory location from a 32-bit parameter | [
"emit_rcr_m32_p32",
"-",
"rcr",
"operation",
"to",
"a",
"32",
"-",
"bit",
"memory",
"location",
"from",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rcr [dest],param\r",
"// mov ecx,param\r",
"// rcr [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_mov_r64_p64 | void | static void emit_mov_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (param->value == 0)
emit_xor_r32_r32(dst, reg, reg); // xor reg,reg
else
emit_mov_r64_imm(dst, reg, param->value); // mov reg,param
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_mov_r64_m64(dst, reg, MABS(drcbe, param->value)); // mov reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_mov_r64_r64(dst, reg, param->value); // mov reg,param
}
} | /*-------------------------------------------------
emit_mov_r64_p64 - move a 64-bit parameter
into a register
-------------------------------------------------*/ | move a 64-bit parameter
into a register | [
"move",
"a",
"64",
"-",
"bit",
"parameter",
"into",
"a",
"register"
] | static void emit_mov_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (param->value == 0)
emit_xor_r32_r32(dst, reg, reg);
else
emit_mov_r64_imm(dst, reg, param->value);
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_mov_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_mov_r64_r64(dst, reg, param->value);
}
} | [
"static",
"void",
"emit_mov_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"param",
"->",
"value",
"==",
"0",
")",
"emit_xor_r32_r32",
"(",
"dst",
",",
"reg",
",",
"reg",
")",
";",
"else",
"emit_mov_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_mov_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"{",
"if",
"(",
"reg",
"!=",
"param",
"->",
"value",
")",
"emit_mov_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"}"
] | emit_mov_r64_p64 - move a 64-bit parameter
into a register | [
"emit_mov_r64_p64",
"-",
"move",
"a",
"64",
"-",
"bit",
"parameter",
"into",
"a",
"register"
] | [
"// xor reg,reg\r",
"// mov reg,param\r",
"// mov reg,[param]\r",
"// mov reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_mov_r64_p64_keepflags | void | static void emit_mov_r64_p64_keepflags(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
emit_mov_r64_imm(dst, reg, param->value); // mov reg,param
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_mov_r64_m64(dst, reg, MABS(drcbe, param->value)); // mov reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_mov_r64_r64(dst, reg, param->value); // mov reg,param
}
} | /*-------------------------------------------------
emit_mov_r64_p64_keepflags - move a 64-bit
parameter into a register without affecting
any flags
-------------------------------------------------*/ | move a 64-bit
parameter into a register without affecting
any flags | [
"move",
"a",
"64",
"-",
"bit",
"parameter",
"into",
"a",
"register",
"without",
"affecting",
"any",
"flags"
] | static void emit_mov_r64_p64_keepflags(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
emit_mov_r64_imm(dst, reg, param->value);
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_mov_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_mov_r64_r64(dst, reg, param->value);
}
} | [
"static",
"void",
"emit_mov_r64_p64_keepflags",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"emit_mov_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_mov_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"{",
"if",
"(",
"reg",
"!=",
"param",
"->",
"value",
")",
"emit_mov_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"}"
] | emit_mov_r64_p64_keepflags - move a 64-bit
parameter into a register without affecting
any flags | [
"emit_mov_r64_p64_keepflags",
"-",
"move",
"a",
"64",
"-",
"bit",
"parameter",
"into",
"a",
"register",
"without",
"affecting",
"any",
"flags"
] | [
"// mov reg,param\r",
"// mov reg,[param]\r",
"// mov reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_mov_p64_r64 | void | static void emit_mov_p64_r64(drcbe_state *drcbe, x86code **dst, const drcuml_parameter *param, UINT8 reg)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_mov_m64_r64(dst, MABS(drcbe, param->value), reg); // mov [param],reg
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_mov_r64_r64(dst, param->value, reg); // mov param,reg
}
} | /*-------------------------------------------------
emit_mov_p64_r64 - move a registers into a
64-bit parameter
-------------------------------------------------*/ | move a registers into a
64-bit parameter | [
"move",
"a",
"registers",
"into",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_mov_p64_r64(drcbe_state *drcbe, x86code **dst, const drcuml_parameter *param, UINT8 reg)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_mov_m64_r64(dst, MABS(drcbe, param->value), reg);
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_mov_r64_r64(dst, param->value, reg);
}
} | [
"static",
"void",
"emit_mov_p64_r64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"UINT8",
"reg",
")",
"{",
"assert",
"(",
"param",
"->",
"type",
"!=",
"DRCUML_PTYPE_IMMEDIATE",
")",
";",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_mov_m64_r64",
"(",
"dst",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
",",
"reg",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"{",
"if",
"(",
"reg",
"!=",
"param",
"->",
"value",
")",
"emit_mov_r64_r64",
"(",
"dst",
",",
"param",
"->",
"value",
",",
"reg",
")",
";",
"}",
"}"
] | emit_mov_p64_r64 - move a registers into a
64-bit parameter | [
"emit_mov_p64_r64",
"-",
"move",
"a",
"registers",
"into",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// mov [param],reg\r",
"// mov param,reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "reg",
"type": "UINT8"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_add_r64_p64 | void | static void emit_add_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_add_r64_imm(dst, reg, param->value); // add reg,param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_add_r64_r64(dst, reg, REG_R11); // add reg,r11
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_add_r64_m64(dst, reg, MABS(drcbe, param->value)); // add reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_add_r64_r64(dst, reg, param->value); // add reg,param
} | /*-------------------------------------------------
emit_add_r64_p64 - add operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | add operation to a 64-bit
register from a 64-bit parameter | [
"add",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_add_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_add_r64_imm(dst, reg, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_add_r64_r64(dst, reg, REG_R11);
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_add_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_add_r64_r64(dst, reg, param->value);
} | [
"static",
"void",
"emit_add_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"0",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_add_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_add_r64_r64",
"(",
"dst",
",",
"reg",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_add_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_add_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_add_r64_p64 - add operation to a 64-bit
register from a 64-bit parameter | [
"emit_add_r64_p64",
"-",
"add",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// add reg,param\r",
"// mov r11,param\r",
"// add reg,r11\r",
"// add reg,[param]\r",
"// add reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_add_m64_p64 | void | static void emit_add_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_add_m64_imm(dst, MEMPARAMS, param->value); // add [mem],param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_add_m64_r64(dst, MEMPARAMS, REG_R11); // add [mem],r11
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param); // mov reg,param
emit_add_m64_r64(dst, MEMPARAMS, reg); // add [dest],reg
}
} | /*-------------------------------------------------
emit_add_m64_p64 - add operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | add operation to a 64-bit
memory location from a 64-bit parameter | [
"add",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_add_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_add_m64_imm(dst, MEMPARAMS, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_add_m64_r64(dst, MEMPARAMS, REG_R11);
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param);
emit_add_m64_r64(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_add_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"0",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_add_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_add_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_add_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_add_m64_p64 - add operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_add_m64_p64",
"-",
"add",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// add [mem],param\r",
"// mov r11,param\r",
"// add [mem],r11\r",
"// mov reg,param\r",
"// add [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_adc_r64_p64 | void | static void emit_adc_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (short_immediate(param->value))
emit_adc_r64_imm(dst, reg, param->value); // adc reg,param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_adc_r64_r64(dst, reg, REG_R11); // adc reg,r11
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_adc_r64_m64(dst, reg, MABS(drcbe, param->value)); // adc reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_adc_r64_r64(dst, reg, param->value); // adc reg,param
} | /*-------------------------------------------------
emit_adc_r64_p64 - adc operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | adc operation to a 64-bit
register from a 64-bit parameter | [
"adc",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_adc_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (short_immediate(param->value))
emit_adc_r64_imm(dst, reg, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_adc_r64_r64(dst, reg, REG_R11);
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_adc_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_adc_r64_r64(dst, reg, param->value);
} | [
"static",
"void",
"emit_adc_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_adc_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_adc_r64_r64",
"(",
"dst",
",",
"reg",
",",
"REG_R11",
")",
";",
"}",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_adc_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_adc_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_adc_r64_p64 - adc operation to a 64-bit
register from a 64-bit parameter | [
"emit_adc_r64_p64",
"-",
"adc",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// adc reg,param\r",
"// mov r11,param\r",
"// adc reg,r11\r",
"// adc reg,[param]\r",
"// adc reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_adc_m64_p64 | void | static void emit_adc_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE && short_immediate(param->value))
emit_adc_m64_imm(dst, MEMPARAMS, param->value); // adc [mem],param
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64_keepflags(drcbe, dst, reg, param); // mov reg,param
emit_adc_m64_r64(dst, MEMPARAMS, reg); // adc [dest],reg
}
} | /*-------------------------------------------------
emit_adc_m64_p64 - adc operation to a 64-bit
memory locaiton from a 64-bit parameter
-------------------------------------------------*/ | adc operation to a 64-bit
memory locaiton from a 64-bit parameter | [
"adc",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"locaiton",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_adc_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE && short_immediate(param->value))
emit_adc_m64_imm(dst, MEMPARAMS, param->value);
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64_keepflags(drcbe, dst, reg, param);
emit_adc_m64_r64(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_adc_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
"&&",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_adc_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r64_p64_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_adc_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_adc_m64_p64 - adc operation to a 64-bit
memory locaiton from a 64-bit parameter | [
"emit_adc_m64_p64",
"-",
"adc",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"locaiton",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// adc [mem],param\r",
"// mov reg,param\r",
"// adc [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_sub_r64_p64 | void | static void emit_sub_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_sub_r64_imm(dst, reg, param->value); // sub reg,param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_sub_r64_r64(dst, reg, REG_R11); // sub reg,r11
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_sub_r64_m64(dst, reg, MABS(drcbe, param->value)); // sub reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_sub_r64_r64(dst, reg, param->value); // sub reg,param
} | /*-------------------------------------------------
emit_sub_r64_p64 - sub operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | sub operation to a 64-bit
register from a 64-bit parameter | [
"sub",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_sub_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_sub_r64_imm(dst, reg, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_sub_r64_r64(dst, reg, REG_R11);
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_sub_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_sub_r64_r64(dst, reg, param->value);
} | [
"static",
"void",
"emit_sub_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"0",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_sub_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_sub_r64_r64",
"(",
"dst",
",",
"reg",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_sub_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_sub_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_sub_r64_p64 - sub operation to a 64-bit
register from a 64-bit parameter | [
"emit_sub_r64_p64",
"-",
"sub",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// sub reg,param\r",
"// mov r11,param\r",
"// sub reg,r11\r",
"// sub reg,[param]\r",
"// sub reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_sub_m64_p64 | void | static void emit_sub_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_sub_m64_imm(dst, MEMPARAMS, param->value); // sub [mem],param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_sub_m64_r64(dst, MEMPARAMS, REG_R11); // sub [mem],r11
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param); // mov reg,param
emit_sub_m64_r64(dst, MEMPARAMS, reg); // sub [dest],reg
}
} | /*-------------------------------------------------
emit_sub_m64_p64 - sub operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | sub operation to a 64-bit
memory location from a 64-bit parameter | [
"sub",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_sub_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_sub_m64_imm(dst, MEMPARAMS, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_sub_m64_r64(dst, MEMPARAMS, REG_R11);
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param);
emit_sub_m64_r64(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_sub_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"0",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_sub_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_sub_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_sub_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_sub_m64_p64 - sub operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_sub_m64_p64",
"-",
"sub",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// sub [mem],param\r",
"// mov r11,param\r",
"// sub [mem],r11\r",
"// mov reg,param\r",
"// sub [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_sbb_r64_p64 | void | static void emit_sbb_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (short_immediate(param->value))
emit_sbb_r64_imm(dst, reg, param->value); // sbb reg,param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_sbb_r64_r64(dst, reg, REG_R11); // sbb reg,r11
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_sbb_r64_m64(dst, reg, MABS(drcbe, param->value)); // sbb reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_sbb_r64_r64(dst, reg, param->value); // sbb reg,param
} | /*-------------------------------------------------
emit_sbb_r64_p64 - sbb operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | sbb operation to a 64-bit
register from a 64-bit parameter | [
"sbb",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_sbb_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (short_immediate(param->value))
emit_sbb_r64_imm(dst, reg, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_sbb_r64_r64(dst, reg, REG_R11);
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_sbb_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_sbb_r64_r64(dst, reg, param->value);
} | [
"static",
"void",
"emit_sbb_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_sbb_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_sbb_r64_r64",
"(",
"dst",
",",
"reg",
",",
"REG_R11",
")",
";",
"}",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_sbb_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_sbb_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_sbb_r64_p64 - sbb operation to a 64-bit
register from a 64-bit parameter | [
"emit_sbb_r64_p64",
"-",
"sbb",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// sbb reg,param\r",
"// mov r11,param\r",
"// sbb reg,r11\r",
"// sbb reg,[param]\r",
"// sbb reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_sbb_m64_p64 | void | static void emit_sbb_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE && short_immediate(param->value))
emit_sbb_m64_imm(dst, MEMPARAMS, param->value); // sbb [mem],param
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64_keepflags(drcbe, dst, reg, param); // mov reg,param
emit_sbb_m64_r64(dst, MEMPARAMS, reg); // sbb [dest],reg
}
} | /*-------------------------------------------------
emit_sbb_m64_p64 - sbb operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | sbb operation to a 64-bit
memory location from a 64-bit parameter | [
"sbb",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_sbb_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE && short_immediate(param->value))
emit_sbb_m64_imm(dst, MEMPARAMS, param->value);
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64_keepflags(drcbe, dst, reg, param);
emit_sbb_m64_r64(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_sbb_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
"&&",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_sbb_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r64_p64_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_sbb_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_sbb_m64_p64 - sbb operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_sbb_m64_p64",
"-",
"sbb",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// sbb [mem],param\r",
"// mov reg,param\r",
"// sbb [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_cmp_r64_p64 | void | static void emit_cmp_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (short_immediate(param->value))
emit_cmp_r64_imm(dst, reg, param->value); // cmp reg,param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_cmp_r64_r64(dst, reg, REG_R11); // cmp reg,r11
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_cmp_r64_m64(dst, reg, MABS(drcbe, param->value)); // cmp reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_cmp_r64_r64(dst, reg, param->value); // cmp reg,param
} | /*-------------------------------------------------
emit_cmp_r64_p64 - cmp operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | cmp operation to a 64-bit
register from a 64-bit parameter | [
"cmp",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_cmp_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (short_immediate(param->value))
emit_cmp_r64_imm(dst, reg, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_cmp_r64_r64(dst, reg, REG_R11);
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_cmp_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_cmp_r64_r64(dst, reg, param->value);
} | [
"static",
"void",
"emit_cmp_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_cmp_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_cmp_r64_r64",
"(",
"dst",
",",
"reg",
",",
"REG_R11",
")",
";",
"}",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_cmp_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_cmp_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_cmp_r64_p64 - cmp operation to a 64-bit
register from a 64-bit parameter | [
"emit_cmp_r64_p64",
"-",
"cmp",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// cmp reg,param\r",
"// mov r11,param\r",
"// cmp reg,r11\r",
"// cmp reg,[param]\r",
"// cmp reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_cmp_m64_p64 | void | static void emit_cmp_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE && short_immediate(param->value))
emit_cmp_m64_imm(dst, MEMPARAMS, param->value); // cmp [dest],param
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param); // mov reg,param
emit_cmp_m64_r64(dst, MEMPARAMS, reg); // cmp [dest],reg
}
} | /*-------------------------------------------------
emit_cmp_m64_p64 - cmp operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | cmp operation to a 64-bit
memory location from a 64-bit parameter | [
"cmp",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_cmp_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE && short_immediate(param->value))
emit_cmp_m64_imm(dst, MEMPARAMS, param->value);
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param);
emit_cmp_m64_r64(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_cmp_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
"&&",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_cmp_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_cmp_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_cmp_m64_p64 - cmp operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_cmp_m64_p64",
"-",
"cmp",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// cmp [dest],param\r",
"// mov reg,param\r",
"// cmp [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_and_r64_p64 | void | static void emit_and_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != U64(0xffffffffffffffff))
{
if (short_immediate(param->value))
emit_and_r64_imm(dst, reg, param->value); // and reg,param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_and_r64_r64(dst, reg, REG_R11); // and reg,r11
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_and_r64_m64(dst, reg, MABS(drcbe, param->value)); // and reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_and_r64_r64(dst, reg, param->value); // and reg,param
} | /*-------------------------------------------------
emit_and_r64_p64 - and operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | and operation to a 64-bit
register from a 64-bit parameter | [
"and",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_and_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != U64(0xffffffffffffffff))
{
if (short_immediate(param->value))
emit_and_r64_imm(dst, reg, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_and_r64_r64(dst, reg, REG_R11);
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_and_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_and_r64_r64(dst, reg, param->value);
} | [
"static",
"void",
"emit_and_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"U64",
"(",
"0xffffffffffffffff",
")",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_and_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_and_r64_r64",
"(",
"dst",
",",
"reg",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_and_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_and_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_and_r64_p64 - and operation to a 64-bit
register from a 64-bit parameter | [
"emit_and_r64_p64",
"-",
"and",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// and reg,param\r",
"// mov r11,param\r",
"// and reg,r11\r",
"// and reg,[param]\r",
"// and reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_and_m64_p64 | void | static void emit_and_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != U64(0xffffffffffffffff))
{
if (short_immediate(param->value))
emit_and_m64_imm(dst, MEMPARAMS, param->value); // and [mem],param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_and_m64_r64(dst, MEMPARAMS, REG_R11); // and [mem],r11
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param); // mov reg,param
emit_and_m64_r64(dst, MEMPARAMS, reg); // and [dest],reg
}
} | /*-------------------------------------------------
emit_and_m64_p64 - and operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | and operation to a 64-bit
memory location from a 64-bit parameter | [
"and",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_and_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != U64(0xffffffffffffffff))
{
if (short_immediate(param->value))
emit_and_m64_imm(dst, MEMPARAMS, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_and_m64_r64(dst, MEMPARAMS, REG_R11);
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param);
emit_and_m64_r64(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_and_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"U64",
"(",
"0xffffffffffffffff",
")",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_and_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_and_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_and_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_and_m64_p64 - and operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_and_m64_p64",
"-",
"and",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// and [mem],param\r",
"// mov r11,param\r",
"// and [mem],r11\r",
"// mov reg,param\r",
"// and [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_or_r64_p64 | void | static void emit_or_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_or_r64_imm(dst, reg, param->value); // or reg,param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_or_r64_r64(dst, reg, REG_R11); // or reg,r11
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_or_r64_m64(dst, reg, MABS(drcbe, param->value)); // or reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_or_r64_r64(dst, reg, param->value); // or reg,param
} | /*-------------------------------------------------
emit_or_r64_p64 - or operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | or operation to a 64-bit
register from a 64-bit parameter | [
"or",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_or_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_or_r64_imm(dst, reg, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_or_r64_r64(dst, reg, REG_R11);
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_or_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_or_r64_r64(dst, reg, param->value);
} | [
"static",
"void",
"emit_or_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"0",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_or_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_or_r64_r64",
"(",
"dst",
",",
"reg",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_or_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_or_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_or_r64_p64 - or operation to a 64-bit
register from a 64-bit parameter | [
"emit_or_r64_p64",
"-",
"or",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// or reg,param\r",
"// mov r11,param\r",
"// or reg,r11\r",
"// or reg,[param]\r",
"// or reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_or_m64_p64 | void | static void emit_or_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_or_m64_imm(dst, MEMPARAMS, param->value); // or [mem],param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_or_m64_r64(dst, MEMPARAMS, REG_R11); // or [mem],r11
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param); // mov reg,param
emit_or_m64_r64(dst, MEMPARAMS, reg); // or [dest],reg
}
} | /*-------------------------------------------------
emit_or_m64_p64 - or operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | or operation to a 64-bit
memory location from a 64-bit parameter | [
"or",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_or_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (short_immediate(param->value))
emit_or_m64_imm(dst, MEMPARAMS, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_or_m64_r64(dst, MEMPARAMS, REG_R11);
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param);
emit_or_m64_r64(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_or_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"0",
")",
"{",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_or_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_or_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_or_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_or_m64_p64 - or operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_or_m64_p64",
"-",
"or",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// or [mem],param\r",
"// mov r11,param\r",
"// or [mem],r11\r",
"// mov reg,param\r",
"// or [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_xor_r64_p64 | void | static void emit_xor_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (param->value == U64(0xffffffffffffffff))
emit_not_r64(dst, reg); // not reg
else if (short_immediate(param->value))
emit_xor_r64_imm(dst, reg, param->value); // xor reg,param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_xor_r64_r64(dst, reg, REG_R11); // xor reg,r11
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_xor_r64_m64(dst, reg, MABS(drcbe, param->value)); // xor reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_xor_r64_r64(dst, reg, param->value); // xor reg,param
} | /*-------------------------------------------------
emit_xor_r64_p64 - xor operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | xor operation to a 64-bit
register from a 64-bit parameter | [
"xor",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_xor_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (param->value == U64(0xffffffffffffffff))
emit_not_r64(dst, reg);
else if (short_immediate(param->value))
emit_xor_r64_imm(dst, reg, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_xor_r64_r64(dst, reg, REG_R11);
}
}
}
else if (param->type == DRCUML_PTYPE_MEMORY)
emit_xor_r64_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
emit_xor_r64_r64(dst, reg, param->value);
} | [
"static",
"void",
"emit_xor_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"0",
")",
"{",
"if",
"(",
"param",
"->",
"value",
"==",
"U64",
"(",
"0xffffffffffffffff",
")",
")",
"emit_not_r64",
"(",
"dst",
",",
"reg",
")",
";",
"else",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_xor_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_xor_r64_r64",
"(",
"dst",
",",
"reg",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_xor_r64_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"emit_xor_r64_r64",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}"
] | emit_xor_r64_p64 - xor operation to a 64-bit
register from a 64-bit parameter | [
"emit_xor_r64_p64",
"-",
"xor",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// not reg\r",
"// xor reg,param\r",
"// mov r11,param\r",
"// xor reg,r11\r",
"// xor reg,[param]\r",
"// xor reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_xor_m64_p64 | void | static void emit_xor_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (param->value == U64(0xffffffffffffffff))
emit_not_m64(dst, MEMPARAMS); // not [mem]
else if (short_immediate(param->value))
emit_xor_m64_imm(dst, MEMPARAMS, param->value); // xor [mem],param
else
{
emit_mov_r64_imm(dst, REG_R11, param->value); // mov r11,param
emit_xor_m64_r64(dst, MEMPARAMS, REG_R11); // xor [mem],r11
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param); // mov reg,param
emit_xor_m64_r64(dst, MEMPARAMS, reg); // xor [dest],reg
}
} | /*-------------------------------------------------
emit_xor_m64_p64 - xor operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | xor operation to a 64-bit
memory location from a 64-bit parameter | [
"xor",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_xor_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags != 0 || param->value != 0)
{
if (param->value == U64(0xffffffffffffffff))
emit_not_m64(dst, MEMPARAMS);
else if (short_immediate(param->value))
emit_xor_m64_imm(dst, MEMPARAMS, param->value);
else
{
emit_mov_r64_imm(dst, REG_R11, param->value);
emit_xor_m64_r64(dst, MEMPARAMS, REG_R11);
}
}
}
else
{
int reg = param_select_register(REG_EAX, param, NULL);
emit_mov_r64_p64(drcbe, dst, reg, param);
emit_xor_m64_r64(dst, MEMPARAMS, reg);
}
} | [
"static",
"void",
"emit_xor_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"!=",
"0",
"||",
"param",
"->",
"value",
"!=",
"0",
")",
"{",
"if",
"(",
"param",
"->",
"value",
"==",
"U64",
"(",
"0xffffffffffffffff",
")",
")",
"emit_not_m64",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"else",
"if",
"(",
"short_immediate",
"(",
"param",
"->",
"value",
")",
")",
"emit_xor_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"else",
"{",
"emit_mov_r64_imm",
"(",
"dst",
",",
"REG_R11",
",",
"param",
"->",
"value",
")",
";",
"emit_xor_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"REG_R11",
")",
";",
"}",
"}",
"}",
"else",
"{",
"int",
"reg",
"=",
"param_select_register",
"(",
"REG_EAX",
",",
"param",
",",
"NULL",
")",
";",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"reg",
",",
"param",
")",
";",
"emit_xor_m64_r64",
"(",
"dst",
",",
"MEMPARAMS",
",",
"reg",
")",
";",
"}",
"}"
] | emit_xor_m64_p64 - xor operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_xor_m64_p64",
"-",
"xor",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// not [mem]\r",
"// xor [mem],param\r",
"// mov r11,param\r",
"// xor [mem],r11\r",
"// mov reg,param\r",
"// xor [dest],reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_shl_r64_p64 | void | static void emit_shl_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_shl_r64_imm(dst, reg, param->value); // shl reg,param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_shl_r64_cl(dst, reg); // shl reg,cl
}
} | /*-------------------------------------------------
emit_shl_r64_p64 - shl operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | shl operation to a 64-bit
register from a 64-bit parameter | [
"shl",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_shl_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_shl_r64_imm(dst, reg, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_shl_r64_cl(dst, reg);
}
} | [
"static",
"void",
"emit_shl_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_shl_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_shl_r64_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_shl_r64_p64 - shl operation to a 64-bit
register from a 64-bit parameter | [
"emit_shl_r64_p64",
"-",
"shl",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// shl reg,param\r",
"// mov rcx,param\r",
"// shl reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_shl_m64_p64 | void | static void emit_shl_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
/* skip */;
else
emit_shl_m64_imm(dst, MEMPARAMS, param->value); // shl [dest],param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_shl_m64_cl(dst, MEMPARAMS); // shl [dest],cl
}
} | /*-------------------------------------------------
emit_shl_m64_p64 - shl operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | shl operation to a 64-bit
memory location from a 64-bit parameter | [
"shl",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_shl_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
;
else
emit_shl_m64_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_shl_m64_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_shl_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT64",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_shl_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_shl_m64_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_shl_m64_p64 - shl operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_shl_m64_p64",
"-",
"shl",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// shl [dest],param\r",
"// mov rcx,param\r",
"// shl [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_shr_r64_p64 | void | static void emit_shr_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_shr_r64_imm(dst, reg, param->value); // shr reg,param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_shr_r64_cl(dst, reg); // shr reg,cl
}
} | /*-------------------------------------------------
emit_shr_r64_p64 - shr operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | shr operation to a 64-bit
register from a 64-bit parameter | [
"shr",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_shr_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_shr_r64_imm(dst, reg, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_shr_r64_cl(dst, reg);
}
} | [
"static",
"void",
"emit_shr_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_shr_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_shr_r64_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_shr_r64_p64 - shr operation to a 64-bit
register from a 64-bit parameter | [
"emit_shr_r64_p64",
"-",
"shr",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// shr reg,param\r",
"// mov rcx,param\r",
"// shr reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_shr_m64_p64 | void | static void emit_shr_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
/* skip */;
else
emit_shr_m64_imm(dst, MEMPARAMS, param->value); // shr [dest],param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_shr_m64_cl(dst, MEMPARAMS); // shr [dest],cl
}
} | /*-------------------------------------------------
emit_shr_m64_p64 - shr operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | shr operation to a 64-bit
memory location from a 64-bit parameter | [
"shr",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_shr_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
;
else
emit_shr_m64_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_shr_m64_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_shr_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT64",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_shr_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_shr_m64_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_shr_m64_p64 - shr operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_shr_m64_p64",
"-",
"shr",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// shr [dest],param\r",
"// mov rcx,param\r",
"// shr [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_sar_r64_p64 | void | static void emit_sar_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_sar_r64_imm(dst, reg, param->value); // sar reg,param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_sar_r64_cl(dst, reg); // sar reg,cl
}
} | /*-------------------------------------------------
emit_sar_r64_p64 - sar operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | sar operation to a 64-bit
register from a 64-bit parameter | [
"sar",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_sar_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_sar_r64_imm(dst, reg, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_sar_r64_cl(dst, reg);
}
} | [
"static",
"void",
"emit_sar_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_sar_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_sar_r64_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_sar_r64_p64 - sar operation to a 64-bit
register from a 64-bit parameter | [
"emit_sar_r64_p64",
"-",
"sar",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// sar reg,param\r",
"// mov rcx,param\r",
"// sar reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_sar_m64_p64 | void | static void emit_sar_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
/* skip */;
else
emit_sar_m64_imm(dst, MEMPARAMS, param->value); // sar [dest],param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_sar_m64_cl(dst, MEMPARAMS); // sar [dest],cl
}
} | /*-------------------------------------------------
emit_sar_m64_p64 - sar operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | sar operation to a 64-bit
memory location from a 64-bit parameter | [
"sar",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_sar_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
;
else
emit_sar_m64_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_sar_m64_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_sar_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT64",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_sar_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_sar_m64_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_sar_m64_p64 - sar operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_sar_m64_p64",
"-",
"sar",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// sar [dest],param\r",
"// mov rcx,param\r",
"// sar [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rol_r64_p64 | void | static void emit_rol_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rol_r64_imm(dst, reg, param->value); // rol reg,param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_rol_r64_cl(dst, reg); // rol reg,cl
}
} | /*-------------------------------------------------
emit_rol_r64_p64 - rol operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | rol operation to a 64-bit
register from a 64-bit parameter | [
"rol",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_rol_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rol_r64_imm(dst, reg, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_rol_r64_cl(dst, reg);
}
} | [
"static",
"void",
"emit_rol_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rol_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_rol_r64_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_rol_r64_p64 - rol operation to a 64-bit
register from a 64-bit parameter | [
"emit_rol_r64_p64",
"-",
"rol",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rol reg,param\r",
"// mov rcx,param\r",
"// rol reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rol_m64_p64 | void | static void emit_rol_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
/* skip */;
else
emit_rol_m64_imm(dst, MEMPARAMS, param->value); // rol [dest],param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_rol_m64_cl(dst, MEMPARAMS); // rol [dest],cl
}
} | /*-------------------------------------------------
emit_rol_m64_p64 - rol operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | rol operation to a 64-bit
memory location from a 64-bit parameter | [
"rol",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_rol_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
;
else
emit_rol_m64_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_rol_m64_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_rol_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT64",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rol_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_rol_m64_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_rol_m64_p64 - rol operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_rol_m64_p64",
"-",
"rol",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rol [dest],param\r",
"// mov rcx,param\r",
"// rol [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_ror_r64_p64 | void | static void emit_ror_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_ror_r64_imm(dst, reg, param->value); // ror reg,param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_ror_r64_cl(dst, reg); // ror reg,cl
}
} | /*-------------------------------------------------
emit_ror_r64_p64 - ror operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | ror operation to a 64-bit
register from a 64-bit parameter | [
"ror",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_ror_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_ror_r64_imm(dst, reg, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_ror_r64_cl(dst, reg);
}
} | [
"static",
"void",
"emit_ror_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_ror_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_ror_r64_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_ror_r64_p64 - ror operation to a 64-bit
register from a 64-bit parameter | [
"emit_ror_r64_p64",
"-",
"ror",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// ror reg,param\r",
"// mov rcx,param\r",
"// ror reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_ror_m64_p64 | void | static void emit_ror_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
/* skip */;
else
emit_ror_m64_imm(dst, MEMPARAMS, param->value); // ror [dest],param
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_ror_m64_cl(dst, MEMPARAMS); // ror [dest],cl
}
} | /*-------------------------------------------------
emit_ror_m64_p64 - ror operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | ror operation to a 64-bit
memory location from a 64-bit parameter | [
"ror",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_ror_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
;
else
emit_ror_m64_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r64_p64(drcbe, dst, REG_RCX, param);
emit_ror_m64_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_ror_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT64",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_ror_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_ror_m64_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_ror_m64_p64 - ror operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_ror_m64_p64",
"-",
"ror",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// ror [dest],param\r",
"// mov rcx,param\r",
"// ror [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rcl_r64_p64 | void | static void emit_rcl_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rcl_r64_imm(dst, reg, param->value); // rcl reg,param
}
else
{
emit_mov_r64_p64_keepflags(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_rcl_r64_cl(dst, reg); // rcl reg,cl
}
} | /*-------------------------------------------------
emit_rcl_r64_p64 - rcl operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | rcl operation to a 64-bit
register from a 64-bit parameter | [
"rcl",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_rcl_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rcl_r64_imm(dst, reg, param->value);
}
else
{
emit_mov_r64_p64_keepflags(drcbe, dst, REG_RCX, param);
emit_rcl_r64_cl(dst, reg);
}
} | [
"static",
"void",
"emit_rcl_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rcl_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_rcl_r64_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_rcl_r64_p64 - rcl operation to a 64-bit
register from a 64-bit parameter | [
"emit_rcl_r64_p64",
"-",
"rcl",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rcl reg,param\r",
"// mov rcx,param\r",
"// rcl reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rcl_m64_p64 | void | static void emit_rcl_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
/* skip */;
else
emit_rcl_m64_imm(dst, MEMPARAMS, param->value); // rcl [dest],param
}
else
{
emit_mov_r64_p64_keepflags(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_rcl_m64_cl(dst, MEMPARAMS); // rcl [dest],cl
}
} | /*-------------------------------------------------
emit_rcl_m64_p64 - rcl operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | rcl operation to a 64-bit
memory location from a 64-bit parameter | [
"rcl",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_rcl_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
;
else
emit_rcl_m64_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r64_p64_keepflags(drcbe, dst, REG_RCX, param);
emit_rcl_m64_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_rcl_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT64",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rcl_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_rcl_m64_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_rcl_m64_p64 - rcl operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_rcl_m64_p64",
"-",
"rcl",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rcl [dest],param\r",
"// mov rcx,param\r",
"// rcl [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rcr_r64_p64 | void | static void emit_rcr_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
/* skip */;
else
emit_rcr_r64_imm(dst, reg, param->value); // rcr reg,param
}
else
{
emit_mov_r64_p64_keepflags(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_rcr_r64_cl(dst, reg); // rcr reg,cl
}
} | /*-------------------------------------------------
emit_rcr_r64_p64 - rcr operation to a 64-bit
register from a 64-bit parameter
-------------------------------------------------*/ | rcr operation to a 64-bit
register from a 64-bit parameter | [
"rcr",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_rcr_r64_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT32)param->value == 0)
;
else
emit_rcr_r64_imm(dst, reg, param->value);
}
else
{
emit_mov_r64_p64_keepflags(drcbe, dst, REG_RCX, param);
emit_rcr_r64_cl(dst, reg);
}
} | [
"static",
"void",
"emit_rcr_r64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT32",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rcr_r64_imm",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_rcr_r64_cl",
"(",
"dst",
",",
"reg",
")",
";",
"}",
"}"
] | emit_rcr_r64_p64 - rcr operation to a 64-bit
register from a 64-bit parameter | [
"emit_rcr_r64_p64",
"-",
"rcr",
"operation",
"to",
"a",
"64",
"-",
"bit",
"register",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rcr reg,param\r",
"// mov rcx,param\r",
"// rcr reg,cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_rcr_m64_p64 | void | static void emit_rcr_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
/* skip */;
else
emit_rcr_m64_imm(dst, MEMPARAMS, param->value); // rcr [dest],param
}
else
{
emit_mov_r64_p64_keepflags(drcbe, dst, REG_RCX, param); // mov rcx,param
emit_rcr_m64_cl(dst, MEMPARAMS); // rcr [dest],cl
}
} | /*-------------------------------------------------
emit_rcr_m64_p64 - rcr operation to a 64-bit
memory location from a 64-bit parameter
-------------------------------------------------*/ | rcr operation to a 64-bit
memory location from a 64-bit parameter | [
"rcr",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_rcr_m64_p64(drcbe_state *drcbe, x86code **dst, DECLARE_MEMPARAMS, const drcuml_parameter *param, const drcuml_instruction *inst)
{
if (param->type == DRCUML_PTYPE_IMMEDIATE)
{
if (inst->flags == 0 && (UINT64)param->value == 0)
;
else
emit_rcr_m64_imm(dst, MEMPARAMS, param->value);
}
else
{
emit_mov_r64_p64_keepflags(drcbe, dst, REG_RCX, param);
emit_rcr_m64_cl(dst, MEMPARAMS);
}
} | [
"static",
"void",
"emit_rcr_m64_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"DECLARE_MEMPARAMS",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"const",
"drcuml_instruction",
"*",
"inst",
")",
"{",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_IMMEDIATE",
")",
"{",
"if",
"(",
"inst",
"->",
"flags",
"==",
"0",
"&&",
"(",
"UINT64",
")",
"param",
"->",
"value",
"==",
"0",
")",
";",
"else",
"emit_rcr_m64_imm",
"(",
"dst",
",",
"MEMPARAMS",
",",
"param",
"->",
"value",
")",
";",
"}",
"else",
"{",
"emit_mov_r64_p64_keepflags",
"(",
"drcbe",
",",
"dst",
",",
"REG_RCX",
",",
"param",
")",
";",
"emit_rcr_m64_cl",
"(",
"dst",
",",
"MEMPARAMS",
")",
";",
"}",
"}"
] | emit_rcr_m64_p64 - rcr operation to a 64-bit
memory location from a 64-bit parameter | [
"emit_rcr_m64_p64",
"-",
"rcr",
"operation",
"to",
"a",
"64",
"-",
"bit",
"memory",
"location",
"from",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"/* skip */",
"// rcr [dest],param\r",
"// mov rcx,param\r",
"// rcr [dest],cl\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "inst",
"type": "drcuml_instruction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "inst",
"type": "drcuml_instruction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_movss_r128_p32 | void | static void emit_movss_r128_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_movss_r128_m32(dst, reg, MABS(drcbe, param->value)); // movss reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_movss_r128_r128(dst, reg, param->value); // movss reg,param
}
} | /*-------------------------------------------------
emit_movss_r128_p32 - move a 32-bit parameter
into a register
-------------------------------------------------*/ | move a 32-bit parameter
into a register | [
"move",
"a",
"32",
"-",
"bit",
"parameter",
"into",
"a",
"register"
] | static void emit_movss_r128_p32(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_movss_r128_m32(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_movss_r128_r128(dst, reg, param->value);
}
} | [
"static",
"void",
"emit_movss_r128_p32",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
")",
"{",
"assert",
"(",
"param",
"->",
"type",
"!=",
"DRCUML_PTYPE_IMMEDIATE",
")",
";",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_movss_r128_m32",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"{",
"if",
"(",
"reg",
"!=",
"param",
"->",
"value",
")",
"emit_movss_r128_r128",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"}"
] | emit_movss_r128_p32 - move a 32-bit parameter
into a register | [
"emit_movss_r128_p32",
"-",
"move",
"a",
"32",
"-",
"bit",
"parameter",
"into",
"a",
"register"
] | [
"// movss reg,[param]\r",
"// movss reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_movss_p32_r128 | void | static void emit_movss_p32_r128(drcbe_state *drcbe, x86code **dst, const drcuml_parameter *param, UINT8 reg)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_movss_m32_r128(dst, MABS(drcbe, param->value), reg); // movss [param],reg
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_movss_r128_r128(dst, param->value, reg); // movss param,reg
}
} | /*-------------------------------------------------
emit_movss_p32_r128 - move a register into a
32-bit parameter
-------------------------------------------------*/ | move a register into a
32-bit parameter | [
"move",
"a",
"register",
"into",
"a",
"32",
"-",
"bit",
"parameter"
] | static void emit_movss_p32_r128(drcbe_state *drcbe, x86code **dst, const drcuml_parameter *param, UINT8 reg)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_movss_m32_r128(dst, MABS(drcbe, param->value), reg);
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_movss_r128_r128(dst, param->value, reg);
}
} | [
"static",
"void",
"emit_movss_p32_r128",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"UINT8",
"reg",
")",
"{",
"assert",
"(",
"param",
"->",
"type",
"!=",
"DRCUML_PTYPE_IMMEDIATE",
")",
";",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_movss_m32_r128",
"(",
"dst",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
",",
"reg",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"{",
"if",
"(",
"reg",
"!=",
"param",
"->",
"value",
")",
"emit_movss_r128_r128",
"(",
"dst",
",",
"param",
"->",
"value",
",",
"reg",
")",
";",
"}",
"}"
] | emit_movss_p32_r128 - move a register into a
32-bit parameter | [
"emit_movss_p32_r128",
"-",
"move",
"a",
"register",
"into",
"a",
"32",
"-",
"bit",
"parameter"
] | [
"// movss [param],reg\r",
"// movss param,reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "reg",
"type": "UINT8"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_movsd_r128_p64 | void | static void emit_movsd_r128_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_movsd_r128_m64(dst, reg, MABS(drcbe, param->value)); // movsd reg,[param]
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_movsd_r128_r128(dst, reg, param->value); // movsd reg,param
}
} | /*-------------------------------------------------
emit_movsd_r128_p64 - move a 64-bit parameter
into a register
-------------------------------------------------*/ | move a 64-bit parameter
into a register | [
"move",
"a",
"64",
"-",
"bit",
"parameter",
"into",
"a",
"register"
] | static void emit_movsd_r128_p64(drcbe_state *drcbe, x86code **dst, UINT8 reg, const drcuml_parameter *param)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_movsd_r128_m64(dst, reg, MABS(drcbe, param->value));
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_movsd_r128_r128(dst, reg, param->value);
}
} | [
"static",
"void",
"emit_movsd_r128_p64",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"UINT8",
"reg",
",",
"const",
"drcuml_parameter",
"*",
"param",
")",
"{",
"assert",
"(",
"param",
"->",
"type",
"!=",
"DRCUML_PTYPE_IMMEDIATE",
")",
";",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_movsd_r128_m64",
"(",
"dst",
",",
"reg",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"{",
"if",
"(",
"reg",
"!=",
"param",
"->",
"value",
")",
"emit_movsd_r128_r128",
"(",
"dst",
",",
"reg",
",",
"param",
"->",
"value",
")",
";",
"}",
"}"
] | emit_movsd_r128_p64 - move a 64-bit parameter
into a register | [
"emit_movsd_r128_p64",
"-",
"move",
"a",
"64",
"-",
"bit",
"parameter",
"into",
"a",
"register"
] | [
"// movsd reg,[param]\r",
"// movsd reg,param\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "reg",
"type": "UINT8"
},
{
"param": "param",
"type": "drcuml_parameter"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | emit_movsd_p64_r128 | void | static void emit_movsd_p64_r128(drcbe_state *drcbe, x86code **dst, const drcuml_parameter *param, UINT8 reg)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_movsd_m64_r128(dst, MABS(drcbe, param->value), reg); // movsd [param],reg
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_movsd_r128_r128(dst, param->value, reg); // movsd param,reg
}
} | /*-------------------------------------------------
emit_movsd_p64_r128 - move a register into a
64-bit parameter
-------------------------------------------------*/ | move a register into a
64-bit parameter | [
"move",
"a",
"register",
"into",
"a",
"64",
"-",
"bit",
"parameter"
] | static void emit_movsd_p64_r128(drcbe_state *drcbe, x86code **dst, const drcuml_parameter *param, UINT8 reg)
{
assert(param->type != DRCUML_PTYPE_IMMEDIATE);
if (param->type == DRCUML_PTYPE_MEMORY)
emit_movsd_m64_r128(dst, MABS(drcbe, param->value), reg);
else if (param->type == DRCUML_PTYPE_INT_REGISTER)
{
if (reg != param->value)
emit_movsd_r128_r128(dst, param->value, reg);
}
} | [
"static",
"void",
"emit_movsd_p64_r128",
"(",
"drcbe_state",
"*",
"drcbe",
",",
"x86code",
"*",
"*",
"dst",
",",
"const",
"drcuml_parameter",
"*",
"param",
",",
"UINT8",
"reg",
")",
"{",
"assert",
"(",
"param",
"->",
"type",
"!=",
"DRCUML_PTYPE_IMMEDIATE",
")",
";",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_MEMORY",
")",
"emit_movsd_m64_r128",
"(",
"dst",
",",
"MABS",
"(",
"drcbe",
",",
"param",
"->",
"value",
")",
",",
"reg",
")",
";",
"else",
"if",
"(",
"param",
"->",
"type",
"==",
"DRCUML_PTYPE_INT_REGISTER",
")",
"{",
"if",
"(",
"reg",
"!=",
"param",
"->",
"value",
")",
"emit_movsd_r128_r128",
"(",
"dst",
",",
"param",
"->",
"value",
",",
"reg",
")",
";",
"}",
"}"
] | emit_movsd_p64_r128 - move a register into a
64-bit parameter | [
"emit_movsd_p64_r128",
"-",
"move",
"a",
"register",
"into",
"a",
"64",
"-",
"bit",
"parameter"
] | [
"// movsd [param],reg\r",
"// movsd param,reg\r"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
},
{
"param": "dst",
"type": "x86code"
},
{
"param": "param",
"type": "drcuml_parameter"
},
{
"param": "reg",
"type": "UINT8"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dst",
"type": "x86code",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "drcuml_parameter",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reg",
"type": "UINT8",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | fixup_label | void | static void fixup_label(void *parameter, drccodeptr labelcodeptr)
{
drccodeptr src = (drccodeptr)parameter;
/* find the end of the instruction */
if (src[0] == 0xe3)
{
src += 1 + 1;
src[-1] = labelcodeptr - src;
}
else if (src[0] == 0xe9)
{
src += 1 + 4;
((UINT32 *)src)[-1] = labelcodeptr - src;
}
else if (src[0] == 0x0f && (src[1] & 0xf0) == 0x80)
{
src += 2 + 4;
((UINT32 *)src)[-1] = labelcodeptr - src;
}
else
fatalerror("fixup_label called with invalid jmp source!");
} | /*-------------------------------------------------
fixup_label - callback to fixup forward-
referenced labels
-------------------------------------------------*/ | callback to fixup forward
referenced labels | [
"callback",
"to",
"fixup",
"forward",
"referenced",
"labels"
] | static void fixup_label(void *parameter, drccodeptr labelcodeptr)
{
drccodeptr src = (drccodeptr)parameter;
if (src[0] == 0xe3)
{
src += 1 + 1;
src[-1] = labelcodeptr - src;
}
else if (src[0] == 0xe9)
{
src += 1 + 4;
((UINT32 *)src)[-1] = labelcodeptr - src;
}
else if (src[0] == 0x0f && (src[1] & 0xf0) == 0x80)
{
src += 2 + 4;
((UINT32 *)src)[-1] = labelcodeptr - src;
}
else
fatalerror("fixup_label called with invalid jmp source!");
} | [
"static",
"void",
"fixup_label",
"(",
"void",
"*",
"parameter",
",",
"drccodeptr",
"labelcodeptr",
")",
"{",
"drccodeptr",
"src",
"=",
"(",
"drccodeptr",
")",
"parameter",
";",
"if",
"(",
"src",
"[",
"0",
"]",
"==",
"0xe3",
")",
"{",
"src",
"+=",
"1",
"+",
"1",
";",
"src",
"[",
"-1",
"]",
"=",
"labelcodeptr",
"-",
"src",
";",
"}",
"else",
"if",
"(",
"src",
"[",
"0",
"]",
"==",
"0xe9",
")",
"{",
"src",
"+=",
"1",
"+",
"4",
";",
"(",
"(",
"UINT32",
"*",
")",
"src",
")",
"[",
"-1",
"]",
"=",
"labelcodeptr",
"-",
"src",
";",
"}",
"else",
"if",
"(",
"src",
"[",
"0",
"]",
"==",
"0x0f",
"&&",
"(",
"src",
"[",
"1",
"]",
"&",
"0xf0",
")",
"==",
"0x80",
")",
"{",
"src",
"+=",
"2",
"+",
"4",
";",
"(",
"(",
"UINT32",
"*",
")",
"src",
")",
"[",
"-1",
"]",
"=",
"labelcodeptr",
"-",
"src",
";",
"}",
"else",
"fatalerror",
"(",
"\"",
"\"",
")",
";",
"}"
] | fixup_label - callback to fixup forward
referenced labels | [
"fixup_label",
"-",
"callback",
"to",
"fixup",
"forward",
"referenced",
"labels"
] | [
"/* find the end of the instruction */"
] | [
{
"param": "parameter",
"type": "void"
},
{
"param": "labelcodeptr",
"type": "drccodeptr"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "parameter",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "labelcodeptr",
"type": "drccodeptr",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
83e07bf5e7c896f6d63e6b87d110edf2c88d8f12 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbex64.c | [
"Unlicense"
] | C | fixup_exception | void | static void fixup_exception(drccodeptr *codeptr, void *param1, void *param2, void *param3)
{
drcuml_parameter handp, exp;
drcbe_state *drcbe = (drcbe_state *)param1;
drccodeptr src = (drccodeptr)param2;
const drcuml_instruction *inst = (const drcuml_instruction *)param3;
drccodeptr dst = *codeptr;
drccodeptr *targetptr;
/* normalize parameters */
param_normalize_2(drcbe, inst, &handp, PTYPE_M, &exp, PTYPE_MRI);
/* look up the handle target */
targetptr = drcuml_handle_codeptr_addr((drcuml_codehandle *)handp.value);
/* first fixup the jump to get us here */
((UINT32 *)src)[-1] = dst - src;
/* then store the exception parameter */
emit_mov_m32_p32(drcbe, &dst, MABS(drcbe, &drcbe->state.exp), &exp); // mov [exp],exp
/* push the original return address on the stack */
emit_lea_r64_m64(&dst, REG_RAX, MABS(drcbe, src)); // lea rax,[return]
emit_push_r64(&dst, REG_RAX); // push rax
if (*targetptr != NULL)
emit_jmp(&dst, *targetptr); // jmp *targetptr
else
emit_jmp_m64(&dst, MABS(drcbe, targetptr)); // jmp [targetptr]
*codeptr = dst;
} | /*-------------------------------------------------
fixup_exception - callback to perform cleanup
and jump to an exception handler
-------------------------------------------------*/ | callback to perform cleanup
and jump to an exception handler | [
"callback",
"to",
"perform",
"cleanup",
"and",
"jump",
"to",
"an",
"exception",
"handler"
] | static void fixup_exception(drccodeptr *codeptr, void *param1, void *param2, void *param3)
{
drcuml_parameter handp, exp;
drcbe_state *drcbe = (drcbe_state *)param1;
drccodeptr src = (drccodeptr)param2;
const drcuml_instruction *inst = (const drcuml_instruction *)param3;
drccodeptr dst = *codeptr;
drccodeptr *targetptr;
param_normalize_2(drcbe, inst, &handp, PTYPE_M, &exp, PTYPE_MRI);
targetptr = drcuml_handle_codeptr_addr((drcuml_codehandle *)handp.value);
((UINT32 *)src)[-1] = dst - src;
emit_mov_m32_p32(drcbe, &dst, MABS(drcbe, &drcbe->state.exp), &exp);
emit_lea_r64_m64(&dst, REG_RAX, MABS(drcbe, src));
emit_push_r64(&dst, REG_RAX);
if (*targetptr != NULL)
emit_jmp(&dst, *targetptr);
else
emit_jmp_m64(&dst, MABS(drcbe, targetptr));
*codeptr = dst;
} | [
"static",
"void",
"fixup_exception",
"(",
"drccodeptr",
"*",
"codeptr",
",",
"void",
"*",
"param1",
",",
"void",
"*",
"param2",
",",
"void",
"*",
"param3",
")",
"{",
"drcuml_parameter",
"handp",
",",
"exp",
";",
"drcbe_state",
"*",
"drcbe",
"=",
"(",
"drcbe_state",
"*",
")",
"param1",
";",
"drccodeptr",
"src",
"=",
"(",
"drccodeptr",
")",
"param2",
";",
"const",
"drcuml_instruction",
"*",
"inst",
"=",
"(",
"const",
"drcuml_instruction",
"*",
")",
"param3",
";",
"drccodeptr",
"dst",
"=",
"*",
"codeptr",
";",
"drccodeptr",
"*",
"targetptr",
";",
"param_normalize_2",
"(",
"drcbe",
",",
"inst",
",",
"&",
"handp",
",",
"PTYPE_M",
",",
"&",
"exp",
",",
"PTYPE_MRI",
")",
";",
"targetptr",
"=",
"drcuml_handle_codeptr_addr",
"(",
"(",
"drcuml_codehandle",
"*",
")",
"handp",
".",
"value",
")",
";",
"(",
"(",
"UINT32",
"*",
")",
"src",
")",
"[",
"-1",
"]",
"=",
"dst",
"-",
"src",
";",
"emit_mov_m32_p32",
"(",
"drcbe",
",",
"&",
"dst",
",",
"MABS",
"(",
"drcbe",
",",
"&",
"drcbe",
"->",
"state",
".",
"exp",
")",
",",
"&",
"exp",
")",
";",
"emit_lea_r64_m64",
"(",
"&",
"dst",
",",
"REG_RAX",
",",
"MABS",
"(",
"drcbe",
",",
"src",
")",
")",
";",
"emit_push_r64",
"(",
"&",
"dst",
",",
"REG_RAX",
")",
";",
"if",
"(",
"*",
"targetptr",
"!=",
"NULL",
")",
"emit_jmp",
"(",
"&",
"dst",
",",
"*",
"targetptr",
")",
";",
"else",
"emit_jmp_m64",
"(",
"&",
"dst",
",",
"MABS",
"(",
"drcbe",
",",
"targetptr",
")",
")",
";",
"*",
"codeptr",
"=",
"dst",
";",
"}"
] | fixup_exception - callback to perform cleanup
and jump to an exception handler | [
"fixup_exception",
"-",
"callback",
"to",
"perform",
"cleanup",
"and",
"jump",
"to",
"an",
"exception",
"handler"
] | [
"/* normalize parameters */",
"/* look up the handle target */",
"/* first fixup the jump to get us here */",
"/* then store the exception parameter */",
"// mov [exp],exp\r",
"/* push the original return address on the stack */",
"// lea rax,[return]\r",
"// push rax\r",
"// jmp *targetptr\r",
"// jmp [targetptr]\r"
] | [
{
"param": "codeptr",
"type": "drccodeptr"
},
{
"param": "param1",
"type": "void"
},
{
"param": "param2",
"type": "void"
},
{
"param": "param3",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "codeptr",
"type": "drccodeptr",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param1",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param2",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param3",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6a6a4a584bfdb98c1258b994ffde2f1fe7c3e6aa | lofunz/mieme | Reloaded/tags/MAME4droid.Reloaded.1.0.WIP/src/mame/video/deco32.c | [
"Unlicense"
] | C | deco32_draw_sprite | void | static void deco32_draw_sprite(bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
UINT32 code,UINT32 priority,int flipx,int flipy,int sx,int sy)
{
const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
int ox,oy,cx,cy;
int x_index,y_index,x,y;
/* check bounds */
ox = sx;
oy = sy;
if (sx>319 || sy>247 || sx<-15 || sy<-7)
return;
if (sy<0) sy=0;
if (sx<0) sx=0;
if (sx>319) cx=319;
else cx=ox+16;
cy=(sy-oy);
if (flipy) y_index=15-cy; else y_index=cy;
for( y=0; y<16-cy; y++ )
{
const UINT8 *source = code_base + y_index * gfx->line_modulo;
UINT16 *destb = BITMAP_ADDR16(dest, sy, 0);
if (flipx) { source+=15-(sx-ox); x_index=-1; } else { x_index=1; source+=(sx-ox); }
for (x=sx; x<cx; x++)
{
int c = *source;
if( c )
destb[x] = c | priority;
source+=x_index;
}
sy++;
if (sy>247)
return;
if (flipy) y_index--; else y_index++;
}
} | /*
This renders sprites to a 16 bit bitmap, for later mixing.
Bottom 8 bits per pixel is palettised sprite data, top 8 is
colour/alpha/priority.
*/ | This renders sprites to a 16 bit bitmap, for later mixing.
Bottom 8 bits per pixel is palettised sprite data, top 8 is
colour/alpha/priority. | [
"This",
"renders",
"sprites",
"to",
"a",
"16",
"bit",
"bitmap",
"for",
"later",
"mixing",
".",
"Bottom",
"8",
"bits",
"per",
"pixel",
"is",
"palettised",
"sprite",
"data",
"top",
"8",
"is",
"colour",
"/",
"alpha",
"/",
"priority",
"."
] | static void deco32_draw_sprite(bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
UINT32 code,UINT32 priority,int flipx,int flipy,int sx,int sy)
{
const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
int ox,oy,cx,cy;
int x_index,y_index,x,y;
ox = sx;
oy = sy;
if (sx>319 || sy>247 || sx<-15 || sy<-7)
return;
if (sy<0) sy=0;
if (sx<0) sx=0;
if (sx>319) cx=319;
else cx=ox+16;
cy=(sy-oy);
if (flipy) y_index=15-cy; else y_index=cy;
for( y=0; y<16-cy; y++ )
{
const UINT8 *source = code_base + y_index * gfx->line_modulo;
UINT16 *destb = BITMAP_ADDR16(dest, sy, 0);
if (flipx) { source+=15-(sx-ox); x_index=-1; } else { x_index=1; source+=(sx-ox); }
for (x=sx; x<cx; x++)
{
int c = *source;
if( c )
destb[x] = c | priority;
source+=x_index;
}
sy++;
if (sy>247)
return;
if (flipy) y_index--; else y_index++;
}
} | [
"static",
"void",
"deco32_draw_sprite",
"(",
"bitmap_t",
"*",
"dest",
",",
"const",
"rectangle",
"*",
"clip",
",",
"const",
"gfx_element",
"*",
"gfx",
",",
"UINT32",
"code",
",",
"UINT32",
"priority",
",",
"int",
"flipx",
",",
"int",
"flipy",
",",
"int",
"sx",
",",
"int",
"sy",
")",
"{",
"const",
"UINT8",
"*",
"code_base",
"=",
"gfx_element_get_data",
"(",
"gfx",
",",
"code",
"%",
"gfx",
"->",
"total_elements",
")",
";",
"int",
"ox",
",",
"oy",
",",
"cx",
",",
"cy",
";",
"int",
"x_index",
",",
"y_index",
",",
"x",
",",
"y",
";",
"ox",
"=",
"sx",
";",
"oy",
"=",
"sy",
";",
"if",
"(",
"sx",
">",
"319",
"||",
"sy",
">",
"247",
"||",
"sx",
"<",
"-15",
"||",
"sy",
"<",
"-7",
")",
"return",
";",
"if",
"(",
"sy",
"<",
"0",
")",
"sy",
"=",
"0",
";",
"if",
"(",
"sx",
"<",
"0",
")",
"sx",
"=",
"0",
";",
"if",
"(",
"sx",
">",
"319",
")",
"cx",
"=",
"319",
";",
"else",
"cx",
"=",
"ox",
"+",
"16",
";",
"cy",
"=",
"(",
"sy",
"-",
"oy",
")",
";",
"if",
"(",
"flipy",
")",
"y_index",
"=",
"15",
"-",
"cy",
";",
"else",
"y_index",
"=",
"cy",
";",
"for",
"(",
"y",
"=",
"0",
";",
"y",
"<",
"16",
"-",
"cy",
";",
"y",
"++",
")",
"{",
"const",
"UINT8",
"*",
"source",
"=",
"code_base",
"+",
"y_index",
"*",
"gfx",
"->",
"line_modulo",
";",
"UINT16",
"*",
"destb",
"=",
"BITMAP_ADDR16",
"(",
"dest",
",",
"sy",
",",
"0",
")",
";",
"if",
"(",
"flipx",
")",
"{",
"source",
"+=",
"15",
"-",
"(",
"sx",
"-",
"ox",
")",
";",
"x_index",
"=",
"-1",
";",
"}",
"else",
"{",
"x_index",
"=",
"1",
";",
"source",
"+=",
"(",
"sx",
"-",
"ox",
")",
";",
"}",
"for",
"(",
"x",
"=",
"sx",
";",
"x",
"<",
"cx",
";",
"x",
"++",
")",
"{",
"int",
"c",
"=",
"*",
"source",
";",
"if",
"(",
"c",
")",
"destb",
"[",
"x",
"]",
"=",
"c",
"|",
"priority",
";",
"source",
"+=",
"x_index",
";",
"}",
"sy",
"++",
";",
"if",
"(",
"sy",
">",
"247",
")",
"return",
";",
"if",
"(",
"flipy",
")",
"y_index",
"--",
";",
"else",
"y_index",
"++",
";",
"}",
"}"
] | This renders sprites to a 16 bit bitmap, for later mixing. | [
"This",
"renders",
"sprites",
"to",
"a",
"16",
"bit",
"bitmap",
"for",
"later",
"mixing",
"."
] | [
"/* check bounds */"
] | [
{
"param": "dest",
"type": "bitmap_t"
},
{
"param": "clip",
"type": "rectangle"
},
{
"param": "gfx",
"type": "gfx_element"
},
{
"param": "code",
"type": "UINT32"
},
{
"param": "priority",
"type": "UINT32"
},
{
"param": "flipx",
"type": "int"
},
{
"param": "flipy",
"type": "int"
},
{
"param": "sx",
"type": "int"
},
{
"param": "sy",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dest",
"type": "bitmap_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "clip",
"type": "rectangle",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "gfx",
"type": "gfx_element",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "code",
"type": "UINT32",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "priority",
"type": "UINT32",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "flipx",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "flipy",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sx",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sy",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6a6a4a584bfdb98c1258b994ffde2f1fe7c3e6aa | lofunz/mieme | Reloaded/tags/MAME4droid.Reloaded.1.0.WIP/src/mame/video/deco32.c | [
"Unlicense"
] | C | nslasher_draw_sprites | void | static void nslasher_draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT32 *spritedata, int gfxbank)
{
int offs;
// Draw sprites back to front saving priority & alpha data per pixel for later mixing
for (offs = 0; offs<0x400; offs+=4)
{
int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; /*,pri=0,spri=0;*/
//int trans;
sprite = spritedata[offs+1] & 0xffff;
y = spritedata[offs];
flash=y&0x1000;
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
//trans=TRANSPARENCY_PEN;
x = spritedata[offs+2];
// Prepare colour, priority and alpha info
colour = (x>>9) & 0x7f;
if (y&0x8000)
colour|=0x80;
colour<<=8;
fx = y & 0x2000;
fy = y & 0x4000;
multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */
x = x & 0x01ff;
y = y & 0x01ff;
if (x >= 320) x -= 512;
if (y >= 256) y -= 512;
sprite &= ~multi;
if (fy)
inc = -1;
else
{
sprite += multi;
inc = 1;
}
mult=+16;
if (fx) fx=0; else fx=1;
if (fy) fy=0; else fy=1;
while (multi >= 0)
{
deco32_draw_sprite(bitmap,cliprect,machine->gfx[gfxbank],
sprite - multi * inc,
colour,
fx,fy,
x,y + mult * multi);
multi--;
}
}
} | // Merge with Tattass & Fghthist sprite routines later | Merge with Tattass & Fghthist sprite routines later | [
"Merge",
"with",
"Tattass",
"&",
"Fghthist",
"sprite",
"routines",
"later"
] | static void nslasher_draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT32 *spritedata, int gfxbank)
{
int offs;
for (offs = 0; offs<0x400; offs+=4)
{
int x,y,sprite,colour,multi,fx,fy,inc,flash,mult;
sprite = spritedata[offs+1] & 0xffff;
y = spritedata[offs];
flash=y&0x1000;
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
x = spritedata[offs+2];
colour = (x>>9) & 0x7f;
if (y&0x8000)
colour|=0x80;
colour<<=8;
fx = y & 0x2000;
fy = y & 0x4000;
multi = (1 << ((y & 0x0600) >> 9)) - 1;
x = x & 0x01ff;
y = y & 0x01ff;
if (x >= 320) x -= 512;
if (y >= 256) y -= 512;
sprite &= ~multi;
if (fy)
inc = -1;
else
{
sprite += multi;
inc = 1;
}
mult=+16;
if (fx) fx=0; else fx=1;
if (fy) fy=0; else fy=1;
while (multi >= 0)
{
deco32_draw_sprite(bitmap,cliprect,machine->gfx[gfxbank],
sprite - multi * inc,
colour,
fx,fy,
x,y + mult * multi);
multi--;
}
}
} | [
"static",
"void",
"nslasher_draw_sprites",
"(",
"running_machine",
"*",
"machine",
",",
"bitmap_t",
"*",
"bitmap",
",",
"const",
"rectangle",
"*",
"cliprect",
",",
"const",
"UINT32",
"*",
"spritedata",
",",
"int",
"gfxbank",
")",
"{",
"int",
"offs",
";",
"for",
"(",
"offs",
"=",
"0",
";",
"offs",
"<",
"0x400",
";",
"offs",
"+=",
"4",
")",
"{",
"int",
"x",
",",
"y",
",",
"sprite",
",",
"colour",
",",
"multi",
",",
"fx",
",",
"fy",
",",
"inc",
",",
"flash",
",",
"mult",
";",
"sprite",
"=",
"spritedata",
"[",
"offs",
"+",
"1",
"]",
"&",
"0xffff",
";",
"y",
"=",
"spritedata",
"[",
"offs",
"]",
";",
"flash",
"=",
"y",
"&",
"0x1000",
";",
"if",
"(",
"flash",
"&&",
"(",
"video_screen_get_frame_number",
"(",
"machine",
"->",
"primary_screen",
")",
"&",
"1",
")",
")",
"continue",
";",
"x",
"=",
"spritedata",
"[",
"offs",
"+",
"2",
"]",
";",
"colour",
"=",
"(",
"x",
">>",
"9",
")",
"&",
"0x7f",
";",
"if",
"(",
"y",
"&",
"0x8000",
")",
"colour",
"|=",
"0x80",
";",
"colour",
"<<=",
"8",
";",
"fx",
"=",
"y",
"&",
"0x2000",
";",
"fy",
"=",
"y",
"&",
"0x4000",
";",
"multi",
"=",
"(",
"1",
"<<",
"(",
"(",
"y",
"&",
"0x0600",
")",
">>",
"9",
")",
")",
"-",
"1",
";",
"x",
"=",
"x",
"&",
"0x01ff",
";",
"y",
"=",
"y",
"&",
"0x01ff",
";",
"if",
"(",
"x",
">=",
"320",
")",
"x",
"-=",
"512",
";",
"if",
"(",
"y",
">=",
"256",
")",
"y",
"-=",
"512",
";",
"sprite",
"&=",
"~",
"multi",
";",
"if",
"(",
"fy",
")",
"inc",
"=",
"-1",
";",
"else",
"{",
"sprite",
"+=",
"multi",
";",
"inc",
"=",
"1",
";",
"}",
"mult",
"=",
"+16",
";",
"if",
"(",
"fx",
")",
"fx",
"=",
"0",
";",
"else",
"fx",
"=",
"1",
";",
"if",
"(",
"fy",
")",
"fy",
"=",
"0",
";",
"else",
"fy",
"=",
"1",
";",
"while",
"(",
"multi",
">=",
"0",
")",
"{",
"deco32_draw_sprite",
"(",
"bitmap",
",",
"cliprect",
",",
"machine",
"->",
"gfx",
"[",
"gfxbank",
"]",
",",
"sprite",
"-",
"multi",
"*",
"inc",
",",
"colour",
",",
"fx",
",",
"fy",
",",
"x",
",",
"y",
"+",
"mult",
"*",
"multi",
")",
";",
"multi",
"--",
";",
"}",
"}",
"}"
] | Merge with Tattass & Fghthist sprite routines later | [
"Merge",
"with",
"Tattass",
"&",
"Fghthist",
"sprite",
"routines",
"later"
] | [
"// Draw sprites back to front saving priority & alpha data per pixel for later mixing",
"/*,pri=0,spri=0;*/",
"//int trans;",
"//trans=TRANSPARENCY_PEN;",
"// Prepare colour, priority and alpha info",
"/* 1x, 2x, 4x, 8x height */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "bitmap",
"type": "bitmap_t"
},
{
"param": "cliprect",
"type": "rectangle"
},
{
"param": "spritedata",
"type": "UINT32"
},
{
"param": "gfxbank",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "bitmap",
"type": "bitmap_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cliprect",
"type": "rectangle",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "spritedata",
"type": "UINT32",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "gfxbank",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6a6a4a584bfdb98c1258b994ffde2f1fe7c3e6aa | lofunz/mieme | Reloaded/tags/MAME4droid.Reloaded.1.0.WIP/src/mame/video/deco32.c | [
"Unlicense"
] | C | mixDualAlphaSprites | void | static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap)
{
running_machine *machine = gfx0->machine;
const pen_t *pens = machine->pens;
const pen_t *pal0 = &pens[gfx0->color_base];
const pen_t *pal1 = &pens[gfx1->color_base];
const pen_t *pal2 = &pens[machine->gfx[(deco32_pri&1) ? 1 : 2]->color_base];
int x,y;
/* Mix sprites into main bitmap, based on priority & alpha */
for (y=8; y<248; y++) {
UINT8* tilemapPri=BITMAP_ADDR8(machine->priority_bitmap, y, 0);
UINT16* sprite0=BITMAP_ADDR16(sprite0_mix_bitmap, y, 0);
UINT16* sprite1=BITMAP_ADDR16(sprite1_mix_bitmap, y, 0);
UINT32* destLine=BITMAP_ADDR32(bitmap, y, 0);
UINT16* alphaTilemap=BITMAP_ADDR16(tilemap_alpha_bitmap, y, 0);
for (x=0; x<320; x++) {
UINT16 priColAlphaPal0=sprite0[x];
UINT16 priColAlphaPal1=sprite1[x];
UINT16 pri0=(priColAlphaPal0&0x6000)>>13;
UINT16 pri1=(priColAlphaPal1&0x6000)>>13;
UINT16 col0=((priColAlphaPal0&0x1f00)>>8) % gfx0->total_colors;
UINT16 col1=((priColAlphaPal1&0x0f00)>>8) % gfx1->total_colors;
UINT16 alpha1=priColAlphaPal1&0x8000;
// Apply sprite bitmap 0 according to priority rules
if ((priColAlphaPal0&0xff)!=0)
{
/*
Sprite 0 priority rules:
0 = Sprite above all layers
1 = Sprite under top playfield
2 = Sprite under top two playfields
3 = Sprite under all playfields
*/
if ((pri0&0x3)==0 || (pri0&0x3)==1 || ((pri0&0x3)==2 && mixAlphaTilemap)) // Spri0 on top of everything, or under alpha playfield
{
destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0->color_granularity * col0)];
}
else if ((pri0&0x3)==2) // Spri0 under top playfield
{
if (tilemapPri[x]<4)
destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0->color_granularity * col0)];
}
else // Spri0 under top & middle playfields
{
if (tilemapPri[x]<2)
destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0->color_granularity * col0)];
}
}
// Apply sprite bitmap 1 according to priority rules
if ((priColAlphaPal1&0xff)!=0)
{
// Apply alpha for this pixel based on Ace setting
if (alpha1)
{
/*
Alpha rules:
Pri 0 - Over all tilemaps, but under sprite 0 pri 0, pri 1, pri 2
Pri 1 -
Pri 2 -
Pri 3 -
*/
/* Alpha values are tied to ACE ram... */
//int alpha=((deco32_ace_ram[0x0 + (((priColAlphaPal1&0xf0)>>4)/2)]) * 8)-1;
//if (alpha<0)
// alpha=0;
/* I don't really understand how object ACE ram is really hooked up,
the only obvious place in Night Slashers is the stagecoach in level 2 */
if (pri1==0 && (((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0 && (pri0&0x3)!=1 && (pri0&0x3)!=2))))
{
if ((deco32_pri&1)==0 || ((deco32_pri&1)==1 && tilemapPri[x]<4) || ((deco32_pri&1)==1 && mixAlphaTilemap))
destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)], 0x80);
}
else if (pri1==1 && ((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0 && (pri0&0x3)!=1 && (pri0&0x3)!=2)))
destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)], 0x80);
else if (pri1==2)// TOdo
destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)], 0x80);
else if (pri1==3)// TOdo
destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)], 0x80);
}
else
{
/*
Non alpha rules:
Pri 0 - Under sprite 0 pri 0, over all tilemaps
*/
if (pri1==0 && ((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0)))
destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)];
else if (pri1==1) // todo
destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)];
else if (pri1==2) // todo
destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)];
else if (pri1==3) // todo
destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)];
}
}
/* Optionally mix in alpha tilemap */
if (mixAlphaTilemap)
{
UINT16 p=alphaTilemap[x];
if (p&0xf)
{
/* Alpha tilemap under top two sprite 0 priorities */
if (((priColAlphaPal0&0xff)==0 || (pri0&0x3)==2 || (pri0&0x3)==3)
&& ((priColAlphaPal1&0xff)==0 || (pri1&0x3)==2 || (pri1&0x3)==3 || alpha1))
{
/* Alpha values are tied to ACE ram */
int alpha=((deco32_ace_ram[0x17 + (((p&0xf0)>>4)/2)]) * 8)-1;
if (alpha<0)
alpha=0;
destLine[x]=alpha_blend_r32(destLine[x], pal2[p], 255-alpha);
}
}
}
}
}
} | /*
This function mimics the priority PROM/circuit on the pcb. It takes
the tilemaps & sprite bitmaps as inputs, and outputs a final pixel
based on alpha & priority values. Rendering sprites to temporary
bitmaps is the only reasonable way to implement proper priority &
blending support - it can't be done in-place on the final framebuffer
without a lot of support bitmaps.
*/ | This function mimics the priority PROM/circuit on the pcb. It takes
the tilemaps & sprite bitmaps as inputs, and outputs a final pixel
based on alpha & priority values. Rendering sprites to temporary
bitmaps is the only reasonable way to implement proper priority &
blending support - it can't be done in-place on the final framebuffer
without a lot of support bitmaps. | [
"This",
"function",
"mimics",
"the",
"priority",
"PROM",
"/",
"circuit",
"on",
"the",
"pcb",
".",
"It",
"takes",
"the",
"tilemaps",
"&",
"sprite",
"bitmaps",
"as",
"inputs",
"and",
"outputs",
"a",
"final",
"pixel",
"based",
"on",
"alpha",
"&",
"priority",
"values",
".",
"Rendering",
"sprites",
"to",
"temporary",
"bitmaps",
"is",
"the",
"only",
"reasonable",
"way",
"to",
"implement",
"proper",
"priority",
"&",
"blending",
"support",
"-",
"it",
"can",
"'",
"t",
"be",
"done",
"in",
"-",
"place",
"on",
"the",
"final",
"framebuffer",
"without",
"a",
"lot",
"of",
"support",
"bitmaps",
"."
] | static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap)
{
running_machine *machine = gfx0->machine;
const pen_t *pens = machine->pens;
const pen_t *pal0 = &pens[gfx0->color_base];
const pen_t *pal1 = &pens[gfx1->color_base];
const pen_t *pal2 = &pens[machine->gfx[(deco32_pri&1) ? 1 : 2]->color_base];
int x,y;
for (y=8; y<248; y++) {
UINT8* tilemapPri=BITMAP_ADDR8(machine->priority_bitmap, y, 0);
UINT16* sprite0=BITMAP_ADDR16(sprite0_mix_bitmap, y, 0);
UINT16* sprite1=BITMAP_ADDR16(sprite1_mix_bitmap, y, 0);
UINT32* destLine=BITMAP_ADDR32(bitmap, y, 0);
UINT16* alphaTilemap=BITMAP_ADDR16(tilemap_alpha_bitmap, y, 0);
for (x=0; x<320; x++) {
UINT16 priColAlphaPal0=sprite0[x];
UINT16 priColAlphaPal1=sprite1[x];
UINT16 pri0=(priColAlphaPal0&0x6000)>>13;
UINT16 pri1=(priColAlphaPal1&0x6000)>>13;
UINT16 col0=((priColAlphaPal0&0x1f00)>>8) % gfx0->total_colors;
UINT16 col1=((priColAlphaPal1&0x0f00)>>8) % gfx1->total_colors;
UINT16 alpha1=priColAlphaPal1&0x8000;
if ((priColAlphaPal0&0xff)!=0)
{
if ((pri0&0x3)==0 || (pri0&0x3)==1 || ((pri0&0x3)==2 && mixAlphaTilemap))
{
destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0->color_granularity * col0)];
}
else if ((pri0&0x3)==2)
{
if (tilemapPri[x]<4)
destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0->color_granularity * col0)];
}
else
{
if (tilemapPri[x]<2)
destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0->color_granularity * col0)];
}
}
if ((priColAlphaPal1&0xff)!=0)
{
if (alpha1)
{
if (pri1==0 && (((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0 && (pri0&0x3)!=1 && (pri0&0x3)!=2))))
{
if ((deco32_pri&1)==0 || ((deco32_pri&1)==1 && tilemapPri[x]<4) || ((deco32_pri&1)==1 && mixAlphaTilemap))
destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)], 0x80);
}
else if (pri1==1 && ((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0 && (pri0&0x3)!=1 && (pri0&0x3)!=2)))
destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)], 0x80);
else if (pri1==2)
destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)], 0x80);
else if (pri1==3)
destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)], 0x80);
}
else
{
if (pri1==0 && ((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0)))
destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)];
else if (pri1==1)
destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)];
else if (pri1==2)
destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)];
else if (pri1==3)
destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1->color_granularity * col1)];
}
}
if (mixAlphaTilemap)
{
UINT16 p=alphaTilemap[x];
if (p&0xf)
{
if (((priColAlphaPal0&0xff)==0 || (pri0&0x3)==2 || (pri0&0x3)==3)
&& ((priColAlphaPal1&0xff)==0 || (pri1&0x3)==2 || (pri1&0x3)==3 || alpha1))
{
int alpha=((deco32_ace_ram[0x17 + (((p&0xf0)>>4)/2)]) * 8)-1;
if (alpha<0)
alpha=0;
destLine[x]=alpha_blend_r32(destLine[x], pal2[p], 255-alpha);
}
}
}
}
}
} | [
"static",
"void",
"mixDualAlphaSprites",
"(",
"bitmap_t",
"*",
"bitmap",
",",
"const",
"rectangle",
"*",
"cliprect",
",",
"const",
"gfx_element",
"*",
"gfx0",
",",
"const",
"gfx_element",
"*",
"gfx1",
",",
"int",
"mixAlphaTilemap",
")",
"{",
"running_machine",
"*",
"machine",
"=",
"gfx0",
"->",
"machine",
";",
"const",
"pen_t",
"*",
"pens",
"=",
"machine",
"->",
"pens",
";",
"const",
"pen_t",
"*",
"pal0",
"=",
"&",
"pens",
"[",
"gfx0",
"->",
"color_base",
"]",
";",
"const",
"pen_t",
"*",
"pal1",
"=",
"&",
"pens",
"[",
"gfx1",
"->",
"color_base",
"]",
";",
"const",
"pen_t",
"*",
"pal2",
"=",
"&",
"pens",
"[",
"machine",
"->",
"gfx",
"[",
"(",
"deco32_pri",
"&",
"1",
")",
"?",
"1",
":",
"2",
"]",
"->",
"color_base",
"]",
";",
"int",
"x",
",",
"y",
";",
"for",
"(",
"y",
"=",
"8",
";",
"y",
"<",
"248",
";",
"y",
"++",
")",
"{",
"UINT8",
"*",
"tilemapPri",
"=",
"BITMAP_ADDR8",
"(",
"machine",
"->",
"priority_bitmap",
",",
"y",
",",
"0",
")",
";",
"UINT16",
"*",
"sprite0",
"=",
"BITMAP_ADDR16",
"(",
"sprite0_mix_bitmap",
",",
"y",
",",
"0",
")",
";",
"UINT16",
"*",
"sprite1",
"=",
"BITMAP_ADDR16",
"(",
"sprite1_mix_bitmap",
",",
"y",
",",
"0",
")",
";",
"UINT32",
"*",
"destLine",
"=",
"BITMAP_ADDR32",
"(",
"bitmap",
",",
"y",
",",
"0",
")",
";",
"UINT16",
"*",
"alphaTilemap",
"=",
"BITMAP_ADDR16",
"(",
"tilemap_alpha_bitmap",
",",
"y",
",",
"0",
")",
";",
"for",
"(",
"x",
"=",
"0",
";",
"x",
"<",
"320",
";",
"x",
"++",
")",
"{",
"UINT16",
"priColAlphaPal0",
"=",
"sprite0",
"[",
"x",
"]",
";",
"UINT16",
"priColAlphaPal1",
"=",
"sprite1",
"[",
"x",
"]",
";",
"UINT16",
"pri0",
"=",
"(",
"priColAlphaPal0",
"&",
"0x6000",
")",
">>",
"13",
";",
"UINT16",
"pri1",
"=",
"(",
"priColAlphaPal1",
"&",
"0x6000",
")",
">>",
"13",
";",
"UINT16",
"col0",
"=",
"(",
"(",
"priColAlphaPal0",
"&",
"0x1f00",
")",
">>",
"8",
")",
"%",
"gfx0",
"->",
"total_colors",
";",
"UINT16",
"col1",
"=",
"(",
"(",
"priColAlphaPal1",
"&",
"0x0f00",
")",
">>",
"8",
")",
"%",
"gfx1",
"->",
"total_colors",
";",
"UINT16",
"alpha1",
"=",
"priColAlphaPal1",
"&",
"0x8000",
";",
"if",
"(",
"(",
"priColAlphaPal0",
"&",
"0xff",
")",
"!=",
"0",
")",
"{",
"if",
"(",
"(",
"pri0",
"&",
"0x3",
")",
"==",
"0",
"||",
"(",
"pri0",
"&",
"0x3",
")",
"==",
"1",
"||",
"(",
"(",
"pri0",
"&",
"0x3",
")",
"==",
"2",
"&&",
"mixAlphaTilemap",
")",
")",
"{",
"destLine",
"[",
"x",
"]",
"=",
"pal0",
"[",
"(",
"priColAlphaPal0",
"&",
"0xff",
")",
"+",
"(",
"gfx0",
"->",
"color_granularity",
"*",
"col0",
")",
"]",
";",
"}",
"else",
"if",
"(",
"(",
"pri0",
"&",
"0x3",
")",
"==",
"2",
")",
"{",
"if",
"(",
"tilemapPri",
"[",
"x",
"]",
"<",
"4",
")",
"destLine",
"[",
"x",
"]",
"=",
"pal0",
"[",
"(",
"priColAlphaPal0",
"&",
"0xff",
")",
"+",
"(",
"gfx0",
"->",
"color_granularity",
"*",
"col0",
")",
"]",
";",
"}",
"else",
"{",
"if",
"(",
"tilemapPri",
"[",
"x",
"]",
"<",
"2",
")",
"destLine",
"[",
"x",
"]",
"=",
"pal0",
"[",
"(",
"priColAlphaPal0",
"&",
"0xff",
")",
"+",
"(",
"gfx0",
"->",
"color_granularity",
"*",
"col0",
")",
"]",
";",
"}",
"}",
"if",
"(",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"!=",
"0",
")",
"{",
"if",
"(",
"alpha1",
")",
"{",
"if",
"(",
"pri1",
"==",
"0",
"&&",
"(",
"(",
"(",
"priColAlphaPal0",
"&",
"0xff",
")",
"==",
"0",
"||",
"(",
"(",
"pri0",
"&",
"0x3",
")",
"!=",
"0",
"&&",
"(",
"pri0",
"&",
"0x3",
")",
"!=",
"1",
"&&",
"(",
"pri0",
"&",
"0x3",
")",
"!=",
"2",
")",
")",
")",
")",
"{",
"if",
"(",
"(",
"deco32_pri",
"&",
"1",
")",
"==",
"0",
"||",
"(",
"(",
"deco32_pri",
"&",
"1",
")",
"==",
"1",
"&&",
"tilemapPri",
"[",
"x",
"]",
"<",
"4",
")",
"||",
"(",
"(",
"deco32_pri",
"&",
"1",
")",
"==",
"1",
"&&",
"mixAlphaTilemap",
")",
")",
"destLine",
"[",
"x",
"]",
"=",
"alpha_blend_r32",
"(",
"destLine",
"[",
"x",
"]",
",",
"pal1",
"[",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"+",
"(",
"gfx1",
"->",
"color_granularity",
"*",
"col1",
")",
"]",
",",
"0x80",
")",
";",
"}",
"else",
"if",
"(",
"pri1",
"==",
"1",
"&&",
"(",
"(",
"priColAlphaPal0",
"&",
"0xff",
")",
"==",
"0",
"||",
"(",
"(",
"pri0",
"&",
"0x3",
")",
"!=",
"0",
"&&",
"(",
"pri0",
"&",
"0x3",
")",
"!=",
"1",
"&&",
"(",
"pri0",
"&",
"0x3",
")",
"!=",
"2",
")",
")",
")",
"destLine",
"[",
"x",
"]",
"=",
"alpha_blend_r32",
"(",
"destLine",
"[",
"x",
"]",
",",
"pal1",
"[",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"+",
"(",
"gfx1",
"->",
"color_granularity",
"*",
"col1",
")",
"]",
",",
"0x80",
")",
";",
"else",
"if",
"(",
"pri1",
"==",
"2",
")",
"destLine",
"[",
"x",
"]",
"=",
"alpha_blend_r32",
"(",
"destLine",
"[",
"x",
"]",
",",
"pal1",
"[",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"+",
"(",
"gfx1",
"->",
"color_granularity",
"*",
"col1",
")",
"]",
",",
"0x80",
")",
";",
"else",
"if",
"(",
"pri1",
"==",
"3",
")",
"destLine",
"[",
"x",
"]",
"=",
"alpha_blend_r32",
"(",
"destLine",
"[",
"x",
"]",
",",
"pal1",
"[",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"+",
"(",
"gfx1",
"->",
"color_granularity",
"*",
"col1",
")",
"]",
",",
"0x80",
")",
";",
"}",
"else",
"{",
"if",
"(",
"pri1",
"==",
"0",
"&&",
"(",
"(",
"priColAlphaPal0",
"&",
"0xff",
")",
"==",
"0",
"||",
"(",
"(",
"pri0",
"&",
"0x3",
")",
"!=",
"0",
")",
")",
")",
"destLine",
"[",
"x",
"]",
"=",
"pal1",
"[",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"+",
"(",
"gfx1",
"->",
"color_granularity",
"*",
"col1",
")",
"]",
";",
"else",
"if",
"(",
"pri1",
"==",
"1",
")",
"destLine",
"[",
"x",
"]",
"=",
"pal1",
"[",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"+",
"(",
"gfx1",
"->",
"color_granularity",
"*",
"col1",
")",
"]",
";",
"else",
"if",
"(",
"pri1",
"==",
"2",
")",
"destLine",
"[",
"x",
"]",
"=",
"pal1",
"[",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"+",
"(",
"gfx1",
"->",
"color_granularity",
"*",
"col1",
")",
"]",
";",
"else",
"if",
"(",
"pri1",
"==",
"3",
")",
"destLine",
"[",
"x",
"]",
"=",
"pal1",
"[",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"+",
"(",
"gfx1",
"->",
"color_granularity",
"*",
"col1",
")",
"]",
";",
"}",
"}",
"if",
"(",
"mixAlphaTilemap",
")",
"{",
"UINT16",
"p",
"=",
"alphaTilemap",
"[",
"x",
"]",
";",
"if",
"(",
"p",
"&",
"0xf",
")",
"{",
"if",
"(",
"(",
"(",
"priColAlphaPal0",
"&",
"0xff",
")",
"==",
"0",
"||",
"(",
"pri0",
"&",
"0x3",
")",
"==",
"2",
"||",
"(",
"pri0",
"&",
"0x3",
")",
"==",
"3",
")",
"&&",
"(",
"(",
"priColAlphaPal1",
"&",
"0xff",
")",
"==",
"0",
"||",
"(",
"pri1",
"&",
"0x3",
")",
"==",
"2",
"||",
"(",
"pri1",
"&",
"0x3",
")",
"==",
"3",
"||",
"alpha1",
")",
")",
"{",
"int",
"alpha",
"=",
"(",
"(",
"deco32_ace_ram",
"[",
"0x17",
"+",
"(",
"(",
"(",
"p",
"&",
"0xf0",
")",
">>",
"4",
")",
"/",
"2",
")",
"]",
")",
"*",
"8",
")",
"-",
"1",
";",
"if",
"(",
"alpha",
"<",
"0",
")",
"alpha",
"=",
"0",
";",
"destLine",
"[",
"x",
"]",
"=",
"alpha_blend_r32",
"(",
"destLine",
"[",
"x",
"]",
",",
"pal2",
"[",
"p",
"]",
",",
"255",
"-",
"alpha",
")",
";",
"}",
"}",
"}",
"}",
"}",
"}"
] | This function mimics the priority PROM/circuit on the pcb. | [
"This",
"function",
"mimics",
"the",
"priority",
"PROM",
"/",
"circuit",
"on",
"the",
"pcb",
"."
] | [
"/* Mix sprites into main bitmap, based on priority & alpha */",
"// Apply sprite bitmap 0 according to priority rules",
"/*\n Sprite 0 priority rules:\n\n 0 = Sprite above all layers\n 1 = Sprite under top playfield\n 2 = Sprite under top two playfields\n 3 = Sprite under all playfields\n */",
"// Spri0 on top of everything, or under alpha playfield",
"// Spri0 under top playfield",
"// Spri0 under top & middle playfields",
"// Apply sprite bitmap 1 according to priority rules",
"// Apply alpha for this pixel based on Ace setting",
"/*\n Alpha rules:\n\n Pri 0 - Over all tilemaps, but under sprite 0 pri 0, pri 1, pri 2\n Pri 1 -\n Pri 2 -\n Pri 3 -\n */",
"/* Alpha values are tied to ACE ram... */",
"//int alpha=((deco32_ace_ram[0x0 + (((priColAlphaPal1&0xf0)>>4)/2)]) * 8)-1;",
"//if (alpha<0)",
"// alpha=0;",
"/* I don't really understand how object ACE ram is really hooked up,\n the only obvious place in Night Slashers is the stagecoach in level 2 */",
"// TOdo",
"// TOdo",
"/*\n Non alpha rules:\n\n Pri 0 - Under sprite 0 pri 0, over all tilemaps\n */",
"// todo",
"// todo",
"// todo",
"/* Optionally mix in alpha tilemap */",
"/* Alpha tilemap under top two sprite 0 priorities */",
"/* Alpha values are tied to ACE ram */"
] | [
{
"param": "bitmap",
"type": "bitmap_t"
},
{
"param": "cliprect",
"type": "rectangle"
},
{
"param": "gfx0",
"type": "gfx_element"
},
{
"param": "gfx1",
"type": "gfx_element"
},
{
"param": "mixAlphaTilemap",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bitmap",
"type": "bitmap_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cliprect",
"type": "rectangle",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "gfx0",
"type": "gfx_element",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "gfx1",
"type": "gfx_element",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "mixAlphaTilemap",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c8db1add06462226a9cd2274868d2006f4b47b75 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbec.c | [
"Unlicense"
] | C | drcbec_reset | void | static void drcbec_reset(drcbe_state *drcbe)
{
/* reset our hash tables */
drchash_reset(drcbe->hash);
drchash_set_default_codeptr(drcbe->hash, NULL);
} | /*-------------------------------------------------
drcbec_reset - reset back-end specific state
-------------------------------------------------*/ | reset back-end specific state | [
"reset",
"back",
"-",
"end",
"specific",
"state"
] | static void drcbec_reset(drcbe_state *drcbe)
{
drchash_reset(drcbe->hash);
drchash_set_default_codeptr(drcbe->hash, NULL);
} | [
"static",
"void",
"drcbec_reset",
"(",
"drcbe_state",
"*",
"drcbe",
")",
"{",
"drchash_reset",
"(",
"drcbe",
"->",
"hash",
")",
";",
"drchash_set_default_codeptr",
"(",
"drcbe",
"->",
"hash",
",",
"NULL",
")",
";",
"}"
] | drcbec_reset - reset back-end specific state | [
"drcbec_reset",
"-",
"reset",
"back",
"-",
"end",
"specific",
"state"
] | [
"/* reset our hash tables */"
] | [
{
"param": "drcbe",
"type": "drcbe_state"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "drcbe",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c8db1add06462226a9cd2274868d2006f4b47b75 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbec.c | [
"Unlicense"
] | C | drcbec_get_info | void | static void drcbec_get_info(drcbe_state *state, drcbe_info *info)
{
info->direct_iregs = 0;
info->direct_fregs = 0;
} | /*-------------------------------------------------
drcbec_get_info - return information about
the back-end implementation
-------------------------------------------------*/ | return information about
the back-end implementation | [
"return",
"information",
"about",
"the",
"back",
"-",
"end",
"implementation"
] | static void drcbec_get_info(drcbe_state *state, drcbe_info *info)
{
info->direct_iregs = 0;
info->direct_fregs = 0;
} | [
"static",
"void",
"drcbec_get_info",
"(",
"drcbe_state",
"*",
"state",
",",
"drcbe_info",
"*",
"info",
")",
"{",
"info",
"->",
"direct_iregs",
"=",
"0",
";",
"info",
"->",
"direct_fregs",
"=",
"0",
";",
"}"
] | drcbec_get_info - return information about
the back-end implementation | [
"drcbec_get_info",
"-",
"return",
"information",
"about",
"the",
"back",
"-",
"end",
"implementation"
] | [] | [
{
"param": "state",
"type": "drcbe_state"
},
{
"param": "info",
"type": "drcbe_info"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "state",
"type": "drcbe_state",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "info",
"type": "drcbe_info",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c8db1add06462226a9cd2274868d2006f4b47b75 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbec.c | [
"Unlicense"
] | C | fixup_label | void | static void fixup_label(void *parameter, drccodeptr labelcodeptr)
{
drcbec_instruction *dst = (drcbec_instruction *)parameter;
dst->inst = (drcbec_instruction *)labelcodeptr;
} | /*-------------------------------------------------
fixup_label - callback to fixup forward-
referenced labels
-------------------------------------------------*/ | callback to fixup forward
referenced labels | [
"callback",
"to",
"fixup",
"forward",
"referenced",
"labels"
] | static void fixup_label(void *parameter, drccodeptr labelcodeptr)
{
drcbec_instruction *dst = (drcbec_instruction *)parameter;
dst->inst = (drcbec_instruction *)labelcodeptr;
} | [
"static",
"void",
"fixup_label",
"(",
"void",
"*",
"parameter",
",",
"drccodeptr",
"labelcodeptr",
")",
"{",
"drcbec_instruction",
"*",
"dst",
"=",
"(",
"drcbec_instruction",
"*",
")",
"parameter",
";",
"dst",
"->",
"inst",
"=",
"(",
"drcbec_instruction",
"*",
")",
"labelcodeptr",
";",
"}"
] | fixup_label - callback to fixup forward
referenced labels | [
"fixup_label",
"-",
"callback",
"to",
"fixup",
"forward",
"referenced",
"labels"
] | [] | [
{
"param": "parameter",
"type": "void"
},
{
"param": "labelcodeptr",
"type": "drccodeptr"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "parameter",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "labelcodeptr",
"type": "drccodeptr",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c8db1add06462226a9cd2274868d2006f4b47b75 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbec.c | [
"Unlicense"
] | C | dmulu | int | static int dmulu(UINT64 *dstlo, UINT64 *dsthi, UINT64 src1, UINT64 src2, int flags)
{
UINT64 lo, hi, prevlo;
UINT64 a, b, temp;
/* shortcut if we don't care about the high bits or the flags */
if (dstlo == dsthi && flags == 0)
{
*dstlo = src1 * src2;
return 0;
}
/* fetch source values */
a = src1;
b = src2;
if (a == 0 || b == 0)
{
*dsthi = *dstlo = 0;
return DRCUML_FLAG_Z;
}
/* compute high and low parts first */
lo = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 0);
hi = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 32);
/* compute middle parts */
prevlo = lo;
temp = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 0);
lo += temp << 32;
hi += (temp >> 32) + (lo < prevlo);
prevlo = lo;
temp = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 32);
lo += temp << 32;
hi += (temp >> 32) + (lo < prevlo);
/* store the results */
*dsthi = hi;
*dstlo = lo;
return ((hi >> 60) & DRCUML_FLAG_S) | ((*dsthi != 0) << 1);
} | /*-------------------------------------------------
dmulu - perform a double-wide unsigned multiply
-------------------------------------------------*/ | perform a double-wide unsigned multiply | [
"perform",
"a",
"double",
"-",
"wide",
"unsigned",
"multiply"
] | static int dmulu(UINT64 *dstlo, UINT64 *dsthi, UINT64 src1, UINT64 src2, int flags)
{
UINT64 lo, hi, prevlo;
UINT64 a, b, temp;
if (dstlo == dsthi && flags == 0)
{
*dstlo = src1 * src2;
return 0;
}
a = src1;
b = src2;
if (a == 0 || b == 0)
{
*dsthi = *dstlo = 0;
return DRCUML_FLAG_Z;
}
lo = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 0);
hi = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 32);
prevlo = lo;
temp = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 0);
lo += temp << 32;
hi += (temp >> 32) + (lo < prevlo);
prevlo = lo;
temp = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 32);
lo += temp << 32;
hi += (temp >> 32) + (lo < prevlo);
*dsthi = hi;
*dstlo = lo;
return ((hi >> 60) & DRCUML_FLAG_S) | ((*dsthi != 0) << 1);
} | [
"static",
"int",
"dmulu",
"(",
"UINT64",
"*",
"dstlo",
",",
"UINT64",
"*",
"dsthi",
",",
"UINT64",
"src1",
",",
"UINT64",
"src2",
",",
"int",
"flags",
")",
"{",
"UINT64",
"lo",
",",
"hi",
",",
"prevlo",
";",
"UINT64",
"a",
",",
"b",
",",
"temp",
";",
"if",
"(",
"dstlo",
"==",
"dsthi",
"&&",
"flags",
"==",
"0",
")",
"{",
"*",
"dstlo",
"=",
"src1",
"*",
"src2",
";",
"return",
"0",
";",
"}",
"a",
"=",
"src1",
";",
"b",
"=",
"src2",
";",
"if",
"(",
"a",
"==",
"0",
"||",
"b",
"==",
"0",
")",
"{",
"*",
"dsthi",
"=",
"*",
"dstlo",
"=",
"0",
";",
"return",
"DRCUML_FLAG_Z",
";",
"}",
"lo",
"=",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"a",
">>",
"0",
")",
"*",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"b",
">>",
"0",
")",
";",
"hi",
"=",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"a",
">>",
"32",
")",
"*",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"b",
">>",
"32",
")",
";",
"prevlo",
"=",
"lo",
";",
"temp",
"=",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"a",
">>",
"32",
")",
"*",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"b",
">>",
"0",
")",
";",
"lo",
"+=",
"temp",
"<<",
"32",
";",
"hi",
"+=",
"(",
"temp",
">>",
"32",
")",
"+",
"(",
"lo",
"<",
"prevlo",
")",
";",
"prevlo",
"=",
"lo",
";",
"temp",
"=",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"a",
">>",
"0",
")",
"*",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"b",
">>",
"32",
")",
";",
"lo",
"+=",
"temp",
"<<",
"32",
";",
"hi",
"+=",
"(",
"temp",
">>",
"32",
")",
"+",
"(",
"lo",
"<",
"prevlo",
")",
";",
"*",
"dsthi",
"=",
"hi",
";",
"*",
"dstlo",
"=",
"lo",
";",
"return",
"(",
"(",
"hi",
">>",
"60",
")",
"&",
"DRCUML_FLAG_S",
")",
"|",
"(",
"(",
"*",
"dsthi",
"!=",
"0",
")",
"<<",
"1",
")",
";",
"}"
] | dmulu - perform a double-wide unsigned multiply | [
"dmulu",
"-",
"perform",
"a",
"double",
"-",
"wide",
"unsigned",
"multiply"
] | [
"/* shortcut if we don't care about the high bits or the flags */",
"/* fetch source values */",
"/* compute high and low parts first */",
"/* compute middle parts */",
"/* store the results */"
] | [
{
"param": "dstlo",
"type": "UINT64"
},
{
"param": "dsthi",
"type": "UINT64"
},
{
"param": "src1",
"type": "UINT64"
},
{
"param": "src2",
"type": "UINT64"
},
{
"param": "flags",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dstlo",
"type": "UINT64",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dsthi",
"type": "UINT64",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "src1",
"type": "UINT64",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "src2",
"type": "UINT64",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "flags",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c8db1add06462226a9cd2274868d2006f4b47b75 | lofunz/mieme | Reloaded/trunk/src/emu/cpu/drcbec.c | [
"Unlicense"
] | C | dmuls | int | static int dmuls(UINT64 *dstlo, UINT64 *dsthi, INT64 src1, INT64 src2, int flags)
{
UINT64 lo, hi, prevlo;
UINT64 a, b, temp;
/* shortcut if we don't care about the high bits or the flags */
if (dstlo == dsthi && flags == 0)
{
*dstlo = src1 * src2;
return 0;
}
/* fetch absolute source values */
a = src1; if ((INT64)a < 0) a = -a;
b = src2; if ((INT64)b < 0) b = -b;
if (a == 0 || b == 0)
{
*dsthi = *dstlo = 0;
return DRCUML_FLAG_Z;
}
/* compute high and low parts first */
lo = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 0);
hi = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 32);
/* compute middle parts */
prevlo = lo;
temp = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 0);
lo += temp << 32;
hi += (temp >> 32) + (lo < prevlo);
prevlo = lo;
temp = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 32);
lo += temp << 32;
hi += (temp >> 32) + (lo < prevlo);
/* adjust for signage */
if ((INT64)(src1 ^ src2) < 0)
{
hi = ~hi + (lo == 0);
lo = ~lo + 1;
}
/* store the results */
*dsthi = hi;
*dstlo = lo;
return ((hi >> 60) & DRCUML_FLAG_S) | ((*dsthi != ((INT64)lo >> 63)) << 1);
} | /*-------------------------------------------------
dmuls - perform a double-wide signed multiply
-------------------------------------------------*/ | perform a double-wide signed multiply | [
"perform",
"a",
"double",
"-",
"wide",
"signed",
"multiply"
] | static int dmuls(UINT64 *dstlo, UINT64 *dsthi, INT64 src1, INT64 src2, int flags)
{
UINT64 lo, hi, prevlo;
UINT64 a, b, temp;
if (dstlo == dsthi && flags == 0)
{
*dstlo = src1 * src2;
return 0;
}
a = src1; if ((INT64)a < 0) a = -a;
b = src2; if ((INT64)b < 0) b = -b;
if (a == 0 || b == 0)
{
*dsthi = *dstlo = 0;
return DRCUML_FLAG_Z;
}
lo = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 0);
hi = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 32);
prevlo = lo;
temp = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 0);
lo += temp << 32;
hi += (temp >> 32) + (lo < prevlo);
prevlo = lo;
temp = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 32);
lo += temp << 32;
hi += (temp >> 32) + (lo < prevlo);
if ((INT64)(src1 ^ src2) < 0)
{
hi = ~hi + (lo == 0);
lo = ~lo + 1;
}
*dsthi = hi;
*dstlo = lo;
return ((hi >> 60) & DRCUML_FLAG_S) | ((*dsthi != ((INT64)lo >> 63)) << 1);
} | [
"static",
"int",
"dmuls",
"(",
"UINT64",
"*",
"dstlo",
",",
"UINT64",
"*",
"dsthi",
",",
"INT64",
"src1",
",",
"INT64",
"src2",
",",
"int",
"flags",
")",
"{",
"UINT64",
"lo",
",",
"hi",
",",
"prevlo",
";",
"UINT64",
"a",
",",
"b",
",",
"temp",
";",
"if",
"(",
"dstlo",
"==",
"dsthi",
"&&",
"flags",
"==",
"0",
")",
"{",
"*",
"dstlo",
"=",
"src1",
"*",
"src2",
";",
"return",
"0",
";",
"}",
"a",
"=",
"src1",
";",
"if",
"(",
"(",
"INT64",
")",
"a",
"<",
"0",
")",
"a",
"=",
"-",
"a",
";",
"b",
"=",
"src2",
";",
"if",
"(",
"(",
"INT64",
")",
"b",
"<",
"0",
")",
"b",
"=",
"-",
"b",
";",
"if",
"(",
"a",
"==",
"0",
"||",
"b",
"==",
"0",
")",
"{",
"*",
"dsthi",
"=",
"*",
"dstlo",
"=",
"0",
";",
"return",
"DRCUML_FLAG_Z",
";",
"}",
"lo",
"=",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"a",
">>",
"0",
")",
"*",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"b",
">>",
"0",
")",
";",
"hi",
"=",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"a",
">>",
"32",
")",
"*",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"b",
">>",
"32",
")",
";",
"prevlo",
"=",
"lo",
";",
"temp",
"=",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"a",
">>",
"32",
")",
"*",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"b",
">>",
"0",
")",
";",
"lo",
"+=",
"temp",
"<<",
"32",
";",
"hi",
"+=",
"(",
"temp",
">>",
"32",
")",
"+",
"(",
"lo",
"<",
"prevlo",
")",
";",
"prevlo",
"=",
"lo",
";",
"temp",
"=",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"a",
">>",
"0",
")",
"*",
"(",
"UINT64",
")",
"(",
"UINT32",
")",
"(",
"b",
">>",
"32",
")",
";",
"lo",
"+=",
"temp",
"<<",
"32",
";",
"hi",
"+=",
"(",
"temp",
">>",
"32",
")",
"+",
"(",
"lo",
"<",
"prevlo",
")",
";",
"if",
"(",
"(",
"INT64",
")",
"(",
"src1",
"^",
"src2",
")",
"<",
"0",
")",
"{",
"hi",
"=",
"~",
"hi",
"+",
"(",
"lo",
"==",
"0",
")",
";",
"lo",
"=",
"~",
"lo",
"+",
"1",
";",
"}",
"*",
"dsthi",
"=",
"hi",
";",
"*",
"dstlo",
"=",
"lo",
";",
"return",
"(",
"(",
"hi",
">>",
"60",
")",
"&",
"DRCUML_FLAG_S",
")",
"|",
"(",
"(",
"*",
"dsthi",
"!=",
"(",
"(",
"INT64",
")",
"lo",
">>",
"63",
")",
")",
"<<",
"1",
")",
";",
"}"
] | dmuls - perform a double-wide signed multiply | [
"dmuls",
"-",
"perform",
"a",
"double",
"-",
"wide",
"signed",
"multiply"
] | [
"/* shortcut if we don't care about the high bits or the flags */",
"/* fetch absolute source values */",
"/* compute high and low parts first */",
"/* compute middle parts */",
"/* adjust for signage */",
"/* store the results */"
] | [
{
"param": "dstlo",
"type": "UINT64"
},
{
"param": "dsthi",
"type": "UINT64"
},
{
"param": "src1",
"type": "INT64"
},
{
"param": "src2",
"type": "INT64"
},
{
"param": "flags",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dstlo",
"type": "UINT64",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dsthi",
"type": "UINT64",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "src1",
"type": "INT64",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "src2",
"type": "INT64",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "flags",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | debug_command_parameter_cpu | int | int debug_command_parameter_cpu(running_machine *machine, const char *param, device_t **result)
{
UINT64 cpunum;
EXPRERR err;
/* if no parameter, use the visible CPU */
if (param == NULL)
{
*result = debug_cpu_get_visible_cpu(machine);
if (*result == NULL)
{
debug_console_printf(machine, "No valid CPU is currently selected\n");
return FALSE;
}
return TRUE;
}
/* first look for a tag match */
*result = machine->device(param);
if (*result != NULL)
return TRUE;
/* then evaluate as an expression; on an error assume it was a tag */
err = expression_evaluate(param, debug_cpu_get_visible_symtable(machine), &debug_expression_callbacks, machine, &cpunum);
if (err != EXPRERR_NONE)
{
debug_console_printf(machine, "Unable to find CPU '%s'\n", param);
return FALSE;
}
/* if we got a valid one, return */
device_execute_interface *exec = NULL;
for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (cpunum-- == 0)
{
*result = &exec->device();
return TRUE;
}
/* if out of range, complain */
debug_console_printf(machine, "Invalid CPU index %d\n", (UINT32)cpunum);
return FALSE;
} | /*-------------------------------------------------
debug_command_parameter_cpu - validates a
parameter as a cpu
-------------------------------------------------*/ | validates a
parameter as a cpu | [
"validates",
"a",
"parameter",
"as",
"a",
"cpu"
] | int debug_command_parameter_cpu(running_machine *machine, const char *param, device_t **result)
{
UINT64 cpunum;
EXPRERR err;
if (param == NULL)
{
*result = debug_cpu_get_visible_cpu(machine);
if (*result == NULL)
{
debug_console_printf(machine, "No valid CPU is currently selected\n");
return FALSE;
}
return TRUE;
}
*result = machine->device(param);
if (*result != NULL)
return TRUE;
err = expression_evaluate(param, debug_cpu_get_visible_symtable(machine), &debug_expression_callbacks, machine, &cpunum);
if (err != EXPRERR_NONE)
{
debug_console_printf(machine, "Unable to find CPU '%s'\n", param);
return FALSE;
}
device_execute_interface *exec = NULL;
for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (cpunum-- == 0)
{
*result = &exec->device();
return TRUE;
}
debug_console_printf(machine, "Invalid CPU index %d\n", (UINT32)cpunum);
return FALSE;
} | [
"int",
"debug_command_parameter_cpu",
"(",
"running_machine",
"*",
"machine",
",",
"const",
"char",
"*",
"param",
",",
"device_t",
"*",
"*",
"result",
")",
"{",
"UINT64",
"cpunum",
";",
"EXPRERR",
"err",
";",
"if",
"(",
"param",
"==",
"NULL",
")",
"{",
"*",
"result",
"=",
"debug_cpu_get_visible_cpu",
"(",
"machine",
")",
";",
"if",
"(",
"*",
"result",
"==",
"NULL",
")",
"{",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
")",
";",
"return",
"FALSE",
";",
"}",
"return",
"TRUE",
";",
"}",
"*",
"result",
"=",
"machine",
"->",
"device",
"(",
"param",
")",
";",
"if",
"(",
"*",
"result",
"!=",
"NULL",
")",
"return",
"TRUE",
";",
"err",
"=",
"expression_evaluate",
"(",
"param",
",",
"debug_cpu_get_visible_symtable",
"(",
"machine",
")",
",",
"&",
"debug_expression_callbacks",
",",
"machine",
",",
"&",
"cpunum",
")",
";",
"if",
"(",
"err",
"!=",
"EXPRERR_NONE",
")",
"{",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"param",
")",
";",
"return",
"FALSE",
";",
"}",
"device_execute_interface",
"*",
"exec",
"=",
"NULL",
";",
"for",
"(",
"bool",
"gotone",
"=",
"machine",
"->",
"m_devicelist",
".",
"first",
"(",
"exec",
")",
";",
"gotone",
";",
"gotone",
"=",
"exec",
"->",
"next",
"(",
"exec",
")",
")",
"if",
"(",
"cpunum",
"--",
"==",
"0",
")",
"{",
"*",
"result",
"=",
"&",
"exec",
"->",
"device",
"(",
")",
";",
"return",
"TRUE",
";",
"}",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"(",
"UINT32",
")",
"cpunum",
")",
";",
"return",
"FALSE",
";",
"}"
] | debug_command_parameter_cpu - validates a
parameter as a cpu | [
"debug_command_parameter_cpu",
"-",
"validates",
"a",
"parameter",
"as",
"a",
"cpu"
] | [
"/* if no parameter, use the visible CPU */",
"/* first look for a tag match */",
"/* then evaluate as an expression; on an error assume it was a tag */",
"/* if we got a valid one, return */",
"/* if out of range, complain */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "param",
"type": "char"
},
{
"param": "result",
"type": "device_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "result",
"type": "device_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | debug_command_parameter_cpu_space | int | int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, const address_space **result)
{
device_t *cpu;
/* first do the standard CPU thing */
if (!debug_command_parameter_cpu(machine, param, &cpu))
return FALSE;
/* fetch the space pointer */
*result = cpu_get_address_space(cpu, spacenum);
if (*result == NULL)
{
debug_console_printf(machine, "No matching memory space found for CPU '%s'\n", cpu->tag());
return FALSE;
}
return TRUE;
} | /*-------------------------------------------------
debug_command_parameter_cpu_space - validates
a parameter as a cpu and retrieves the given
address space
-------------------------------------------------*/ | validates
a parameter as a cpu and retrieves the given
address space | [
"validates",
"a",
"parameter",
"as",
"a",
"cpu",
"and",
"retrieves",
"the",
"given",
"address",
"space"
] | int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, const address_space **result)
{
device_t *cpu;
if (!debug_command_parameter_cpu(machine, param, &cpu))
return FALSE;
*result = cpu_get_address_space(cpu, spacenum);
if (*result == NULL)
{
debug_console_printf(machine, "No matching memory space found for CPU '%s'\n", cpu->tag());
return FALSE;
}
return TRUE;
} | [
"int",
"debug_command_parameter_cpu_space",
"(",
"running_machine",
"*",
"machine",
",",
"const",
"char",
"*",
"param",
",",
"int",
"spacenum",
",",
"const",
"address_space",
"*",
"*",
"result",
")",
"{",
"device_t",
"*",
"cpu",
";",
"if",
"(",
"!",
"debug_command_parameter_cpu",
"(",
"machine",
",",
"param",
",",
"&",
"cpu",
")",
")",
"return",
"FALSE",
";",
"*",
"result",
"=",
"cpu_get_address_space",
"(",
"cpu",
",",
"spacenum",
")",
";",
"if",
"(",
"*",
"result",
"==",
"NULL",
")",
"{",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"cpu",
"->",
"tag",
"(",
")",
")",
";",
"return",
"FALSE",
";",
"}",
"return",
"TRUE",
";",
"}"
] | debug_command_parameter_cpu_space - validates
a parameter as a cpu and retrieves the given
address space | [
"debug_command_parameter_cpu_space",
"-",
"validates",
"a",
"parameter",
"as",
"a",
"cpu",
"and",
"retrieves",
"the",
"given",
"address",
"space"
] | [
"/* first do the standard CPU thing */",
"/* fetch the space pointer */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "param",
"type": "char"
},
{
"param": "spacenum",
"type": "int"
},
{
"param": "result",
"type": "address_space"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "spacenum",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "result",
"type": "address_space",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | execute_comment | void | static void execute_comment(running_machine *machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
/* param 1 is the address for the comment */
if (!debug_command_parameter_number(machine, param[0], &address))
return;
/* CPU parameter is implicit */
if (!debug_command_parameter_cpu(machine, NULL, &cpu))
return;
/* make sure param 2 exists */
if (strlen(param[1]) == 0)
{
debug_console_printf(machine, "Error : comment text empty\n");
return;
}
/* Now try adding the comment */
debug_comment_add(cpu, address, param[1], 0x00ff0000, debug_comment_get_opcode_crc32(cpu, address));
cpu->machine->m_debug_view->update_all(DVT_DISASSEMBLY);
} | /*-------------------------------------------------
execute_comment - add a comment to a line
-------------------------------------------------*/ | add a comment to a line | [
"add",
"a",
"comment",
"to",
"a",
"line"
] | static void execute_comment(running_machine *machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
if (!debug_command_parameter_number(machine, param[0], &address))
return;
if (!debug_command_parameter_cpu(machine, NULL, &cpu))
return;
if (strlen(param[1]) == 0)
{
debug_console_printf(machine, "Error : comment text empty\n");
return;
}
debug_comment_add(cpu, address, param[1], 0x00ff0000, debug_comment_get_opcode_crc32(cpu, address));
cpu->machine->m_debug_view->update_all(DVT_DISASSEMBLY);
} | [
"static",
"void",
"execute_comment",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"ref",
",",
"int",
"params",
",",
"const",
"char",
"*",
"param",
"[",
"]",
")",
"{",
"device_t",
"*",
"cpu",
";",
"UINT64",
"address",
";",
"if",
"(",
"!",
"debug_command_parameter_number",
"(",
"machine",
",",
"param",
"[",
"0",
"]",
",",
"&",
"address",
")",
")",
"return",
";",
"if",
"(",
"!",
"debug_command_parameter_cpu",
"(",
"machine",
",",
"NULL",
",",
"&",
"cpu",
")",
")",
"return",
";",
"if",
"(",
"strlen",
"(",
"param",
"[",
"1",
"]",
")",
"==",
"0",
")",
"{",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
")",
";",
"return",
";",
"}",
"debug_comment_add",
"(",
"cpu",
",",
"address",
",",
"param",
"[",
"1",
"]",
",",
"0x00ff0000",
",",
"debug_comment_get_opcode_crc32",
"(",
"cpu",
",",
"address",
")",
")",
";",
"cpu",
"->",
"machine",
"->",
"m_debug_view",
"->",
"update_all",
"(",
"DVT_DISASSEMBLY",
")",
";",
"}"
] | execute_comment - add a comment to a line | [
"execute_comment",
"-",
"add",
"a",
"comment",
"to",
"a",
"line"
] | [
"/* param 1 is the address for the comment */",
"/* CPU parameter is implicit */",
"/* make sure param 2 exists */",
"/* Now try adding the comment */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "ref",
"type": "int"
},
{
"param": "params",
"type": "int"
},
{
"param": "param",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ref",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | execute_comment_del | void | static void execute_comment_del(running_machine *machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
/* param 1 can either be a command or the address for the comment */
if (!debug_command_parameter_number(machine, param[0], &address))
return;
/* CPU parameter is implicit */
if (!debug_command_parameter_cpu(machine, NULL, &cpu))
return;
/* If it's a number, it must be an address */
/* The bankoff and cbn will be pulled from what's currently active */
debug_comment_remove(cpu, address, debug_comment_get_opcode_crc32(cpu, address));
cpu->machine->m_debug_view->update_all(DVT_DISASSEMBLY);
} | /*------------------------------------------------------
execute_comment_del - remove a comment from an addr
--------------------------------------------------------*/ | remove a comment from an addr | [
"remove",
"a",
"comment",
"from",
"an",
"addr"
] | static void execute_comment_del(running_machine *machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
if (!debug_command_parameter_number(machine, param[0], &address))
return;
if (!debug_command_parameter_cpu(machine, NULL, &cpu))
return;
debug_comment_remove(cpu, address, debug_comment_get_opcode_crc32(cpu, address));
cpu->machine->m_debug_view->update_all(DVT_DISASSEMBLY);
} | [
"static",
"void",
"execute_comment_del",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"ref",
",",
"int",
"params",
",",
"const",
"char",
"*",
"param",
"[",
"]",
")",
"{",
"device_t",
"*",
"cpu",
";",
"UINT64",
"address",
";",
"if",
"(",
"!",
"debug_command_parameter_number",
"(",
"machine",
",",
"param",
"[",
"0",
"]",
",",
"&",
"address",
")",
")",
"return",
";",
"if",
"(",
"!",
"debug_command_parameter_cpu",
"(",
"machine",
",",
"NULL",
",",
"&",
"cpu",
")",
")",
"return",
";",
"debug_comment_remove",
"(",
"cpu",
",",
"address",
",",
"debug_comment_get_opcode_crc32",
"(",
"cpu",
",",
"address",
")",
")",
";",
"cpu",
"->",
"machine",
"->",
"m_debug_view",
"->",
"update_all",
"(",
"DVT_DISASSEMBLY",
")",
";",
"}"
] | execute_comment_del - remove a comment from an addr | [
"execute_comment_del",
"-",
"remove",
"a",
"comment",
"from",
"an",
"addr"
] | [
"/* param 1 can either be a command or the address for the comment */",
"/* CPU parameter is implicit */",
"/* If it's a number, it must be an address */",
"/* The bankoff and cbn will be pulled from what's currently active */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "ref",
"type": "int"
},
{
"param": "params",
"type": "int"
},
{
"param": "param",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ref",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | execute_comment_save | void | static void execute_comment_save(running_machine *machine, int ref, int params, const char *param[])
{
if (debug_comment_save(machine))
debug_console_printf(machine, "Comments successfully saved\n");
} | /*-------------------------------------------------
execute_comment - add a comment to a line
-------------------------------------------------*/ | add a comment to a line | [
"add",
"a",
"comment",
"to",
"a",
"line"
] | static void execute_comment_save(running_machine *machine, int ref, int params, const char *param[])
{
if (debug_comment_save(machine))
debug_console_printf(machine, "Comments successfully saved\n");
} | [
"static",
"void",
"execute_comment_save",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"ref",
",",
"int",
"params",
",",
"const",
"char",
"*",
"param",
"[",
"]",
")",
"{",
"if",
"(",
"debug_comment_save",
"(",
"machine",
")",
")",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
")",
";",
"}"
] | execute_comment - add a comment to a line | [
"execute_comment",
"-",
"add",
"a",
"comment",
"to",
"a",
"line"
] | [] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "ref",
"type": "int"
},
{
"param": "params",
"type": "int"
},
{
"param": "param",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ref",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | execute_bpdisenable | void | static void execute_bpdisenable(running_machine *machine, int ref, int params, const char *param[])
{
UINT64 bpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
device->debug()->breakpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all breakpoints\n");
else
debug_console_printf(machine, "Enabled all breakpoints\n");
}
/* otherwise, clear the specific one */
else if (!debug_command_parameter_number(machine, param[0], &bpindex))
return;
else
{
bool found = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_enable(bpindex, ref))
found = true;
if (found)
debug_console_printf(machine, "Breakpoint %X %s\n", (UINT32)bpindex, ref ? "enabled" : "disabled");
else
debug_console_printf(machine, "Invalid breakpoint number %X\n", (UINT32)bpindex);
}
} | /*-------------------------------------------------
execute_bpdisenable - execute the breakpoint
disable/enable commands
-------------------------------------------------*/ | execute the breakpoint
disable/enable commands | [
"execute",
"the",
"breakpoint",
"disable",
"/",
"enable",
"commands"
] | static void execute_bpdisenable(running_machine *machine, int ref, int params, const char *param[])
{
UINT64 bpindex;
if (params == 0)
{
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
device->debug()->breakpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all breakpoints\n");
else
debug_console_printf(machine, "Enabled all breakpoints\n");
}
else if (!debug_command_parameter_number(machine, param[0], &bpindex))
return;
else
{
bool found = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_enable(bpindex, ref))
found = true;
if (found)
debug_console_printf(machine, "Breakpoint %X %s\n", (UINT32)bpindex, ref ? "enabled" : "disabled");
else
debug_console_printf(machine, "Invalid breakpoint number %X\n", (UINT32)bpindex);
}
} | [
"static",
"void",
"execute_bpdisenable",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"ref",
",",
"int",
"params",
",",
"const",
"char",
"*",
"param",
"[",
"]",
")",
"{",
"UINT64",
"bpindex",
";",
"if",
"(",
"params",
"==",
"0",
")",
"{",
"for",
"(",
"device_t",
"*",
"device",
"=",
"machine",
"->",
"m_devicelist",
".",
"first",
"(",
")",
";",
"device",
"!=",
"NULL",
";",
"device",
"=",
"device",
"->",
"next",
"(",
")",
")",
"device",
"->",
"debug",
"(",
")",
"->",
"breakpoint_enable_all",
"(",
"ref",
")",
";",
"if",
"(",
"ref",
"==",
"0",
")",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
")",
";",
"else",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
")",
";",
"}",
"else",
"if",
"(",
"!",
"debug_command_parameter_number",
"(",
"machine",
",",
"param",
"[",
"0",
"]",
",",
"&",
"bpindex",
")",
")",
"return",
";",
"else",
"{",
"bool",
"found",
"=",
"false",
";",
"for",
"(",
"device_t",
"*",
"device",
"=",
"machine",
"->",
"m_devicelist",
".",
"first",
"(",
")",
";",
"device",
"!=",
"NULL",
";",
"device",
"=",
"device",
"->",
"next",
"(",
")",
")",
"if",
"(",
"device",
"->",
"debug",
"(",
")",
"->",
"breakpoint_enable",
"(",
"bpindex",
",",
"ref",
")",
")",
"found",
"=",
"true",
";",
"if",
"(",
"found",
")",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"(",
"UINT32",
")",
"bpindex",
",",
"ref",
"?",
"\"",
"\"",
":",
"\"",
"\"",
")",
";",
"else",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"(",
"UINT32",
")",
"bpindex",
")",
";",
"}",
"}"
] | execute_bpdisenable - execute the breakpoint
disable/enable commands | [
"execute_bpdisenable",
"-",
"execute",
"the",
"breakpoint",
"disable",
"/",
"enable",
"commands"
] | [
"/* if 0 parameters, clear all */",
"/* otherwise, clear the specific one */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "ref",
"type": "int"
},
{
"param": "params",
"type": "int"
},
{
"param": "param",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ref",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | execute_wpdisenable | void | static void execute_wpdisenable(running_machine *machine, int ref, int params, const char *param[])
{
UINT64 wpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
device->debug()->watchpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all watchpoints\n");
else
debug_console_printf(machine, "Enabled all watchpoints\n");
}
/* otherwise, clear the specific one */
else if (!debug_command_parameter_number(machine, param[0], &wpindex))
return;
else
{
bool found = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_enable(wpindex, ref))
found = true;
if (found)
debug_console_printf(machine, "Watchpoint %X %s\n", (UINT32)wpindex, ref ? "enabled" : "disabled");
else
debug_console_printf(machine, "Invalid watchpoint number %X\n", (UINT32)wpindex);
}
} | /*-------------------------------------------------
execute_wpdisenable - execute the watchpoint
disable/enable commands
-------------------------------------------------*/ | execute the watchpoint
disable/enable commands | [
"execute",
"the",
"watchpoint",
"disable",
"/",
"enable",
"commands"
] | static void execute_wpdisenable(running_machine *machine, int ref, int params, const char *param[])
{
UINT64 wpindex;
if (params == 0)
{
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
device->debug()->watchpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all watchpoints\n");
else
debug_console_printf(machine, "Enabled all watchpoints\n");
}
else if (!debug_command_parameter_number(machine, param[0], &wpindex))
return;
else
{
bool found = false;
for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_enable(wpindex, ref))
found = true;
if (found)
debug_console_printf(machine, "Watchpoint %X %s\n", (UINT32)wpindex, ref ? "enabled" : "disabled");
else
debug_console_printf(machine, "Invalid watchpoint number %X\n", (UINT32)wpindex);
}
} | [
"static",
"void",
"execute_wpdisenable",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"ref",
",",
"int",
"params",
",",
"const",
"char",
"*",
"param",
"[",
"]",
")",
"{",
"UINT64",
"wpindex",
";",
"if",
"(",
"params",
"==",
"0",
")",
"{",
"for",
"(",
"device_t",
"*",
"device",
"=",
"machine",
"->",
"m_devicelist",
".",
"first",
"(",
")",
";",
"device",
"!=",
"NULL",
";",
"device",
"=",
"device",
"->",
"next",
"(",
")",
")",
"device",
"->",
"debug",
"(",
")",
"->",
"watchpoint_enable_all",
"(",
"ref",
")",
";",
"if",
"(",
"ref",
"==",
"0",
")",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
")",
";",
"else",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
")",
";",
"}",
"else",
"if",
"(",
"!",
"debug_command_parameter_number",
"(",
"machine",
",",
"param",
"[",
"0",
"]",
",",
"&",
"wpindex",
")",
")",
"return",
";",
"else",
"{",
"bool",
"found",
"=",
"false",
";",
"for",
"(",
"device_t",
"*",
"device",
"=",
"machine",
"->",
"m_devicelist",
".",
"first",
"(",
")",
";",
"device",
"!=",
"NULL",
";",
"device",
"=",
"device",
"->",
"next",
"(",
")",
")",
"if",
"(",
"device",
"->",
"debug",
"(",
")",
"->",
"watchpoint_enable",
"(",
"wpindex",
",",
"ref",
")",
")",
"found",
"=",
"true",
";",
"if",
"(",
"found",
")",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"(",
"UINT32",
")",
"wpindex",
",",
"ref",
"?",
"\"",
"\"",
":",
"\"",
"\"",
")",
";",
"else",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"(",
"UINT32",
")",
"wpindex",
")",
";",
"}",
"}"
] | execute_wpdisenable - execute the watchpoint
disable/enable commands | [
"execute_wpdisenable",
"-",
"execute",
"the",
"watchpoint",
"disable",
"/",
"enable",
"commands"
] | [
"/* if 0 parameters, clear all */",
"/* otherwise, clear the specific one */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "ref",
"type": "int"
},
{
"param": "params",
"type": "int"
},
{
"param": "param",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ref",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | execute_cheatlist | void | static void execute_cheatlist(running_machine *machine, int ref, int params, const char *param[])
{
char spaceletter, sizeletter;
const address_space *space;
device_t *cpu;
UINT32 active_cheat = 0;
UINT64 cheatindex;
UINT64 sizemask;
FILE *f = NULL;
if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, ADDRESS_SPACE_PROGRAM, &space))
return;
if (!debug_command_parameter_cpu(machine, &cheat.cpu, &cpu))
return;
if (params > 0)
f = fopen(param[0], "w");
switch (space->spacenum)
{
default:
case ADDRESS_SPACE_PROGRAM: spaceletter = 'p'; break;
case ADDRESS_SPACE_DATA: spaceletter = 'd'; break;
case ADDRESS_SPACE_IO: spaceletter = 'i'; break;
}
switch (cheat.width)
{
default:
case 1: sizeletter = 'b'; sizemask = 0xff; break;
case 2: sizeletter = 'w'; sizemask = 0xffff; break;
case 4: sizeletter = 'd'; sizemask = 0xffffffff; break;
case 8: sizeletter = 'q'; sizemask = U64(0xffffffffffffffff); break;
}
/* write the cheat list */
for (cheatindex = 0; cheatindex < cheat.length; cheatindex += 1)
{
if (cheat.cheatmap[cheatindex].state == 1)
{
UINT64 value = cheat_byte_swap(&cheat, cheat_read_extended(&cheat, space, cheat.cheatmap[cheatindex].offset)) & sizemask;
offs_t address = memory_byte_to_address(space, cheat.cheatmap[cheatindex].offset);
if (params > 0)
{
active_cheat++;
fprintf(f, " <cheat desc=\"Possibility %d : %s (%s)\">\n", active_cheat, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(value, cheat.width * 2));
fprintf(f, " <script state=\"run\">\n");
fprintf(f, " <action>%s.p%c%c@%s=%s</action>\n", cpu->tag(), spaceletter, sizeletter, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(cheat_byte_swap(&cheat, cheat.cheatmap[cheatindex].first_value) & sizemask, cheat.width * 2));
fprintf(f, " </script>\n");
fprintf(f, " </cheat>\n\n");
}
else
debug_console_printf(machine, "Address=%s Start=%s Current=%s\n", core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(cheat_byte_swap(&cheat, cheat.cheatmap[cheatindex].first_value) & sizemask, cheat.width * 2), core_i64_hex_format(value, cheat.width * 2));
}
}
if (params > 0)
fclose(f);
} | /*-------------------------------------------------
execute_cheatlist - show a list of active cheat
-------------------------------------------------*/ | show a list of active cheat | [
"show",
"a",
"list",
"of",
"active",
"cheat"
] | static void execute_cheatlist(running_machine *machine, int ref, int params, const char *param[])
{
char spaceletter, sizeletter;
const address_space *space;
device_t *cpu;
UINT32 active_cheat = 0;
UINT64 cheatindex;
UINT64 sizemask;
FILE *f = NULL;
if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, ADDRESS_SPACE_PROGRAM, &space))
return;
if (!debug_command_parameter_cpu(machine, &cheat.cpu, &cpu))
return;
if (params > 0)
f = fopen(param[0], "w");
switch (space->spacenum)
{
default:
case ADDRESS_SPACE_PROGRAM: spaceletter = 'p'; break;
case ADDRESS_SPACE_DATA: spaceletter = 'd'; break;
case ADDRESS_SPACE_IO: spaceletter = 'i'; break;
}
switch (cheat.width)
{
default:
case 1: sizeletter = 'b'; sizemask = 0xff; break;
case 2: sizeletter = 'w'; sizemask = 0xffff; break;
case 4: sizeletter = 'd'; sizemask = 0xffffffff; break;
case 8: sizeletter = 'q'; sizemask = U64(0xffffffffffffffff); break;
}
for (cheatindex = 0; cheatindex < cheat.length; cheatindex += 1)
{
if (cheat.cheatmap[cheatindex].state == 1)
{
UINT64 value = cheat_byte_swap(&cheat, cheat_read_extended(&cheat, space, cheat.cheatmap[cheatindex].offset)) & sizemask;
offs_t address = memory_byte_to_address(space, cheat.cheatmap[cheatindex].offset);
if (params > 0)
{
active_cheat++;
fprintf(f, " <cheat desc=\"Possibility %d : %s (%s)\">\n", active_cheat, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(value, cheat.width * 2));
fprintf(f, " <script state=\"run\">\n");
fprintf(f, " <action>%s.p%c%c@%s=%s</action>\n", cpu->tag(), spaceletter, sizeletter, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(cheat_byte_swap(&cheat, cheat.cheatmap[cheatindex].first_value) & sizemask, cheat.width * 2));
fprintf(f, " </script>\n");
fprintf(f, " </cheat>\n\n");
}
else
debug_console_printf(machine, "Address=%s Start=%s Current=%s\n", core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(cheat_byte_swap(&cheat, cheat.cheatmap[cheatindex].first_value) & sizemask, cheat.width * 2), core_i64_hex_format(value, cheat.width * 2));
}
}
if (params > 0)
fclose(f);
} | [
"static",
"void",
"execute_cheatlist",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"ref",
",",
"int",
"params",
",",
"const",
"char",
"*",
"param",
"[",
"]",
")",
"{",
"char",
"spaceletter",
",",
"sizeletter",
";",
"const",
"address_space",
"*",
"space",
";",
"device_t",
"*",
"cpu",
";",
"UINT32",
"active_cheat",
"=",
"0",
";",
"UINT64",
"cheatindex",
";",
"UINT64",
"sizemask",
";",
"FILE",
"*",
"f",
"=",
"NULL",
";",
"if",
"(",
"!",
"debug_command_parameter_cpu_space",
"(",
"machine",
",",
"&",
"cheat",
".",
"cpu",
",",
"ADDRESS_SPACE_PROGRAM",
",",
"&",
"space",
")",
")",
"return",
";",
"if",
"(",
"!",
"debug_command_parameter_cpu",
"(",
"machine",
",",
"&",
"cheat",
".",
"cpu",
",",
"&",
"cpu",
")",
")",
"return",
";",
"if",
"(",
"params",
">",
"0",
")",
"f",
"=",
"fopen",
"(",
"param",
"[",
"0",
"]",
",",
"\"",
"\"",
")",
";",
"switch",
"(",
"space",
"->",
"spacenum",
")",
"{",
"default",
":",
"case",
"ADDRESS_SPACE_PROGRAM",
":",
"spaceletter",
"=",
"'",
"'",
";",
"break",
";",
"case",
"ADDRESS_SPACE_DATA",
":",
"spaceletter",
"=",
"'",
"'",
";",
"break",
";",
"case",
"ADDRESS_SPACE_IO",
":",
"spaceletter",
"=",
"'",
"'",
";",
"break",
";",
"}",
"switch",
"(",
"cheat",
".",
"width",
")",
"{",
"default",
":",
"case",
"1",
":",
"sizeletter",
"=",
"'",
"'",
";",
"sizemask",
"=",
"0xff",
";",
"break",
";",
"case",
"2",
":",
"sizeletter",
"=",
"'",
"'",
";",
"sizemask",
"=",
"0xffff",
";",
"break",
";",
"case",
"4",
":",
"sizeletter",
"=",
"'",
"'",
";",
"sizemask",
"=",
"0xffffffff",
";",
"break",
";",
"case",
"8",
":",
"sizeletter",
"=",
"'",
"'",
";",
"sizemask",
"=",
"U64",
"(",
"0xffffffffffffffff",
")",
";",
"break",
";",
"}",
"for",
"(",
"cheatindex",
"=",
"0",
";",
"cheatindex",
"<",
"cheat",
".",
"length",
";",
"cheatindex",
"+=",
"1",
")",
"{",
"if",
"(",
"cheat",
".",
"cheatmap",
"[",
"cheatindex",
"]",
".",
"state",
"==",
"1",
")",
"{",
"UINT64",
"value",
"=",
"cheat_byte_swap",
"(",
"&",
"cheat",
",",
"cheat_read_extended",
"(",
"&",
"cheat",
",",
"space",
",",
"cheat",
".",
"cheatmap",
"[",
"cheatindex",
"]",
".",
"offset",
")",
")",
"&",
"sizemask",
";",
"offs_t",
"address",
"=",
"memory_byte_to_address",
"(",
"space",
",",
"cheat",
".",
"cheatmap",
"[",
"cheatindex",
"]",
".",
"offset",
")",
";",
"if",
"(",
"params",
">",
"0",
")",
"{",
"active_cheat",
"++",
";",
"fprintf",
"(",
"f",
",",
"\"",
"\\\"",
"\\\"",
"\\n",
"\"",
",",
"active_cheat",
",",
"core_i64_hex_format",
"(",
"address",
",",
"space",
"->",
"logaddrchars",
")",
",",
"core_i64_hex_format",
"(",
"value",
",",
"cheat",
".",
"width",
"*",
"2",
")",
")",
";",
"fprintf",
"(",
"f",
",",
"\"",
"\\\"",
"\\\"",
"\\n",
"\"",
")",
";",
"fprintf",
"(",
"f",
",",
"\"",
"\\n",
"\"",
",",
"cpu",
"->",
"tag",
"(",
")",
",",
"spaceletter",
",",
"sizeletter",
",",
"core_i64_hex_format",
"(",
"address",
",",
"space",
"->",
"logaddrchars",
")",
",",
"core_i64_hex_format",
"(",
"cheat_byte_swap",
"(",
"&",
"cheat",
",",
"cheat",
".",
"cheatmap",
"[",
"cheatindex",
"]",
".",
"first_value",
")",
"&",
"sizemask",
",",
"cheat",
".",
"width",
"*",
"2",
")",
")",
";",
"fprintf",
"(",
"f",
",",
"\"",
"\\n",
"\"",
")",
";",
"fprintf",
"(",
"f",
",",
"\"",
"\\n",
"\\n",
"\"",
")",
";",
"}",
"else",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"core_i64_hex_format",
"(",
"address",
",",
"space",
"->",
"logaddrchars",
")",
",",
"core_i64_hex_format",
"(",
"cheat_byte_swap",
"(",
"&",
"cheat",
",",
"cheat",
".",
"cheatmap",
"[",
"cheatindex",
"]",
".",
"first_value",
")",
"&",
"sizemask",
",",
"cheat",
".",
"width",
"*",
"2",
")",
",",
"core_i64_hex_format",
"(",
"value",
",",
"cheat",
".",
"width",
"*",
"2",
")",
")",
";",
"}",
"}",
"if",
"(",
"params",
">",
"0",
")",
"fclose",
"(",
"f",
")",
";",
"}"
] | execute_cheatlist - show a list of active cheat | [
"execute_cheatlist",
"-",
"show",
"a",
"list",
"of",
"active",
"cheat"
] | [
"/* write the cheat list */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "ref",
"type": "int"
},
{
"param": "params",
"type": "int"
},
{
"param": "param",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ref",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2b342733e605d9408ab81cb27a135b3359f7be20 | lofunz/mieme | Reloaded/trunk/src/emu/debug/debugcmd.c | [
"Unlicense"
] | C | execute_trace_internal | void | static void execute_trace_internal(running_machine *machine, int ref, int params, const char *param[], int trace_over)
{
const char *action = NULL, *filename = param[0];
device_t *cpu;
FILE *f = NULL;
const char *mode;
/* validate parameters */
if (!debug_command_parameter_cpu(machine, (params > 1) ? param[1] : NULL, &cpu))
return;
if (!debug_command_parameter_command(machine, action = param[2]))
return;
/* further validation */
if (mame_stricmp(filename, "off") == 0)
filename = NULL;
/* open the file */
if (filename)
{
mode = "w";
/* opening for append? */
if ((filename[0] == '>') && (filename[1] == '>'))
{
mode = "a";
filename += 2;
}
f = fopen(filename, mode);
if (!f)
{
debug_console_printf(machine, "Error opening file '%s'\n", param[0]);
return;
}
}
/* do it */
cpu->debug()->trace(f, trace_over, action);
if (f)
debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename);
else
debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag());
} | /*-------------------------------------------------
execute_trace_internal - functionality for
trace over and trace info
-------------------------------------------------*/ | functionality for
trace over and trace info | [
"functionality",
"for",
"trace",
"over",
"and",
"trace",
"info"
] | static void execute_trace_internal(running_machine *machine, int ref, int params, const char *param[], int trace_over)
{
const char *action = NULL, *filename = param[0];
device_t *cpu;
FILE *f = NULL;
const char *mode;
if (!debug_command_parameter_cpu(machine, (params > 1) ? param[1] : NULL, &cpu))
return;
if (!debug_command_parameter_command(machine, action = param[2]))
return;
if (mame_stricmp(filename, "off") == 0)
filename = NULL;
if (filename)
{
mode = "w";
if ((filename[0] == '>') && (filename[1] == '>'))
{
mode = "a";
filename += 2;
}
f = fopen(filename, mode);
if (!f)
{
debug_console_printf(machine, "Error opening file '%s'\n", param[0]);
return;
}
}
cpu->debug()->trace(f, trace_over, action);
if (f)
debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename);
else
debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag());
} | [
"static",
"void",
"execute_trace_internal",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"ref",
",",
"int",
"params",
",",
"const",
"char",
"*",
"param",
"[",
"]",
",",
"int",
"trace_over",
")",
"{",
"const",
"char",
"*",
"action",
"=",
"NULL",
",",
"*",
"filename",
"=",
"param",
"[",
"0",
"]",
";",
"device_t",
"*",
"cpu",
";",
"FILE",
"*",
"f",
"=",
"NULL",
";",
"const",
"char",
"*",
"mode",
";",
"if",
"(",
"!",
"debug_command_parameter_cpu",
"(",
"machine",
",",
"(",
"params",
">",
"1",
")",
"?",
"param",
"[",
"1",
"]",
":",
"NULL",
",",
"&",
"cpu",
")",
")",
"return",
";",
"if",
"(",
"!",
"debug_command_parameter_command",
"(",
"machine",
",",
"action",
"=",
"param",
"[",
"2",
"]",
")",
")",
"return",
";",
"if",
"(",
"mame_stricmp",
"(",
"filename",
",",
"\"",
"\"",
")",
"==",
"0",
")",
"filename",
"=",
"NULL",
";",
"if",
"(",
"filename",
")",
"{",
"mode",
"=",
"\"",
"\"",
";",
"if",
"(",
"(",
"filename",
"[",
"0",
"]",
"==",
"'",
"'",
")",
"&&",
"(",
"filename",
"[",
"1",
"]",
"==",
"'",
"'",
")",
")",
"{",
"mode",
"=",
"\"",
"\"",
";",
"filename",
"+=",
"2",
";",
"}",
"f",
"=",
"fopen",
"(",
"filename",
",",
"mode",
")",
";",
"if",
"(",
"!",
"f",
")",
"{",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"param",
"[",
"0",
"]",
")",
";",
"return",
";",
"}",
"}",
"cpu",
"->",
"debug",
"(",
")",
"->",
"trace",
"(",
"f",
",",
"trace_over",
",",
"action",
")",
";",
"if",
"(",
"f",
")",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"cpu",
"->",
"tag",
"(",
")",
",",
"filename",
")",
";",
"else",
"debug_console_printf",
"(",
"machine",
",",
"\"",
"\\n",
"\"",
",",
"cpu",
"->",
"tag",
"(",
")",
")",
";",
"}"
] | execute_trace_internal - functionality for
trace over and trace info | [
"execute_trace_internal",
"-",
"functionality",
"for",
"trace",
"over",
"and",
"trace",
"info"
] | [
"/* validate parameters */",
"/* further validation */",
"/* open the file */",
"/* opening for append? */",
"/* do it */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "ref",
"type": "int"
},
{
"param": "params",
"type": "int"
},
{
"param": "param",
"type": "char"
},
{
"param": "trace_over",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ref",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "param",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "trace_over",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
72e3704497f090e024cc2df774c994dc8e9b2be8 | lofunz/mieme | Reloaded/tags/MAME4droid.Reloaded.1.0.WIP/src/emu/restrack.c | [
"Unlicense"
] | C | exit_resource_tracking | void | void exit_resource_tracking(void)
{
while (resource_tracking_tag != 0)
end_resource_tracking();
} | /*-------------------------------------------------
exit_resource_tracking - tear down the
resource tracking system
-------------------------------------------------*/ | tear down the
resource tracking system | [
"tear",
"down",
"the",
"resource",
"tracking",
"system"
] | void exit_resource_tracking(void)
{
while (resource_tracking_tag != 0)
end_resource_tracking();
} | [
"void",
"exit_resource_tracking",
"(",
"void",
")",
"{",
"while",
"(",
"resource_tracking_tag",
"!=",
"0",
")",
"end_resource_tracking",
"(",
")",
";",
"}"
] | exit_resource_tracking - tear down the
resource tracking system | [
"exit_resource_tracking",
"-",
"tear",
"down",
"the",
"resource",
"tracking",
"system"
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
72e3704497f090e024cc2df774c994dc8e9b2be8 | lofunz/mieme | Reloaded/tags/MAME4droid.Reloaded.1.0.WIP/src/emu/restrack.c | [
"Unlicense"
] | C | validate_auto_malloc_memory | void | void validate_auto_malloc_memory(void *memory, size_t memory_size)
{
memory_block_overlap overlap = OVERLAP_NONE;
void *block_base = NULL;
size_t block_size = 0;
int i;
/* scan all pools for an overlapping block */
for (i = 0; overlap == OVERLAP_NONE && i < resource_tracking_tag; i++)
overlap = pool_contains_block(pools[i], memory, memory_size, &block_base, &block_size);
/* fatal error if not a full overlap */
switch (overlap)
{
case OVERLAP_NONE:
fatalerror("Memory block [0x%p-0x%p] not found", memory, (UINT8 *)memory + memory_size - 1);
break;
case OVERLAP_PARTIAL:
fatalerror("Memory block [0x%p-0x%p] partially overlaps with allocated block [0x%p-0x%p]", memory, (UINT8 *)memory + memory_size - 1, block_base, (UINT8 *)block_base + block_size - 1);
break;
case OVERLAP_FULL:
/* expected outcome */
break;
}
} | /*-------------------------------------------------
validate_auto_malloc_memory - validate that a
block of memory has been allocated by
auto_malloc()
-------------------------------------------------*/ | validate that a
block of memory has been allocated by
auto_malloc() | [
"validate",
"that",
"a",
"block",
"of",
"memory",
"has",
"been",
"allocated",
"by",
"auto_malloc",
"()"
] | void validate_auto_malloc_memory(void *memory, size_t memory_size)
{
memory_block_overlap overlap = OVERLAP_NONE;
void *block_base = NULL;
size_t block_size = 0;
int i;
for (i = 0; overlap == OVERLAP_NONE && i < resource_tracking_tag; i++)
overlap = pool_contains_block(pools[i], memory, memory_size, &block_base, &block_size);
switch (overlap)
{
case OVERLAP_NONE:
fatalerror("Memory block [0x%p-0x%p] not found", memory, (UINT8 *)memory + memory_size - 1);
break;
case OVERLAP_PARTIAL:
fatalerror("Memory block [0x%p-0x%p] partially overlaps with allocated block [0x%p-0x%p]", memory, (UINT8 *)memory + memory_size - 1, block_base, (UINT8 *)block_base + block_size - 1);
break;
case OVERLAP_FULL:
break;
}
} | [
"void",
"validate_auto_malloc_memory",
"(",
"void",
"*",
"memory",
",",
"size_t",
"memory_size",
")",
"{",
"memory_block_overlap",
"overlap",
"=",
"OVERLAP_NONE",
";",
"void",
"*",
"block_base",
"=",
"NULL",
";",
"size_t",
"block_size",
"=",
"0",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"overlap",
"==",
"OVERLAP_NONE",
"&&",
"i",
"<",
"resource_tracking_tag",
";",
"i",
"++",
")",
"overlap",
"=",
"pool_contains_block",
"(",
"pools",
"[",
"i",
"]",
",",
"memory",
",",
"memory_size",
",",
"&",
"block_base",
",",
"&",
"block_size",
")",
";",
"switch",
"(",
"overlap",
")",
"{",
"case",
"OVERLAP_NONE",
":",
"fatalerror",
"(",
"\"",
"\"",
",",
"memory",
",",
"(",
"UINT8",
"*",
")",
"memory",
"+",
"memory_size",
"-",
"1",
")",
";",
"break",
";",
"case",
"OVERLAP_PARTIAL",
":",
"fatalerror",
"(",
"\"",
"\"",
",",
"memory",
",",
"(",
"UINT8",
"*",
")",
"memory",
"+",
"memory_size",
"-",
"1",
",",
"block_base",
",",
"(",
"UINT8",
"*",
")",
"block_base",
"+",
"block_size",
"-",
"1",
")",
";",
"break",
";",
"case",
"OVERLAP_FULL",
":",
"break",
";",
"}",
"}"
] | validate_auto_malloc_memory - validate that a
block of memory has been allocated by
auto_malloc() | [
"validate_auto_malloc_memory",
"-",
"validate",
"that",
"a",
"block",
"of",
"memory",
"has",
"been",
"allocated",
"by",
"auto_malloc",
"()"
] | [
"/* scan all pools for an overlapping block */",
"/* fatal error if not a full overlap */",
"/* expected outcome */"
] | [
{
"param": "memory",
"type": "void"
},
{
"param": "memory_size",
"type": "size_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "memory",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "memory_size",
"type": "size_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
72e3704497f090e024cc2df774c994dc8e9b2be8 | lofunz/mieme | Reloaded/tags/MAME4droid.Reloaded.1.0.WIP/src/emu/restrack.c | [
"Unlicense"
] | C | pool_contains_block | memory_block_overlap | static memory_block_overlap pool_contains_block(object_pool *pool, void *ptr, size_t size, void **found_block, size_t *found_block_size)
{
memory_block_overlap overlap = OVERLAP_NONE;
object_pool_iterator *iter;
UINT8 *ptrstart = (UINT8 *)ptr;
UINT8 *ptrend = ptrstart + size - 1;
void *blockptr = NULL;
size_t blocksize = 0;
/* iterate over memory objects in the pool */
for (iter = pool_iterate_begin(pool, OBJTYPE_MEMORY); iter != NULL && pool_iterate_next(iter, &blockptr, &blocksize, NULL); )
{
int startwithin = (ptrstart >= (UINT8 *)blockptr && ptrstart < (UINT8 *)blockptr + blocksize);
int endwithin = (ptrend >= (UINT8 *)blockptr && ptrend < (UINT8 *)blockptr + blocksize);
/* if the start of the incoming pointer lies within the block... */
if (startwithin || endwithin)
{
overlap = (startwithin && endwithin) ? OVERLAP_FULL : OVERLAP_PARTIAL;
break;
}
}
pool_iterate_end(iter);
/* store the results */
if (overlap != OVERLAP_NONE)
{
if (found_block != NULL)
*found_block = blockptr;
if (found_block_size != NULL)
*found_block_size = blocksize;
}
return overlap;
} | /*-------------------------------------------------
pool_contains_block - determines if a pool
contains a memory block
-------------------------------------------------*/ | determines if a pool
contains a memory block | [
"determines",
"if",
"a",
"pool",
"contains",
"a",
"memory",
"block"
] | static memory_block_overlap pool_contains_block(object_pool *pool, void *ptr, size_t size, void **found_block, size_t *found_block_size)
{
memory_block_overlap overlap = OVERLAP_NONE;
object_pool_iterator *iter;
UINT8 *ptrstart = (UINT8 *)ptr;
UINT8 *ptrend = ptrstart + size - 1;
void *blockptr = NULL;
size_t blocksize = 0;
for (iter = pool_iterate_begin(pool, OBJTYPE_MEMORY); iter != NULL && pool_iterate_next(iter, &blockptr, &blocksize, NULL); )
{
int startwithin = (ptrstart >= (UINT8 *)blockptr && ptrstart < (UINT8 *)blockptr + blocksize);
int endwithin = (ptrend >= (UINT8 *)blockptr && ptrend < (UINT8 *)blockptr + blocksize);
if (startwithin || endwithin)
{
overlap = (startwithin && endwithin) ? OVERLAP_FULL : OVERLAP_PARTIAL;
break;
}
}
pool_iterate_end(iter);
if (overlap != OVERLAP_NONE)
{
if (found_block != NULL)
*found_block = blockptr;
if (found_block_size != NULL)
*found_block_size = blocksize;
}
return overlap;
} | [
"static",
"memory_block_overlap",
"pool_contains_block",
"(",
"object_pool",
"*",
"pool",
",",
"void",
"*",
"ptr",
",",
"size_t",
"size",
",",
"void",
"*",
"*",
"found_block",
",",
"size_t",
"*",
"found_block_size",
")",
"{",
"memory_block_overlap",
"overlap",
"=",
"OVERLAP_NONE",
";",
"object_pool_iterator",
"*",
"iter",
";",
"UINT8",
"*",
"ptrstart",
"=",
"(",
"UINT8",
"*",
")",
"ptr",
";",
"UINT8",
"*",
"ptrend",
"=",
"ptrstart",
"+",
"size",
"-",
"1",
";",
"void",
"*",
"blockptr",
"=",
"NULL",
";",
"size_t",
"blocksize",
"=",
"0",
";",
"for",
"(",
"iter",
"=",
"pool_iterate_begin",
"(",
"pool",
",",
"OBJTYPE_MEMORY",
")",
";",
"iter",
"!=",
"NULL",
"&&",
"pool_iterate_next",
"(",
"iter",
",",
"&",
"blockptr",
",",
"&",
"blocksize",
",",
"NULL",
")",
";",
")",
"{",
"int",
"startwithin",
"=",
"(",
"ptrstart",
">=",
"(",
"UINT8",
"*",
")",
"blockptr",
"&&",
"ptrstart",
"<",
"(",
"UINT8",
"*",
")",
"blockptr",
"+",
"blocksize",
")",
";",
"int",
"endwithin",
"=",
"(",
"ptrend",
">=",
"(",
"UINT8",
"*",
")",
"blockptr",
"&&",
"ptrend",
"<",
"(",
"UINT8",
"*",
")",
"blockptr",
"+",
"blocksize",
")",
";",
"if",
"(",
"startwithin",
"||",
"endwithin",
")",
"{",
"overlap",
"=",
"(",
"startwithin",
"&&",
"endwithin",
")",
"?",
"OVERLAP_FULL",
":",
"OVERLAP_PARTIAL",
";",
"break",
";",
"}",
"}",
"pool_iterate_end",
"(",
"iter",
")",
";",
"if",
"(",
"overlap",
"!=",
"OVERLAP_NONE",
")",
"{",
"if",
"(",
"found_block",
"!=",
"NULL",
")",
"*",
"found_block",
"=",
"blockptr",
";",
"if",
"(",
"found_block_size",
"!=",
"NULL",
")",
"*",
"found_block_size",
"=",
"blocksize",
";",
"}",
"return",
"overlap",
";",
"}"
] | pool_contains_block - determines if a pool
contains a memory block | [
"pool_contains_block",
"-",
"determines",
"if",
"a",
"pool",
"contains",
"a",
"memory",
"block"
] | [
"/* iterate over memory objects in the pool */",
"/* if the start of the incoming pointer lies within the block... */",
"/* store the results */"
] | [
{
"param": "pool",
"type": "object_pool"
},
{
"param": "ptr",
"type": "void"
},
{
"param": "size",
"type": "size_t"
},
{
"param": "found_block",
"type": "void"
},
{
"param": "found_block_size",
"type": "size_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "pool",
"type": "object_pool",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ptr",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "size",
"type": "size_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "found_block",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "found_block_size",
"type": "size_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
841a706f6ba54f6d3c03ddb570ed2e2f9e307ab5 | lofunz/mieme | Reloaded/trunk/src/mame/drivers/coolridr.c | [
"Unlicense"
] | C | sysh1_dma_transfer | void | static void sysh1_dma_transfer( const address_space *space, UINT16 dma_index )
{
static UINT32 src,dst,size,type,s_i;
static UINT8 end_dma_mark;
end_dma_mark = 0;
do{
src = (framebuffer_vram[(0+dma_index)/4] & 0x0fffffff);
dst = (framebuffer_vram[(4+dma_index)/4]);
size = framebuffer_vram[(8+dma_index)/4];
type = (framebuffer_vram[(0+dma_index)/4] & 0xf0000000) >> 28;
#if 0
if(type == 0xc || type == 0xd || type == 0xe)
printf("* %08x %08x %08x %08x\n",src,dst,size,type);
else if(type != 0 && type != 0x4)
printf("%08x %08x %08x %08x\n",src,dst,size,type);
#endif
if(type == 0x3 || type == 0x4)
{
//type 3 sets a DMA param, type 4 sets some kind of table? Skip it for now
dma_index+=4;
continue;
}
if(type == 0xc)
{
dst &= 0xfffff;
dst |= 0x3000000; //to videoram, FIXME: unknown offset
size*=2;
}
if(type == 0xd)
{
dst &= 0xfffff;
dst |= 0x3d00000; //to charram, FIXME: unknown offset
size*=2;
}
if(type == 0xe)
{
dst &= 0xfffff;
dst |= 0x3c00000; //to paletteram FIXME: unknown offset
//size/=2;
if((src & 0xff00000) == 0x3e00000)
return; //FIXME: kludge to avoid palette corruption
//debugger_break(space->machine);
}
if(type == 0xc || type == 0xd || type == 0xe)
{
for(s_i=0;s_i<size;s_i+=4)
{
memory_write_dword(space,dst,memory_read_dword(space,src));
dst+=4;
src+=4;
}
}
else
{
//printf("%08x %08x %08x %08x\n",src,dst,size,type);
}
if(type == 0x00)
end_dma_mark = 1; //end of DMA list
dma_index+=0xc;
}while(!end_dma_mark );
} | /* FIXME: this seems to do a hell lot of stuff, it's not ST-V SCU but still somewhat complex :/ */ | this seems to do a hell lot of stuff, it's not ST-V SCU but still somewhat complex . | [
"this",
"seems",
"to",
"do",
"a",
"hell",
"lot",
"of",
"stuff",
"it",
"'",
"s",
"not",
"ST",
"-",
"V",
"SCU",
"but",
"still",
"somewhat",
"complex",
"."
] | static void sysh1_dma_transfer( const address_space *space, UINT16 dma_index )
{
static UINT32 src,dst,size,type,s_i;
static UINT8 end_dma_mark;
end_dma_mark = 0;
do{
src = (framebuffer_vram[(0+dma_index)/4] & 0x0fffffff);
dst = (framebuffer_vram[(4+dma_index)/4]);
size = framebuffer_vram[(8+dma_index)/4];
type = (framebuffer_vram[(0+dma_index)/4] & 0xf0000000) >> 28;
#if 0
if(type == 0xc || type == 0xd || type == 0xe)
printf("* %08x %08x %08x %08x\n",src,dst,size,type);
else if(type != 0 && type != 0x4)
printf("%08x %08x %08x %08x\n",src,dst,size,type);
#endif
if(type == 0x3 || type == 0x4)
{
dma_index+=4;
continue;
}
if(type == 0xc)
{
dst &= 0xfffff;
dst |= 0x3000000;
size*=2;
}
if(type == 0xd)
{
dst &= 0xfffff;
dst |= 0x3d00000;
size*=2;
}
if(type == 0xe)
{
dst &= 0xfffff;
dst |= 0x3c00000;
if((src & 0xff00000) == 0x3e00000)
return;
}
if(type == 0xc || type == 0xd || type == 0xe)
{
for(s_i=0;s_i<size;s_i+=4)
{
memory_write_dword(space,dst,memory_read_dword(space,src));
dst+=4;
src+=4;
}
}
else
{
}
if(type == 0x00)
end_dma_mark = 1;
dma_index+=0xc;
}while(!end_dma_mark );
} | [
"static",
"void",
"sysh1_dma_transfer",
"(",
"const",
"address_space",
"*",
"space",
",",
"UINT16",
"dma_index",
")",
"{",
"static",
"UINT32",
"src",
",",
"dst",
",",
"size",
",",
"type",
",",
"s_i",
";",
"static",
"UINT8",
"end_dma_mark",
";",
"end_dma_mark",
"=",
"0",
";",
"do",
"{",
"src",
"=",
"(",
"framebuffer_vram",
"[",
"(",
"0",
"+",
"dma_index",
")",
"/",
"4",
"]",
"&",
"0x0fffffff",
")",
";",
"dst",
"=",
"(",
"framebuffer_vram",
"[",
"(",
"4",
"+",
"dma_index",
")",
"/",
"4",
"]",
")",
";",
"size",
"=",
"framebuffer_vram",
"[",
"(",
"8",
"+",
"dma_index",
")",
"/",
"4",
"]",
";",
"type",
"=",
"(",
"framebuffer_vram",
"[",
"(",
"0",
"+",
"dma_index",
")",
"/",
"4",
"]",
"&",
"0xf0000000",
")",
">>",
"28",
";",
"#if",
"0",
"\n",
"if",
"(",
"type",
"==",
"0xc",
"||",
"type",
"==",
"0xd",
"||",
"type",
"==",
"0xe",
")",
"printf",
"(",
"\"",
"\\n",
"\"",
",",
"src",
",",
"dst",
",",
"size",
",",
"type",
")",
";",
"else",
"if",
"(",
"type",
"!=",
"0",
"&&",
"type",
"!=",
"0x4",
")",
"printf",
"(",
"\"",
"\\n",
"\"",
",",
"src",
",",
"dst",
",",
"size",
",",
"type",
")",
";",
"#endif",
"if",
"(",
"type",
"==",
"0x3",
"||",
"type",
"==",
"0x4",
")",
"{",
"dma_index",
"+=",
"4",
";",
"continue",
";",
"}",
"if",
"(",
"type",
"==",
"0xc",
")",
"{",
"dst",
"&=",
"0xfffff",
";",
"dst",
"|=",
"0x3000000",
";",
"size",
"*=",
"2",
";",
"}",
"if",
"(",
"type",
"==",
"0xd",
")",
"{",
"dst",
"&=",
"0xfffff",
";",
"dst",
"|=",
"0x3d00000",
";",
"size",
"*=",
"2",
";",
"}",
"if",
"(",
"type",
"==",
"0xe",
")",
"{",
"dst",
"&=",
"0xfffff",
";",
"dst",
"|=",
"0x3c00000",
";",
"if",
"(",
"(",
"src",
"&",
"0xff00000",
")",
"==",
"0x3e00000",
")",
"return",
";",
"}",
"if",
"(",
"type",
"==",
"0xc",
"||",
"type",
"==",
"0xd",
"||",
"type",
"==",
"0xe",
")",
"{",
"for",
"(",
"s_i",
"=",
"0",
";",
"s_i",
"<",
"size",
";",
"s_i",
"+=",
"4",
")",
"{",
"memory_write_dword",
"(",
"space",
",",
"dst",
",",
"memory_read_dword",
"(",
"space",
",",
"src",
")",
")",
";",
"dst",
"+=",
"4",
";",
"src",
"+=",
"4",
";",
"}",
"}",
"else",
"{",
"}",
"if",
"(",
"type",
"==",
"0x00",
")",
"end_dma_mark",
"=",
"1",
";",
"dma_index",
"+=",
"0xc",
";",
"}",
"while",
"(",
"!",
"end_dma_mark",
")",
";",
"}"
] | FIXME: this seems to do a hell lot of stuff, it's not ST-V SCU but still somewhat complex : | [
"FIXME",
":",
"this",
"seems",
"to",
"do",
"a",
"hell",
"lot",
"of",
"stuff",
"it",
"'",
"s",
"not",
"ST",
"-",
"V",
"SCU",
"but",
"still",
"somewhat",
"complex",
":"
] | [
"//type 3 sets a DMA param, type 4 sets some kind of table? Skip it for now\r",
"//to videoram, FIXME: unknown offset\r",
"//to charram, FIXME: unknown offset\r",
"//to paletteram FIXME: unknown offset\r",
"//size/=2;\r",
"//FIXME: kludge to avoid palette corruption\r",
"//debugger_break(space->machine);\r",
"//printf(\"%08x %08x %08x %08x\\n\",src,dst,size,type);\r",
"//end of DMA list\r"
] | [
{
"param": "space",
"type": "address_space"
},
{
"param": "dma_index",
"type": "UINT16"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "space",
"type": "address_space",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dma_index",
"type": "UINT16",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_set_cdrom | void | void cdda_set_cdrom(running_device *device, void *file)
{
cdda_info *info = get_safe_token(device);
info->disc = (cdrom_file *)file;
} | /*-------------------------------------------------
cdda_set_cdrom - set the CD-ROM file for the
given CDDA stream
-------------------------------------------------*/ | set the CD-ROM file for the
given CDDA stream | [
"set",
"the",
"CD",
"-",
"ROM",
"file",
"for",
"the",
"given",
"CDDA",
"stream"
] | void cdda_set_cdrom(running_device *device, void *file)
{
cdda_info *info = get_safe_token(device);
info->disc = (cdrom_file *)file;
} | [
"void",
"cdda_set_cdrom",
"(",
"running_device",
"*",
"device",
",",
"void",
"*",
"file",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"device",
")",
";",
"info",
"->",
"disc",
"=",
"(",
"cdrom_file",
"*",
")",
"file",
";",
"}"
] | cdda_set_cdrom - set the CD-ROM file for the
given CDDA stream | [
"cdda_set_cdrom",
"-",
"set",
"the",
"CD",
"-",
"ROM",
"file",
"for",
"the",
"given",
"CDDA",
"stream"
] | [] | [
{
"param": "device",
"type": "running_device"
},
{
"param": "file",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "device",
"type": "running_device",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "file",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_from_cdrom | running_device | running_device *cdda_from_cdrom(running_machine *machine, void *file)
{
device_sound_interface *sound = NULL;
for (bool gotone = machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
if (sound->device().type() == SOUND_CDDA)
{
cdda_info *info = get_safe_token(*sound);
if (info->disc == file)
return *sound;
}
return NULL;
} | /*-------------------------------------------------
cdda_from_cdrom - find the CDDA stream
that references the given CD-ROM file
-------------------------------------------------*/ | find the CDDA stream
that references the given CD-ROM file | [
"find",
"the",
"CDDA",
"stream",
"that",
"references",
"the",
"given",
"CD",
"-",
"ROM",
"file"
] | running_device *cdda_from_cdrom(running_machine *machine, void *file)
{
device_sound_interface *sound = NULL;
for (bool gotone = machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
if (sound->device().type() == SOUND_CDDA)
{
cdda_info *info = get_safe_token(*sound);
if (info->disc == file)
return *sound;
}
return NULL;
} | [
"running_device",
"*",
"cdda_from_cdrom",
"(",
"running_machine",
"*",
"machine",
",",
"void",
"*",
"file",
")",
"{",
"device_sound_interface",
"*",
"sound",
"=",
"NULL",
";",
"for",
"(",
"bool",
"gotone",
"=",
"machine",
"->",
"m_devicelist",
".",
"first",
"(",
"sound",
")",
";",
"gotone",
";",
"gotone",
"=",
"sound",
"->",
"next",
"(",
"sound",
")",
")",
"if",
"(",
"sound",
"->",
"device",
"(",
")",
".",
"type",
"(",
")",
"==",
"SOUND_CDDA",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"*",
"sound",
")",
";",
"if",
"(",
"info",
"->",
"disc",
"==",
"file",
")",
"return",
"*",
"sound",
";",
"}",
"return",
"NULL",
";",
"}"
] | cdda_from_cdrom - find the CDDA stream
that references the given CD-ROM file | [
"cdda_from_cdrom",
"-",
"find",
"the",
"CDDA",
"stream",
"that",
"references",
"the",
"given",
"CD",
"-",
"ROM",
"file"
] | [] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "file",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "file",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_start_audio | void | void cdda_start_audio(running_device *device, UINT32 startlba, UINT32 numblocks)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
info->audio_playing = TRUE;
info->audio_pause = FALSE;
info->audio_ended_normally = FALSE;
info->audio_lba = startlba;
info->audio_length = numblocks;
} | /*-------------------------------------------------
cdda_start_audio - begin playback of a Red
Book audio track
-------------------------------------------------*/ | begin playback of a Red
Book audio track | [
"begin",
"playback",
"of",
"a",
"Red",
"Book",
"audio",
"track"
] | void cdda_start_audio(running_device *device, UINT32 startlba, UINT32 numblocks)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
info->audio_playing = TRUE;
info->audio_pause = FALSE;
info->audio_ended_normally = FALSE;
info->audio_lba = startlba;
info->audio_length = numblocks;
} | [
"void",
"cdda_start_audio",
"(",
"running_device",
"*",
"device",
",",
"UINT32",
"startlba",
",",
"UINT32",
"numblocks",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"device",
")",
";",
"stream_update",
"(",
"info",
"->",
"stream",
")",
";",
"info",
"->",
"audio_playing",
"=",
"TRUE",
";",
"info",
"->",
"audio_pause",
"=",
"FALSE",
";",
"info",
"->",
"audio_ended_normally",
"=",
"FALSE",
";",
"info",
"->",
"audio_lba",
"=",
"startlba",
";",
"info",
"->",
"audio_length",
"=",
"numblocks",
";",
"}"
] | cdda_start_audio - begin playback of a Red
Book audio track | [
"cdda_start_audio",
"-",
"begin",
"playback",
"of",
"a",
"Red",
"Book",
"audio",
"track"
] | [] | [
{
"param": "device",
"type": "running_device"
},
{
"param": "startlba",
"type": "UINT32"
},
{
"param": "numblocks",
"type": "UINT32"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "device",
"type": "running_device",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "startlba",
"type": "UINT32",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "numblocks",
"type": "UINT32",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_stop_audio | void | void cdda_stop_audio(running_device *device)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
info->audio_playing = FALSE;
info->audio_ended_normally = TRUE;
} | /*-------------------------------------------------
cdda_stop_audio - stop playback of a Red Book
audio track
-------------------------------------------------*/ | stop playback of a Red Book
audio track | [
"stop",
"playback",
"of",
"a",
"Red",
"Book",
"audio",
"track"
] | void cdda_stop_audio(running_device *device)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
info->audio_playing = FALSE;
info->audio_ended_normally = TRUE;
} | [
"void",
"cdda_stop_audio",
"(",
"running_device",
"*",
"device",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"device",
")",
";",
"stream_update",
"(",
"info",
"->",
"stream",
")",
";",
"info",
"->",
"audio_playing",
"=",
"FALSE",
";",
"info",
"->",
"audio_ended_normally",
"=",
"TRUE",
";",
"}"
] | cdda_stop_audio - stop playback of a Red Book
audio track | [
"cdda_stop_audio",
"-",
"stop",
"playback",
"of",
"a",
"Red",
"Book",
"audio",
"track"
] | [] | [
{
"param": "device",
"type": "running_device"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "device",
"type": "running_device",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_pause_audio | void | void cdda_pause_audio(running_device *device, int pause)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
info->audio_pause = pause;
} | /*-------------------------------------------------
cdda_pause_audio - pause/unpause playback of
a Red Book audio track
-------------------------------------------------*/ | pause/unpause playback of
a Red Book audio track | [
"pause",
"/",
"unpause",
"playback",
"of",
"a",
"Red",
"Book",
"audio",
"track"
] | void cdda_pause_audio(running_device *device, int pause)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
info->audio_pause = pause;
} | [
"void",
"cdda_pause_audio",
"(",
"running_device",
"*",
"device",
",",
"int",
"pause",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"device",
")",
";",
"stream_update",
"(",
"info",
"->",
"stream",
")",
";",
"info",
"->",
"audio_pause",
"=",
"pause",
";",
"}"
] | cdda_pause_audio - pause/unpause playback of
a Red Book audio track | [
"cdda_pause_audio",
"-",
"pause",
"/",
"unpause",
"playback",
"of",
"a",
"Red",
"Book",
"audio",
"track"
] | [] | [
{
"param": "device",
"type": "running_device"
},
{
"param": "pause",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "device",
"type": "running_device",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "pause",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_get_audio_lba | UINT32 | UINT32 cdda_get_audio_lba(running_device *device)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
return info->audio_lba;
} | /*-------------------------------------------------
cdda_get_audio_lba - returns the current LBA
(physical sector) during Red Book playback
-------------------------------------------------*/ | returns the current LBA
(physical sector) during Red Book playback | [
"returns",
"the",
"current",
"LBA",
"(",
"physical",
"sector",
")",
"during",
"Red",
"Book",
"playback"
] | UINT32 cdda_get_audio_lba(running_device *device)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
return info->audio_lba;
} | [
"UINT32",
"cdda_get_audio_lba",
"(",
"running_device",
"*",
"device",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"device",
")",
";",
"stream_update",
"(",
"info",
"->",
"stream",
")",
";",
"return",
"info",
"->",
"audio_lba",
";",
"}"
] | cdda_get_audio_lba - returns the current LBA
(physical sector) during Red Book playback | [
"cdda_get_audio_lba",
"-",
"returns",
"the",
"current",
"LBA",
"(",
"physical",
"sector",
")",
"during",
"Red",
"Book",
"playback"
] | [] | [
{
"param": "device",
"type": "running_device"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "device",
"type": "running_device",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_audio_active | int | int cdda_audio_active(running_device *device)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
return info->audio_playing;
} | /*-------------------------------------------------
cdda_audio_active - returns Red Book audio
playback status
-------------------------------------------------*/ | returns Red Book audio
playback status | [
"returns",
"Red",
"Book",
"audio",
"playback",
"status"
] | int cdda_audio_active(running_device *device)
{
cdda_info *info = get_safe_token(device);
stream_update(info->stream);
return info->audio_playing;
} | [
"int",
"cdda_audio_active",
"(",
"running_device",
"*",
"device",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"device",
")",
";",
"stream_update",
"(",
"info",
"->",
"stream",
")",
";",
"return",
"info",
"->",
"audio_playing",
";",
"}"
] | cdda_audio_active - returns Red Book audio
playback status | [
"cdda_audio_active",
"-",
"returns",
"Red",
"Book",
"audio",
"playback",
"status"
] | [] | [
{
"param": "device",
"type": "running_device"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "device",
"type": "running_device",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_audio_paused | int | int cdda_audio_paused(running_device *device)
{
cdda_info *info = get_safe_token(device);
return info->audio_pause;
} | /*-------------------------------------------------
cdda_audio_paused - returns if Red Book
playback is paused
-------------------------------------------------*/ | returns if Red Book
playback is paused | [
"returns",
"if",
"Red",
"Book",
"playback",
"is",
"paused"
] | int cdda_audio_paused(running_device *device)
{
cdda_info *info = get_safe_token(device);
return info->audio_pause;
} | [
"int",
"cdda_audio_paused",
"(",
"running_device",
"*",
"device",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"device",
")",
";",
"return",
"info",
"->",
"audio_pause",
";",
"}"
] | cdda_audio_paused - returns if Red Book
playback is paused | [
"cdda_audio_paused",
"-",
"returns",
"if",
"Red",
"Book",
"playback",
"is",
"paused"
] | [] | [
{
"param": "device",
"type": "running_device"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "device",
"type": "running_device",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b9488eb0596821c5d01e3145f1ed9a457653b116 | lofunz/mieme | Reloaded/trunk/src/emu/sound/cdda.c | [
"Unlicense"
] | C | cdda_audio_ended | int | int cdda_audio_ended(running_device *device)
{
cdda_info *info = get_safe_token(device);
return info->audio_ended_normally;
} | /*-------------------------------------------------
cdda_audio_ended - returns if a Red Book
track reached it's natural end
-------------------------------------------------*/ | returns if a Red Book
track reached it's natural end | [
"returns",
"if",
"a",
"Red",
"Book",
"track",
"reached",
"it",
"'",
"s",
"natural",
"end"
] | int cdda_audio_ended(running_device *device)
{
cdda_info *info = get_safe_token(device);
return info->audio_ended_normally;
} | [
"int",
"cdda_audio_ended",
"(",
"running_device",
"*",
"device",
")",
"{",
"cdda_info",
"*",
"info",
"=",
"get_safe_token",
"(",
"device",
")",
";",
"return",
"info",
"->",
"audio_ended_normally",
";",
"}"
] | cdda_audio_ended - returns if a Red Book
track reached it's natural end | [
"cdda_audio_ended",
"-",
"returns",
"if",
"a",
"Red",
"Book",
"track",
"reached",
"it",
"'",
"s",
"natural",
"end"
] | [] | [
{
"param": "device",
"type": "running_device"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "device",
"type": "running_device",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9e84dd6167ca80c43b7e1de48990d754b5e2906 | lofunz/mieme | Reloaded/trunk/src/mame/machine/dc.c | [
"Unlicense"
] | C | rtc_initial_setup | void | static void rtc_initial_setup(running_machine *machine)
{
static UINT32 current_time;
static int year_count,cur_year,i;
static const int month_to_day_conversion[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
system_time systime;
machine->base_datetime(systime);
memset(dc_rtcregister, 0, sizeof(dc_rtcregister));
/* put the seconds */
current_time = systime.local_time.second;
/* put the minutes */
current_time+= systime.local_time.minute*60;
/* put the hours */
current_time+= systime.local_time.hour*60*60;
/* put the days (note -1) */
current_time+= (systime.local_time.mday-1)*60*60*24;
/* take the current year here for calculating leaps */
cur_year = (systime.local_time.year);
/* take the months - despite popular beliefs, leap years aren't just evenly divisible by 4 */
if(((((cur_year % 4) == 0) && ((cur_year % 100) != 0)) || ((cur_year % 400) == 0)) && systime.local_time.month > 2)
current_time+= (month_to_day_conversion[systime.local_time.month]+1)*60*60*24;
else
current_time+= (month_to_day_conversion[systime.local_time.month])*60*60*24;
/* put the years */
year_count = (cur_year-1949);
for(i=0;i<year_count-1;i++)
current_time += (((((i+1950) % 4) == 0) && (((i+1950) % 100) != 0)) || (((i+1950) % 400) == 0)) ? 60*60*24*366 : 60*60*24*365;
dc_rtcregister[RTC2] = current_time & 0x0000ffff;
dc_rtcregister[RTC1] = (current_time & 0xffff0000) >> 16;
dc_rtc_timer = timer_alloc(machine, dc_rtc_increment, 0);
} | /* fill the RTC registers with the proper start-up values */ | fill the RTC registers with the proper start-up values | [
"fill",
"the",
"RTC",
"registers",
"with",
"the",
"proper",
"start",
"-",
"up",
"values"
] | static void rtc_initial_setup(running_machine *machine)
{
static UINT32 current_time;
static int year_count,cur_year,i;
static const int month_to_day_conversion[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
system_time systime;
machine->base_datetime(systime);
memset(dc_rtcregister, 0, sizeof(dc_rtcregister));
current_time = systime.local_time.second;
current_time+= systime.local_time.minute*60;
current_time+= systime.local_time.hour*60*60;
current_time+= (systime.local_time.mday-1)*60*60*24;
cur_year = (systime.local_time.year);
if(((((cur_year % 4) == 0) && ((cur_year % 100) != 0)) || ((cur_year % 400) == 0)) && systime.local_time.month > 2)
current_time+= (month_to_day_conversion[systime.local_time.month]+1)*60*60*24;
else
current_time+= (month_to_day_conversion[systime.local_time.month])*60*60*24;
year_count = (cur_year-1949);
for(i=0;i<year_count-1;i++)
current_time += (((((i+1950) % 4) == 0) && (((i+1950) % 100) != 0)) || (((i+1950) % 400) == 0)) ? 60*60*24*366 : 60*60*24*365;
dc_rtcregister[RTC2] = current_time & 0x0000ffff;
dc_rtcregister[RTC1] = (current_time & 0xffff0000) >> 16;
dc_rtc_timer = timer_alloc(machine, dc_rtc_increment, 0);
} | [
"static",
"void",
"rtc_initial_setup",
"(",
"running_machine",
"*",
"machine",
")",
"{",
"static",
"UINT32",
"current_time",
";",
"static",
"int",
"year_count",
",",
"cur_year",
",",
"i",
";",
"static",
"const",
"int",
"month_to_day_conversion",
"[",
"12",
"]",
"=",
"{",
"0",
",",
"31",
",",
"59",
",",
"90",
",",
"120",
",",
"151",
",",
"181",
",",
"212",
",",
"243",
",",
"273",
",",
"304",
",",
"334",
"}",
";",
"system_time",
"systime",
";",
"machine",
"->",
"base_datetime",
"(",
"systime",
")",
";",
"memset",
"(",
"dc_rtcregister",
",",
"0",
",",
"sizeof",
"(",
"dc_rtcregister",
")",
")",
";",
"current_time",
"=",
"systime",
".",
"local_time",
".",
"second",
";",
"current_time",
"+=",
"systime",
".",
"local_time",
".",
"minute",
"*",
"60",
";",
"current_time",
"+=",
"systime",
".",
"local_time",
".",
"hour",
"*",
"60",
"*",
"60",
";",
"current_time",
"+=",
"(",
"systime",
".",
"local_time",
".",
"mday",
"-",
"1",
")",
"*",
"60",
"*",
"60",
"*",
"24",
";",
"cur_year",
"=",
"(",
"systime",
".",
"local_time",
".",
"year",
")",
";",
"if",
"(",
"(",
"(",
"(",
"(",
"cur_year",
"%",
"4",
")",
"==",
"0",
")",
"&&",
"(",
"(",
"cur_year",
"%",
"100",
")",
"!=",
"0",
")",
")",
"||",
"(",
"(",
"cur_year",
"%",
"400",
")",
"==",
"0",
")",
")",
"&&",
"systime",
".",
"local_time",
".",
"month",
">",
"2",
")",
"current_time",
"+=",
"(",
"month_to_day_conversion",
"[",
"systime",
".",
"local_time",
".",
"month",
"]",
"+",
"1",
")",
"*",
"60",
"*",
"60",
"*",
"24",
";",
"else",
"current_time",
"+=",
"(",
"month_to_day_conversion",
"[",
"systime",
".",
"local_time",
".",
"month",
"]",
")",
"*",
"60",
"*",
"60",
"*",
"24",
";",
"year_count",
"=",
"(",
"cur_year",
"-",
"1949",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"year_count",
"-",
"1",
";",
"i",
"++",
")",
"current_time",
"+=",
"(",
"(",
"(",
"(",
"(",
"i",
"+",
"1950",
")",
"%",
"4",
")",
"==",
"0",
")",
"&&",
"(",
"(",
"(",
"i",
"+",
"1950",
")",
"%",
"100",
")",
"!=",
"0",
")",
")",
"||",
"(",
"(",
"(",
"i",
"+",
"1950",
")",
"%",
"400",
")",
"==",
"0",
")",
")",
"?",
"60",
"*",
"60",
"*",
"24",
"*",
"366",
":",
"60",
"*",
"60",
"*",
"24",
"*",
"365",
";",
"dc_rtcregister",
"[",
"RTC2",
"]",
"=",
"current_time",
"&",
"0x0000ffff",
";",
"dc_rtcregister",
"[",
"RTC1",
"]",
"=",
"(",
"current_time",
"&",
"0xffff0000",
")",
">>",
"16",
";",
"dc_rtc_timer",
"=",
"timer_alloc",
"(",
"machine",
",",
"dc_rtc_increment",
",",
"0",
")",
";",
"}"
] | fill the RTC registers with the proper start-up values | [
"fill",
"the",
"RTC",
"registers",
"with",
"the",
"proper",
"start",
"-",
"up",
"values"
] | [
"/* put the seconds */",
"/* put the minutes */",
"/* put the hours */",
"/* put the days (note -1) */",
"/* take the current year here for calculating leaps */",
"/* take the months - despite popular beliefs, leap years aren't just evenly divisible by 4 */",
"/* put the years */"
] | [
{
"param": "machine",
"type": "running_machine"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1644458f56d055ee8a249ab51fc828f34d5cf2c3 | lofunz/mieme | Reloaded/trunk/src/mame/machine/naomibd.c | [
"Unlicense"
] | C | block_decrypt | UINT16 | static UINT16 block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data)
{
int j;
int aux,aux2;
int A,B;
int middle_result;
UINT32 fn1_subkeys[4];
UINT32 fn2_subkeys[4];
/* Game-key scheduling; this could be done just once per game at initialization time */
memset(fn1_subkeys,0,sizeof(UINT32)*4);
memset(fn2_subkeys,0,sizeof(UINT32)*4);
for (j=0; j<30; ++j)
{
if (BIT(game_key, fn1_game_key_scheduling[j][0])!=0)
{
aux = fn1_game_key_scheduling[j][1]%24;
aux2 = fn1_game_key_scheduling[j][1]/24;
fn1_subkeys[aux2] ^= (1<<aux);
}
}
for (j=0; j<27; ++j)
{
if (BIT(game_key, fn2_game_key_scheduling[j][0])!=0)
{
aux = fn2_game_key_scheduling[j][1]%24;
aux2 = fn2_game_key_scheduling[j][1]/24;
fn2_subkeys[aux2] ^= (1<<aux);
}
}
/********************************************************/
/* Sequence-key scheduling; this could be done just once per decryption run */
for (j=0; j<20; ++j)
{
if (BIT(sequence_key,fn1_sequence_key_scheduling[j][0])!=0)
{
aux = fn1_sequence_key_scheduling[j][1]%24;
aux2 = fn1_sequence_key_scheduling[j][1]/24;
fn1_subkeys[aux2] ^= (1<<aux);
}
}
for (j=0; j<16; ++j)
{
if (BIT(sequence_key,j)!=0)
{
aux = fn2_sequence_key_scheduling[j]%24;
aux2 = fn2_sequence_key_scheduling[j]/24;
fn2_subkeys[aux2] ^= (1<<aux);
}
}
// subkeys bits 10 & 41
fn2_subkeys[0] ^= (BIT(sequence_key,2)<<10);
fn2_subkeys[1] ^= (BIT(sequence_key,4)<<17);
/**************************************************************/
// First Feistel Network
aux = BITSWAP16(counter,5,12,14,13,9,3,6,4, 8,1,15,11,0,7,10,2);
// 1st round
B = aux >> 8;
A = (aux & 0xff) ^ feistel_function(B,fn1_sboxes[0],fn1_subkeys[0]);
// 2nd round
B = B ^ feistel_function(A,fn1_sboxes[1],fn1_subkeys[1]);
// 3rd round
A = A ^ feistel_function(B,fn1_sboxes[2],fn1_subkeys[2]);
// 4th round
B = B ^ feistel_function(A,fn1_sboxes[3],fn1_subkeys[3]);
middle_result = (B<<8)|A;
/* Middle-result-key sheduling */
for (j=0; j<16; ++j)
{
if (BIT(middle_result,j)!=0)
{
aux = fn2_middle_result_scheduling[j]%24;
aux2 = fn2_middle_result_scheduling[j]/24;
fn2_subkeys[aux2] ^= (1<<aux);
}
}
/*********************/
// Second Feistel Network
aux = BITSWAP16(data,14,3,8,12,13,7,15,4, 6,2,9,5,11,0,1,10);
// 1st round
B = aux >> 8;
A = (aux & 0xff) ^ feistel_function(B,fn2_sboxes[0],fn2_subkeys[0]);
// 2nd round
B = B ^ feistel_function(A,fn2_sboxes[1],fn2_subkeys[1]);
// 3rd round
A = A ^ feistel_function(B,fn2_sboxes[2],fn2_subkeys[2]);
// 4th round
B = B ^ feistel_function(A,fn2_sboxes[3],fn2_subkeys[3]);
aux = (B<<8)|A;
aux = BITSWAP16(aux,15,7,6,14,13,12,5,4, 3,2,11,10,9,1,0,8);
return aux;
} | /**************************
This implementation is an "educational" version. It must be noted that it can be speed-optimized in a number of ways.
The most evident one is to factor out the parts of the key-scheduling that must only be done once (like the game-key &
sequence-key parts) as noted in the comments inlined in the function. More sophisticated speed-ups can be gained by
noticing that the weak key-scheduling would allow to create some pregenerated look-up tables for doing most of the work
of the function. Even so, it would still be pretty slow, so caching techniques could be a wiser option here.
**************************/ | This implementation is an "educational" version. It must be noted that it can be speed-optimized in a number of ways.
The most evident one is to factor out the parts of the key-scheduling that must only be done once (like the game-key &
sequence-key parts) as noted in the comments inlined in the function. More sophisticated speed-ups can be gained by
noticing that the weak key-scheduling would allow to create some pregenerated look-up tables for doing most of the work
of the function. Even so, it would still be pretty slow, so caching techniques could be a wiser option here. | [
"This",
"implementation",
"is",
"an",
"\"",
"educational",
"\"",
"version",
".",
"It",
"must",
"be",
"noted",
"that",
"it",
"can",
"be",
"speed",
"-",
"optimized",
"in",
"a",
"number",
"of",
"ways",
".",
"The",
"most",
"evident",
"one",
"is",
"to",
"factor",
"out",
"the",
"parts",
"of",
"the",
"key",
"-",
"scheduling",
"that",
"must",
"only",
"be",
"done",
"once",
"(",
"like",
"the",
"game",
"-",
"key",
"&",
"sequence",
"-",
"key",
"parts",
")",
"as",
"noted",
"in",
"the",
"comments",
"inlined",
"in",
"the",
"function",
".",
"More",
"sophisticated",
"speed",
"-",
"ups",
"can",
"be",
"gained",
"by",
"noticing",
"that",
"the",
"weak",
"key",
"-",
"scheduling",
"would",
"allow",
"to",
"create",
"some",
"pregenerated",
"look",
"-",
"up",
"tables",
"for",
"doing",
"most",
"of",
"the",
"work",
"of",
"the",
"function",
".",
"Even",
"so",
"it",
"would",
"still",
"be",
"pretty",
"slow",
"so",
"caching",
"techniques",
"could",
"be",
"a",
"wiser",
"option",
"here",
"."
] | static UINT16 block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data)
{
int j;
int aux,aux2;
int A,B;
int middle_result;
UINT32 fn1_subkeys[4];
UINT32 fn2_subkeys[4];
memset(fn1_subkeys,0,sizeof(UINT32)*4);
memset(fn2_subkeys,0,sizeof(UINT32)*4);
for (j=0; j<30; ++j)
{
if (BIT(game_key, fn1_game_key_scheduling[j][0])!=0)
{
aux = fn1_game_key_scheduling[j][1]%24;
aux2 = fn1_game_key_scheduling[j][1]/24;
fn1_subkeys[aux2] ^= (1<<aux);
}
}
for (j=0; j<27; ++j)
{
if (BIT(game_key, fn2_game_key_scheduling[j][0])!=0)
{
aux = fn2_game_key_scheduling[j][1]%24;
aux2 = fn2_game_key_scheduling[j][1]/24;
fn2_subkeys[aux2] ^= (1<<aux);
}
}
for (j=0; j<20; ++j)
{
if (BIT(sequence_key,fn1_sequence_key_scheduling[j][0])!=0)
{
aux = fn1_sequence_key_scheduling[j][1]%24;
aux2 = fn1_sequence_key_scheduling[j][1]/24;
fn1_subkeys[aux2] ^= (1<<aux);
}
}
for (j=0; j<16; ++j)
{
if (BIT(sequence_key,j)!=0)
{
aux = fn2_sequence_key_scheduling[j]%24;
aux2 = fn2_sequence_key_scheduling[j]/24;
fn2_subkeys[aux2] ^= (1<<aux);
}
}
fn2_subkeys[0] ^= (BIT(sequence_key,2)<<10);
fn2_subkeys[1] ^= (BIT(sequence_key,4)<<17);
aux = BITSWAP16(counter,5,12,14,13,9,3,6,4, 8,1,15,11,0,7,10,2);
B = aux >> 8;
A = (aux & 0xff) ^ feistel_function(B,fn1_sboxes[0],fn1_subkeys[0]);
B = B ^ feistel_function(A,fn1_sboxes[1],fn1_subkeys[1]);
A = A ^ feistel_function(B,fn1_sboxes[2],fn1_subkeys[2]);
B = B ^ feistel_function(A,fn1_sboxes[3],fn1_subkeys[3]);
middle_result = (B<<8)|A;
for (j=0; j<16; ++j)
{
if (BIT(middle_result,j)!=0)
{
aux = fn2_middle_result_scheduling[j]%24;
aux2 = fn2_middle_result_scheduling[j]/24;
fn2_subkeys[aux2] ^= (1<<aux);
}
}
aux = BITSWAP16(data,14,3,8,12,13,7,15,4, 6,2,9,5,11,0,1,10);
B = aux >> 8;
A = (aux & 0xff) ^ feistel_function(B,fn2_sboxes[0],fn2_subkeys[0]);
B = B ^ feistel_function(A,fn2_sboxes[1],fn2_subkeys[1]);
A = A ^ feistel_function(B,fn2_sboxes[2],fn2_subkeys[2]);
B = B ^ feistel_function(A,fn2_sboxes[3],fn2_subkeys[3]);
aux = (B<<8)|A;
aux = BITSWAP16(aux,15,7,6,14,13,12,5,4, 3,2,11,10,9,1,0,8);
return aux;
} | [
"static",
"UINT16",
"block_decrypt",
"(",
"UINT32",
"game_key",
",",
"UINT16",
"sequence_key",
",",
"UINT16",
"counter",
",",
"UINT16",
"data",
")",
"{",
"int",
"j",
";",
"int",
"aux",
",",
"aux2",
";",
"int",
"A",
",",
"B",
";",
"int",
"middle_result",
";",
"UINT32",
"fn1_subkeys",
"[",
"4",
"]",
";",
"UINT32",
"fn2_subkeys",
"[",
"4",
"]",
";",
"memset",
"(",
"fn1_subkeys",
",",
"0",
",",
"sizeof",
"(",
"UINT32",
")",
"*",
"4",
")",
";",
"memset",
"(",
"fn2_subkeys",
",",
"0",
",",
"sizeof",
"(",
"UINT32",
")",
"*",
"4",
")",
";",
"for",
"(",
"j",
"=",
"0",
";",
"j",
"<",
"30",
";",
"++",
"j",
")",
"{",
"if",
"(",
"BIT",
"(",
"game_key",
",",
"fn1_game_key_scheduling",
"[",
"j",
"]",
"[",
"0",
"]",
")",
"!=",
"0",
")",
"{",
"aux",
"=",
"fn1_game_key_scheduling",
"[",
"j",
"]",
"[",
"1",
"]",
"%",
"24",
";",
"aux2",
"=",
"fn1_game_key_scheduling",
"[",
"j",
"]",
"[",
"1",
"]",
"/",
"24",
";",
"fn1_subkeys",
"[",
"aux2",
"]",
"^=",
"(",
"1",
"<<",
"aux",
")",
";",
"}",
"}",
"for",
"(",
"j",
"=",
"0",
";",
"j",
"<",
"27",
";",
"++",
"j",
")",
"{",
"if",
"(",
"BIT",
"(",
"game_key",
",",
"fn2_game_key_scheduling",
"[",
"j",
"]",
"[",
"0",
"]",
")",
"!=",
"0",
")",
"{",
"aux",
"=",
"fn2_game_key_scheduling",
"[",
"j",
"]",
"[",
"1",
"]",
"%",
"24",
";",
"aux2",
"=",
"fn2_game_key_scheduling",
"[",
"j",
"]",
"[",
"1",
"]",
"/",
"24",
";",
"fn2_subkeys",
"[",
"aux2",
"]",
"^=",
"(",
"1",
"<<",
"aux",
")",
";",
"}",
"}",
"for",
"(",
"j",
"=",
"0",
";",
"j",
"<",
"20",
";",
"++",
"j",
")",
"{",
"if",
"(",
"BIT",
"(",
"sequence_key",
",",
"fn1_sequence_key_scheduling",
"[",
"j",
"]",
"[",
"0",
"]",
")",
"!=",
"0",
")",
"{",
"aux",
"=",
"fn1_sequence_key_scheduling",
"[",
"j",
"]",
"[",
"1",
"]",
"%",
"24",
";",
"aux2",
"=",
"fn1_sequence_key_scheduling",
"[",
"j",
"]",
"[",
"1",
"]",
"/",
"24",
";",
"fn1_subkeys",
"[",
"aux2",
"]",
"^=",
"(",
"1",
"<<",
"aux",
")",
";",
"}",
"}",
"for",
"(",
"j",
"=",
"0",
";",
"j",
"<",
"16",
";",
"++",
"j",
")",
"{",
"if",
"(",
"BIT",
"(",
"sequence_key",
",",
"j",
")",
"!=",
"0",
")",
"{",
"aux",
"=",
"fn2_sequence_key_scheduling",
"[",
"j",
"]",
"%",
"24",
";",
"aux2",
"=",
"fn2_sequence_key_scheduling",
"[",
"j",
"]",
"/",
"24",
";",
"fn2_subkeys",
"[",
"aux2",
"]",
"^=",
"(",
"1",
"<<",
"aux",
")",
";",
"}",
"}",
"fn2_subkeys",
"[",
"0",
"]",
"^=",
"(",
"BIT",
"(",
"sequence_key",
",",
"2",
")",
"<<",
"10",
")",
";",
"fn2_subkeys",
"[",
"1",
"]",
"^=",
"(",
"BIT",
"(",
"sequence_key",
",",
"4",
")",
"<<",
"17",
")",
";",
"aux",
"=",
"BITSWAP16",
"(",
"counter",
",",
"5",
",",
"12",
",",
"14",
",",
"13",
",",
"9",
",",
"3",
",",
"6",
",",
"4",
",",
"8",
",",
"1",
",",
"15",
",",
"11",
",",
"0",
",",
"7",
",",
"10",
",",
"2",
")",
";",
"B",
"=",
"aux",
">>",
"8",
";",
"A",
"=",
"(",
"aux",
"&",
"0xff",
")",
"^",
"feistel_function",
"(",
"B",
",",
"fn1_sboxes",
"[",
"0",
"]",
",",
"fn1_subkeys",
"[",
"0",
"]",
")",
";",
"B",
"=",
"B",
"^",
"feistel_function",
"(",
"A",
",",
"fn1_sboxes",
"[",
"1",
"]",
",",
"fn1_subkeys",
"[",
"1",
"]",
")",
";",
"A",
"=",
"A",
"^",
"feistel_function",
"(",
"B",
",",
"fn1_sboxes",
"[",
"2",
"]",
",",
"fn1_subkeys",
"[",
"2",
"]",
")",
";",
"B",
"=",
"B",
"^",
"feistel_function",
"(",
"A",
",",
"fn1_sboxes",
"[",
"3",
"]",
",",
"fn1_subkeys",
"[",
"3",
"]",
")",
";",
"middle_result",
"=",
"(",
"B",
"<<",
"8",
")",
"|",
"A",
";",
"for",
"(",
"j",
"=",
"0",
";",
"j",
"<",
"16",
";",
"++",
"j",
")",
"{",
"if",
"(",
"BIT",
"(",
"middle_result",
",",
"j",
")",
"!=",
"0",
")",
"{",
"aux",
"=",
"fn2_middle_result_scheduling",
"[",
"j",
"]",
"%",
"24",
";",
"aux2",
"=",
"fn2_middle_result_scheduling",
"[",
"j",
"]",
"/",
"24",
";",
"fn2_subkeys",
"[",
"aux2",
"]",
"^=",
"(",
"1",
"<<",
"aux",
")",
";",
"}",
"}",
"aux",
"=",
"BITSWAP16",
"(",
"data",
",",
"14",
",",
"3",
",",
"8",
",",
"12",
",",
"13",
",",
"7",
",",
"15",
",",
"4",
",",
"6",
",",
"2",
",",
"9",
",",
"5",
",",
"11",
",",
"0",
",",
"1",
",",
"10",
")",
";",
"B",
"=",
"aux",
">>",
"8",
";",
"A",
"=",
"(",
"aux",
"&",
"0xff",
")",
"^",
"feistel_function",
"(",
"B",
",",
"fn2_sboxes",
"[",
"0",
"]",
",",
"fn2_subkeys",
"[",
"0",
"]",
")",
";",
"B",
"=",
"B",
"^",
"feistel_function",
"(",
"A",
",",
"fn2_sboxes",
"[",
"1",
"]",
",",
"fn2_subkeys",
"[",
"1",
"]",
")",
";",
"A",
"=",
"A",
"^",
"feistel_function",
"(",
"B",
",",
"fn2_sboxes",
"[",
"2",
"]",
",",
"fn2_subkeys",
"[",
"2",
"]",
")",
";",
"B",
"=",
"B",
"^",
"feistel_function",
"(",
"A",
",",
"fn2_sboxes",
"[",
"3",
"]",
",",
"fn2_subkeys",
"[",
"3",
"]",
")",
";",
"aux",
"=",
"(",
"B",
"<<",
"8",
")",
"|",
"A",
";",
"aux",
"=",
"BITSWAP16",
"(",
"aux",
",",
"15",
",",
"7",
",",
"6",
",",
"14",
",",
"13",
",",
"12",
",",
"5",
",",
"4",
",",
"3",
",",
"2",
",",
"11",
",",
"10",
",",
"9",
",",
"1",
",",
"0",
",",
"8",
")",
";",
"return",
"aux",
";",
"}"
] | This implementation is an "educational" version. | [
"This",
"implementation",
"is",
"an",
"\"",
"educational",
"\"",
"version",
"."
] | [
"/* Game-key scheduling; this could be done just once per game at initialization time */",
"/********************************************************/",
"/* Sequence-key scheduling; this could be done just once per decryption run */",
"// subkeys bits 10 & 41\r",
"/**************************************************************/",
"// First Feistel Network\r",
"// 1st round\r",
"// 2nd round\r",
"// 3rd round\r",
"// 4th round\r",
"/* Middle-result-key sheduling */",
"/*********************/",
"// Second Feistel Network\r",
"// 1st round\r",
"// 2nd round\r",
"// 3rd round\r",
"// 4th round\r"
] | [
{
"param": "game_key",
"type": "UINT32"
},
{
"param": "sequence_key",
"type": "UINT16"
},
{
"param": "counter",
"type": "UINT16"
},
{
"param": "data",
"type": "UINT16"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "game_key",
"type": "UINT32",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sequence_key",
"type": "UINT16",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "counter",
"type": "UINT16",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": "UINT16",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8354c20274df6207f2e0973d4442958dcd710e55 | lofunz/mieme | Reloaded/trunk/src/mame/machine/snesst10.c | [
"Unlicense"
] | C | st010_op_05_do_work | void | static void st010_op_05_do_work( INT16 x0, INT16 y0 )
{
INT16 x1, y1, quadrant;
if ((x0 < 0) && (y0 < 0))
{
x1 = -x0;
y1 = -y0;
quadrant = -0x8000;
}
else if (x0 < 0)
{
x1 = y0;
y1 = -x0;
quadrant = -0x4000;
}
else if (y0 < 0)
{
x1 = -y0;
y1 = x0;
quadrant = 0x4000;
}
else
{
x1 = x0;
y1 = y0;
quadrant = 0x0000;
}
while((x1 > 0x1f) || (y1 > 0x1f))
{
if (x1 > 1)
x1 >>= 1;
if (y1 > 1)
y1 >>= 1;
}
if (y1 == 0)
quadrant += 0x4000;
st010_state.o1 = (st010_arctan[y1][x1] << 8) ^ quadrant;
} | // same as op_01_do_work, but we are only interested in the angle!
| same as op_01_do_work, but we are only interested in the angle! | [
"same",
"as",
"op_01_do_work",
"but",
"we",
"are",
"only",
"interested",
"in",
"the",
"angle!"
] | static void st010_op_05_do_work( INT16 x0, INT16 y0 )
{
INT16 x1, y1, quadrant;
if ((x0 < 0) && (y0 < 0))
{
x1 = -x0;
y1 = -y0;
quadrant = -0x8000;
}
else if (x0 < 0)
{
x1 = y0;
y1 = -x0;
quadrant = -0x4000;
}
else if (y0 < 0)
{
x1 = -y0;
y1 = x0;
quadrant = 0x4000;
}
else
{
x1 = x0;
y1 = y0;
quadrant = 0x0000;
}
while((x1 > 0x1f) || (y1 > 0x1f))
{
if (x1 > 1)
x1 >>= 1;
if (y1 > 1)
y1 >>= 1;
}
if (y1 == 0)
quadrant += 0x4000;
st010_state.o1 = (st010_arctan[y1][x1] << 8) ^ quadrant;
} | [
"static",
"void",
"st010_op_05_do_work",
"(",
"INT16",
"x0",
",",
"INT16",
"y0",
")",
"{",
"INT16",
"x1",
",",
"y1",
",",
"quadrant",
";",
"if",
"(",
"(",
"x0",
"<",
"0",
")",
"&&",
"(",
"y0",
"<",
"0",
")",
")",
"{",
"x1",
"=",
"-",
"x0",
";",
"y1",
"=",
"-",
"y0",
";",
"quadrant",
"=",
"-0x8000",
";",
"}",
"else",
"if",
"(",
"x0",
"<",
"0",
")",
"{",
"x1",
"=",
"y0",
";",
"y1",
"=",
"-",
"x0",
";",
"quadrant",
"=",
"-0x4000",
";",
"}",
"else",
"if",
"(",
"y0",
"<",
"0",
")",
"{",
"x1",
"=",
"-",
"y0",
";",
"y1",
"=",
"x0",
";",
"quadrant",
"=",
"0x4000",
";",
"}",
"else",
"{",
"x1",
"=",
"x0",
";",
"y1",
"=",
"y0",
";",
"quadrant",
"=",
"0x0000",
";",
"}",
"while",
"(",
"(",
"x1",
">",
"0x1f",
")",
"||",
"(",
"y1",
">",
"0x1f",
")",
")",
"{",
"if",
"(",
"x1",
">",
"1",
")",
"x1",
">>=",
"1",
";",
"if",
"(",
"y1",
">",
"1",
")",
"y1",
">>=",
"1",
";",
"}",
"if",
"(",
"y1",
"==",
"0",
")",
"quadrant",
"+=",
"0x4000",
";",
"st010_state",
".",
"o1",
"=",
"(",
"st010_arctan",
"[",
"y1",
"]",
"[",
"x1",
"]",
"<<",
"8",
")",
"^",
"quadrant",
";",
"}"
] | same as op_01_do_work, but we are only interested in the angle! | [
"same",
"as",
"op_01_do_work",
"but",
"we",
"are",
"only",
"interested",
"in",
"the",
"angle!"
] | [] | [
{
"param": "x0",
"type": "INT16"
},
{
"param": "y0",
"type": "INT16"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "x0",
"type": "INT16",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "y0",
"type": "INT16",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
0f58c1b45ffab1037aea19dad622869d6abb2fca | lofunz/mieme | Reloaded/tags/MAME4droid.Reloaded.1.0.WIP/src/mame/drivers/limenko.c | [
"Unlicense"
] | C | draw_sprites | void | static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectangle *cliprect, int count)
{
int i;
UINT8 *base_gfx = memory_region(machine, "gfx1");
UINT8 *gfx_max = base_gfx + memory_region_length(machine, "gfx1");
UINT8 *gfxdata;
gfx_element gfx;
for(i = 0; i <= count*2; i += 2)
{
int x, width, flipx, y, height, flipy, code, color, pri;
if(~sprites[i] & 0x80000000) continue;
x = ((sprites[i] & 0x1ff0000) >> 16);
width = (((sprites[i] & 0xe000000) >> 25) + 1) * 8;
flipx = sprites[i] & 0x10000000;
y = sprites[i] & 0x1ff;
height = (((sprites[i] & 0xe00) >> 9) + 1) * 8;
flipy = sprites[i] & 0x1000;
code = sprites[i + 1] & 0x7ffff;
color = (sprites[i + 1] & 0xf0000000) >> 28;
if(sprites[i + 1] & 0x04000000)
{
// below fg
pri = 1;
}
else
{
// above everything
pri = 2;
}
gfxdata = base_gfx + 64 * code;
/* Bounds checking */
if ( (gfxdata + width * height - 1) >= gfx_max )
continue;
/* prepare GfxElement on the fly */
gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width, 0, 256, 0);
draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y,pri);
// wrap around x
draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x-512,y,pri);
// wrap around y
draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y-512,pri);
// wrap around x and y
draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x-512,y-512,pri);
}
} | // sprites aren't tile based (except for 8x8 ones) | sprites aren't tile based (except for 8x8 ones) | [
"sprites",
"aren",
"'",
"t",
"tile",
"based",
"(",
"except",
"for",
"8x8",
"ones",
")"
] | static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectangle *cliprect, int count)
{
int i;
UINT8 *base_gfx = memory_region(machine, "gfx1");
UINT8 *gfx_max = base_gfx + memory_region_length(machine, "gfx1");
UINT8 *gfxdata;
gfx_element gfx;
for(i = 0; i <= count*2; i += 2)
{
int x, width, flipx, y, height, flipy, code, color, pri;
if(~sprites[i] & 0x80000000) continue;
x = ((sprites[i] & 0x1ff0000) >> 16);
width = (((sprites[i] & 0xe000000) >> 25) + 1) * 8;
flipx = sprites[i] & 0x10000000;
y = sprites[i] & 0x1ff;
height = (((sprites[i] & 0xe00) >> 9) + 1) * 8;
flipy = sprites[i] & 0x1000;
code = sprites[i + 1] & 0x7ffff;
color = (sprites[i + 1] & 0xf0000000) >> 28;
if(sprites[i + 1] & 0x04000000)
{
pri = 1;
}
else
{
pri = 2;
}
gfxdata = base_gfx + 64 * code;
if ( (gfxdata + width * height - 1) >= gfx_max )
continue;
gfx_element_build_temporary(&gfx, machine, gfxdata, width, height, width, 0, 256, 0);
draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y,pri);
draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x-512,y,pri);
draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y-512,pri);
and y
draw_single_sprite(sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x-512,y-512,pri);
}
} | [
"static",
"void",
"draw_sprites",
"(",
"running_machine",
"*",
"machine",
",",
"UINT32",
"*",
"sprites",
",",
"const",
"rectangle",
"*",
"cliprect",
",",
"int",
"count",
")",
"{",
"int",
"i",
";",
"UINT8",
"*",
"base_gfx",
"=",
"memory_region",
"(",
"machine",
",",
"\"",
"\"",
")",
";",
"UINT8",
"*",
"gfx_max",
"=",
"base_gfx",
"+",
"memory_region_length",
"(",
"machine",
",",
"\"",
"\"",
")",
";",
"UINT8",
"*",
"gfxdata",
";",
"gfx_element",
"gfx",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<=",
"count",
"*",
"2",
";",
"i",
"+=",
"2",
")",
"{",
"int",
"x",
",",
"width",
",",
"flipx",
",",
"y",
",",
"height",
",",
"flipy",
",",
"code",
",",
"color",
",",
"pri",
";",
"if",
"(",
"~",
"sprites",
"[",
"i",
"]",
"&",
"0x80000000",
")",
"continue",
";",
"x",
"=",
"(",
"(",
"sprites",
"[",
"i",
"]",
"&",
"0x1ff0000",
")",
">>",
"16",
")",
";",
"width",
"=",
"(",
"(",
"(",
"sprites",
"[",
"i",
"]",
"&",
"0xe000000",
")",
">>",
"25",
")",
"+",
"1",
")",
"*",
"8",
";",
"flipx",
"=",
"sprites",
"[",
"i",
"]",
"&",
"0x10000000",
";",
"y",
"=",
"sprites",
"[",
"i",
"]",
"&",
"0x1ff",
";",
"height",
"=",
"(",
"(",
"(",
"sprites",
"[",
"i",
"]",
"&",
"0xe00",
")",
">>",
"9",
")",
"+",
"1",
")",
"*",
"8",
";",
"flipy",
"=",
"sprites",
"[",
"i",
"]",
"&",
"0x1000",
";",
"code",
"=",
"sprites",
"[",
"i",
"+",
"1",
"]",
"&",
"0x7ffff",
";",
"color",
"=",
"(",
"sprites",
"[",
"i",
"+",
"1",
"]",
"&",
"0xf0000000",
")",
">>",
"28",
";",
"if",
"(",
"sprites",
"[",
"i",
"+",
"1",
"]",
"&",
"0x04000000",
")",
"{",
"pri",
"=",
"1",
";",
"}",
"else",
"{",
"pri",
"=",
"2",
";",
"}",
"gfxdata",
"=",
"base_gfx",
"+",
"64",
"*",
"code",
";",
"if",
"(",
"(",
"gfxdata",
"+",
"width",
"*",
"height",
"-",
"1",
")",
">=",
"gfx_max",
")",
"continue",
";",
"gfx_element_build_temporary",
"(",
"&",
"gfx",
",",
"machine",
",",
"gfxdata",
",",
"width",
",",
"height",
",",
"width",
",",
"0",
",",
"256",
",",
"0",
")",
";",
"draw_single_sprite",
"(",
"sprites_bitmap",
",",
"cliprect",
",",
"&",
"gfx",
",",
"0",
",",
"color",
",",
"flipx",
",",
"flipy",
",",
"x",
",",
"y",
",",
"pri",
")",
";",
"draw_single_sprite",
"(",
"sprites_bitmap",
",",
"cliprect",
",",
"&",
"gfx",
",",
"0",
",",
"color",
",",
"flipx",
",",
"flipy",
",",
"x",
"-",
"512",
",",
"y",
",",
"pri",
")",
";",
"draw_single_sprite",
"(",
"sprites_bitmap",
",",
"cliprect",
",",
"&",
"gfx",
",",
"0",
",",
"color",
",",
"flipx",
",",
"flipy",
",",
"x",
",",
"y",
"-",
"512",
",",
"pri",
")",
";",
"draw_single_sprite",
"(",
"sprites_bitmap",
",",
"cliprect",
",",
"&",
"gfx",
",",
"0",
",",
"color",
",",
"flipx",
",",
"flipy",
",",
"x",
"-",
"512",
",",
"y",
"-",
"512",
",",
"pri",
")",
";",
"}",
"}"
] | sprites aren't tile based (except for 8x8 ones) | [
"sprites",
"aren",
"'",
"t",
"tile",
"based",
"(",
"except",
"for",
"8x8",
"ones",
")"
] | [
"// below fg",
"// above everything",
"/* Bounds checking */",
"/* prepare GfxElement on the fly */",
"// wrap around x",
"// wrap around y",
"// wrap around x and y"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "sprites",
"type": "UINT32"
},
{
"param": "cliprect",
"type": "rectangle"
},
{
"param": "count",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sprites",
"type": "UINT32",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cliprect",
"type": "rectangle",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "count",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
833e07de38e4e145c79fa5e6f875855996eddbff | lofunz/mieme | Reloaded/trunk/src/mame/video/dc.c | [
"Unlicense"
] | C | pvr_accumulationbuffer_to_framebuffer | void | static void pvr_accumulationbuffer_to_framebuffer(const address_space *space, int x,int y)
{
// the accumulation buffer is always 8888
//
// the standard format for the framebuffer appears to be 565
// yes, this means colour data is lost in the conversion
UINT32 wc = pvrta_regs[FB_W_CTRL];
UINT32 stride = pvrta_regs[FB_W_LINESTRIDE];
UINT32 writeoffs = pvrta_regs[FB_W_SOF1];
UINT32* src;
UINT8 packmode = wc & 0x7;
switch (packmode)
{
case 0x00:
printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (0555 KRGB)\n",x,y,packmode);
break;
// used by cleoftp
case 0x01: //565 RGB 16 bit
{
int xcnt,ycnt;
for (ycnt=0;ycnt<32;ycnt++)
{
UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
for (xcnt=0;xcnt<32;xcnt++)
{
// data starts in 8888 format, downsample it
UINT32 data = src[xcnt];
UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) |
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
memory_write_word(space,realwriteoffs+xcnt*2, newdat);
}
}
}
break;
case 0x02:
printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (4444 ARGB)\n",x,y,packmode);
break;
case 0x03: // 1555 ARGB 16 bit
{
int xcnt,ycnt;
for (ycnt=0;ycnt<32;ycnt++)
{
UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
for (xcnt=0;xcnt<32;xcnt++)
{
// data starts in 8888 format, downsample it
UINT32 data = src[xcnt];
UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) |
((((data & 0x0000f800) >> 11)) << 5) |
((((data & 0x00f80000) >> 19)) << 10);
// alpha?
memory_write_word(space,realwriteoffs+xcnt*2, newdat);
}
}
}
break;
// used by Suchie3
case 0x04: // 888 RGB 24-bit (HACK! should not downconvert and pvr_drawframebuffer should change accordingly)
{
int xcnt,ycnt;
for (ycnt=0;ycnt<32;ycnt++)
{
UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
for (xcnt=0;xcnt<32;xcnt++)
{
// data is 8888 format
UINT32 data = src[xcnt];
UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) |
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
memory_write_word(space,realwriteoffs+xcnt*2, newdat);
}
}
}
break;
case 0x05:
printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (0888 KGB 32-bit)\n",x,y,packmode);
break;
case 0x06: // 8888 ARGB 32 bit (HACK! should not downconvert and pvr_drawframebuffer should change accordingly)
{
int xcnt,ycnt;
for (ycnt=0;ycnt<32;ycnt++)
{
UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
for (xcnt=0;xcnt<32;xcnt++)
{
// data is 8888 format
UINT32 data = src[xcnt];
UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) |
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
memory_write_word(space,realwriteoffs+xcnt*2, newdat);
}
}
}
break;
case 0x07:
printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (Reserved! Don't Use!)\n",x,y,packmode);
break;
}
} | /*
0x0 0555 KRGB 16 bit (default) Bit 15 is the value of fb_kval 7.
0x1 565 RGB 16 bit
0x2 4444 ARGB 16 bit
0x3 1555 ARGB 16 bit The alpha value is determined by comparison with the value of fb_alpha_threshold.
0x4 888 RGB 24 bit packed
0x5 0888 KRGB 32 bit K is the value of fk_kval.
0x6 8888 ARGB 32 bit
0x7 Setting prohibited.
*/ | 0x0 0555 KRGB 16 bit (default) Bit 15 is the value of fb_kval 7.
0x1 565 RGB 16 bit
0x2 4444 ARGB 16 bit
0x3 1555 ARGB 16 bit The alpha value is determined by comparison with the value of fb_alpha_threshold.
0x4 888 RGB 24 bit packed
0x5 0888 KRGB 32 bit K is the value of fk_kval.
0x6 8888 ARGB 32 bit
0x7 Setting prohibited. | [
"0x0",
"0555",
"KRGB",
"16",
"bit",
"(",
"default",
")",
"Bit",
"15",
"is",
"the",
"value",
"of",
"fb_kval",
"7",
".",
"0x1",
"565",
"RGB",
"16",
"bit",
"0x2",
"4444",
"ARGB",
"16",
"bit",
"0x3",
"1555",
"ARGB",
"16",
"bit",
"The",
"alpha",
"value",
"is",
"determined",
"by",
"comparison",
"with",
"the",
"value",
"of",
"fb_alpha_threshold",
".",
"0x4",
"888",
"RGB",
"24",
"bit",
"packed",
"0x5",
"0888",
"KRGB",
"32",
"bit",
"K",
"is",
"the",
"value",
"of",
"fk_kval",
".",
"0x6",
"8888",
"ARGB",
"32",
"bit",
"0x7",
"Setting",
"prohibited",
"."
] | static void pvr_accumulationbuffer_to_framebuffer(const address_space *space, int x,int y)
{
UINT32 wc = pvrta_regs[FB_W_CTRL];
UINT32 stride = pvrta_regs[FB_W_LINESTRIDE];
UINT32 writeoffs = pvrta_regs[FB_W_SOF1];
UINT32* src;
UINT8 packmode = wc & 0x7;
switch (packmode)
{
case 0x00:
printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (0555 KRGB)\n",x,y,packmode);
break;
case 0x01:
{
int xcnt,ycnt;
for (ycnt=0;ycnt<32;ycnt++)
{
UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
for (xcnt=0;xcnt<32;xcnt++)
{
UINT32 data = src[xcnt];
UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) |
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
memory_write_word(space,realwriteoffs+xcnt*2, newdat);
}
}
}
break;
case 0x02:
printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (4444 ARGB)\n",x,y,packmode);
break;
case 0x03:
{
int xcnt,ycnt;
for (ycnt=0;ycnt<32;ycnt++)
{
UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
for (xcnt=0;xcnt<32;xcnt++)
{
UINT32 data = src[xcnt];
UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) |
((((data & 0x0000f800) >> 11)) << 5) |
((((data & 0x00f80000) >> 19)) << 10);
memory_write_word(space,realwriteoffs+xcnt*2, newdat);
}
}
}
break;
case 0x04:
{
int xcnt,ycnt;
for (ycnt=0;ycnt<32;ycnt++)
{
UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
for (xcnt=0;xcnt<32;xcnt++)
{
UINT32 data = src[xcnt];
UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) |
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
memory_write_word(space,realwriteoffs+xcnt*2, newdat);
}
}
}
break;
case 0x05:
printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (0888 KGB 32-bit)\n",x,y,packmode);
break;
case 0x06:
{
int xcnt,ycnt;
for (ycnt=0;ycnt<32;ycnt++)
{
UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
for (xcnt=0;xcnt<32;xcnt++)
{
UINT32 data = src[xcnt];
UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) |
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
memory_write_word(space,realwriteoffs+xcnt*2, newdat);
}
}
}
break;
case 0x07:
printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (Reserved! Don't Use!)\n",x,y,packmode);
break;
}
} | [
"static",
"void",
"pvr_accumulationbuffer_to_framebuffer",
"(",
"const",
"address_space",
"*",
"space",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"UINT32",
"wc",
"=",
"pvrta_regs",
"[",
"FB_W_CTRL",
"]",
";",
"UINT32",
"stride",
"=",
"pvrta_regs",
"[",
"FB_W_LINESTRIDE",
"]",
";",
"UINT32",
"writeoffs",
"=",
"pvrta_regs",
"[",
"FB_W_SOF1",
"]",
";",
"UINT32",
"*",
"src",
";",
"UINT8",
"packmode",
"=",
"wc",
"&",
"0x7",
";",
"switch",
"(",
"packmode",
")",
"{",
"case",
"0x00",
":",
"printf",
"(",
"\"",
"\\n",
"\"",
",",
"x",
",",
"y",
",",
"packmode",
")",
";",
"break",
";",
"case",
"0x01",
":",
"{",
"int",
"xcnt",
",",
"ycnt",
";",
"for",
"(",
"ycnt",
"=",
"0",
";",
"ycnt",
"<",
"32",
";",
"ycnt",
"++",
")",
"{",
"UINT32",
"realwriteoffs",
"=",
"0x05000000",
"+",
"writeoffs",
"+",
"(",
"y",
"+",
"ycnt",
")",
"*",
"(",
"stride",
"<<",
"3",
")",
"+",
"(",
"x",
"*",
"2",
")",
";",
"src",
"=",
"BITMAP_ADDR32",
"(",
"fake_accumulationbuffer_bitmap",
",",
"y",
"+",
"ycnt",
",",
"x",
")",
";",
"for",
"(",
"xcnt",
"=",
"0",
";",
"xcnt",
"<",
"32",
";",
"xcnt",
"++",
")",
"{",
"UINT32",
"data",
"=",
"src",
"[",
"xcnt",
"]",
";",
"UINT16",
"newdat",
"=",
"(",
"(",
"(",
"(",
"data",
"&",
"0x000000f8",
")",
">>",
"3",
")",
")",
"<<",
"0",
")",
"|",
"(",
"(",
"(",
"(",
"data",
"&",
"0x0000fc00",
")",
">>",
"10",
")",
")",
"<<",
"5",
")",
"|",
"(",
"(",
"(",
"(",
"data",
"&",
"0x00f80000",
")",
">>",
"19",
")",
")",
"<<",
"11",
")",
";",
"memory_write_word",
"(",
"space",
",",
"realwriteoffs",
"+",
"xcnt",
"*",
"2",
",",
"newdat",
")",
";",
"}",
"}",
"}",
"break",
";",
"case",
"0x02",
":",
"printf",
"(",
"\"",
"\\n",
"\"",
",",
"x",
",",
"y",
",",
"packmode",
")",
";",
"break",
";",
"case",
"0x03",
":",
"{",
"int",
"xcnt",
",",
"ycnt",
";",
"for",
"(",
"ycnt",
"=",
"0",
";",
"ycnt",
"<",
"32",
";",
"ycnt",
"++",
")",
"{",
"UINT32",
"realwriteoffs",
"=",
"0x05000000",
"+",
"writeoffs",
"+",
"(",
"y",
"+",
"ycnt",
")",
"*",
"(",
"stride",
"<<",
"3",
")",
"+",
"(",
"x",
"*",
"2",
")",
";",
"src",
"=",
"BITMAP_ADDR32",
"(",
"fake_accumulationbuffer_bitmap",
",",
"y",
"+",
"ycnt",
",",
"x",
")",
";",
"for",
"(",
"xcnt",
"=",
"0",
";",
"xcnt",
"<",
"32",
";",
"xcnt",
"++",
")",
"{",
"UINT32",
"data",
"=",
"src",
"[",
"xcnt",
"]",
";",
"UINT16",
"newdat",
"=",
"(",
"(",
"(",
"(",
"data",
"&",
"0x000000f8",
")",
">>",
"3",
")",
")",
"<<",
"0",
")",
"|",
"(",
"(",
"(",
"(",
"data",
"&",
"0x0000f800",
")",
">>",
"11",
")",
")",
"<<",
"5",
")",
"|",
"(",
"(",
"(",
"(",
"data",
"&",
"0x00f80000",
")",
">>",
"19",
")",
")",
"<<",
"10",
")",
";",
"memory_write_word",
"(",
"space",
",",
"realwriteoffs",
"+",
"xcnt",
"*",
"2",
",",
"newdat",
")",
";",
"}",
"}",
"}",
"break",
";",
"case",
"0x04",
":",
"{",
"int",
"xcnt",
",",
"ycnt",
";",
"for",
"(",
"ycnt",
"=",
"0",
";",
"ycnt",
"<",
"32",
";",
"ycnt",
"++",
")",
"{",
"UINT32",
"realwriteoffs",
"=",
"0x05000000",
"+",
"writeoffs",
"+",
"(",
"y",
"+",
"ycnt",
")",
"*",
"(",
"stride",
"<<",
"3",
")",
"+",
"(",
"x",
"*",
"2",
")",
";",
"src",
"=",
"BITMAP_ADDR32",
"(",
"fake_accumulationbuffer_bitmap",
",",
"y",
"+",
"ycnt",
",",
"x",
")",
";",
"for",
"(",
"xcnt",
"=",
"0",
";",
"xcnt",
"<",
"32",
";",
"xcnt",
"++",
")",
"{",
"UINT32",
"data",
"=",
"src",
"[",
"xcnt",
"]",
";",
"UINT16",
"newdat",
"=",
"(",
"(",
"(",
"(",
"data",
"&",
"0x000000f8",
")",
">>",
"3",
")",
")",
"<<",
"0",
")",
"|",
"(",
"(",
"(",
"(",
"data",
"&",
"0x0000fc00",
")",
">>",
"10",
")",
")",
"<<",
"5",
")",
"|",
"(",
"(",
"(",
"(",
"data",
"&",
"0x00f80000",
")",
">>",
"19",
")",
")",
"<<",
"11",
")",
";",
"memory_write_word",
"(",
"space",
",",
"realwriteoffs",
"+",
"xcnt",
"*",
"2",
",",
"newdat",
")",
";",
"}",
"}",
"}",
"break",
";",
"case",
"0x05",
":",
"printf",
"(",
"\"",
"\\n",
"\"",
",",
"x",
",",
"y",
",",
"packmode",
")",
";",
"break",
";",
"case",
"0x06",
":",
"{",
"int",
"xcnt",
",",
"ycnt",
";",
"for",
"(",
"ycnt",
"=",
"0",
";",
"ycnt",
"<",
"32",
";",
"ycnt",
"++",
")",
"{",
"UINT32",
"realwriteoffs",
"=",
"0x05000000",
"+",
"writeoffs",
"+",
"(",
"y",
"+",
"ycnt",
")",
"*",
"(",
"stride",
"<<",
"3",
")",
"+",
"(",
"x",
"*",
"2",
")",
";",
"src",
"=",
"BITMAP_ADDR32",
"(",
"fake_accumulationbuffer_bitmap",
",",
"y",
"+",
"ycnt",
",",
"x",
")",
";",
"for",
"(",
"xcnt",
"=",
"0",
";",
"xcnt",
"<",
"32",
";",
"xcnt",
"++",
")",
"{",
"UINT32",
"data",
"=",
"src",
"[",
"xcnt",
"]",
";",
"UINT16",
"newdat",
"=",
"(",
"(",
"(",
"(",
"data",
"&",
"0x000000f8",
")",
">>",
"3",
")",
")",
"<<",
"0",
")",
"|",
"(",
"(",
"(",
"(",
"data",
"&",
"0x0000fc00",
")",
">>",
"10",
")",
")",
"<<",
"5",
")",
"|",
"(",
"(",
"(",
"(",
"data",
"&",
"0x00f80000",
")",
">>",
"19",
")",
")",
"<<",
"11",
")",
";",
"memory_write_word",
"(",
"space",
",",
"realwriteoffs",
"+",
"xcnt",
"*",
"2",
",",
"newdat",
")",
";",
"}",
"}",
"}",
"break",
";",
"case",
"0x07",
":",
"printf",
"(",
"\"",
"\\n",
"\"",
",",
"x",
",",
"y",
",",
"packmode",
")",
";",
"break",
";",
"}",
"}"
] | 0x0 0555 KRGB 16 bit (default) Bit 15 is the value of fb_kval 7. | [
"0x0",
"0555",
"KRGB",
"16",
"bit",
"(",
"default",
")",
"Bit",
"15",
"is",
"the",
"value",
"of",
"fb_kval",
"7",
"."
] | [
"// the accumulation buffer is always 8888\r",
"//\r",
"// the standard format for the framebuffer appears to be 565\r",
"// yes, this means colour data is lost in the conversion\r",
"// used by cleoftp\r",
"//565 RGB 16 bit\r",
"// data starts in 8888 format, downsample it\r",
"// 1555 ARGB 16 bit\r",
"// data starts in 8888 format, downsample it\r",
"// alpha?\r",
"// used by Suchie3\r",
"// 888 RGB 24-bit (HACK! should not downconvert and pvr_drawframebuffer should change accordingly)\r",
"// data is 8888 format\r",
"// 8888 ARGB 32 bit (HACK! should not downconvert and pvr_drawframebuffer should change accordingly)\r",
"// data is 8888 format\r"
] | [
{
"param": "space",
"type": "address_space"
},
{
"param": "x",
"type": "int"
},
{
"param": "y",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "space",
"type": "address_space",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "x",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "y",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f1e3eed0528d290dbce7e85b629b202de12d04f7 | lofunz/mieme | Reloaded/tags/MAME4droid.Reloaded.1.0.WIP/src/mame/video/vertigo.c | [
"Unlicense"
] | C | vertigo_vgen | void | static void vertigo_vgen (vector_generator *vg)
{
if (vg->c_l & 0x800)
{
vg->vfin = 1;
vg->c_l = (vg->c_l+1) & 0xfff;
if ((vg->c_l & 0x800) == 0)
{
vg->brez = 0;
vg->vfin = 0;
}
if (vg->brez) /* H/V counter enabled */
{
/* Depending on MSB of adder only one or both
counters are de-/incremented. This is all
defined by the shift register which is
latched in bits 12-15 of L1/L2.
*/
if (vg->adder_s & 0x800)
{
if (vg->hc1)
vg->c_h += vg->hud1? -1: 1;
else
vg->c_v += vg->vud1? -1: 1;
vg->adder_a = vg->l1;
}
else
{
vg->c_h += vg->hud2? -1: 1;
vg->c_v += vg->vud2? -1: 1;
vg->adder_a = vg->l2;
}
/* H/V counters are 12 bit */
vg->c_v &= 0xfff;
vg->c_h &= 0xfff;
}
vg->adder_s = (vg->adder_s + vg->adder_a) & 0xfff;
}
if (vg->brez ^ vg->ven)
{
if (vg->brez)
V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, 0, 0);
else
V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, vg->color, vg->intensity);
vg->ven = vg->brez;
}
} | /********************************************
*
* Vector Generator
*
* This part of the hardware draws vectors
* under control of the bit slice processors.
* It is just a bunch of counters, latches
* and DACs.
*
********************************************/ | Vector Generator
This part of the hardware draws vectors
under control of the bit slice processors.
It is just a bunch of counters, latches
and DACs. | [
"Vector",
"Generator",
"This",
"part",
"of",
"the",
"hardware",
"draws",
"vectors",
"under",
"control",
"of",
"the",
"bit",
"slice",
"processors",
".",
"It",
"is",
"just",
"a",
"bunch",
"of",
"counters",
"latches",
"and",
"DACs",
"."
] | static void vertigo_vgen (vector_generator *vg)
{
if (vg->c_l & 0x800)
{
vg->vfin = 1;
vg->c_l = (vg->c_l+1) & 0xfff;
if ((vg->c_l & 0x800) == 0)
{
vg->brez = 0;
vg->vfin = 0;
}
if (vg->brez)
{
if (vg->adder_s & 0x800)
{
if (vg->hc1)
vg->c_h += vg->hud1? -1: 1;
else
vg->c_v += vg->vud1? -1: 1;
vg->adder_a = vg->l1;
}
else
{
vg->c_h += vg->hud2? -1: 1;
vg->c_v += vg->vud2? -1: 1;
vg->adder_a = vg->l2;
}
vg->c_v &= 0xfff;
vg->c_h &= 0xfff;
}
vg->adder_s = (vg->adder_s + vg->adder_a) & 0xfff;
}
if (vg->brez ^ vg->ven)
{
if (vg->brez)
V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, 0, 0);
else
V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, vg->color, vg->intensity);
vg->ven = vg->brez;
}
} | [
"static",
"void",
"vertigo_vgen",
"(",
"vector_generator",
"*",
"vg",
")",
"{",
"if",
"(",
"vg",
"->",
"c_l",
"&",
"0x800",
")",
"{",
"vg",
"->",
"vfin",
"=",
"1",
";",
"vg",
"->",
"c_l",
"=",
"(",
"vg",
"->",
"c_l",
"+",
"1",
")",
"&",
"0xfff",
";",
"if",
"(",
"(",
"vg",
"->",
"c_l",
"&",
"0x800",
")",
"==",
"0",
")",
"{",
"vg",
"->",
"brez",
"=",
"0",
";",
"vg",
"->",
"vfin",
"=",
"0",
";",
"}",
"if",
"(",
"vg",
"->",
"brez",
")",
"{",
"if",
"(",
"vg",
"->",
"adder_s",
"&",
"0x800",
")",
"{",
"if",
"(",
"vg",
"->",
"hc1",
")",
"vg",
"->",
"c_h",
"+=",
"vg",
"->",
"hud1",
"?",
"-1",
":",
"1",
";",
"else",
"vg",
"->",
"c_v",
"+=",
"vg",
"->",
"vud1",
"?",
"-1",
":",
"1",
";",
"vg",
"->",
"adder_a",
"=",
"vg",
"->",
"l1",
";",
"}",
"else",
"{",
"vg",
"->",
"c_h",
"+=",
"vg",
"->",
"hud2",
"?",
"-1",
":",
"1",
";",
"vg",
"->",
"c_v",
"+=",
"vg",
"->",
"vud2",
"?",
"-1",
":",
"1",
";",
"vg",
"->",
"adder_a",
"=",
"vg",
"->",
"l2",
";",
"}",
"vg",
"->",
"c_v",
"&=",
"0xfff",
";",
"vg",
"->",
"c_h",
"&=",
"0xfff",
";",
"}",
"vg",
"->",
"adder_s",
"=",
"(",
"vg",
"->",
"adder_s",
"+",
"vg",
"->",
"adder_a",
")",
"&",
"0xfff",
";",
"}",
"if",
"(",
"vg",
"->",
"brez",
"^",
"vg",
"->",
"ven",
")",
"{",
"if",
"(",
"vg",
"->",
"brez",
")",
"V_ADDPOINT",
"(",
"vg",
"->",
"machine",
",",
"vg",
"->",
"c_h",
",",
"vg",
"->",
"c_v",
",",
"0",
",",
"0",
")",
";",
"else",
"V_ADDPOINT",
"(",
"vg",
"->",
"machine",
",",
"vg",
"->",
"c_h",
",",
"vg",
"->",
"c_v",
",",
"vg",
"->",
"color",
",",
"vg",
"->",
"intensity",
")",
";",
"vg",
"->",
"ven",
"=",
"vg",
"->",
"brez",
";",
"}",
"}"
] | Vector Generator
This part of the hardware draws vectors
under control of the bit slice processors. | [
"Vector",
"Generator",
"This",
"part",
"of",
"the",
"hardware",
"draws",
"vectors",
"under",
"control",
"of",
"the",
"bit",
"slice",
"processors",
"."
] | [
"/* H/V counter enabled */",
"/* Depending on MSB of adder only one or both\n counters are de-/incremented. This is all\n defined by the shift register which is\n latched in bits 12-15 of L1/L2.\n */",
"/* H/V counters are 12 bit */"
] | [
{
"param": "vg",
"type": "vector_generator"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "vg",
"type": "vector_generator",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
947858016e6cd1fa6f738318c2794b1216fa24bb | lofunz/mieme | Reloaded/trunk/src/mame/video/simpl156.c | [
"Unlicense"
] | C | draw_sprites | void | static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
{
UINT32 *spriteram = machine->generic.spriteram.u32;
int offs;
//FIXME: flip_screen_x should not be written!
flip_screen_set_no_update(machine, 1);
for (offs = (0x1400 / 4) - 4; offs >= 0; offs -= 4) // 0x1400 for charlien
{
int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri;
sprite = spriteram[offs + 1] & 0xffff;
y = spriteram[offs] & 0xffff;
flash = y & 0x1000;
if (flash && (machine->primary_screen->frame_number() & 1))
continue;
x = spriteram[offs + 2] & 0xffff;
colour = (x >> 9) & 0x1f;
pri = (x & 0xc000); // 2 bits or 1?
switch (pri & 0xc000)
{
case 0x0000: pri = 0; break;
case 0x4000: pri = 0xf0; break;
case 0x8000: pri = 0xf0 | 0xcc; break;
case 0xc000: pri = 0xf0 | 0xcc; break; /* or 0xf0|0xcc|0xaa ? */
}
fx = y & 0x2000;
fy = y & 0x4000;
multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */
x = x & 0x01ff;
y = y & 0x01ff;
if (x >= 320) x -= 512;
if (y >= 256) y -= 512;
y = 240 - y;
x = 304 - x;
if (x > 320)
continue;
sprite &= ~multi;
if (fy)
inc = -1;
else
{
sprite += multi;
inc = 1;
}
if (flip_screen_get(machine))
{
y = 240 - y;
x = 304 - x;
if (fx) fx = 0; else fx = 1;
if (fy) fy = 0; else fy = 1;
mult = 16;
}
else
mult = -16;
while (multi >= 0)
{
pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],
sprite - multi * inc,
colour,
fx,fy,
x,y + mult * multi,
machine->priority_bitmap,pri,0);
multi--;
}
}
} | /* spriteram is really 16-bit.. this can be changed to use 16-bit ram like the tilemaps
its the same sprite chip Data East used on many, many 16-bit era titles */ | spriteram is really 16-bit.. this can be changed to use 16-bit ram like the tilemaps
its the same sprite chip Data East used on many, many 16-bit era titles | [
"spriteram",
"is",
"really",
"16",
"-",
"bit",
"..",
"this",
"can",
"be",
"changed",
"to",
"use",
"16",
"-",
"bit",
"ram",
"like",
"the",
"tilemaps",
"its",
"the",
"same",
"sprite",
"chip",
"Data",
"East",
"used",
"on",
"many",
"many",
"16",
"-",
"bit",
"era",
"titles"
] | static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
{
UINT32 *spriteram = machine->generic.spriteram.u32;
int offs;
flip_screen_set_no_update(machine, 1);
for (offs = (0x1400 / 4) - 4; offs >= 0; offs -= 4)
{
int x, y, sprite, colour, multi, fx, fy, inc, flash, mult, pri;
sprite = spriteram[offs + 1] & 0xffff;
y = spriteram[offs] & 0xffff;
flash = y & 0x1000;
if (flash && (machine->primary_screen->frame_number() & 1))
continue;
x = spriteram[offs + 2] & 0xffff;
colour = (x >> 9) & 0x1f;
pri = (x & 0xc000);
switch (pri & 0xc000)
{
case 0x0000: pri = 0; break;
case 0x4000: pri = 0xf0; break;
case 0x8000: pri = 0xf0 | 0xcc; break;
case 0xc000: pri = 0xf0 | 0xcc; break;
}
fx = y & 0x2000;
fy = y & 0x4000;
multi = (1 << ((y & 0x0600) >> 9)) - 1;
x = x & 0x01ff;
y = y & 0x01ff;
if (x >= 320) x -= 512;
if (y >= 256) y -= 512;
y = 240 - y;
x = 304 - x;
if (x > 320)
continue;
sprite &= ~multi;
if (fy)
inc = -1;
else
{
sprite += multi;
inc = 1;
}
if (flip_screen_get(machine))
{
y = 240 - y;
x = 304 - x;
if (fx) fx = 0; else fx = 1;
if (fy) fy = 0; else fy = 1;
mult = 16;
}
else
mult = -16;
while (multi >= 0)
{
pdrawgfx_transpen(bitmap,cliprect,machine->gfx[2],
sprite - multi * inc,
colour,
fx,fy,
x,y + mult * multi,
machine->priority_bitmap,pri,0);
multi--;
}
}
} | [
"static",
"void",
"draw_sprites",
"(",
"running_machine",
"*",
"machine",
",",
"bitmap_t",
"*",
"bitmap",
",",
"const",
"rectangle",
"*",
"cliprect",
")",
"{",
"UINT32",
"*",
"spriteram",
"=",
"machine",
"->",
"generic",
".",
"spriteram",
".",
"u32",
";",
"int",
"offs",
";",
"flip_screen_set_no_update",
"(",
"machine",
",",
"1",
")",
";",
"for",
"(",
"offs",
"=",
"(",
"0x1400",
"/",
"4",
")",
"-",
"4",
";",
"offs",
">=",
"0",
";",
"offs",
"-=",
"4",
")",
"{",
"int",
"x",
",",
"y",
",",
"sprite",
",",
"colour",
",",
"multi",
",",
"fx",
",",
"fy",
",",
"inc",
",",
"flash",
",",
"mult",
",",
"pri",
";",
"sprite",
"=",
"spriteram",
"[",
"offs",
"+",
"1",
"]",
"&",
"0xffff",
";",
"y",
"=",
"spriteram",
"[",
"offs",
"]",
"&",
"0xffff",
";",
"flash",
"=",
"y",
"&",
"0x1000",
";",
"if",
"(",
"flash",
"&&",
"(",
"machine",
"->",
"primary_screen",
"->",
"frame_number",
"(",
")",
"&",
"1",
")",
")",
"continue",
";",
"x",
"=",
"spriteram",
"[",
"offs",
"+",
"2",
"]",
"&",
"0xffff",
";",
"colour",
"=",
"(",
"x",
">>",
"9",
")",
"&",
"0x1f",
";",
"pri",
"=",
"(",
"x",
"&",
"0xc000",
")",
";",
"switch",
"(",
"pri",
"&",
"0xc000",
")",
"{",
"case",
"0x0000",
":",
"pri",
"=",
"0",
";",
"break",
";",
"case",
"0x4000",
":",
"pri",
"=",
"0xf0",
";",
"break",
";",
"case",
"0x8000",
":",
"pri",
"=",
"0xf0",
"|",
"0xcc",
";",
"break",
";",
"case",
"0xc000",
":",
"pri",
"=",
"0xf0",
"|",
"0xcc",
";",
"break",
";",
"}",
"fx",
"=",
"y",
"&",
"0x2000",
";",
"fy",
"=",
"y",
"&",
"0x4000",
";",
"multi",
"=",
"(",
"1",
"<<",
"(",
"(",
"y",
"&",
"0x0600",
")",
">>",
"9",
")",
")",
"-",
"1",
";",
"x",
"=",
"x",
"&",
"0x01ff",
";",
"y",
"=",
"y",
"&",
"0x01ff",
";",
"if",
"(",
"x",
">=",
"320",
")",
"x",
"-=",
"512",
";",
"if",
"(",
"y",
">=",
"256",
")",
"y",
"-=",
"512",
";",
"y",
"=",
"240",
"-",
"y",
";",
"x",
"=",
"304",
"-",
"x",
";",
"if",
"(",
"x",
">",
"320",
")",
"continue",
";",
"sprite",
"&=",
"~",
"multi",
";",
"if",
"(",
"fy",
")",
"inc",
"=",
"-1",
";",
"else",
"{",
"sprite",
"+=",
"multi",
";",
"inc",
"=",
"1",
";",
"}",
"if",
"(",
"flip_screen_get",
"(",
"machine",
")",
")",
"{",
"y",
"=",
"240",
"-",
"y",
";",
"x",
"=",
"304",
"-",
"x",
";",
"if",
"(",
"fx",
")",
"fx",
"=",
"0",
";",
"else",
"fx",
"=",
"1",
";",
"if",
"(",
"fy",
")",
"fy",
"=",
"0",
";",
"else",
"fy",
"=",
"1",
";",
"mult",
"=",
"16",
";",
"}",
"else",
"mult",
"=",
"-16",
";",
"while",
"(",
"multi",
">=",
"0",
")",
"{",
"pdrawgfx_transpen",
"(",
"bitmap",
",",
"cliprect",
",",
"machine",
"->",
"gfx",
"[",
"2",
"]",
",",
"sprite",
"-",
"multi",
"*",
"inc",
",",
"colour",
",",
"fx",
",",
"fy",
",",
"x",
",",
"y",
"+",
"mult",
"*",
"multi",
",",
"machine",
"->",
"priority_bitmap",
",",
"pri",
",",
"0",
")",
";",
"multi",
"--",
";",
"}",
"}",
"}"
] | spriteram is really 16-bit.. this can be changed to use 16-bit ram like the tilemaps
its the same sprite chip Data East used on many, many 16-bit era titles | [
"spriteram",
"is",
"really",
"16",
"-",
"bit",
"..",
"this",
"can",
"be",
"changed",
"to",
"use",
"16",
"-",
"bit",
"ram",
"like",
"the",
"tilemaps",
"its",
"the",
"same",
"sprite",
"chip",
"Data",
"East",
"used",
"on",
"many",
"many",
"16",
"-",
"bit",
"era",
"titles"
] | [
"//FIXME: flip_screen_x should not be written!\r",
"// 0x1400 for charlien\r",
"// 2 bits or 1?\r",
"/* or 0xf0|0xcc|0xaa ? */",
"/* 1x, 2x, 4x, 8x height */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "bitmap",
"type": "bitmap_t"
},
{
"param": "cliprect",
"type": "rectangle"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "bitmap",
"type": "bitmap_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cliprect",
"type": "rectangle",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5b19fb28cdf26eb2dd3f74efb426a77ebf47b9fb | lofunz/mieme | Reloaded/trunk/src/emu/machine/generic.c | [
"Unlicense"
] | C | generic_machine_init | void | void generic_machine_init(running_machine *machine)
{
generic_machine_private *state;
int counternum;
/* allocate our state */
machine->generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
state = machine->generic_machine_data;
/* reset coin counters */
for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
{
state->lastcoin[counternum] = 0;
state->coinlockedout[counternum] = 0;
}
// map devices to the interrupt state
memset(state->interrupt_device, 0, sizeof(state->interrupt_device));
device_execute_interface *exec = NULL;
int index = 0;
for (bool gotone = machine->m_devicelist.first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
state->interrupt_device[index++] = &exec->device();
/* register coin save state */
state_save_register_item_array(machine, "coin", NULL, 0, state->coin_count);
state_save_register_item_array(machine, "coin", NULL, 0, state->coinlockedout);
state_save_register_item_array(machine, "coin", NULL, 0, state->lastcoin);
/* reset NVRAM size and pointers */
machine->generic.nvram.v = NULL;
machine->generic.nvram_size = 0;
/* reset memory card info */
state->memcard_inserted = -1;
/* register a reset callback and save state for interrupt enable */
machine->add_notifier(MACHINE_NOTIFY_RESET, interrupt_reset);
state_save_register_item_array(machine, "cpu", NULL, 0, state->interrupt_enable);
/* register for configuration */
config_register(machine, "counters", counters_load, counters_save);
/* for memory cards, request save state and an exit callback */
if (machine->config->m_memcard_handler != NULL)
{
state_save_register_global(machine, state->memcard_inserted);
machine->add_notifier(MACHINE_NOTIFY_EXIT, memcard_eject);
}
} | /*-------------------------------------------------
generic_machine_init - initialize globals and
register for save states
-------------------------------------------------*/ | initialize globals and
register for save states | [
"initialize",
"globals",
"and",
"register",
"for",
"save",
"states"
] | void generic_machine_init(running_machine *machine)
{
generic_machine_private *state;
int counternum;
machine->generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
state = machine->generic_machine_data;
for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
{
state->lastcoin[counternum] = 0;
state->coinlockedout[counternum] = 0;
}
memset(state->interrupt_device, 0, sizeof(state->interrupt_device));
device_execute_interface *exec = NULL;
int index = 0;
for (bool gotone = machine->m_devicelist.first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
state->interrupt_device[index++] = &exec->device();
state_save_register_item_array(machine, "coin", NULL, 0, state->coin_count);
state_save_register_item_array(machine, "coin", NULL, 0, state->coinlockedout);
state_save_register_item_array(machine, "coin", NULL, 0, state->lastcoin);
machine->generic.nvram.v = NULL;
machine->generic.nvram_size = 0;
state->memcard_inserted = -1;
machine->add_notifier(MACHINE_NOTIFY_RESET, interrupt_reset);
state_save_register_item_array(machine, "cpu", NULL, 0, state->interrupt_enable);
config_register(machine, "counters", counters_load, counters_save);
if (machine->config->m_memcard_handler != NULL)
{
state_save_register_global(machine, state->memcard_inserted);
machine->add_notifier(MACHINE_NOTIFY_EXIT, memcard_eject);
}
} | [
"void",
"generic_machine_init",
"(",
"running_machine",
"*",
"machine",
")",
"{",
"generic_machine_private",
"*",
"state",
";",
"int",
"counternum",
";",
"machine",
"->",
"generic_machine_data",
"=",
"auto_alloc_clear",
"(",
"machine",
",",
"generic_machine_private",
")",
";",
"state",
"=",
"machine",
"->",
"generic_machine_data",
";",
"for",
"(",
"counternum",
"=",
"0",
";",
"counternum",
"<",
"COIN_COUNTERS",
";",
"counternum",
"++",
")",
"{",
"state",
"->",
"lastcoin",
"[",
"counternum",
"]",
"=",
"0",
";",
"state",
"->",
"coinlockedout",
"[",
"counternum",
"]",
"=",
"0",
";",
"}",
"memset",
"(",
"state",
"->",
"interrupt_device",
",",
"0",
",",
"sizeof",
"(",
"state",
"->",
"interrupt_device",
")",
")",
";",
"device_execute_interface",
"*",
"exec",
"=",
"NULL",
";",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"bool",
"gotone",
"=",
"machine",
"->",
"m_devicelist",
".",
"first",
"(",
"exec",
")",
";",
"gotone",
"&&",
"index",
"<",
"ARRAY_LENGTH",
"(",
"state",
"->",
"interrupt_device",
")",
";",
"gotone",
"=",
"exec",
"->",
"next",
"(",
"exec",
")",
")",
"state",
"->",
"interrupt_device",
"[",
"index",
"++",
"]",
"=",
"&",
"exec",
"->",
"device",
"(",
")",
";",
"state_save_register_item_array",
"(",
"machine",
",",
"\"",
"\"",
",",
"NULL",
",",
"0",
",",
"state",
"->",
"coin_count",
")",
";",
"state_save_register_item_array",
"(",
"machine",
",",
"\"",
"\"",
",",
"NULL",
",",
"0",
",",
"state",
"->",
"coinlockedout",
")",
";",
"state_save_register_item_array",
"(",
"machine",
",",
"\"",
"\"",
",",
"NULL",
",",
"0",
",",
"state",
"->",
"lastcoin",
")",
";",
"machine",
"->",
"generic",
".",
"nvram",
".",
"v",
"=",
"NULL",
";",
"machine",
"->",
"generic",
".",
"nvram_size",
"=",
"0",
";",
"state",
"->",
"memcard_inserted",
"=",
"-1",
";",
"machine",
"->",
"add_notifier",
"(",
"MACHINE_NOTIFY_RESET",
",",
"interrupt_reset",
")",
";",
"state_save_register_item_array",
"(",
"machine",
",",
"\"",
"\"",
",",
"NULL",
",",
"0",
",",
"state",
"->",
"interrupt_enable",
")",
";",
"config_register",
"(",
"machine",
",",
"\"",
"\"",
",",
"counters_load",
",",
"counters_save",
")",
";",
"if",
"(",
"machine",
"->",
"config",
"->",
"m_memcard_handler",
"!=",
"NULL",
")",
"{",
"state_save_register_global",
"(",
"machine",
",",
"state",
"->",
"memcard_inserted",
")",
";",
"machine",
"->",
"add_notifier",
"(",
"MACHINE_NOTIFY_EXIT",
",",
"memcard_eject",
")",
";",
"}",
"}"
] | generic_machine_init - initialize globals and
register for save states | [
"generic_machine_init",
"-",
"initialize",
"globals",
"and",
"register",
"for",
"save",
"states"
] | [
"/* allocate our state */",
"/* reset coin counters */",
"// map devices to the interrupt state\r",
"/* register coin save state */",
"/* reset NVRAM size and pointers */",
"/* reset memory card info */",
"/* register a reset callback and save state for interrupt enable */",
"/* register for configuration */",
"/* for memory cards, request save state and an exit callback */"
] | [
{
"param": "machine",
"type": "running_machine"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5b19fb28cdf26eb2dd3f74efb426a77ebf47b9fb | lofunz/mieme | Reloaded/trunk/src/emu/machine/generic.c | [
"Unlicense"
] | C | increment_dispensed_tickets | void | void increment_dispensed_tickets(running_machine *machine, int delta)
{
generic_machine_private *state = machine->generic_machine_data;
state->dispensed_tickets += delta;
} | /*-------------------------------------------------
increment_dispensed_tickets - increment the
number of dispensed tickets
-------------------------------------------------*/ | increment the
number of dispensed tickets | [
"increment",
"the",
"number",
"of",
"dispensed",
"tickets"
] | void increment_dispensed_tickets(running_machine *machine, int delta)
{
generic_machine_private *state = machine->generic_machine_data;
state->dispensed_tickets += delta;
} | [
"void",
"increment_dispensed_tickets",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"delta",
")",
"{",
"generic_machine_private",
"*",
"state",
"=",
"machine",
"->",
"generic_machine_data",
";",
"state",
"->",
"dispensed_tickets",
"+=",
"delta",
";",
"}"
] | increment_dispensed_tickets - increment the
number of dispensed tickets | [
"increment_dispensed_tickets",
"-",
"increment",
"the",
"number",
"of",
"dispensed",
"tickets"
] | [] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "delta",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "delta",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5b19fb28cdf26eb2dd3f74efb426a77ebf47b9fb | lofunz/mieme | Reloaded/trunk/src/emu/machine/generic.c | [
"Unlicense"
] | C | counters_load | void | static void counters_load(running_machine *machine, int config_type, xml_data_node *parentnode)
{
generic_machine_private *state = machine->generic_machine_data;
xml_data_node *coinnode, *ticketnode;
/* on init, reset the counters */
if (config_type == CONFIG_TYPE_INIT)
{
memset(state->coin_count, 0, sizeof(state->coin_count));
state->dispensed_tickets = 0;
}
/* only care about game-specific data */
if (config_type != CONFIG_TYPE_GAME)
return;
/* might not have any data */
if (parentnode == NULL)
return;
/* iterate over coins nodes */
for (coinnode = xml_get_sibling(parentnode->child, "coins"); coinnode; coinnode = xml_get_sibling(coinnode->next, "coins"))
{
int index = xml_get_attribute_int(coinnode, "index", -1);
if (index >= 0 && index < COIN_COUNTERS)
state->coin_count[index] = xml_get_attribute_int(coinnode, "number", 0);
}
/* get the single tickets node */
ticketnode = xml_get_sibling(parentnode->child, "tickets");
if (ticketnode != NULL)
state->dispensed_tickets = xml_get_attribute_int(ticketnode, "number", 0);
} | /*-------------------------------------------------
counters_load - load the state of the counters
and tickets
-------------------------------------------------*/ | load the state of the counters
and tickets | [
"load",
"the",
"state",
"of",
"the",
"counters",
"and",
"tickets"
] | static void counters_load(running_machine *machine, int config_type, xml_data_node *parentnode)
{
generic_machine_private *state = machine->generic_machine_data;
xml_data_node *coinnode, *ticketnode;
if (config_type == CONFIG_TYPE_INIT)
{
memset(state->coin_count, 0, sizeof(state->coin_count));
state->dispensed_tickets = 0;
}
if (config_type != CONFIG_TYPE_GAME)
return;
if (parentnode == NULL)
return;
for (coinnode = xml_get_sibling(parentnode->child, "coins"); coinnode; coinnode = xml_get_sibling(coinnode->next, "coins"))
{
int index = xml_get_attribute_int(coinnode, "index", -1);
if (index >= 0 && index < COIN_COUNTERS)
state->coin_count[index] = xml_get_attribute_int(coinnode, "number", 0);
}
ticketnode = xml_get_sibling(parentnode->child, "tickets");
if (ticketnode != NULL)
state->dispensed_tickets = xml_get_attribute_int(ticketnode, "number", 0);
} | [
"static",
"void",
"counters_load",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"config_type",
",",
"xml_data_node",
"*",
"parentnode",
")",
"{",
"generic_machine_private",
"*",
"state",
"=",
"machine",
"->",
"generic_machine_data",
";",
"xml_data_node",
"*",
"coinnode",
",",
"*",
"ticketnode",
";",
"if",
"(",
"config_type",
"==",
"CONFIG_TYPE_INIT",
")",
"{",
"memset",
"(",
"state",
"->",
"coin_count",
",",
"0",
",",
"sizeof",
"(",
"state",
"->",
"coin_count",
")",
")",
";",
"state",
"->",
"dispensed_tickets",
"=",
"0",
";",
"}",
"if",
"(",
"config_type",
"!=",
"CONFIG_TYPE_GAME",
")",
"return",
";",
"if",
"(",
"parentnode",
"==",
"NULL",
")",
"return",
";",
"for",
"(",
"coinnode",
"=",
"xml_get_sibling",
"(",
"parentnode",
"->",
"child",
",",
"\"",
"\"",
")",
";",
"coinnode",
";",
"coinnode",
"=",
"xml_get_sibling",
"(",
"coinnode",
"->",
"next",
",",
"\"",
"\"",
")",
")",
"{",
"int",
"index",
"=",
"xml_get_attribute_int",
"(",
"coinnode",
",",
"\"",
"\"",
",",
"-1",
")",
";",
"if",
"(",
"index",
">=",
"0",
"&&",
"index",
"<",
"COIN_COUNTERS",
")",
"state",
"->",
"coin_count",
"[",
"index",
"]",
"=",
"xml_get_attribute_int",
"(",
"coinnode",
",",
"\"",
"\"",
",",
"0",
")",
";",
"}",
"ticketnode",
"=",
"xml_get_sibling",
"(",
"parentnode",
"->",
"child",
",",
"\"",
"\"",
")",
";",
"if",
"(",
"ticketnode",
"!=",
"NULL",
")",
"state",
"->",
"dispensed_tickets",
"=",
"xml_get_attribute_int",
"(",
"ticketnode",
",",
"\"",
"\"",
",",
"0",
")",
";",
"}"
] | counters_load - load the state of the counters
and tickets | [
"counters_load",
"-",
"load",
"the",
"state",
"of",
"the",
"counters",
"and",
"tickets"
] | [
"/* on init, reset the counters */",
"/* only care about game-specific data */",
"/* might not have any data */",
"/* iterate over coins nodes */",
"/* get the single tickets node */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "config_type",
"type": "int"
},
{
"param": "parentnode",
"type": "xml_data_node"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "config_type",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parentnode",
"type": "xml_data_node",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5b19fb28cdf26eb2dd3f74efb426a77ebf47b9fb | lofunz/mieme | Reloaded/trunk/src/emu/machine/generic.c | [
"Unlicense"
] | C | counters_save | void | static void counters_save(running_machine *machine, int config_type, xml_data_node *parentnode)
{
generic_machine_private *state = machine->generic_machine_data;
int i;
/* only care about game-specific data */
if (config_type != CONFIG_TYPE_GAME)
return;
/* iterate over coin counters */
for (i = 0; i < COIN_COUNTERS; i++)
if (state->coin_count[i] != 0)
{
xml_data_node *coinnode = xml_add_child(parentnode, "coins", NULL);
if (coinnode != NULL)
{
xml_set_attribute_int(coinnode, "index", i);
xml_set_attribute_int(coinnode, "number", state->coin_count[i]);
}
}
/* output tickets */
if (state->dispensed_tickets != 0)
{
xml_data_node *tickets = xml_add_child(parentnode, "tickets", NULL);
if (tickets != NULL)
xml_set_attribute_int(tickets, "number", state->dispensed_tickets);
}
} | /*-------------------------------------------------
counters_save - save the state of the counters
and tickets
-------------------------------------------------*/ | save the state of the counters
and tickets | [
"save",
"the",
"state",
"of",
"the",
"counters",
"and",
"tickets"
] | static void counters_save(running_machine *machine, int config_type, xml_data_node *parentnode)
{
generic_machine_private *state = machine->generic_machine_data;
int i;
if (config_type != CONFIG_TYPE_GAME)
return;
for (i = 0; i < COIN_COUNTERS; i++)
if (state->coin_count[i] != 0)
{
xml_data_node *coinnode = xml_add_child(parentnode, "coins", NULL);
if (coinnode != NULL)
{
xml_set_attribute_int(coinnode, "index", i);
xml_set_attribute_int(coinnode, "number", state->coin_count[i]);
}
}
if (state->dispensed_tickets != 0)
{
xml_data_node *tickets = xml_add_child(parentnode, "tickets", NULL);
if (tickets != NULL)
xml_set_attribute_int(tickets, "number", state->dispensed_tickets);
}
} | [
"static",
"void",
"counters_save",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"config_type",
",",
"xml_data_node",
"*",
"parentnode",
")",
"{",
"generic_machine_private",
"*",
"state",
"=",
"machine",
"->",
"generic_machine_data",
";",
"int",
"i",
";",
"if",
"(",
"config_type",
"!=",
"CONFIG_TYPE_GAME",
")",
"return",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"COIN_COUNTERS",
";",
"i",
"++",
")",
"if",
"(",
"state",
"->",
"coin_count",
"[",
"i",
"]",
"!=",
"0",
")",
"{",
"xml_data_node",
"*",
"coinnode",
"=",
"xml_add_child",
"(",
"parentnode",
",",
"\"",
"\"",
",",
"NULL",
")",
";",
"if",
"(",
"coinnode",
"!=",
"NULL",
")",
"{",
"xml_set_attribute_int",
"(",
"coinnode",
",",
"\"",
"\"",
",",
"i",
")",
";",
"xml_set_attribute_int",
"(",
"coinnode",
",",
"\"",
"\"",
",",
"state",
"->",
"coin_count",
"[",
"i",
"]",
")",
";",
"}",
"}",
"if",
"(",
"state",
"->",
"dispensed_tickets",
"!=",
"0",
")",
"{",
"xml_data_node",
"*",
"tickets",
"=",
"xml_add_child",
"(",
"parentnode",
",",
"\"",
"\"",
",",
"NULL",
")",
";",
"if",
"(",
"tickets",
"!=",
"NULL",
")",
"xml_set_attribute_int",
"(",
"tickets",
",",
"\"",
"\"",
",",
"state",
"->",
"dispensed_tickets",
")",
";",
"}",
"}"
] | counters_save - save the state of the counters
and tickets | [
"counters_save",
"-",
"save",
"the",
"state",
"of",
"the",
"counters",
"and",
"tickets"
] | [
"/* only care about game-specific data */",
"/* iterate over coin counters */",
"/* output tickets */"
] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "config_type",
"type": "int"
},
{
"param": "parentnode",
"type": "xml_data_node"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "config_type",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parentnode",
"type": "xml_data_node",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5b19fb28cdf26eb2dd3f74efb426a77ebf47b9fb | lofunz/mieme | Reloaded/trunk/src/emu/machine/generic.c | [
"Unlicense"
] | C | coin_counter_get_count | int | int coin_counter_get_count(running_machine *machine, int num)
{
generic_machine_private *state = machine->generic_machine_data;
if (num >= ARRAY_LENGTH(state->coin_count))
return 0;
return state->coin_count[num];
} | /*-------------------------------------------------
coin_counter_get_count - return the coin count
for a given coin
-------------------------------------------------*/ | return the coin count
for a given coin | [
"return",
"the",
"coin",
"count",
"for",
"a",
"given",
"coin"
] | int coin_counter_get_count(running_machine *machine, int num)
{
generic_machine_private *state = machine->generic_machine_data;
if (num >= ARRAY_LENGTH(state->coin_count))
return 0;
return state->coin_count[num];
} | [
"int",
"coin_counter_get_count",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"num",
")",
"{",
"generic_machine_private",
"*",
"state",
"=",
"machine",
"->",
"generic_machine_data",
";",
"if",
"(",
"num",
">=",
"ARRAY_LENGTH",
"(",
"state",
"->",
"coin_count",
")",
")",
"return",
"0",
";",
"return",
"state",
"->",
"coin_count",
"[",
"num",
"]",
";",
"}"
] | coin_counter_get_count - return the coin count
for a given coin | [
"coin_counter_get_count",
"-",
"return",
"the",
"coin",
"count",
"for",
"a",
"given",
"coin"
] | [] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "num",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "num",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5b19fb28cdf26eb2dd3f74efb426a77ebf47b9fb | lofunz/mieme | Reloaded/trunk/src/emu/machine/generic.c | [
"Unlicense"
] | C | coin_lockout_get_state | int | int coin_lockout_get_state(running_machine *machine, int num)
{
generic_machine_private *state = machine->generic_machine_data;
if (num >= ARRAY_LENGTH(state->coinlockedout))
return FALSE;
return state->coinlockedout[num];
} | /*-------------------------------------------------
coin_lockout_get_state - return current lockout
state for a particular coin
-------------------------------------------------*/ | return current lockout
state for a particular coin | [
"return",
"current",
"lockout",
"state",
"for",
"a",
"particular",
"coin"
] | int coin_lockout_get_state(running_machine *machine, int num)
{
generic_machine_private *state = machine->generic_machine_data;
if (num >= ARRAY_LENGTH(state->coinlockedout))
return FALSE;
return state->coinlockedout[num];
} | [
"int",
"coin_lockout_get_state",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"num",
")",
"{",
"generic_machine_private",
"*",
"state",
"=",
"machine",
"->",
"generic_machine_data",
";",
"if",
"(",
"num",
">=",
"ARRAY_LENGTH",
"(",
"state",
"->",
"coinlockedout",
")",
")",
"return",
"FALSE",
";",
"return",
"state",
"->",
"coinlockedout",
"[",
"num",
"]",
";",
"}"
] | coin_lockout_get_state - return current lockout
state for a particular coin | [
"coin_lockout_get_state",
"-",
"return",
"current",
"lockout",
"state",
"for",
"a",
"particular",
"coin"
] | [] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "num",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "num",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5b19fb28cdf26eb2dd3f74efb426a77ebf47b9fb | lofunz/mieme | Reloaded/trunk/src/emu/machine/generic.c | [
"Unlicense"
] | C | coin_lockout_global_w | void | void coin_lockout_global_w(running_machine *machine, int on)
{
generic_machine_private *state = machine->generic_machine_data;
int i;
for (i = 0; i < ARRAY_LENGTH(state->coinlockedout); i++)
coin_lockout_w(machine, i, on);
} | /*-------------------------------------------------
coin_lockout_global_w - locks out all the coin
inputs
-------------------------------------------------*/ | locks out all the coin
inputs | [
"locks",
"out",
"all",
"the",
"coin",
"inputs"
] | void coin_lockout_global_w(running_machine *machine, int on)
{
generic_machine_private *state = machine->generic_machine_data;
int i;
for (i = 0; i < ARRAY_LENGTH(state->coinlockedout); i++)
coin_lockout_w(machine, i, on);
} | [
"void",
"coin_lockout_global_w",
"(",
"running_machine",
"*",
"machine",
",",
"int",
"on",
")",
"{",
"generic_machine_private",
"*",
"state",
"=",
"machine",
"->",
"generic_machine_data",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"ARRAY_LENGTH",
"(",
"state",
"->",
"coinlockedout",
")",
";",
"i",
"++",
")",
"coin_lockout_w",
"(",
"machine",
",",
"i",
",",
"on",
")",
";",
"}"
] | coin_lockout_global_w - locks out all the coin
inputs | [
"coin_lockout_global_w",
"-",
"locks",
"out",
"all",
"the",
"coin",
"inputs"
] | [] | [
{
"param": "machine",
"type": "running_machine"
},
{
"param": "on",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "on",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5b19fb28cdf26eb2dd3f74efb426a77ebf47b9fb | lofunz/mieme | Reloaded/trunk/src/emu/machine/generic.c | [
"Unlicense"
] | C | nvram_load | void | void nvram_load(running_machine *machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
if (!machine->m_devicelist.first(nvram) && machine->config->m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
mame_file *nvram_file = nvram_fopen(machine, OPEN_FLAG_READ);
if (nvram_file != NULL)
{
// read data from general NVRAM handler first
if (machine->config->m_nvram_handler != NULL)
(*machine->config->m_nvram_handler)(machine, nvram_file, FALSE);
// find all devices with NVRAM handlers, and read from them next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
nvram->nvram_load(*nvram_file);
// close the file
mame_fclose(nvram_file);
}
// otherwise, tell everyone to initialize their NVRAM areas
else
{
// initialize via the general NVRAM handler first
if (machine->config->m_nvram_handler != NULL)
(*machine->config->m_nvram_handler)(machine, NULL, FALSE);
// find all devices with NVRAM handlers, and read from them next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
nvram->nvram_reset();
}
} | /*-------------------------------------------------
nvram_load - load a system's NVRAM
-------------------------------------------------*/ | load a system's NVRAM | [
"load",
"a",
"system",
"'",
"s",
"NVRAM"
] | void nvram_load(running_machine *machine)
{
device_nvram_interface *nvram = NULL;
if (!machine->m_devicelist.first(nvram) && machine->config->m_nvram_handler == NULL)
return;
mame_file *nvram_file = nvram_fopen(machine, OPEN_FLAG_READ);
if (nvram_file != NULL)
{
if (machine->config->m_nvram_handler != NULL)
(*machine->config->m_nvram_handler)(machine, nvram_file, FALSE);
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
nvram->nvram_load(*nvram_file);
mame_fclose(nvram_file);
}
else
{
if (machine->config->m_nvram_handler != NULL)
(*machine->config->m_nvram_handler)(machine, NULL, FALSE);
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
nvram->nvram_reset();
}
} | [
"void",
"nvram_load",
"(",
"running_machine",
"*",
"machine",
")",
"{",
"device_nvram_interface",
"*",
"nvram",
"=",
"NULL",
";",
"if",
"(",
"!",
"machine",
"->",
"m_devicelist",
".",
"first",
"(",
"nvram",
")",
"&&",
"machine",
"->",
"config",
"->",
"m_nvram_handler",
"==",
"NULL",
")",
"return",
";",
"mame_file",
"*",
"nvram_file",
"=",
"nvram_fopen",
"(",
"machine",
",",
"OPEN_FLAG_READ",
")",
";",
"if",
"(",
"nvram_file",
"!=",
"NULL",
")",
"{",
"if",
"(",
"machine",
"->",
"config",
"->",
"m_nvram_handler",
"!=",
"NULL",
")",
"(",
"*",
"machine",
"->",
"config",
"->",
"m_nvram_handler",
")",
"(",
"machine",
",",
"nvram_file",
",",
"FALSE",
")",
";",
"for",
"(",
"bool",
"gotone",
"=",
"(",
"nvram",
"!=",
"NULL",
")",
";",
"gotone",
";",
"gotone",
"=",
"nvram",
"->",
"next",
"(",
"nvram",
")",
")",
"nvram",
"->",
"nvram_load",
"(",
"*",
"nvram_file",
")",
";",
"mame_fclose",
"(",
"nvram_file",
")",
";",
"}",
"else",
"{",
"if",
"(",
"machine",
"->",
"config",
"->",
"m_nvram_handler",
"!=",
"NULL",
")",
"(",
"*",
"machine",
"->",
"config",
"->",
"m_nvram_handler",
")",
"(",
"machine",
",",
"NULL",
",",
"FALSE",
")",
";",
"for",
"(",
"bool",
"gotone",
"=",
"(",
"nvram",
"!=",
"NULL",
")",
";",
"gotone",
";",
"gotone",
"=",
"nvram",
"->",
"next",
"(",
"nvram",
")",
")",
"nvram",
"->",
"nvram_reset",
"(",
")",
";",
"}",
"}"
] | nvram_load - load a system's NVRAM | [
"nvram_load",
"-",
"load",
"a",
"system",
"'",
"s",
"NVRAM"
] | [
"// only need to do something if we have an NVRAM device or an nvram_handler\r",
"// open the file; if it exists, call everyone to read from it\r",
"// read data from general NVRAM handler first\r",
"// find all devices with NVRAM handlers, and read from them next\r",
"// close the file\r",
"// otherwise, tell everyone to initialize their NVRAM areas\r",
"// initialize via the general NVRAM handler first\r",
"// find all devices with NVRAM handlers, and read from them next\r"
] | [
{
"param": "machine",
"type": "running_machine"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "machine",
"type": "running_machine",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.