Skip to content

Commit

Permalink
Merged with main branch.
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit eef91e9
Author: dart <[email protected]>
Date:   Sat Aug 31 18:53:16 2024 +0300

    Fix to play SDL_audio on current device by default

    - There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS.
    So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config.

commit 76862fc
Author: dart <[email protected]>
Date:   Sat Aug 31 18:53:16 2024 +0300

    Fix to play SDL_audio on current device by default

    - There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS.
    So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config.

commit b7b8159
Author: Daniel Collin <[email protected]>
Date:   Thu Jun 6 13:05:19 2024 +0200

    Switch to 24.04 for gcc

commit 8eebdd2
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 19:01:09 2024 +0100

    Some more console debugger fixes

commit ef8f052
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 18:53:22 2024 +0100

    Sorta working console debugger

commit b86cc4f
Author: Erik Hemming <[email protected]>
Date:   Fri Mar 29 18:43:59 2024 +0100

    clang-format files

commit ed49fad
Author: Erik Hemming <[email protected]>
Date:   Fri Mar 29 17:44:02 2024 +0100

    basic serial-out support

commit 847225d
Author: Erik Hemming <[email protected]>
Date:   Fri Mar 29 17:40:47 2024 +0100

    vscode; default launch.json and .gitignore build

commit cd3a5e1
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 08:09:12 2024 +0100

    Display correct again

commit dc078a4
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 08:03:51 2024 +0100

    Fixed typo

commit fec2cdf
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 07:59:33 2024 +0100

    Fixed crash on macOS

