mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
DSPAssembler: add WARNPC directive from xkas (technically, from asar)
This adds the WARNPC directive from xkas/asar to complement the existing ORG directive. A common useful idiom is "WARNPC 0xXXXX\nORG 0xXXXX," which only seeks forward and raises an error if you've already written to that part of the file.
This commit is contained in:
@ -956,6 +956,24 @@ bool DSPAssembler::AssemblePass(const std::string& text, int pass)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp("WARNPC", opcode) == 0)
|
||||||
|
{
|
||||||
|
if (params[0].type == P_VAL)
|
||||||
|
{
|
||||||
|
if (m_cur_addr > params[0].val)
|
||||||
|
{
|
||||||
|
std::string msg = StringFromFormat("WARNPC at 0x%04x, expected 0x%04x or less",
|
||||||
|
m_cur_addr, params[0].val);
|
||||||
|
ShowError(ERR_OUT_RANGE_PC, msg.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowError(ERR_EXPECTED_PARAM_VAL);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp("SEGMENT", opcode) == 0)
|
if (strcmp("SEGMENT", opcode) == 0)
|
||||||
{
|
{
|
||||||
if (params[0].type == P_STR)
|
if (params[0].type == P_STR)
|
||||||
|
Reference in New Issue
Block a user