all repos — mgba @ dcfb8d33ef45ada03f76d30b67e2759d312c64dc

mGBA Game Boy Advance Emulator

PSP2: Use raw2c instead of objcopy
Jeffrey Pfau jeffrey@endrift.com
Sat, 22 Aug 2015 23:38:38 -0700
commit

dcfb8d33ef45ada03f76d30b67e2759d312c64dc

parent

c9b01e0aff832ea0e2acc0ac56dda76b66117afd

M src/platform/psp2/CMakeLists.txtsrc/platform/psp2/CMakeLists.txt

@@ -1,10 +1,11 @@

file(GLOB PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/psp2/*.c) +include_directories(${CMAKE_BINARY_DIR}) -execute_process(COMMAND ${DEVKITARM}/bin/arm-none-eabi-objcopy -I binary -O elf32-littlearm -B arm font.png ${CMAKE_BINARY_DIR}/font.o WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/res) +execute_process(COMMAND ${RAW2C} ${CMAKE_SOURCE_DIR}/res/font.png) set(PLATFORM_LIBRARY -lvita2d -lSceCtrl_stub -lSceRtc_stub -lSceGxm_stub -lSceDisplay_stub -lSceAudio_stub -lpng -lz -lm_stub) -add_executable(${BINARY_NAME}.elf ${PLATFORM_SRC} ${GUI_SRC} ${CMAKE_BINARY_DIR}/font.o) +add_executable(${BINARY_NAME}.elf ${PLATFORM_SRC} ${GUI_SRC} ${CMAKE_BINARY_DIR}/font.c) target_link_libraries(${BINARY_NAME}.elf ${BINARY_NAME} ${PLATFORM_LIBRARY}) set_target_properties(${BINARY_NAME}.elf PROPERTIES OUTPUT_NAME ${BINARY_NAME}.elf) add_custom_command(TARGET ${BINARY_NAME}.elf POST_BUILD COMMAND ${FIXUP} -q -S ${BINARY_NAME}.elf ${BINARY_NAME}.velf MAIN_DEPENDENCY ${BINARY_NAME}.elf)
M src/platform/psp2/CMakeToolchain.txtsrc/platform/psp2/CMakeToolchain.txt

@@ -45,6 +45,7 @@

set(PKG_CONFIG_EXECUTABLE "/dev/null" CACHE INTERNAL "" FORCE) set(FIXUP ${toolchain_bin_dir}/psp2-fixup) +set(RAW2C ${DEVKITARM}/bin/raw2c) set(PSP2 ON) add_definitions(-DPSP2)
M src/platform/psp2/gui-font.csrc/platform/psp2/gui-font.c

@@ -4,6 +4,7 @@ * 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/gui/font.h" +#include "font.h" #include <vita2d.h>

@@ -13,19 +14,17 @@ #define FONT_TRACKING 10

#define CELL_HEIGHT 16 #define CELL_WIDTH 16 -extern const uint8_t _binary_font_png_start[]; - struct GUIFont { vita2d_texture* tex; }; struct GUIFont* GUIFontCreate(void) { - struct GUIFont* font = malloc(sizeof(struct GUIFont)); - if (!font) { + struct GUIFont* guiFont = malloc(sizeof(struct GUIFont)); + if (!guiFont) { return 0; } - font->tex = vita2d_load_PNG_buffer(_binary_font_png_start); - return font; + guiFont->tex = vita2d_load_PNG_buffer(font); + return guiFont; } void GUIFontDestroy(struct GUIFont* font) {