Skip to content

Dbg render fix#2

Open
alfishe wants to merge 18 commits into
dartfnm:dbg-devfrom
alfishe:dbg-render-fix
Open

Dbg render fix#2
alfishe wants to merge 18 commits into
dartfnm:dbg-devfrom
alfishe:dbg-render-fix

Conversation

@alfishe

@alfishe alfishe commented May 23, 2026

Copy link
Copy Markdown
  • minimal fixes to allow build on macos / linux
  • fix for improper main window rendering loop (it was rendering empty black buffer between valid frames making everything slow and flickering) - that was introduced after vAmiga integration

Tested on Windows (MSVC2019), MacOS (clang) and Linux (GCC 15)

alfishe added 18 commits May 13, 2026 02:12
Fix case-only mismatches in #include directives that fail on
case-sensitive filesystems (default on Linux, configurable on macOS).
Windows is unaffected due to case-insensitive filesystem.

Changes: color.h -> Color.h, EFlow.h -> eFlow.h, tribool.h -> Tribool.h,
Point2.h -> point2.h
The app would hang on exit because the UAE CPU thread never received
the quit signal when the debugger was not active (Live mode).

Root cause: m68k_go() only checked quit_program AFTER run_func()
completed a full CPU execution round. If the CPU was running without
debugger interaction, it would never exit the inner loop.

Fixes:
- uae_quit(): add set_special(SPCFLAG_MODE_CHANGE) to force the
  CPU loop to break out of run_func()
- m68k_go(): move quit_program check to TOP of the for(;;) loop,
  before run_func() call, so quit is detected immediately
- console_get(): remove infinite for(;;) loop that blocked the
  UAE thread when no console command was available
- UaeServerThread::destroy(): call uae_quit() before sending
  console quit command, add m_isDestroying flag
- popConsoleCmdWait(): change timeout from 100ms to 0ms (non-blocking
  poll) to prevent blocking during shutdown
- qsr_main.cpp: wrap CLI11 parse in try/catch to handle --help and
  invalid arguments gracefully instead of crashing
- qsr_main_wnd_client_app.cpp: use SDL_GetRendererOutputSize() instead
  of SDL_GetWindowSize() to get correct pixel dimensions on HiDPI
  and Retina displays
- drawing.cpp: add null check for amiga2aspect_line_map before
  dereferencing in draw_frame2 render loop
- fnvHash.h: add missing #include <cstddef> for size_t used in
  hash function signatures
- CMakeLists.txt: remove -Werror from GCC and Clang blocks to
  prevent build failures from warnings in vAmiga's upstream code
- FSStorage.cpp: replace std::ranges::sort with std::sort for
  broader compiler support (std::ranges requires full C++20
  library support)
- Skip render entirely when no new frame from emulator
- Prevents black frame flicker between emulator frames
… + span overrun fix

- Add -force_load (macOS) and --whole-archive (Linux) for amDebugger
  static library so TS_BEGIN_REFLECT_CLASS auto-registered debugger
  windows (Blitter, Console, Copper, Registers, Memory, Screen, etc.)
  are not stripped by the linker. Previously only MSVC WHOLEARCHIVE
  was configured.
- Fix off-by-one buffer overrun in createPredefinedShortcuts: span was
  sized with EId::MAX_COUNT (13) but g_shortcuts_list only has 12
  entries. On ARM64 the garbage function pointer caused SIGBUS.
Add POSIX sigaction handler (macOS/Linux) and SEH handler (Windows)
that captures signal info, registers, and backtrace on SIGSEGV/SIGABRT.
Writes crash log to /tmp/quaesar_crash_*.log for post-mortem debugging.

