Skip to content

Commit 7e41fce

Browse files
committed
VAmiga support
1 parent d125cc8 commit 7e41fce

39 files changed

+749
-542
lines changed

CMakeLists.txt

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# Minimum CMake version requirement
21
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
32

4-
#set(CMAKE_GENERATOR_TOOLSET "ClangCl") # test compilation on clang-c
3+
project(quaesar LANGUAGES CXX)
54

5+
#set(CMAKE_GENERATOR_TOOLSET "ClangCl") # test compilation on clang-c
66
option(ENABLE_CODE_GENERATION "Enable code generation" OFF)
77

8-
# Project name and languages used
9-
project(quaesar LANGUAGES CXX)
8+
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
9+
message(WARNING "You are doing an in-source build. Recommended:
10+
${CMAKE_COMMAND} -S ${CMAKE_SOURCE_DIR} -B build
11+
${CMAKE_COMMAND} --build build")
12+
endif()
13+
1014

1115
# Specify the C++ standard
1216
set(CMAKE_CXX_STANDARD 20)
@@ -25,6 +29,24 @@ include(scripts/cmake/format_sources.cmake)
2529
include(external/sdl2/sdl2.cmake)
2630

2731

32+
# ---------------------------------------------------------------------------
33+
# Global list of libraries to link with 'quaesar' collected from child cmake files
34+
# Children can call: quaesar_add_libs(<lib1> <lib2> ...)
35+
# ---------------------------------------------------------------------------
36+
set(QUAESAR_EXTRA_LIBS "" CACHE INTERNAL "Accumulated extra libraries for quaesar final link")
37+
function(quaesar_add_libs)
38+
foreach(lib IN LISTS ARGN)
39+
if(lib)
40+
list(APPEND QUAESAR_EXTRA_LIBS "${lib}")
41+
endif()
42+
endforeach()
43+
list(REMOVE_DUPLICATES QUAESAR_EXTRA_LIBS)
44+
# Write back to cache so subdirectories (different scopes) see updated value
45+
set(QUAESAR_EXTRA_LIBS "${QUAESAR_EXTRA_LIBS}" CACHE INTERNAL "Accumulated extra libraries for quaesar final link" FORCE)
46+
endfunction()
47+
48+
49+
2850
# Include CMakelists.txt libraries
2951
set(UAE_CUSTOM_IMPL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/uae_lib_imp" CACHE INTERNAL "Path to UAE custom implementation directory")
3052
add_subdirectory(libs/uae_lib)
@@ -37,8 +59,12 @@ add_subdirectory(external/nativefiledialog-extended) #nfd
3759
add_subdirectory(libs/qd)
3860
add_subdirectory(libs/amDebugger)
3961
add_subdirectory(libs/exprParser)
40-
add_subdirectory(libs/vAmiga)
41-
add_subdirectory(libs/vamiga_imp_lib)
62+
63+
option(VAMIGA "Enable VAmiga support" ON)
64+
if (VAMIGA)
65+
include(VAmigaLib.cmake)
66+
endif()
67+
#-------------------------------------------------------------------------------------------
4268

4369
# Quasar *.h/cpp files
4470
file(GLOB_RECURSE QUAESAR_SOURCES "src/*.cpp")
@@ -130,6 +156,9 @@ if (LINUX OR UNIX)
130156
target_link_libraries(quaesar PRIVATE dl)
131157
endif()
132158

159+
160+
include(user_custoom_plugins.cmake OPTIONAL)
161+
133162
#-------------------------------------------------------------------------------------------
134163
# Include dirs
135164
#-------------------------------------------------------------------------------------------
@@ -153,12 +182,12 @@ target_link_libraries(quaesar PRIVATE
153182
qd
154183
uae_lib
155184
amDebugger
156-
VamigaImpLib
185+
${QUAESAR_EXTRA_LIBS}
157186
)
158187

159188

160189
#if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/imgui.ini")
161-
#file(COPY_FILE "${CMAKE_CURRENT_LIST_DIR}/bin/install/default_layout.ini" "${CMAKE_CURRENT_BINARY_DIR}/imgui.ini")
190+
# file(COPY_FILE "${CMAKE_CURRENT_LIST_DIR}/bin/install/default_layout.ini" "${CMAKE_CURRENT_BINARY_DIR}/imgui.ini")
162191
#endif()
163192

164193

VAmigaLib.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
2+
3+
set(VAMIGA ON CACHE BOOL "Enable VAmiga support")
4+
5+
add_subdirectory(libs/vAmiga)
6+
add_subdirectory(libs/vAmiga_imp_lib)
7+
8+
quaesar_add_libs(VAmigaImpLib)

libs/amDebugger/src/amDebugger/codeAnalyzer/cdaServer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct CodeChunk : public eastl::intrusive_list_node {
2828
qd::array<cda::CodeItem*, cda::g_chunkSize / 2> m_codeItems = {};
2929
uint16_t m_idx = 0;
3030
union {
31+
EA_DISABLE_VC_WARNING(4201) // nameless struct/union
3132
uint16_t m_flags = 0;
3233
struct {
3334
bool m_bAddrValid :1;

libs/amDebugger/src/amDebugger/dbgConnection.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace amD {
77
class UaeSharedConnectionImpl;
88

99

10-
class IVmServiceProvider : public qd::RefCounted
10+
class IVmDbgServiceBridge : public qd::RefCounted
1111
{
1212
public:
1313
qd::string m_name;
@@ -16,12 +16,12 @@ class IVmServiceProvider : public qd::RefCounted
1616
virtual ref_ptr<IVm::VM> getClientVm() = 0;
1717
virtual ref_ptr<IVm::VM> getServerVm() = 0;
1818

19-
}; // IVmServiceProvider
19+
}; // IVmDbgServiceBridge
2020
//////////////////////////////////////////////////////////////////////////
2121

2222

23-
ref_ptr<IVmServiceProvider> create_dummy_connection();
24-
ref_ptr<IVmServiceProvider> create_uae_shared_connection(const char* name);
23+
ref_ptr<IVmDbgServiceBridge> create_dummy_connection();
24+
ref_ptr<IVmDbgServiceBridge> create_uae_shared_connection(const char* name);
2525

2626

2727
}; // namespace amD

libs/amDebugger/src/amDebugger/debugger.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,8 @@ void Debugger::fetchVmState()
5454
}
5555

5656

57-
amD::IVmServiceProvider* Debugger::getConnection() const
58-
{
59-
return m_pConnection.get();
60-
}
61-
6257

63-
void Debugger::setConnection(ref_ptr<IVmServiceProvider> pCon)
58+
void Debugger::setDbgServiceBridge(ref_ptr<IVmDbgServiceBridge> pCon)
6459
{
6560
if (m_pConnection == pCon)
6661
return;

libs/amDebugger/src/amDebugger/debugger.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace amD {
1010

1111
class DebuggerApp;
12-
class IVmServiceProvider;
12+
class IVmDbgServiceBridge;
1313

1414
constexpr static int BREAKPOINTS_MAX = 20;
1515

@@ -59,7 +59,7 @@ class Debugger
5959
, public qd::IOperationEnvironment
6060
{
6161
DebuggerApp* m_pDbgApp = nullptr;
62-
ref_ptr<IVmServiceProvider> m_pConnection;
62+
ref_ptr<IVmDbgServiceBridge> m_pConnection;
6363
ref_ptr<IVm::VM> m_pVm = nullptr; // owner
6464

6565
public:
@@ -69,8 +69,7 @@ class Debugger
6969
IVm::VM* getVm() const;
7070
amD::DebuggerApp* getDbgApp() const { return m_pDbgApp; }
7171

72-
amD::IVmServiceProvider* getConnection() const;
73-
void setConnection(ref_ptr<IVmServiceProvider> pCon);
72+
void setDbgServiceBridge(ref_ptr<IVmDbgServiceBridge> pCon);
7473

7574
void execConsoleCmd(qd::string&& cmd);
7675

libs/amDebugger/src/amDebugger/debuggerServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class IVmConnectionBuilder : public qd::RefCounted, public qd::IOperationEnviron
1616

1717
void init();
1818
IVm::VM* getVm() const { return vm; }
19-
virtual ref_ptr<amD::IVmServiceProvider> createConnection() const = 0;
19+
virtual ref_ptr<amD::IVmDbgServiceBridge> createConnection() const = 0;
2020

2121
}; // class IVmConnectionBuilder
2222

libs/amDebugger/src/amDebugger/debuggerWndApp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FORWARD_DECLARATION_2(IVm, VM);
2323
namespace amD {
2424

2525
class DebuggerDesktop;
26-
class IVmServiceProvider;
26+
class IVmDbgServiceBridge;
2727

2828

2929
class IVmConnectionsManager
@@ -32,7 +32,7 @@ class IVmConnectionsManager
3232

3333
public:
3434
virtual uint32_t getNumConnections() = 0;
35-
virtual ref_ptr<amD::IVmServiceProvider> createVmProvider(const char* conn_id) = 0;
35+
virtual ref_ptr<amD::IVmDbgServiceBridge> createVmProvider(const char* conn_id) = 0;
3636
}; // class IVmConnectionsManager
3737

3838

libs/amDebugger/src/amDebugger/exprValue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void ExprValStr::parse()
8181
}
8282
catch (const ExprError& e)
8383
{
84-
qd::log_debug("[ FAIL ] ParserOop: \"%s\" unexpected error: %s\n", m_strVal.c_str(), e.message());
84+
qd::logDbg("[ FAIL ] ParserOop: \"%s\" unexpected error: %s\n", m_strVal.c_str(), e.message());
8585
}
8686
}
8787

libs/amDebugger/src/amDebugger/ui/debuggerDesktop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void DebuggerDesktop::createAllUiWndows()
138138
auto* pCreateAttr = pCurWindowType->getAttribute_<qd::tsAttr::CreateClassCb>();
139139
if (!pCreateAttr)
140140
{
141-
log_error("Creator not defined in class:'%s'", pCurWindowType->getFullName().c_str());
141+
logErr("Creator not defined in class:'%s'", pCurWindowType->getFullName().c_str());
142142
continue;
143143
}
144144
UiViewCreateCtx cv(this);

0 commit comments

Comments
 (0)