Skip to content

Commit

Permalink
debug structure
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jul 3, 2024
1 parent 461dda4 commit 7ba93e7
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
21 changes: 21 additions & 0 deletions platforms/shared/desktop/gui_debug.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Geargrafx - PC Engine / TurboGrafx Emulator
* Copyright (C) 2024 Ignacio Sanchez
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
*
*/

#define GUI_DEBUG_IMPORT
#include "gui_debug.h"
41 changes: 41 additions & 0 deletions platforms/shared/desktop/gui_debug.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Geargrafx - PC Engine / TurboGrafx Emulator
* Copyright (C) 2024 Ignacio Sanchez
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
*
*/

#ifndef GUI_DEBUG_H
#define GUI_DEBUG_H

#ifdef GUI_DEBUG_IMPORT
#define EXTERN
#else
#define EXTERN extern
#endif

EXTERN void gui_debug_windows(void);
EXTERN void gui_debug_reset(void);
EXTERN void gui_debug_reset_symbols(void);
EXTERN void gui_debug_load_symbols_file(const char* path);
EXTERN void gui_debug_toggle_breakpoint(void);
EXTERN void gui_debug_reset_breakpoints_cpu(void);
EXTERN void gui_debug_reset_breakpoints_mem(void);
EXTERN void gui_debug_runtocursor(void);
EXTERN void gui_debug_go_back(void);
EXTERN void gui_debug_copy_memory(void);
EXTERN void gui_debug_paste_memory(void);

#endif /* GUI_DEBUG_H */
1 change: 1 addition & 0 deletions platforms/shared/desktop/makefiles/Makefile.sources
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SOURCES_CXX := \
$(DESKTOP_SRC_DIR)/gui_menus.cpp \
$(DESKTOP_SRC_DIR)/gui_popups.cpp \
$(DESKTOP_SRC_DIR)/gui_actions.cpp \
$(DESKTOP_SRC_DIR)/gui_debug.cpp \
$(DESKTOP_SRC_DIR)/renderer.cpp \
$(DESKTOP_SRC_DIR)/emu.cpp \
$(DESKTOP_SRC_DIR)/imgui/imgui_impl_sdl2.cpp \
Expand Down
36 changes: 36 additions & 0 deletions platforms/shared/desktop/util.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Geargrafx - PC Engine / TurboGrafx Emulator
* Copyright (C) 2024 Ignacio Sanchez
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
*
*/

#ifndef UTIL_H
#define UTIL_H

#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c"
#define BYTE_TO_BINARY_PATTERN_SPACED "%c%c%c%c %c%c%c%c"
#define BYTE_TO_BINARY_PATTERN_ALL_SPACED "%c %c %c %c %c %c %c %c"
#define BYTE_TO_BINARY(byte) \
(byte & 0x80 ? '1' : '0'), \
(byte & 0x40 ? '1' : '0'), \
(byte & 0x20 ? '1' : '0'), \
(byte & 0x10 ? '1' : '0'), \
(byte & 0x08 ? '1' : '0'), \
(byte & 0x04 ? '1' : '0'), \
(byte & 0x02 ? '1' : '0'), \
(byte & 0x01 ? '1' : '0')

#endif /* UTIL_H */

0 comments on commit 7ba93e7

Please sign in to comment.