all repos — mgba @ 2aae3dc6601ec7ff19a2577f8aa7031e2a5a34f6

mGBA Game Boy Advance Emulator

3DS: Progress on 3DS linking
Jeffrey Pfau jeffrey@endrift.com
Mon, 08 Dec 2014 18:42:13 -0800
commit

2aae3dc6601ec7ff19a2577f8aa7031e2a5a34f6

parent

03de43511fb26dd1e315e59752ecc72fefee87f3

2 files changed, 19 insertions(+), 2 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -112,7 +112,10 @@ add_definitions(-DUSE_PTHREADS)

list(APPEND OS_LIB pthread) file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/posix/*.c) source_group("POSIX-specific code" FILES ${OS_SRC}) -else() +elseif(3DS) + list(APPEND OS_LIB ctru) + list(APPEND OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/3ds/memory.c) + source_group("3DS-specific code" FILES ${OS_SRC}) set(BINARY_TYPE STATIC) endif()

@@ -215,7 +218,7 @@ endif()

if(3DS) add_executable(${BINARY_NAME}-elf ${CMAKE_SOURCE_DIR}/src/platform/3ds/main.c) - target_link_libraries(${BINARY_NAME}-elf ${BINARY_NAME} -lctru) + target_link_libraries(${BINARY_NAME}-elf ${BINARY_NAME} m ${OS_LIB}) endif() # Packaging
A src/platform/3ds/memory.c

@@ -0,0 +1,14 @@

+/* Copyright (c) 2013-2014 Jeffrey Pfau + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "util/memory.h" + +void* anonymousMemoryMap(size_t size) { + return malloc(size); +} + +void mappedMemoryFree(void* memory, size_t size) { + free(memory); +}