mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-06-28 01:49:42 -06:00

* attempt at betterer wifi * add preliminary sync mechanism * fix gaps in wifi implementation * move local-MP comm to its own module instead of cramping Platform.cpp * remove some stupid cruft * as you wish, Sorer (starting work on shared-memory system) * shared-memory IPC that actually works (albeit Windows-only for now) * shut up logging from NULL writes on ARM7 (ffs Nintendo learn to code) * get this somewhat good * leave client sync mode when host deauths. makes download play actually work. * start implementing MP-comm error handling * * add MP-reply error counters * feeble attempt at fixing slowdown/desync/etc problems * somewhat better exchange/sync method * * when entering power-saving mode, be sure to finish transferring the current frame first * fix misc bug due to old cruft leftover makes for a more stable connection * remove a bunch of cruft * set wifi time interval to 34 cycles instead of 33. games seem sensitive to the general timing of wifi vs the rest of the system, and this seems to make things run better, atleast until I rewrite this to use a proper scheduler. * more graceful handling of disconnects * deal with FIFO overflow more gracefully * BAHAHAHAHAHAHAHAHHHH THE SNEAKY BASTARDS so, when the DS receives a beacon with the right BSSID that beacon's timestamp is copied to USCOUNTER * attempt at making the connection process smoother for weird games * * begin adding POWCNT2, only applies to wifi for now * begin work on wifi scheduler * implement the shitty timers * add the RF wakeup thing * begin work on receiving frames. for now it can just receive melonAP beacons, but hey, it's a start. * add enough TX functionality that online wifi is a possibility again. * there are problems with this scheduler thing. committing it anyway * kind of a rollback... we're gonna work out a compromise on this, I guess * don't transmit shit if RXCNT.bit15 isn't set * move RX-finish to its own function. more accurate filtering. implement RXFILTER. * remove some cruft * fix some of the shittiness when trying to connect more than two players * fix some more shittiness * fix more wifi shittiness (mainly don't try to receive shit while sending a frame) * run wifi every 8µs. improves performance. * fix IRQ14/IRQ15 * make this work under Linux * Make it work on macOS, for now using a custom sem_timedwait implementation. If anyone knows anything about mach ports and have an idea for how to make this work using mach IPC, please do let me know. * 25ms seems like a good timeout * begin work on proper multiplayer UI shito. for now, determine a global instance ID, and derivate the system MAC from it. remove 'randomize MAC' option. * finish removing RandomizeMAC * lay groundwork for instance-unique config * work some on the UI... make it not labelled Fart * more UI work: make it explicit that some things are instance-unique * separate firmware files for multiplayer instances * make instances save to different save files, too * more UI work, make things somewhat less shitty * lay base for the multiplayer settings dialog * actually hook up most of that dialog * actually implement the fun audio settings * ensure all the wifi shit is properly savestated and reset. properly update timings for the wifi region when wifi is disabled. * add more fun labels * * ignore WEP frames if WEP is off * implement RX_LEN_CROP * fake enough of WEP processing to make Inazuma Eleven work * * do not copy more ROM banner data than actually needed * avoid trying to read out of bounds if the banner offset is bad * Fix oversight with the preferences action causing the build to fail on macOS Co-authored-by: Nadia Holmquist Pedersen <nadia@nhp.sh>
153 lines
4.6 KiB
CMake
153 lines
4.6 KiB
CMake
include(CMakeDependentOption)
|
|
|
|
include(FixInterfaceIncludes)
|
|
|
|
set(SOURCES_QT_SDL
|
|
main.cpp
|
|
main_shaders.h
|
|
CheatsDialog.cpp
|
|
Config.cpp
|
|
EmuSettingsDialog.cpp
|
|
PowerManagement/PowerManagementDialog.cpp
|
|
PowerManagement/resources/battery.qrc
|
|
InputConfig/InputConfigDialog.cpp
|
|
InputConfig/MapButton.h
|
|
InputConfig/resources/ds.qrc
|
|
VideoSettingsDialog.cpp
|
|
AudioSettingsDialog.cpp
|
|
FirmwareSettingsDialog.cpp
|
|
PathSettingsDialog.cpp
|
|
MPSettingsDialog.cpp
|
|
WifiSettingsDialog.cpp
|
|
InterfaceSettingsDialog.cpp
|
|
ROMInfoDialog.cpp
|
|
RAMInfoDialog.cpp
|
|
TitleManagerDialog.cpp
|
|
Input.cpp
|
|
LAN_PCap.cpp
|
|
LAN_Socket.cpp
|
|
LocalMP.cpp
|
|
OSD.cpp
|
|
OSD_shaders.h
|
|
font.h
|
|
Platform.cpp
|
|
QPathInput.h
|
|
ROMManager.cpp
|
|
SaveManager.cpp
|
|
|
|
ArchiveUtil.h
|
|
ArchiveUtil.cpp
|
|
|
|
../Util_Video.cpp
|
|
../Util_Audio.cpp
|
|
../FrontendUtil.h
|
|
../mic_blow.h
|
|
|
|
${CMAKE_SOURCE_DIR}/res/melon.qrc
|
|
)
|
|
|
|
if (APPLE)
|
|
option(USE_QT6 "Build using Qt 6 instead of 5" ON)
|
|
else()
|
|
option(USE_QT6 "Build using Qt 6 instead of 5" OFF)
|
|
endif()
|
|
|
|
|
|
if (WIN32)
|
|
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>")
|
|
endif()
|
|
|
|
if (USE_QT6)
|
|
find_package(Qt6 COMPONENTS Core Gui Widgets Network OpenGL OpenGLWidgets REQUIRED)
|
|
set(QT_LINK_LIBS Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Network Qt6::OpenGL Qt6::OpenGLWidgets)
|
|
else()
|
|
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
|
|
set(QT_LINK_LIBS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network)
|
|
endif()
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTOUIC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
if (BUILD_STATIC)
|
|
list(APPEND PKG_CONFIG_EXECUTABLE "--static")
|
|
endif()
|
|
|
|
find_package(Threads REQUIRED)
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
|
|
pkg_check_modules(Slirp REQUIRED IMPORTED_TARGET slirp)
|
|
pkg_check_modules(LibArchive REQUIRED IMPORTED_TARGET libarchive)
|
|
|
|
fix_interface_includes(PkgConfig::SDL2 PkgConfig::Slirp PkgConfig::LibArchive)
|
|
|
|
add_compile_definitions(ARCHIVE_SUPPORT_ENABLED)
|
|
|
|
add_executable(melonDS ${SOURCES_QT_SDL})
|
|
|
|
if (BUILD_STATIC)
|
|
qt_import_plugins(melonDS INCLUDE Qt::QSvgPlugin)
|
|
target_link_options(melonDS PRIVATE -static)
|
|
endif()
|
|
|
|
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
|
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..")
|
|
target_link_libraries(melonDS PRIVATE core)
|
|
target_link_libraries(melonDS PRIVATE PkgConfig::SDL2 PkgConfig::Slirp PkgConfig::LibArchive)
|
|
target_link_libraries(melonDS PRIVATE ${QT_LINK_LIBS} ${CMAKE_DL_LIBS})
|
|
|
|
if (UNIX)
|
|
option(PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF)
|
|
elseif (WIN32)
|
|
option(PORTABLE "Make a portable build that looks for its configuration in the current directory" ON)
|
|
|
|
configure_file("${CMAKE_SOURCE_DIR}/res/melon.rc.in" "${CMAKE_SOURCE_DIR}/melon.rc")
|
|
target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc")
|
|
|
|
target_link_libraries(melonDS PRIVATE ws2_32 iphlpapi)
|
|
set_target_properties(melonDS PROPERTIES LINK_FLAGS_DEBUG "-mconsole")
|
|
endif()
|
|
|
|
if (PORTABLE)
|
|
target_compile_definitions(melonDS PRIVATE PORTABLE)
|
|
endif()
|
|
|
|
if (APPLE)
|
|
target_sources(melonDS PRIVATE sem_timedwait.cpp)
|
|
|
|
# Copy icon into the bundle
|
|
set(RESOURCE_FILES "${CMAKE_SOURCE_DIR}/res/melon.icns")
|
|
target_sources(melonDS PUBLIC "${RESOURCE_FILES}")
|
|
|
|
set_target_properties(melonDS PROPERTIES
|
|
MACOSX_BUNDLE true
|
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/melon.plist.in
|
|
OUTPUT_NAME melonDS
|
|
RESOURCE "${RESOURCE_FILES}")
|
|
|
|
|
|
option(MACOS_BUNDLE_LIBS "Bundle libraries with the app on macOS" OFF)
|
|
option(MACOS_BUILD_DMG "Build DMG image of the macOS application bundle" OFF)
|
|
|
|
if (MACOS_BUNDLE_LIBS)
|
|
if (MACOS_BUILD_DMG)
|
|
set(DMGARG "--dmg")
|
|
endif()
|
|
add_custom_command(TARGET melonDS POST_BUILD
|
|
COMMAND ${CMAKE_SOURCE_DIR}/tools/mac-libs.rb ${DMGARG} ${CMAKE_BINARY_DIR}
|
|
COMMENT "Bundling macOS libraries...")
|
|
endif()
|
|
endif()
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
foreach(SIZE 16 32 48 64 128 256)
|
|
install(FILES ${CMAKE_SOURCE_DIR}/res/icon/melon_${SIZE}x${SIZE}.png
|
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${SIZE}x${SIZE}/apps
|
|
RENAME net.kuribo64.melonDS.png)
|
|
endforeach()
|
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/res/net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
|
install(TARGETS melonDS BUNDLE DESTINATION ${CMAKE_BINARY_DIR} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
|
endif()
|