-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get libretro core compiling for Windows #198
base: master
Are you sure you want to change the base?
Changes from 13 commits
34b93ed
98addda
9e9fc73
ac1b249
e077dca
a0fa9f9
0d2d56e
154e5c9
6889044
45a48e0
af635cd
262ca8a
72258a5
54c8d4f
b248204
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,3 +249,6 @@ CMakeLists.txt.user* | |
|
||
# VSCode | ||
.vscode | ||
|
||
# libretro | ||
source/frontends/libretro/*.inl |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,6 @@ if ("${SLIRP_FOUND}" STREQUAL "") | |
endif() | ||
endif() | ||
|
||
find_package(Boost REQUIRED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. boost is now only pulled in to the |
||
|
||
set(SOURCE_FILES | ||
Tfe/tfesupp.cpp | ||
Tfe/NetworkBackend.cpp | ||
|
@@ -103,19 +101,13 @@ set(SOURCE_FILES | |
FrameBase.cpp | ||
CmdLine.cpp | ||
|
||
Configuration/PropertySheetHelper.cpp | ||
Configuration/Config.cpp | ||
|
||
linux/resources.cpp | ||
linux/benchmark.cpp | ||
linux/context.cpp | ||
linux/linuxframe.cpp | ||
linux/paddle.cpp | ||
linux/version.cpp | ||
linux/registryclass.cpp | ||
linux/linuxframe.cpp | ||
linux/context.cpp | ||
linux/cassettetape.cpp | ||
linux/network/slirp2.cpp | ||
linux/network/portfwds.cpp | ||
linux/resources.cpp | ||
linux/soundbuffer.cpp | ||
linux/version.cpp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This directory should be moved. They're no longer linux-specific. I couldn't think of a good name. Maybe they should be moved into the |
||
|
||
linux/duplicates/Debugger_Display.cpp | ||
linux/duplicates/Debugger_Win32.cpp | ||
|
@@ -132,12 +124,15 @@ set(SOURCE_FILES | |
linux/duplicates/PageSound.cpp | ||
linux/duplicates/PageDisk.cpp | ||
linux/duplicates/PageAdvanced.cpp | ||
|
||
Configuration/PropertySheetHelper.cpp | ||
Configuration/Config.cpp | ||
|
||
Z80VICE/z80.cpp | ||
Z80VICE/z80mem.cpp | ||
Z80VICE/daa.cpp | ||
) | ||
|
||
set(HEADER_FILES | ||
Tfe/tfearch.h | ||
Tfe/tfesupp.h | ||
|
@@ -218,28 +213,63 @@ set(HEADER_FILES | |
Configuration/PropertySheetHelper.h | ||
Configuration/Config.h | ||
|
||
linux/resources.h | ||
linux/linuxinterface.h | ||
linux/benchmark.h | ||
linux/paddle.h | ||
linux/version.h | ||
linux/registryclass.h | ||
linux/keyboardbuffer.h | ||
linux/linuxframe.h | ||
linux/cassettetape.h | ||
linux/network/slirp2.h | ||
linux/network/portfwds.h | ||
|
||
Z80VICE/z80.h | ||
Z80VICE/z80mem.h | ||
Z80VICE/z80regs.h | ||
Z80VICE/daa.h | ||
) | ||
|
||
if(WIN32) | ||
set(SOURCE_FILES_PLATFORM | ||
Registry.cpp | ||
Keyboard.cpp | ||
Speech.cpp | ||
Tape.cpp | ||
) | ||
set(HEADER_FILES_PLATFORM | ||
Registry.h | ||
Keyboard.h | ||
) | ||
set(EXTRA_LIBS -lwsock32 -liphlpapi -ldsound -ldxguid -lwinmm -ldinput8 -luser32 -lgdi32 -lcomctl32 -lsapi -lstrmiids) | ||
|
||
# force static link of dependent libraries | ||
if(EXISTS "${YAML_LIBRARY_DIRS}/libyaml.a") | ||
set(YAML_LIBRARIES -L${YAML_LIBRARY_DIRS};libyaml.a) | ||
endif() | ||
if(EXISTS "${MINIZIP_LIBRARY_DIRS}/libminizip.a") | ||
set(MINIZIP_LIBRARIES -L${MINIZIP_LIBRARY_DIRS};libminizip.a;libz.a;libbz2.a) | ||
endif() | ||
if(EXISTS "${SLIRP_LIBDIR}/libslirp.a") | ||
set(SLIRP_LIBRARIES -L${SLIRP_LIBDIR};libslirp.a;libintl.a) | ||
endif() | ||
else() | ||
set(SOURCE_FILES_PLATFORM | ||
linux/benchmark.cpp | ||
linux/cassettetape.cpp | ||
linux/network/slirp2.cpp | ||
linux/network/portfwds.cpp | ||
) | ||
|
||
set(HEADER_FILES_PLATFORM | ||
linux/resources.h | ||
linux/benchmark.h | ||
linux/paddle.h | ||
linux/version.h | ||
linux/registryclass.h | ||
linux/keyboardbuffer.h | ||
linux/linuxframe.h | ||
linux/cassettetape.h | ||
linux/network/slirp2.h | ||
linux/network/portfwds.h | ||
) | ||
|
||
set(EXTRA_LIBS windows) | ||
endif() | ||
|
||
# we used to generate a shared object, but it turns out there are more cons than pros | ||
add_library(appleii STATIC | ||
${SOURCE_FILES} | ||
${HEADER_FILES} | ||
${SOURCE_FILES} ${SOURCE_FILES_PLATFORM} | ||
${HEADER_FILES} ${HEADER_FILES_PLATFORM} | ||
) | ||
|
||
if ("${PCAP_FOUND}" STREQUAL "1") | ||
|
@@ -251,7 +281,6 @@ endif() | |
target_include_directories(appleii PRIVATE | ||
${YAML_INCLUDE_DIRS} | ||
${PCAP_INCLUDE_DIRS} | ||
${Boost_INCLUDE_DIRS} | ||
${SLIRP_INCLUDE_DIRS} | ||
Debugger | ||
) | ||
|
@@ -268,10 +297,8 @@ target_link_libraries(appleii PRIVATE | |
${PCAP_LIBRARIES} | ||
${SLIRP_LIBRARIES} | ||
ZLIB::ZLIB | ||
) | ||
|
||
target_link_libraries(appleii PUBLIC | ||
windows | ||
common2 | ||
${EXTRA_LIBS} | ||
) | ||
|
||
target_link_directories(appleii PRIVATE | ||
|
@@ -287,7 +314,8 @@ target_compile_options(appleii PUBLIC | |
|
||
add_custom_command( | ||
TARGET appleii POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/bin/*.SYM ${CMAKE_BINARY_DIR} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. msys2 didn't like the |
||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/bin/A2_BASIC.SYM ${CMAKE_BINARY_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/bin/APPLE2E.SYM ${CMAKE_BINARY_DIR} | ||
) | ||
|
||
configure_file(linux/config.h.in linux/config.h) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ enum AppMode_e | |
#define WM_USER_FULLSCREEN WM_USER+8 | ||
#define VK_SNAPSHOT_TEXT WM_USER+9 // PrintScreen+Ctrl | ||
|
||
#ifdef _MSC_VER | ||
#ifdef _WIN32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
#define PATH_SEPARATOR '\\' | ||
#else | ||
#define PATH_SEPARATOR '/' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6538,7 +6538,9 @@ bool ParseAssemblyListing ( bool bBytesToMemory, bool bAddSymbols ) | |
{ | ||
*p = 0; | ||
// sscanf( sLine, "%s %s %s %s %s %s %s %s", sAddr1, sByte1, sByte2, sByte3, sLineN, sLabel, sAsm, sParam ); | ||
sscanf( sLine, "%X", &nAddress ); | ||
unsigned nScanAddress; // helper variable in case sizeof(DWORD) != sizeof(unsigned) | ||
sscanf( sLine, "%X", &nScanAddress ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect this will require more care. I must define We will probably have to use a macro to select the correct print format like we already do for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
nAddress = nScanAddress; | ||
|
||
if (nAddress >= INVALID_ADDRESS) // || (sName[0] == 0) ) | ||
continue; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
class SoundBufferBase | ||
{ | ||
public: | ||
typedef SoundBufferBase* (*CreateSoundBufferFunc)(void); | ||
static CreateSoundBufferFunc Create; | ||
|
||
virtual HRESULT Init(DWORD dwFlags, DWORD dwBufferSize, DWORD nSampleRate, int nChannels, LPCSTR pDevName) = 0; | ||
virtual HRESULT Release() = 0; | ||
|
||
virtual HRESULT SetCurrentPosition(DWORD dwNewPosition) = 0; | ||
virtual HRESULT GetCurrentPosition(LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) = 0; | ||
|
||
virtual HRESULT Lock(DWORD dwWriteCursor, DWORD dwWriteBytes, LPVOID* lplpvAudioPtr1, DWORD* lpdwAudioBytes1, LPVOID* lplpvAudioPtr2, DWORD* lpdwAudioBytes2, DWORD dwFlags) = 0; | ||
virtual HRESULT Unlock(LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) = 0; | ||
|
||
virtual HRESULT Stop() = 0; | ||
virtual HRESULT Play(DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) = 0; | ||
|
||
virtual HRESULT SetVolume(LONG lVolume) = 0; | ||
virtual HRESULT GetVolume(LONG* lplVolume) = 0; | ||
|
||
virtual HRESULT GetStatus(LPDWORD lpdwStatus) = 0; | ||
virtual HRESULT Restore() = 0; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libretro should statically link to as much as possible to prevent possible missing dependency errors and/or conflicting versions of dependencies between the core and the frontend.