mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07: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:
parent
a4cb691058
commit
1683c69fb7
@ -956,6 +956,24 @@ bool DSPAssembler::AssemblePass(const std::string& text, int pass)
|
||||
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 (params[0].type == P_STR)
|
||||
|
Loading…
Reference in New Issue
Block a user