Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
},
"C_Cpp.formatting": "clangFormat",
"C_Cpp.clang_format_style": "file",
"C_Cpp.clang_format_fallbackStyle": "Google"
"C_Cpp.clang_format_path": "${workspaceFolder}\\bin\\windows\\bin\\clang-format.exe",
}
61 changes: 50 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Minimum CMake version requirement
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.10)

#set(CMAKE_GENERATOR_TOOLSET "ClangCl") # test compilation on clang-c

option(ENABLE_CODE_GENERATION "Enable code generation" OFF)

Expand All @@ -25,8 +27,10 @@ if (APPLE OR LINUX OR UNIX)
find_package(SDL2 REQUIRED)
endif()

if(NOT DEFINED SDL2_INCLUDE_DIRS)
set(SDL2_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/external/sdl2/include")
endif()

add_definitions(-DEASTL_EASTDC_VSNPRINTF=0)

if (WIN32)
add_definitions(-D_HAS_STD_BYTE=0)
Expand All @@ -35,6 +39,10 @@ if (WIN32)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
add_link_options("/INCREMENTAL")
add_compile_options("/MP") # multiprocessor build

if(NOT CMAKE_GENERATOR_PLATFORM)
set(CMAKE_GENERATOR_PLATFORM "Win32") # add Win32 platform to solution
endif()
endif()
endif()

Expand Down Expand Up @@ -209,6 +217,10 @@ set(UAE_SOURCE_LIST
uae_src/blit.h
)
add_executable(quaesar ${UAE_SOURCE_LIST})
if (WIN32)
add_dependencies(quaesar quaesar-clang-format)
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${UAE_SOURCE_LIST})

# Recursively glob for all .cpp files in the src directory
Expand All @@ -220,16 +232,15 @@ target_sources(quaesar PRIVATE ${CROSS_FILES} ${QUAE_HEADERS})
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${QUAE_HEADERS} ${CROSS_FILES} ${SDL2_INCLUDE_DIRS})

target_include_directories(quaesar PRIVATE ${SDL2_INCLUDE_DIRS})