- crashhandler.h/cpp: platform detection and install API
- crashhandler_macos.cpp: POSIX sigaction + backtrace_symbols
- crashhandler_linux.cpp: same with Linux-specific signal codes
- crashhandler_windows.cpp: SEH exception filter + StackWalk64
- Integrated via installCrashHandler() in qsr_main.cpp
- CMakeLists.txt: added crashhandler sources to quaesar-dbg target
The createWindowCb_ template expects UiViewCreateCtx* but was receiving
a copy by value, causing the callback to interpret stack garbage as a
pointer. This corrupted the ui member in all debugger windows, leading
to crashes when activating the debugger (Shift+F12).
…Timing)

Copper (Gaps 4.1-4.2):
- fetch() caches agnus.copper.getInfo() into m_copInfo
- getCopperAddr() returns cop1lc/cop2lc/coppc0 from cached CopperInfo

Blitter (Gaps 4.3-4.4):
- isBlitterActive() queries agnus.blitter.getInfo().bbusy
- getScreenPixBuf() returns VAmServerThread display buffer

Floppy (Gaps 5.1-5.4):
- getEnabled() reads df[n]->getConfig().connected
- setEnabled() uses emu->set(Opt::DRIVE_CONNECT, ...)
- getAdfPath()/setAdfPath() track path and insert/eject disk
- getWriteProtect()/setWriteProtect() use DiskFlags::PROTECTED

Timing (Gaps 6.1-6.5):
- getVPos()/getHPos() read amiga.getInfo() vpos/hpos
- getCurCycle() returns horizontal position as cycle count
- isDebugActivated() checks isPaused()
- isDebugActivatedFull() checks isPaused() && debug mode
Build default dock layout programmatically on first frame when no
existing layout is loaded from ini. Places Disassembly, Registers,
Screen, Memory, Console and other windows in a sensible arrangement.
- Add 15 FPS frame throttling to reduce excessive refresh rate
- Fix disassembly table empty on init when nReqLine is -1 (cast to size_t overflow)
- Skip ImGui frames when window is hidden or throttled
- Scale frame preview to fit window while preserving aspect ratio
- GPU-accelerated scaling via SDL texture linear filtering
- Force redraw during window resize via SDL event watcher
- Show placeholder frame during resize to avoid distortion
- Scale VPos/HPos indicator lines accordingly
- Remove unnecessary scrollbar from screen widget
- Scale frame preview to fit window while preserving aspect ratio
- GPU-accelerated scaling via SDL texture linear filtering
- Force redraw during window resize via SDL event watcher
- Show placeholder frame during resize to avoid distortion
- Scale VPos/HPos indicator lines accordingly
- Remove unnecessary scrollbar from screen widget
- Change DockingEmptyBg from red to dark gray
- Clear framebuffer to gray on window creation and show
- Defer menu/toolbar drawing until fully initialized
- Add m_bFullyInitialized flag to avoid layout jumps during init
- Save layout to debugger_layout.ini on window close and app exit
- Load saved layout on startup with explicit LoadIniSettingsFromDisk
- Fallback to default layout if ini missing/empty/invalid (check on 2nd frame)
- Draw toolbar before DockSpace to position it at top
- Add NoScrollbar flag to prevent viewport scrollbar
- Defer layout settings load until after GUI creation for proper tab restore
- Fix popConsoleCmdWait to use blocking wait() instead of non-blocking
  wait(0), which caused debug_1() to return immediately instead of
  blocking the emulation loop
- Route step/continue commands via execConsoleCmd() when UAE debugger
  is active (debugger_active check), bypassing the stalled ops queue
- Use activate_debugger_new_pc(0, 0xFFFFFFFF) to enter UAE's native
  debug_1() blocking console loop for pause
- Mirror debug mode to dummy VM in forwarding callback for correct
  menu enable/disable state
- Forward operations via DebuggerDesktop instead of Debugger to reach
  forwardOpToEmulator callback
- Gate step/trace menu items on debugMode.isBreak() so they're only
  enabled when paused
- Add null guards for pUae in UaeVmImp operation handlers
- Add CONFIGURE_DEPENDS to file(GLOB) in amDebugger and qd CMakeLists
  with explanatory comments for reliable incremental builds
- Add PauseEmulation operation and Ctrl+F8 shortcut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant