Skip to content

Commit

Permalink
Fixed Headless
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Dec 28, 2024
1 parent 05d1b64 commit 56c07c0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Emulator/Base/MsgQueueTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ enum_long(MSG_TYPE)
MSG_CPU_HALT,

// Agnus
MSG_EOL_REACHED,
MSG_EOF_REACHED,
MSG_BEAMTRAP_REACHED,
MSG_BEAMTRAP_UPDATED,

Expand Down Expand Up @@ -171,6 +173,8 @@ struct MsgTypeEnum : vamiga::util::Reflection<MsgTypeEnum, MsgType>
case MSG_SWTRAP_REACHED: return "SWTRAP_REACHED";
case MSG_CPU_HALT: return "CPU_HALT";

case MSG_EOL_REACHED: return "EOL_REACHED";
case MSG_EOF_REACHED: return "EOF_REACHED";
case MSG_BEAMTRAP_REACHED: return "BEAMTRAP_REACHED";
case MSG_BEAMTRAP_UPDATED: return "BEAMTRAP_UPDATED";

Expand Down
16 changes: 16 additions & 0 deletions Emulator/Components/Amiga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,22 @@ Amiga::computeFrame()
break;
}

// Shall we stop at the end of the current line?
if (flags & RL::EOL_REACHED) {
clearFlag(RL::EOL_REACHED);
msgQueue.put(MSG_EOL_REACHED);
throw StateChangeException(STATE_PAUSED);
break;
}

// Shall we stop at the end of the current frame?
if (flags & RL::EOF_REACHED) {
clearFlag(RL::EOF_REACHED);
msgQueue.put(MSG_EOF_REACHED);
throw StateChangeException(STATE_PAUSED);
break;
}

// Did we reach a breakpoint?
if (flags & RL::BREAKPOINT_REACHED) {
clearFlag(RL::BREAKPOINT_REACHED);
Expand Down
22 changes: 12 additions & 10 deletions Emulator/Components/AmigaTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,18 @@ namespace RL
{
constexpr u32 STOP = (1 << 0);
constexpr u32 SOFTSTOP_REACHED = (1 << 1);
constexpr u32 BREAKPOINT_REACHED = (1 << 2);
constexpr u32 WATCHPOINT_REACHED = (1 << 3);
constexpr u32 CATCHPOINT_REACHED = (1 << 4);
constexpr u32 SWTRAP_REACHED = (1 << 5);
constexpr u32 BEAMTRAP_REACHED = (1 << 6);
constexpr u32 COPPERBP_REACHED = (1 << 7);
constexpr u32 COPPERWP_REACHED = (1 << 8);
constexpr u32 AUTO_SNAPSHOT = (1 << 9);
constexpr u32 USER_SNAPSHOT = (1 << 10);
constexpr u32 SYNC_THREAD = (1 << 11);
constexpr u32 EOL_REACHED = (1 << 2);
constexpr u32 EOF_REACHED = (1 << 3);
constexpr u32 BREAKPOINT_REACHED = (1 << 4);
constexpr u32 WATCHPOINT_REACHED = (1 << 5);
constexpr u32 CATCHPOINT_REACHED = (1 << 6);
constexpr u32 SWTRAP_REACHED = (1 << 7);
constexpr u32 BEAMTRAP_REACHED = (1 << 8);
constexpr u32 COPPERBP_REACHED = (1 << 9);
constexpr u32 COPPERWP_REACHED = (1 << 10);
constexpr u32 AUTO_SNAPSHOT = (1 << 11);
constexpr u32 USER_SNAPSHOT = (1 << 12);
constexpr u32 SYNC_THREAD = (1 << 13);
};

#endif
2 changes: 1 addition & 1 deletion Emulator/HeadlessScripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ static const char *smokeTestScript[] = {
"? df3",
"? df3 disk",

"? host",
"? thread",
"? server",

"shutdown",
Expand Down
2 changes: 1 addition & 1 deletion GUI/MyController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ extension MyController {
case .CPU_HALT:
refreshStatusBar()

case .BEAMTRAP_REACHED:
case .BEAMTRAP_REACHED, .EOF_REACHED, .EOL_REACHED:

inspector?.signalBeamtrap()

Expand Down

0 comments on commit 56c07c0

Please sign in to comment.