if (APPLE OR LINUX 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)
target_compile_options(quaesar PRIVATE -DUAE=1 -D_cdecl= -DOS_NAME=\"linux\")
target_compile_definitions(quaesar PRIVATE FSUAE)
target_include_directories(quaesar PRIVATE ${SDL2_INCLUDE_DIRS})
target_link_libraries(quaesar PRIVATE ${SDL2_LIBRARIES})
endif()

if (WIN32)
target_include_directories(quaesar PRIVATE "${CMAKE_SOURCE_DIR}/external/sdl2/include")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
target_link_libraries(quaesar PRIVATE "${CMAKE_SOURCE_DIR}/external/sdl2/x64/sdl2.lib")
target_link_libraries(quaesar PRIVATE "${CMAKE_SOURCE_DIR}/external/sdl2/x64/SDL2main.lib")
Expand All @@ -243,23 +254,51 @@ if (WIN32)
endif()

if (APPLE)
target_compile_options(quaesar PRIVATE -Wno-macro-redefined -Wno-deprecated-declarations -DFILEFLAG_DIR=1 -DFILEFLAG_DIR=1 -D_ftelli64=ftell -D_fseeki64=fseek -D_fseeko64=fseeko -Dfseeko64=fseeko -Dftello64=ftell)
target_compile_options(quaesar PRIVATE -Wno-macro-redefined -Wno-deprecated-declarations)
endif()

if (LINUX OR UNIX)
target_compile_options(quaesar PRIVATE -DFILEFLAG_DIR=1 -D_ftelli64=ftello64 -D_fseeki64=fseeko64)
target_link_libraries(quaesar PRIVATE dl)
endif()

target_include_directories(quaesar PRIVATE "${CMAKE_SOURCE_DIR}/external/ADFlib/src")
target_include_directories(quaesar PRIVATE "${CMAKE_SOURCE_DIR}/external/dear_imgui")
target_include_directories(quaesar PRIVATE "${CMAKE_SOURCE_DIR}/external")
target_include_directories(quaesar PRIVATE "${CMAKE_SOURCE_DIR}/external/capstone/include")
target_include_directories(quaesar PRIVATE "${CMAKE_SOURCE_DIR}/external/EASTL/include")
target_link_libraries(quaesar PRIVATE ${SDL2_LIBRARIES} zlibstatic adf imgui capstone EASTL)


if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/imgui.ini")
file(COPY_FILE "${CMAKE_CURRENT_LIST_DIR}/bin/install/default_layout.ini" "${CMAKE_CURRENT_BINARY_DIR}/imgui.ini")
endif()


# Format source code with clang-format
if(WIN32)
set(CLANG_FORMAT_EXE "${CMAKE_SOURCE_DIR}/bin/windows/bin/clang-format.exe")
else()
find_program(CLANG_FORMAT_EXE NAMES clang-format)
endif()

if(CLANG_FORMAT_EXE)
file(GLOB_RECURSE QUAE_FORMAT_SRC_FILES
"${CMAKE_SOURCE_DIR}/src/*.cpp"
"${CMAKE_SOURCE_DIR}/src/*.h"
)

# Create a stamp file to track formatting
set(CLANG_FORMAT_STAMP "${CMAKE_BINARY_DIR}/.clang_format.stamp")

add_custom_command(
OUTPUT ${CLANG_FORMAT_STAMP}
COMMAND ${CMAKE_COMMAND} -E echo "Format sources with clang-format: ${CLANG_FORMAT_EXE}"
COMMAND ${CLANG_FORMAT_EXE} -i --style=file ${QUAE_FORMAT_SRC_FILES}
COMMAND ${CMAKE_COMMAND} -E touch ${CLANG_FORMAT_STAMP}
DEPENDS ${QUAE_FORMAT_SRC_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Running clang-format on changed files"
)

add_custom_target(
quaesar-clang-format
DEPENDS ${CLANG_FORMAT_STAMP}
)
endif()
111 changes: 72 additions & 39 deletions bin/install/default_layout.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,69 +9,73 @@ Size=400,400
Collapsed=0

[Window][Disassembly]
Pos=8,42
Size=334,670
Pos=8,57
Size=383,655
Collapsed=0
DockId=0x00000002,0
DockId=0x00000003,0

[Window][Registers]
Pos=343,42
Size=245,244
Pos=392,57
Size=267,323
Collapsed=0
DockId=0x00000005,0
DockId=0x00000007,0

[Window][Console]
Pos=589,490
Size=683,222
Pos=660,490
Size=612,222
Collapsed=0
DockId=0x00000008,1
DockId=0x00000001,1

[Window][Screen]
Pos=589,42
Size=683,447
Pos=660,57
Size=612,432
Collapsed=0
DockId=0x00000007,1
DockId=0x00000002,0

[Window][Palette]
Pos=343,42
Size=245,244
Pos=392,57
Size=267,323
Collapsed=0
DockId=0x00000005,1
DockId=0x00000007,1

[Window][Memory graph]
Pos=589,42
Size=683,447
Pos=660,57
Size=612,432
Collapsed=0
DockId=0x00000007,0
DockId=0x00000002,1

[Window][Memory]
Pos=589,490
Size=683,222
Pos=660,490
Size=612,222
Collapsed=0
DockId=0x00000008,0
DockId=0x00000001,0

[Window][Custom regs]
Pos=343,287
Size=245,425
Pos=392,381
Size=267,331
Collapsed=0
DockId=0x00000006,0
DockId=0x00000008,0

[Window][Copper debug]
Pos=8,42
Size=334,670
Pos=8,57
Size=383,655
Collapsed=0
DockId=0x00000002,1
DockId=0x00000003,1

[Window][Blitter]
Pos=343,42
Size=245,244
Pos=392,57
Size=267,323
Collapsed=0
DockId=0x00000005,2
DockId=0x00000007,2

[Window][Blitter/##LEFT_COL_FF37AB84]
IsChild=1
Size=112,188

[Window][Blitter/##LEFT_COL_0360C455]
IsChild=1
Size=124,267

[Table][0xF68F8465,4]
RefScale=13
Column 0 Width=14
Expand Down Expand Up @@ -101,14 +105,43 @@ Column 2 Width=63
Column 3 Width=28
Column 4 Width=589

[Table][0xD8F01B49,5]
RefScale=13
Column 0 Width=8
Column 1 Width=42
Column 2 Width=63
Column 3 Width=28
Column 4 Width=119

[Table][0x8745BE8D,4]
RefScale=13
Column 0 Width=8
Column 1 Width=56
Column 2 Width=84
Column 3 Width=183

[Table][0x0613C452,4]
RefScale=13
Column 0 Width=14
Column 1 Width=66
Column 2 Width=18
Column 3 Width=70

[Table][0x1F97F2CE,4]
RefScale=13
Column 0 Width=52
Column 1 Width=40
Column 2 Width=52
Column 3 Width=45

[Docking][Data]
DockSpace ID=0x7A095824 Window=0xBB552D6F Pos=8,42 Size=1264,670 Split=X
DockNode ID=0x00000001 Parent=0x7A095824 SizeRef=580,670 Split=X Selected=0x19EDEE42
DockNode ID=0x00000002 Parent=0x00000001 SizeRef=333,826 Selected=0x19EDEE42
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=245,826 Split=Y Selected=0x13D58281
DockNode ID=0x00000005 Parent=0x00000003 SizeRef=257,301 Selected=0xEAEE9E08
DockNode ID=0x00000006 Parent=0x00000003 SizeRef=257,523 Selected=0x13D58281
DockNode ID=0x00000004 Parent=0x7A095824 SizeRef=865,670 Split=Y Selected=0x35059272
DockNode ID=0x00000007 Parent=0x00000004 SizeRef=923,602 CentralNode=1 Selected=0x35059272
DockNode ID=0x00000008 Parent=0x00000004 SizeRef=923,222 Selected=0xB2805FDB
DockSpace ID=0x8E823F11 Window=0x0569B611 Pos=8,57 Size=1264,655 Split=X
DockNode ID=0x0000000A Parent=0x8E823F11 SizeRef=651,655 Split=X
DockNode ID=0x00000003 Parent=0x0000000A SizeRef=383,655 Selected=0xC5987190
DockNode ID=0x00000006 Parent=0x0000000A SizeRef=267,655 Split=Y
DockNode ID=0x00000007 Parent=0x00000006 SizeRef=174,323 Selected=0xDACC7E9B
DockNode ID=0x00000008 Parent=0x00000006 SizeRef=174,331 CentralNode=1 Selected=0x50B6849F
DockNode ID=0x00000009 Parent=0x8E823F11 SizeRef=612,655 Split=Y Selected=0x60A93F38
DockNode ID=0x00000002 Parent=0x00000009 SizeRef=629,432 Selected=0xDD2D1825
DockNode ID=0x00000001 Parent=0x00000009 SizeRef=629,222 Selected=0x561FC6F4

Binary file added bin/windows/bin/clang-format.exe
Binary file not shown.
3 changes: 2 additions & 1 deletion external/dear_imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ list(APPEND IMGUI_SOURCES backends/imgui_impl_sdl2.cpp)
list(APPEND IMGUI_SOURCES backends/imgui_impl_sdlrenderer2.cpp)

# Include directories for ImGui (SDL2 include paths should be handled in the main CMakeLists.txt)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/backends)

# Create static library
Expand All @@ -28,3 +27,5 @@ else()
target_include_directories(imgui PRIVATE "${CMAKE_SOURCE_DIR}/external/sdl2/include")
endif()

# Include dirs
target_include_directories(imgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
6 changes: 5 additions & 1 deletion src/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BraceWrapping:
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyFunction: false
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
Expand Down Expand Up @@ -99,9 +99,13 @@ SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
Expand Down
2 changes: 1 addition & 1 deletion src/avioutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

avioutput.h

Copyright(c) 2001 - 2002 §ane
Copyright(c) 2001 - 2002 $ane
*/

extern int avioutput_video, avioutput_audio, avioutput_enabled, avioutput_requested;
Expand Down
2 changes: 2 additions & 0 deletions src/debugger/action/comps.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class ShortcutComp : public comp::Base {
public:
ShortcutComp(action::ActionCreator* cp) : comp::Base(cp, CLASSID) {
}
virtual ~ShortcutComp() {
}

eastl::span<const Shortcut* const> getShortcuts() const {
const Shortcut* const* ptrBeg = mShortcuts.data();
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/action_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void ActionManager::create(GuiManager* pGuiMgr, Debugger* pDbg) {
// create all actions
action::ActionCreator ca = {pGuiMgr, pDbg};
auto actionClassMgr = qd::action::details::ActionClassRegistry::get();
for (auto it : actionClassMgr->m_classInfoMap) {
for (auto it : actionClassMgr->mClassInfoMap) {
action::Action* curAction = actionClassMgr->makeInstance(it.first, &ca);
mActions.push_back(curAction);
const qd::action::details::ActionClassRegistry::MetaInfo& meta = it.second;
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/action_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ struct AutoRegistrator {
metaInfo.classId = class_id != 0 ? class_id : ++qdbActionAutoClassId;
metaInfo.createCallback = (void*)&createClassCb;
metaInfo.rtti = &typeid(TClass);
ActionClassRegistry::get()->registerClass(eastl::move(metaInfo));
metaInfo.registerClass();
}

static Action* createClassCb(const ActionClassRegistry::MetaInfo& meta, ActionCreator* cp) {
Expand Down
12 changes: 6 additions & 6 deletions src/debugger/class_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ClassInfoRegistry_ {
void registerClass();
}; // MetaInfo

eastl::vector_map<uint32_t, TThis::MetaInfo> m_classInfoMap;
eastl::vector_map<uint32_t, TThis::MetaInfo> mClassInfoMap;
typedef eastl::vector_map<uint32_t, TThis::MetaInfo> TClassInfoMap;

public:
Expand All @@ -35,19 +35,19 @@ class ClassInfoRegistry_ {
~ClassInfoRegistry_(void) = default;

void registerClass(TThis::MetaInfo&& meta) {
auto insIt = m_classInfoMap.insert(eastl::make_pair(meta.classId, eastl::move(meta)));
auto insIt = mClassInfoMap.insert(eastl::make_pair(meta.classId, eastl::move(meta)));
if (insIt.second == false) {
ASSERT_F(0, "Registered classId:%u already exists", meta.classId);
}
}

const MetaInfo* findClassInfo(uint32_t class_id) const {
typename TClassInfoMap::const_iterator It = m_classInfoMap.find(class_id);
if (It == m_classInfoMap.end()) {
typename TClassInfoMap::const_iterator it = mClassInfoMap.find(class_id);
if (it == mClassInfoMap.end()) {
ASSERT_F(0, "classId:%u not registered", class_id);
return nullptr;
}
return &It->second;
return &it->second;
}

template <typename... TArgs>
Expand All @@ -61,7 +61,7 @@ class ClassInfoRegistry_ {
return pInstance;
}

}; // class ClassInfoMgr_
}; // class ClassInfoRegistry_
//////////////////////////////////////////////////////////////////////////


Expand Down
Loading
Loading