mirror of https://github.com/mgba-emu/mgba.git
PSP2: Use raw2c instead of objcopy
This commit is contained in:
parent
c9b01e0aff
commit
dcfb8d33ef
|
@ -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)
|
||||
|
|
|
@ -45,6 +45,7 @@ set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared link flags")
|
|||
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)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* 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 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) {
|
||||
|
|
Loading…
Reference in New Issue