commit 73b8932
Author: Anton Nikolaev <[email protected]>
Date:   Mon Mar 18 12:06:23 2024 +0300

    Fixed stack memory corruption due to strcat() function (theblacklotus#21)

    * Fixed memory corruption due to strcat() function

    - The problem with memory stack corruption occurred in the 'fetch_saveimagepath()' function when starting the emulator.
    Because the memory allocated on the stack `TCHAR path[MAX_DPATH]` in function `DISK_get_default_saveimagepath` does not have a end of line marker ('/0').
    That's why further call of the strcat() function which first searches for a zero byte and then adds another string to it resulted in stack corruption in this place and application crash as a consequence.
    - In other similar functions, the same scenario is possible.

    * Update dummy.cpp

    Compilation error, I forgot to specify the variable name

    * Fixed memory corruption due to strcat() function

    - The problem with memory stack corruption occurred in the 'fetch_saveimagepath()' function when starting the emulator.
    Because the memory allocated on the stack `TCHAR path[MAX_DPATH]` in function `DISK_get_default_saveimagepath` does not have a end of line marker ('/0').
    That's why further call of the strcat() function which first searches for a zero byte and then adds another string to it resulted in stack corruption in this place and application crash as a consequence.
    - In other similar functions, the same scenario is possible.

    * Fix crash if host processor doesn't support 'movbe' SSE3 extension

    - My Intel processor 2011 does not support SSE3 extensions, in particular 'movbe' instruction. As a result, the emulator crashes with the error 'illegal instruction'
    Therefore, I would recommend leaving the original #ifdef HAVE_MOVBE

    * Refactor to pass .clangformat test

commit e01df20
Author: Daniel Collin <[email protected]>
Date:   Wed Feb 21 19:30:37 2024 +0100

    Support starting without a file

commit 2134e72
Author: Erik Hemming <[email protected]>
Date:   Wed Feb 21 18:57:15 2024 +0100

    cmake 'OR UNIX'

commit 8294b45
Author: Daniel Collin <[email protected]>
Date:   Wed Feb 21 17:15:08 2024 +0100

    Removed stupid test code

commit fb67cf9
Author: Daniel Collin <[email protected]>
Date:   Sat Feb 17 15:29:50 2024 +0100

    Winuae integrate (theblacklotus#20)

    * Small sprite optimization

    * Layout B CD32 key fix

    * Fullscreen OSD font update fix

    * Do not save GUI size if not visible, do not close GUI when emulation window is minimized and GUI is about to open.

    * Wait until last line is complete before finishing it.

    * Harddrive limit bumped to 50, check limit.

    * Quickstart disk image/executable drag&drop check, insert in harddrives if archive with multiple executables.

    * Option to force (unconnected) floppy data line high.

    * Add delay between LD reply bytes

    * ALG Marbella Vice needs LD Frame # Mode command.

    * Force floppy data pullup = high if ALG mode.

    * 5200b7

    * Add CIA IO ports to CIA debug output

    * Overscan+ HBSTRT parameter calculation fix (relative to endhpos)

    * Better NTSC vertical positioning in normal overscan mode.

    * Genlock positioning/scaling fixes. Manual offset config entries added.

    * ALG/Picmatic emulation updates.

    * Input remapping fixes.

    * ALG LD status info update.

    * 5200b8

    * Reduce LDP ACK delay. It was far too long. (Picmatic Zorton Brothers hang fix)

    * CIA E-clock mode on the fly change support

    * Fix Harddrives panel shortcut keys

    * Only show "OCS Denise blanking bug" black lines in Overscan+ or higher.

    * Fix 68040 MMU MOVES special case

    * Quickstart ALG/Picmatic PAL/NTSC selection

    * 68060 custom register byte write bug emulation fix

    * Genlock adjustable blanking support, fix scaling.

    * 5200b9

    * temp move for merge

    * Integrated latest from WinUAE

    * Hide the very last OCS-only line if mode is not at least Overscan+

    * Disk swapper: insert new image in cursor position, allow multiple identical images, fix removal cursor position.

    * Add unused qualifier bit combination for future use

    * 5200b10

    * temp move

    * Moved file back

    * Fix genlock emulation in single line mode

    * temp move

    * moved file back

    ---------

    Co-authored-by: Toni Wilen <[email protected]>

Introduces very early debugger feature for Queasar amiga emulator

Squashed commit of the following:

commit f2009043d4de0294895f4614d9176a6f4135ba82
Merge: 8f9a5112 de37c8b
Author: dart <[email protected]>
Date:   Tue Oct 8 11:21:46 2024 +0300

    Merge branch 'dbg-dev' of https://github.com/DartFNM/quaesar into dbg-dev

commit 8f9a5112279451197c7cc00a31fe9a3a879b10f4
Author: dart <[email protected]>
Date:   Mon Oct 7 10:57:08 2024 +0300

    Introduces very early debugger feature for Queasar amiga emulator

    - added some debug windows but they not very functional yet.

commit de37c8b
Author: dart <[email protected]>
Date:   Mon Oct 7 10:57:08 2024 +0300

    Introduces very early debugger feature for Queasar amiga emulator

    - added some debug windows but they not very functional yet.

Added the EASTL library as a fast and cross-platform implementation of basic containers and functions that are not available in regular STL, such as vector_map or string::sprintf().

Merged `debug-start` with `main` branch.

Squashed commit of the following:

commit eef91e9
Author: dart <[email protected]>
Date:   Sat Aug 31 18:53:16 2024 +0300

    Fix to play SDL_audio on current device by default

    - There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS.
    So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config.

commit 76862fc
Author: dart <[email protected]>
Date:   Sat Aug 31 18:53:16 2024 +0300

    Fix to play SDL_audio on current device by default

    - There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS.
    So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config.

commit b7b8159
Author: Daniel Collin <[email protected]>
Date:   Thu Jun 6 13:05:19 2024 +0200

    Switch to 24.04 for gcc

commit 8eebdd2
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 19:01:09 2024 +0100

    Some more console debugger fixes

commit ef8f052
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 18:53:22 2024 +0100

    Sorta working console debugger

commit b86cc4f
Author: Erik Hemming <[email protected]>
Date:   Fri Mar 29 18:43:59 2024 +0100

    clang-format files

commit ed49fad
Author: Erik Hemming <[email protected]>
Date:   Fri Mar 29 17:44:02 2024 +0100

    basic serial-out support

commit 847225d
Author: Erik Hemming <[email protected]>
Date:   Fri Mar 29 17:40:47 2024 +0100

    vscode; default launch.json and .gitignore build

commit cd3a5e1
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 08:09:12 2024 +0100

    Display correct again

commit dc078a4
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 08:03:51 2024 +0100

    Fixed typo

commit fec2cdf
Author: Daniel Collin <[email protected]>
Date:   Fri Mar 29 07:59:33 2024 +0100

    Fixed crash on macOS

commit 73b8932
Author: Anton Nikolaev <[email protected]>
Date:   Mon Mar 18 12:06:23 2024 +0300

    Fixed stack memory corruption due to strcat() function (theblacklotus#21)

    * Fixed memory corruption due to strcat() function

    - The problem with memory stack corruption occurred in the 'fetch_saveimagepath()' function when starting the emulator.
    Because the memory allocated on the stack `TCHAR path[MAX_DPATH]` in function `DISK_get_default_saveimagepath` does not have a end of line marker ('/0').
    That's why further call of the strcat() function which first searches for a zero byte and then adds another string to it resulted in stack corruption in this place and application crash as a consequence.
    - In other similar functions, the same scenario is possible.

    * Update dummy.cpp

    Compilation error, I forgot to specify the variable name

    * Fixed memory corruption due to strcat() function

    - The problem with memory stack corruption occurred in the 'fetch_saveimagepath()' function when starting the emulator.
    Because the memory allocated on the stack `TCHAR path[MAX_DPATH]` in function `DISK_get_default_saveimagepath` does not have a end of line marker ('/0').
    That's why further call of the strcat() function which first searches for a zero byte and then adds another string to it resulted in stack corruption in this place and application crash as a consequence.
    - In other similar functions, the same scenario is possible.

    * Fix crash if host processor doesn't support 'movbe' SSE3 extension

    - My Intel processor 2011 does not support SSE3 extensions, in particular 'movbe' instruction. As a result, the emulator crashes with the error 'illegal instruction'
    Therefore, I would recommend leaving the original #ifdef HAVE_MOVBE

    * Refactor to pass .clangformat test

commit e01df20
Author: Daniel Collin <[email protected]>
Date:   Wed Feb 21 19:30:37 2024 +0100

    Support starting without a file

commit 2134e72
Author: Erik Hemming <[email protected]>
Date:   Wed Feb 21 18:57:15 2024 +0100

    cmake 'OR UNIX'

commit 8294b45
Author: Daniel Collin <[email protected]>
Date:   Wed Feb 21 17:15:08 2024 +0100

    Removed stupid test code

commit fb67cf9
Author: Daniel Collin <[email protected]>
Date:   Sat Feb 17 15:29:50 2024 +0100

    Winuae integrate (theblacklotus#20)

    * Small sprite optimization

    * Layout B CD32 key fix

    * Fullscreen OSD font update fix

    * Do not save GUI size if not visible, do not close GUI when emulation window is minimized and GUI is about to open.

    * Wait until last line is complete before finishing it.

    * Harddrive limit bumped to 50, check limit.

    * Quickstart disk image/executable drag&drop check, insert in harddrives if archive with multiple executables.

    * Option to force (unconnected) floppy data line high.

    * Add delay between LD reply bytes

    * ALG Marbella Vice needs LD Frame # Mode command.

    * Force floppy data pullup = high if ALG mode.

    * 5200b7

    * Add CIA IO ports to CIA debug output

    * Overscan+ HBSTRT parameter calculation fix (relative to endhpos)

    * Better NTSC vertical positioning in normal overscan mode.

    * Genlock positioning/scaling fixes. Manual offset config entries added.

    * ALG/Picmatic emulation updates.

    * Input remapping fixes.

    * ALG LD status info update.

    * 5200b8

    * Reduce LDP ACK delay. It was far too long. (Picmatic Zorton Brothers hang fix)

    * CIA E-clock mode on the fly change support

    * Fix Harddrives panel shortcut keys

    * Only show "OCS Denise blanking bug" black lines in Overscan+ or higher.

    * Fix 68040 MMU MOVES special case

    * Quickstart ALG/Picmatic PAL/NTSC selection

    * 68060 custom register byte write bug emulation fix

    * Genlock adjustable blanking support, fix scaling.

    * 5200b9

    * temp move for merge

    * Integrated latest from WinUAE

    * Hide the very last OCS-only line if mode is not at least Overscan+

    * Disk swapper: insert new image in cursor position, allow multiple identical images, fix removal cursor position.

    * Add unused qualifier bit combination for future use

    * 5200b10

    * temp move

    * Moved file back

    * Fix genlock emulation in single line mode

    * temp move

    * moved file back

    ---------

    Co-authored-by: Toni Wilen <[email protected]>
  • Loading branch information
dartfnm committed Oct 9, 2024
1 parent fb3a79c commit df688ed
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ packages.config
*.zip
*.d
temp
out
output
build/
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ add_executable(quaesar
# Recursively glob for all .cpp files in the src directory
file(GLOB_RECURSE CROSS_FILES "src/*.cpp")
<<<<<<< HEAD
<<<<<<< HEAD
file(GLOB_RECURSE QUAE_HEADERS "src/*.h")
target_sources(quaesar PRIVATE ${CROSS_FILES} ${QUAE_HEADERS})

Expand All @@ -222,12 +223,21 @@ if (APPLE OR LINUX)
=======
=======
target_sources(quaesar PRIVATE ${CROSS_FILES})
=======
file(GLOB_RECURSE QUAE_HEADERS "src/*.h")
target_sources(quaesar PRIVATE ${CROSS_FILES} ${QUAE_HEADERS})
>>>>>>> ae863fad (Merged with main branch.)

>>>>>>> c95323b5 (WIP on Disassembly)
if (APPLE OR LINUX OR UNIX)
<<<<<<< HEAD
target_compile_options(quaesar PRIVATE -DUAE=1 -D_cdecl= -DFILEFLAG_WRITE=1 -DOS_NAME=\"linux\")
target_compile_options(quaesar PRIVATE -DUSHORT=uint16_t -DHWND=uint32_t -DHRESULT=uint32_t -DWPARAM=uint16_t -DLPARAM=uint32_t)
>>>>>>> 2134e72d (cmake 'OR UNIX')
=======
target_compile_options(quaesar PRIVATE -DUAE=1 -D_cdecl= -DFILEFLAG_WRITE=1 -DOS_NAME=\"linux\")
target_compile_options(quaesar PRIVATE -DUSHORT=uint16_t -DHWND=uint32_t -DHRESULT=uint32_t -DWPARAM=uint16_t -DLPARAM=uint32_t)
>>>>>>> ae863fad (Merged with main branch.)
target_compile_definitions(quaesar PRIVATE FSUAE)
target_include_directories(quaesar PRIVATE ${SDL2_INCLUDE_DIRS})
target_link_libraries(quaesar PRIVATE ${SDL2_LIBRARIES})
Expand Down
154 changes: 112 additions & 42 deletions src/debugger/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <dear_imgui/backends/imgui_impl_sdlrenderer2.h>
#include <dear_imgui/imgui.h>
<<<<<<< HEAD
<<<<<<< HEAD
#include <dear_imgui/imgui_internal.h>
#include <debugger/ui/gui_manager.h>
#include <debugger/vm.h>
Expand Down Expand Up @@ -86,6 +87,11 @@ Debugger* Debugger_create() {

cs_option(debugger->capstone, CS_OPT_DETAIL, CS_OPT_ON);
>>>>>>> 4380b77f (WIP on debugger)
=======
#include <dear_imgui/imgui_internal.h>
#include <debugger/ui/gui_manager.h>
#include <debugger/vm.h>
>>>>>>> ae863fad (Merged with main branch.)

namespace qd {
void imgui_apply_dark_style() {
Expand Down Expand Up @@ -182,6 +188,7 @@ void imgui_apply_dark_style() {
}
}

<<<<<<< HEAD
<<<<<<< HEAD
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
=======
Expand All @@ -194,10 +201,15 @@ void imgui_apply_dark_style() {
>>>>>>> ee5fcf82 (Register view and semi working stepping)

<<<<<<< HEAD
=======
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

>>>>>>> ae863fad (Merged with main branch.)
Debugger* Debugger_create() {
uint32_t window_flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_HIDDEN;
SDL_Window* window =
SDL_CreateWindow("Quaesar: Debugger", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, window_flags);
<<<<<<< HEAD

// From 2.0.18: Enable native IME.
#ifdef SDL_HINT_IME_SHOW_UI
Expand Down Expand Up @@ -253,6 +265,59 @@ Debugger* Debugger_create() {
s_debugger = debugger;

>>>>>>> 4380b77f (WIP on debugger)
=======

// From 2.0.18: Enable native IME.
#ifdef SDL_HINT_IME_SHOW_UI
SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");
#endif

if (!window) {
fprintf(stderr, "Error creating window.\n");
return nullptr;
}

SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED);
if (!renderer) {
SDL_DestroyWindow(window);
SDL_Log("Error creating SDL_Renderer!");
return nullptr;
}

// Setup Dear ImGui context
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
(void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;

// Setup Dear ImGui style
ImGui::StyleColorsDark();
// ImGui::StyleColorsLight();

// Setup Platform/Renderer backends
ImGui_ImplSDL2_InitForSDLRenderer(window, renderer);
ImGui_ImplSDLRenderer2_Init(renderer);

Debugger* debugger = new Debugger();
debugger->window = window;
debugger->renderer = renderer;

// TODO: Pick correct CPU depending on starting CPU
cs_err err = cs_open(CS_ARCH_M68K, (cs_mode)(CS_MODE_BIG_ENDIAN | CS_MODE_M68K_000), &debugger->capstone);
if (err) {
printf("Failed on cs_open() with error returned: %u\n", err);
abort();
}

cs_option(debugger->capstone, CS_OPT_DETAIL, CS_OPT_ON);

imgui_apply_dark_style();

// create windows
debugger->create();
>>>>>>> ae863fad (Merged with main branch.)
return debugger;
}

Expand All @@ -261,11 +326,14 @@ Debugger* Debugger_create() {
static void draw_debugger_window(Debugger* self) {
ImGuiIO& io = ImGui::GetIO();

<<<<<<< HEAD
<<<<<<< HEAD
=======
static bool p_open = true;

>>>>>>> c95323b5 (WIP on Disassembly)
=======
>>>>>>> ae863fad (Merged with main branch.)
const ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->WorkPos);
ImGui::SetNextWindowSize(viewport->WorkSize);
Expand All @@ -280,6 +348,7 @@ static void draw_debugger_window(Debugger* self) {
bool p_open = true;
ImGui::Begin("Quaesar debugger", &p_open, window_flags);
ImGui::PopStyleVar(2);
<<<<<<< HEAD
<<<<<<< HEAD
ImGui::DockSpace(ImGui::GetID("DockSpace"), ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_None);
self->gui->drawImGuiFrame();
Expand Down Expand Up @@ -344,6 +413,10 @@ static void draw_debugger_window(Debugger* self) {
*/

>>>>>>> b105bd89 (WIP)
=======
ImGui::DockSpace(ImGui::GetID("DockSpace"), ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_None);
self->gui->drawImGuiFrame();
>>>>>>> ae863fad (Merged with main branch.)
ImGui::End();
}

Expand Down Expand Up @@ -384,6 +457,9 @@ bool Debugger_is_window_visible(Debugger* debugger) {
uint32_t window_flags = SDL_GetWindowFlags(debugger->window);
if (window_flags & SDL_WINDOW_HIDDEN) {
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> ae863fad (Merged with main branch.)
return false;
} else {
return true;
Expand All @@ -392,9 +468,12 @@ bool Debugger_is_window_visible(Debugger* debugger) {

void Debugger_toggle(Debugger* debugger, DebuggerMode mode) {
if (!Debugger_is_window_visible(debugger)) {
<<<<<<< HEAD
=======
activate_debugger_new();
>>>>>>> 4380b77f (WIP on debugger)
=======
>>>>>>> ae863fad (Merged with main branch.)
SDL_ShowWindow(debugger->window);
} else {
deactivate_debugger();
Expand All @@ -418,6 +497,7 @@ void Debugger_destroy(Debugger* debugger) {
delete debugger;
}

<<<<<<< HEAD
<<<<<<< HEAD
//////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -459,59 +539,46 @@ void* Debugger::addrToPtr(uint32_t addr) {
}; // namespace qd
=======
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
=======
//////////////////////////////////////////////////////////////////////////
>>>>>>> ae863fad (Merged with main branch.)

static void* create(void* user_data) {
return nullptr;
}
static void check_exception(void* self) {
}
static void cop_debug(void* self, uint32_t addr, uint32_t nextaddr, uint16_t word1, uint16_t word2, int hpos,
int vpos) {
void Debugger::create() {
vm = qd::VM::get();
gui = new GuiManager(this);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void update(void* self) {
set_special(SPCFLAG_BRK);

SDL_Event e;

while (1) {
while (SDL_PollEvent(&e) != 0) {
// User requests quit
switch (e.type) {
case SDL_QUIT: // User closes the window
// TODO: Fix me
exit(0);
break;
default:
break;

case SDL_KEYDOWN:
if (e.key.keysym.sym == SDLK_ESCAPE) {
exit(0);
}
void Debugger::destroy() {
if (gui)
gui->destroy();
delete gui;
gui = nullptr;

if (e.key.keysym.sym == SDLK_F10) {
Debugger_step(s_debugger);
return;
}
vm = nullptr;
}

break;
}
bool Debugger::isDebugActivated() {
return ::debugging != 0;
}

Debugger_update_event(&e);
}
void Debugger::setDebugMode(DebuggerMode debug_mode) {
if (debug_mode == DebuggerMode_Break) {
activate_debugger_new();

Debugger_update(s_debugger);
// trace_mode = TRACE_MATCH_PC;
// trace_param[0] = nextpc;
// exception_debugging = 1;
// debug_cycles(2);
} else if (debug_mode == DebuggerMode_Live) {
deactivate_debugger();
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void Debugger_step(Debugger* debugger) {
debug_internal_step();
void* Debugger::addrToPtr(uint32_t addr) {
void* addr_ptr = memory_get_real_address(addr);
return addr_ptr;
}
<<<<<<< HEAD

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Expand All @@ -530,3 +597,6 @@ DebuggerAPI s_debugger_api = {
>>>>>>> 4380b77f (WIP on debugger)
=======
>>>>>>> eafcacf8 (Format fixes)
=======
}; // namespace qd
>>>>>>> ae863fad (Merged with main branch.)
15 changes: 15 additions & 0 deletions src/debugger/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ struct SDL_Window;
struct SDL_Renderer;
union SDL_Event;
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> ae863fad (Merged with main branch.)

namespace qd {
class GuiManager;
class VM;
<<<<<<< HEAD

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Expand All @@ -30,6 +34,11 @@ struct Debugger {
};

>>>>>>> ee5fcf82 (Register view and semi working stepping)
=======

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

>>>>>>> ae863fad (Merged with main branch.)
enum DebuggerMode {
DebuggerMode_Live,
DebuggerMode_Break,
Expand Down Expand Up @@ -67,9 +76,15 @@ void Debugger_update_event(SDL_Event* event);
void Debugger_destroy(Debugger* debugger);
void Debugger_toggle(Debugger* debugger, DebuggerMode mode);
<<<<<<< HEAD
<<<<<<< HEAD
bool Debugger_is_window_visible(Debugger* debugger);

}; // namespace qd
=======
void Debugger_step(Debugger* debugger);
>>>>>>> b105bd89 (WIP)
=======
bool Debugger_is_window_visible(Debugger* debugger);

}; // namespace qd
>>>>>>> ae863fad (Merged with main branch.)
4 changes: 2 additions & 2 deletions src/debugger/window/memory_wnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,8 @@ void MemoryView::draw_preview_data(size_t addr, const uint8_t* mem_data, size_t
}
case ImGuiDataType_COUNT:
break;
}
IM_ASSERT(0);
} // Switch
IM_ASSERT(0); // Shouldn't reach
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
11 changes: 11 additions & 0 deletions src/dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,16 @@ int graphics_init(bool) {

alloc_colors64k(0, bits, bits, bits, red_shift, green_shift, blue_shift, bits, 24, 0, 0, false);

<<<<<<< HEAD
<<<<<<< HEAD
s_debugger = qd::Debugger_create();

=======
>>>>>>> fec2cdfe (Fixed crash on macOS)
=======
s_debugger = qd::Debugger_create();

>>>>>>> ae863fad (Merged with main branch.)
TRACE();
return 1;
}
Expand Down Expand Up @@ -1099,12 +1104,16 @@ void unlockscr(struct vidbuffer* vb_in, int y_start, int y_end) {
int amiga_height = vb->outheight;

<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> ae863fad (Merged with main branch.)
// Change pixels
for (int y = 0; y < amiga_height; y++) {
uint8_t* dest = (uint8_t*)&pixels[y * 754];
memcpy(dest, sptr, amiga_width * 4);
sptr += vb->rowbytes;
}
<<<<<<< HEAD
=======
int amiga_width = vb->outwidth;
int amiga_height = vb->outheight;
Expand All @@ -1115,6 +1124,8 @@ void unlockscr(struct vidbuffer* vb_in, int y_start, int y_end) {
memcpy(dest, sptr, amiga_width * 4);
sptr += vb->rowbytes;
>>>>>>> fec2cdfe (Fixed crash on macOS)
=======
>>>>>>> ae863fad (Merged with main branch.)
}
SDL_UnlockTexture(s_texture);
}
Expand Down
Loading

0 comments on commit df688ed

Please sign in to comment.