Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Parse DefBreakPoint
This is very easy for now, as we don't support any sort of AML debugging.
This should actually do something if we want to.
  • Loading branch information
IsaacWoods committed Jan 10, 2021
1 parent 8b5b457 commit e4b49be
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions aml/src/opcode.rs
Expand Up @@ -39,6 +39,7 @@ pub const DEF_IF_ELSE_OP: u8 = 0xa0;
pub const DEF_ELSE_OP: u8 = 0xa1;
pub const DEF_NOOP_OP: u8 = 0xa3;
pub const DEF_RETURN_OP: u8 = 0xa4;
pub const DEF_BREAKPOINT_OP: u8 = 0xcc;

/*
* Type 2 opcodes
Expand Down
20 changes: 19 additions & 1 deletion aml/src/type1.rs
Expand Up @@ -17,7 +17,25 @@ where
* DefNotify | DefRelease | DefReset | DefReturn | DefSignal | DefSleep | DefStall |
* DefWhile
*/
comment_scope(DebugVerbosity::AllScopes, "Type1Opcode", choice!(def_if_else(), def_noop(), def_return()))
comment_scope(
DebugVerbosity::AllScopes,
"Type1Opcode",
choice!(def_breakpoint(), def_if_else(), def_noop(), def_return()),
)
}

fn def_breakpoint<'a, 'c>() -> impl Parser<'a, 'c, ()>
where
'c: 'a,
{
/*
* DefBreakPoint := 0xcc
* TODO: there is no debugger, so this doesn't do anything. If there was, this should stop execution and enter
* the AML debugger.
*/
opcode(opcode::DEF_BREAKPOINT_OP)
.then(comment_scope(DebugVerbosity::AllScopes, "DefBreakPoint", id()))
.discard_result()
}

fn def_if_else<'a, 'c>() -> impl Parser<'a, 'c, ()>
Expand Down

0 comments on commit e4b49be

Please sign in to comment.