Skip to content

Commit

Permalink
Work on Guards API (Breakpoints, Watchpoints, Catchpoints)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Jul 8, 2024
1 parent 38a144c commit 79e8f96
Show file tree
Hide file tree
Showing 11 changed files with 444 additions and 40 deletions.
12 changes: 3 additions & 9 deletions Emulator/Base/CmdQueueTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ enum_long(CMD_TYPE)
CMD_ALARM_REL, ///< Schedule an alarm (relative cycle)
CMD_INSPECTION_TARGET, ///< Sets the auto-inspection mask

/*
// CPU
CMD_CPU_BRK, ///< Let the CPU execute a BRK instruction
CMD_CPU_NMI, ///< Emulate an external expansion port NMI
// CPU (Breakpoints)
CMD_BP_SET_AT, ///< Set a breakpoint
CMD_BP_MOVE_TO, ///< Change the address of breakpoint
Expand All @@ -49,6 +44,8 @@ enum_long(CMD_TYPE)
CMD_BP_DISABLE_AT, ///< Disable the breakpoint at an address
CMD_BP_DISABLE_ALL, ///< Disable all brekpoints

/*
// CPU (Watchpoints)
CMD_WP_SET_AT, ///< Set a watchpoint
CMD_WP_MOVE_TO, ///< Change the address of watchpoint
Expand Down Expand Up @@ -110,10 +107,6 @@ struct CmdTypeEnum : util::Reflection<CmdTypeEnum, CmdType> {
case CMD_ALARM_REL: return "ALARM_REL";
case CMD_INSPECTION_TARGET: return "INSPECTION_TARGET";

/*
case CMD_CPU_BRK: return "CPU_BRK";
case CMD_CPU_NMI: return "CPU_NMI";
case CMD_BP_SET_AT: return "BP_SET_AT";
case CMD_BP_REMOVE_NR: return "BP_REMOVE_NR";
case CMD_BP_REMOVE_AT: return "BP_REMOVE_AT";
Expand All @@ -125,6 +118,7 @@ struct CmdTypeEnum : util::Reflection<CmdTypeEnum, CmdType> {
case CMD_BP_DISABLE_AT: return "BP_DISABLE_AT";
case CMD_BP_DISABLE_ALL: return "BP_DISABLE_ALL";

/*
case CMD_WP_SET_AT: return "WP_SET_AT";
case CMD_WP_REMOVE_NR: return "WP_REMOVE_NR";
case CMD_WP_REMOVE_AT: return "WP_REMOVE_AT";
Expand Down
25 changes: 25 additions & 0 deletions Emulator/Components/Amiga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,31 @@ Amiga::takeUserSnapshot()
}
*/

void
Amiga::processCommand(const Cmd &cmd)
{
switch (cmd.type) {

case CMD_ALARM_ABS:

setAlarmAbs(cmd.alarm.cycle, cmd.alarm.value);
break;

case CMD_ALARM_REL:

setAlarmRel(cmd.alarm.cycle, cmd.alarm.value);
break;

case CMD_INSPECTION_TARGET:

setAutoInspectionMask(cmd.value);
break;

default:
fatalError;
}
}

void
Amiga::eolHandler()
{
Expand Down
5 changes: 4 additions & 1 deletion Emulator/Components/Amiga.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,14 @@ class Amiga final : public CoreComponent, public Inspectable<AmigaInfo> {


//
// Managing events
// Managing commands and events
//

public:

// Processes a command from the command queue
void processCommand(const Cmd &cmd);

// End-of-line handler
void eolHandler();

Expand Down
Loading

0 comments on commit 79e8f96

Please sign in to comment.