mirror of
https://github.com/LIV2/amiberry.git
synced 2025-12-06 06:32:45 +00:00
feat: implemented SERIAL_ENET functionality
- Added new dependency, libenet - Enabled serial enet functionality
This commit is contained in:
parent
9dc7dec4f4
commit
f5ad0c3841
@ -24,8 +24,6 @@ endif ()
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
find_package(SDL2_image MODULE REQUIRED)
|
||||
find_package(SDL2_ttf MODULE REQUIRED)
|
||||
include_directories(${SDL2_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIR} ${SDL2_TTF_INCLUDE_DIR})
|
||||
|
||||
find_package(FLAC REQUIRED)
|
||||
find_package(mpg123 REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
@ -34,6 +32,9 @@ find_helper(LIBSERIALPORT libserialport libserialport.h serialport)
|
||||
find_helper(PORTMIDI portmidi portmidi.h portmidi)
|
||||
find_helper(LIBMPEG2_CONVERT libmpeg2convert mpeg2convert.h mpeg2convert)
|
||||
find_helper(LIBMPEG2 libmpeg2 mpeg2.h mpeg2)
|
||||
find_helper(LIBENET libenet enet.h enet)
|
||||
|
||||
include_directories(${SDL2_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIR} ${SDL2_TTF_INCLUDE_DIR} ${LIBENET_INCLUDE_DIRS})
|
||||
|
||||
set(libmt32emu_SHARED FALSE)
|
||||
add_subdirectory(external/mt32emu)
|
||||
|
||||
@ -444,6 +444,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
${LIBMPEG2_LIBRARIES}
|
||||
${LIBMPEG2_CONVERT_LIBRARIES}
|
||||
${LIBSERIALPORT_LIBRARIES}
|
||||
${LIBENET_LIBRARIES}
|
||||
z
|
||||
pthread
|
||||
dl
|
||||
|
||||
@ -27,7 +27,7 @@ set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_SOURCE_DIR}/packaging/dmg/AppDMGSet
|
||||
|
||||
# Linux DEB settings
|
||||
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libstdc++6, libsdl2-2.0-0, libsdl2-image-2.0-0, libsdl2-ttf-2.0-0, flac, libmpg123-0, libpng16-16, zlib1g, libserialport0, libportmidi0, libmpeg2-4") # Adjust dependencies as needed
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libstdc++6, libsdl2-2.0-0, libsdl2-image-2.0-0, libsdl2-ttf-2.0-0, flac, libmpg123-0, libpng16-16, zlib1g, libserialport0, libportmidi0, libenet7, libmpeg2-4") # Adjust dependencies as needed
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
|
||||
@ -39,7 +39,7 @@ set(CPACK_DEBIAN_PACKAGE_SECTION "otherosfs")
|
||||
|
||||
# Linux RPM settings
|
||||
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "glibc, libstdc++, SDL2, SDL2_ttf SDL2_image, flac, mpg123, libpng, libserialport, portmidi, libmpeg2")
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "glibc, libstdc++, SDL2, SDL2_ttf SDL2_image, flac, mpg123, libpng, libserialport, portmidi, libenet, libmpeg2")
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "GPL-3.0-or-later")
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||
set(CPACK_RPM_PACKAGE_ARCHITECTURE "arm64")
|
||||
|
||||
@ -1938,7 +1938,7 @@ int enet_open(TCHAR* name)
|
||||
if (!_tcsnicmp(name, _T("ENET:H"), 6)) {
|
||||
address.host = ENET_HOST_ANY;
|
||||
address.port = 1234;
|
||||
enethost = enet_host_create(&address, 2, 0, 0);
|
||||
enethost = enet_host_create(&address, 2, 0, 0, 0);
|
||||
if (enethost == NULL) {
|
||||
write_log(_T("ENET_SERVER: enet_host_create(server) failed\n"));
|
||||
enet_close();
|
||||
@ -1950,7 +1950,7 @@ int enet_open(TCHAR* name)
|
||||
else {
|
||||
enetmode = -1;
|
||||
}
|
||||
enetclient = enet_host_create(NULL, 1, 0, 0);
|
||||
enetclient = enet_host_create(NULL, 1, 0, 0, 0);
|
||||
if (enetclient == NULL) {
|
||||
write_log(_T("ENET_CLIENT: enet_host_create(client) failed\n"));
|
||||
enet_close();
|
||||
@ -1959,7 +1959,7 @@ int enet_open(TCHAR* name)
|
||||
write_log(_T("ENET_CLIENT: client created\n"));
|
||||
enet_address_set_host(&address, enetmode > 0 ? "127.0.0.1" : "192.168.0.10");
|
||||
address.port = 1234;
|
||||
enetpeer = enet_host_connect(enetclient, &address, 2);
|
||||
enetpeer = enet_host_connect(enetclient, &address, 2, 0);
|
||||
if (enetpeer == NULL) {
|
||||
write_log(_T("ENET_CLIENT: connection to host %d.%d.%d.%d:%d failed\n"),
|
||||
(address.host >> 0) & 0xff, (address.host >> 8) & 0xff, (address.host >> 16) & 0xff, (address.host >> 24) & 0xff, address.port);
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
#define PARALLEL_PORT /* parallel port emulation */
|
||||
//#define PARALLEL_DIRECT /* direct parallel port emulation */
|
||||
#define SERIAL_PORT /* serial port emulation */
|
||||
/* #define SERIAL_ENET */ /* serial port UDP transport */
|
||||
#define SERIAL_ENET /* serial port UDP transport */
|
||||
#define SCSIEMU /* uaescsi.device emulation */
|
||||
#define UAESERIAL /* uaeserial.device emulation */
|
||||
#define FPUEMU /* FPU emulation */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user