mirror of
https://github.com/libretro/Mu.git
synced 2026-02-04 13:45:04 +00:00
Add CMake and re-organize project, keeping includes separated from sources.
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -18,4 +18,10 @@
|
||||
/tools/desktop/build-BufferGraphViewer-*
|
||||
/tools/desktop/build-MakePalmBitmap-*
|
||||
/tools/desktop/export16BitImageProperly/convert
|
||||
.idea/workspace.xml
|
||||
|
||||
# CLion
|
||||
.idea/workspace.xml
|
||||
|
||||
# CMake
|
||||
cmake-build-debug/
|
||||
cmake-build-release/
|
||||
0
.idea/.gitignore
generated
vendored
Normal file
0
.idea/.gitignore
generated
vendored
Normal file
8
.idea/Mu.iml
generated
8
.idea/Mu.iml
generated
@@ -1,8 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="CPP_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
17
.idea/misc.xml
generated
Normal file
17
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
<component name="CidrRootsConfiguration">
|
||||
<sourceRoots>
|
||||
<file path="$PROJECT_DIR$/include" />
|
||||
<file path="$PROJECT_DIR$/src" />
|
||||
</sourceRoots>
|
||||
<excludeRoots>
|
||||
<file path="$PROJECT_DIR$/.github" />
|
||||
<file path="$PROJECT_DIR$/.idea" />
|
||||
<file path="$PROJECT_DIR$/bugs" />
|
||||
<file path="$PROJECT_DIR$/images" />
|
||||
<file path="$PROJECT_DIR$/tools" />
|
||||
</excludeRoots>
|
||||
</component>
|
||||
</project>
|
||||
16
CMakeLists.txt
Normal file
16
CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
cmake_minimum_required (VERSION 3.13)
|
||||
project(Mu
|
||||
VERSION 1.2.0
|
||||
DESCRIPTION "Classic Palm OS Emulator."
|
||||
HOMEPAGE_URL https://github.com/libretro/Mu
|
||||
LANGUAGES C CXX)
|
||||
|
||||
# Build properties for Mu
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED True)
|
||||
|
||||
# Main project sources
|
||||
add_subdirectory(src)
|
||||
|
||||
# LibRetro Build
|
||||
add_subdirectory(libretroBuildSystem)
|
||||
0
src/flx68000.h → include/flx68000.h
Executable file → Normal file
0
src/flx68000.h → include/flx68000.h
Executable file → Normal file
0
src/m68k/m68k.h → include/m68k/m68k.h
Executable file → Normal file
0
src/m68k/m68k.h → include/m68k/m68k.h
Executable file → Normal file
0
src/m68k/m68kconf.h → include/m68k/m68kconf.h
Executable file → Normal file
0
src/m68k/m68kconf.h → include/m68k/m68kconf.h
Executable file → Normal file
0
src/m68k/m68kcpu.h → include/m68k/m68kcpu.h
Executable file → Normal file
0
src/m68k/m68kcpu.h → include/m68k/m68kcpu.h
Executable file → Normal file
0
src/m68k/m68kexternal.h → include/m68k/m68kexternal.h
Executable file → Normal file
0
src/m68k/m68kexternal.h → include/m68k/m68kexternal.h
Executable file → Normal file
0
src/m68k/m68kops.h → include/m68k/m68kops.h
Executable file → Normal file
0
src/m68k/m68kops.h → include/m68k/m68kops.h
Executable file → Normal file
46
libretroBuildSystem/CMakeLists.txt
Normal file
46
libretroBuildSystem/CMakeLists.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
add_library(mu-libretro SHARED
|
||||
libretro.c
|
||||
cursors.c
|
||||
libretro-common/compat/compat_strl.c
|
||||
libretro-common/compat/compat_posix_string.c
|
||||
libretro-common/compat/fopen_utf8.c
|
||||
libretro-common/encodings/encoding_utf.c
|
||||
libretro-common/memmap/memmap.c
|
||||
libretro-common/streams/file_stream.c
|
||||
libretro-common/string/stdstring.c
|
||||
libretro-common/vfs/vfs_implementation.c)
|
||||
|
||||
# Remove the "lib" prefix on Windows, it is incorrect
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
set_target_properties(mu-libretro PROPERTIES PREFIX "")
|
||||
endif()
|
||||
|
||||
# Bring all the sub-modules as needed
|
||||
target_link_libraries(mu-libretro
|
||||
MuCore)
|
||||
|
||||
# Include the required includes
|
||||
target_include_directories(mu-libretro PUBLIC
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"libretro-common/include")
|
||||
|
||||
# Custom launching the core, tries to find RetroArch on the system
|
||||
## Determine RetroArch directory
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
set(MU_LIBRETRO_EXTENSION ".exe")
|
||||
|
||||
if (EXISTS "$ENV{APPDATA}/RetroArch")
|
||||
set(MU_LIBRETRO_DIR "$ENV{APPDATA}/RetroArch")
|
||||
endif()
|
||||
else()
|
||||
set(MU_LIBRETRO_EXTENSION "")
|
||||
endif()
|
||||
|
||||
## Target to run RetroArch with the SquirrelJME Core
|
||||
if(DEFINED MU_LIBRETRO_DIR)
|
||||
add_custom_target(RetroArch
|
||||
DEPENDS mu-libretro
|
||||
COMMAND "${MU_LIBRETRO_DIR}/retroarch${MU_LIBRETRO_EXTENSION}" "-v" "-L" "$<TARGET_FILE:mu-libretro>"
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
COMMENT "Starting RetroArch with Mu")
|
||||
endif()
|
||||
@@ -13,10 +13,10 @@
|
||||
#include <streams/file_stream.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../src/emulator.h"
|
||||
#include "../src/portability.h"
|
||||
#include "../src/silkscreen.h"
|
||||
#include "../src/fileLauncher/launcher.h"
|
||||
#include "emulator.h"
|
||||
#include "portability.h"
|
||||
#include "silkscreen.h"
|
||||
#include "fileLauncher/launcher.h"
|
||||
#include "cursors.h"
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ void retro_get_system_info(struct retro_system_info *info){
|
||||
#ifndef GIT_VERSION
|
||||
#define GIT_VERSION ""
|
||||
#endif
|
||||
info->library_version = "v1.1.0" GIT_VERSION;
|
||||
info->library_version = "v1.2.0" GIT_VERSION;
|
||||
info->need_fullpath = true;
|
||||
info->valid_extensions = "prc|pqa|img";
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ categories = "Emulator"
|
||||
systemname = "Palm OS"
|
||||
license = "Non-commercial"
|
||||
permissions = ""
|
||||
display_version = "v1.1.0"
|
||||
display_version = "v1.2.0"
|
||||
supports_no_game = "true"
|
||||
firmware_count = 5
|
||||
firmware0_desc = "palmos40-en-m500.rom (Palm OS 4.0)"
|
||||
|
||||
37
src/CMakeLists.txt
Normal file
37
src/CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
# Base Mu library
|
||||
add_library(MuCore STATIC
|
||||
ads7846.c
|
||||
dbvz.c
|
||||
emulator.c
|
||||
flx68000.c
|
||||
m5XXBus.c
|
||||
pdiUsbD12.c
|
||||
sdCard.c
|
||||
sed1376.c
|
||||
silkscreen.c
|
||||
tps65010.c
|
||||
tsc2101.c
|
||||
w86l488.c)
|
||||
|
||||
# Bring all the sub-modules as needed
|
||||
target_link_libraries(MuCore
|
||||
#MuCorePxa260Experimental
|
||||
MuCoreFileLauncher
|
||||
MuCoreAudio
|
||||
MuCoreM68k)
|
||||
|
||||
# Includes for the project
|
||||
target_include_directories(MuCore PUBLIC
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/include")
|
||||
|
||||
# Core Mu
|
||||
add_subdirectory(audio)
|
||||
add_subdirectory(fileLauncher)
|
||||
|
||||
# Classic m68k Core
|
||||
add_subdirectory(m68k)
|
||||
|
||||
# Experimental ARM Cores
|
||||
add_subdirectory(armv5te)
|
||||
add_subdirectory(pxa260)
|
||||
45
src/armv5te/CMakeLists.txt
Normal file
45
src/armv5te/CMakeLists.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
# Experimental ARM V5TE Module
|
||||
add_library(MuCoreArmV5TEExperimental STATIC
|
||||
uArm/CPU_2.c
|
||||
uArm/icache.c
|
||||
uArm/uArmGlue.cpp
|
||||
arm_interpreter.cpp
|
||||
asmcode.c
|
||||
coproc.cpp
|
||||
cpu.cpp
|
||||
disasm.c
|
||||
emuVarPool.c
|
||||
mem.c
|
||||
mmu.c
|
||||
thumb_interpreter.cpp)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES aarch64)
|
||||
target_sources(MuCoreArmV5TEExperimental PUBLIC
|
||||
translate_aarch64.cpp)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES arm)
|
||||
target_sources(MuCoreArmV5TEExperimental PUBLIC
|
||||
translate_arm.cpp)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(i386)")
|
||||
target_sources(MuCoreArmV5TEExperimental PUBLIC
|
||||
translate_x86.c)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(x86-64)|(amd64)|(AMD64)")
|
||||
target_sources(MuCoreArmV5TEExperimental PUBLIC
|
||||
translate_x86_64.c)
|
||||
endif()
|
||||
|
||||
# Windows?
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
target_sources(MuCoreArmV5TEExperimental PUBLIC
|
||||
os/os-win32.c)
|
||||
|
||||
# Everything else?
|
||||
else()
|
||||
target_sources(MuCoreArmV5TEExperimental PUBLIC
|
||||
os/os-linux.c)
|
||||
endif()
|
||||
|
||||
# Includes for the project
|
||||
target_include_directories(MuCoreArmV5TEExperimental PUBLIC
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"${PROJECT_SOURCE_DIR}/include/armv5te")
|
||||
@@ -16,12 +16,10 @@
|
||||
#endif
|
||||
|
||||
#include "os.h"
|
||||
#include "../debug.h"
|
||||
#include "../mmu.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "mmu.h"
|
||||
|
||||
#ifdef IS_IOS_BUILD
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "os.h"
|
||||
#include "os/os.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <assert.h>
|
||||
@@ -9,8 +9,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <share.h>
|
||||
|
||||
#include "../emu.h"
|
||||
#include "../mmu.h"
|
||||
#include "emu.h"
|
||||
#include "mmu.h"
|
||||
|
||||
void *os_reserve(size_t size)
|
||||
{
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "CPU_2.h"
|
||||
#include "../../pxa260/pxa260_math64.h"
|
||||
#include "uArm/CPU_2.h"
|
||||
#include "pxa260/pxa260_math64.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "../../pxa260/pxa260_types.h"
|
||||
#include "CPU_2.h"
|
||||
#include "icache.h"
|
||||
#include "pxa260/pxa260_types.h"
|
||||
#include "uArm/CPU_2.h"
|
||||
#include "uArm/icache.h"
|
||||
|
||||
//#define ICACHE_DEBUGGING
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "uArmGlue.h"
|
||||
#include "CPU_2.h"
|
||||
#include "armv5te/uArm/uArmGlue.h"
|
||||
#include "armv5te/uArm/CPU_2.h"
|
||||
|
||||
#include "../../emulator.h"
|
||||
#include "../../armv5te/cpu.h"
|
||||
#include "../../armv5te/asmcode.h"
|
||||
#include "../../armv5te/cpudefs.h"
|
||||
#include "../../pxa260/pxa260.h"
|
||||
#include "emulator.h"
|
||||
#include "armv5te/cpu.h"
|
||||
#include "armv5te/asmcode.h"
|
||||
#include "armv5te/cpudefs.h"
|
||||
#include "pxa260/pxa260.h"
|
||||
|
||||
|
||||
static ArmCoprocessor uArmCp14;
|
||||
|
||||
9
src/audio/CMakeLists.txt
Normal file
9
src/audio/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# m68k Module
|
||||
add_library(MuCoreAudio STATIC
|
||||
blip_buf.c)
|
||||
|
||||
# Includes for the project
|
||||
target_include_directories(MuCoreAudio PUBLIC
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"${PROJECT_SOURCE_DIR}/include/audio")
|
||||
9
src/fileLauncher/CMakeLists.txt
Normal file
9
src/fileLauncher/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# m68k Module
|
||||
add_library(MuCoreFileLauncher STATIC
|
||||
launcher.c)
|
||||
|
||||
# Includes for the project
|
||||
target_include_directories(MuCoreFileLauncher PUBLIC
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"${PROJECT_SOURCE_DIR}/include/fileLauncher")
|
||||
14
src/m68k/CMakeLists.txt
Normal file
14
src/m68k/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
# m68k Module
|
||||
add_library(MuCoreM68k STATIC
|
||||
m68kcpu.c
|
||||
m68kdasm.c
|
||||
m68kopac.c
|
||||
m68kopdm.c
|
||||
m68kopnz.c
|
||||
m68kops.c)
|
||||
|
||||
# Includes for the project
|
||||
target_include_directories(MuCoreM68k PUBLIC
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"${PROJECT_SOURCE_DIR}/include/m68k")
|
||||
34
src/pxa260/CMakeLists.txt
Normal file
34
src/pxa260/CMakeLists.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
# PXA260 Module
|
||||
add_library(MuCorePxa260Experimental STATIC
|
||||
pxa260.c
|
||||
pxa260_DMA.c
|
||||
pxa260_DSP.c
|
||||
pxa260_GPIO.c
|
||||
pxa260_IC.c
|
||||
pxa260_LCD.c
|
||||
pxa260_PwrClk.c
|
||||
pxa260_RTC.c
|
||||
pxa260_TIMR.c
|
||||
pxa260_UART.c
|
||||
pxa260I2c.c
|
||||
pxa260Memctrl.c
|
||||
pxa260Ssp.c
|
||||
pxa260Timing.c
|
||||
pxa260Udc.c)
|
||||
|
||||
# Bring all the sub-modules as needed
|
||||
target_link_libraries(MuCorePxa260Experimental
|
||||
MuCoreArmV5TEExperimental)
|
||||
|
||||
# Some defines are required for this to function properly
|
||||
target_compile_definitions(MuCorePxa260Experimental
|
||||
PUBLIC EMU_SUPPORT_PALM_OS5=1
|
||||
|
||||
# forces the dynarec to use accurate mode and disable Nspire OS hacks
|
||||
PUBLIC SUPPORT_LINUX=1)
|
||||
|
||||
# Includes for the project
|
||||
target_include_directories(MuCorePxa260Experimental PUBLIC
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"${PROJECT_SOURCE_DIR}/include/pxa260")
|
||||
Reference in New Issue
Block a user