Skip to content

Commit

Permalink
Proper CMake -DRELEASE option
Browse files Browse the repository at this point in the history
Update to latest SDK headers
  • Loading branch information
xerpi committed Apr 1, 2017
1 parent d56ef14 commit 529635e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ link_directories(
${CMAKE_CURRENT_BINARY_DIR}
)

if (${RELEASE} EQUAL 1)
option(RELEASE "Release build" OFF)

if (RELEASE)
add_definitions(-DRELEASE)
endif()
endif(RELEASE)

add_executable(${PROJECT_NAME}.elf
main.c
Expand Down
10 changes: 5 additions & 5 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ static int is_ds4(const unsigned short vid_pid[2])

static inline void *mempool_alloc(unsigned int size)
{
return ksceKernelMemPoolAlloc(bt_mempool_uid, size);
return ksceKernelAllocHeapMemory(bt_mempool_uid, size);
}

static inline void mempool_free(void *ptr)
{
ksceKernelMemPoolFree(bt_mempool_uid, ptr);
ksceKernelFreeHeapMemory(bt_mempool_uid, ptr);
}

static int ds4_send_report(unsigned int mac0, unsigned int mac1, uint8_t flags, uint8_t report,
Expand Down Expand Up @@ -603,7 +603,7 @@ int module_start(SceSize argc, const void *args)
&SceMotion_sceMotionGetState_ref, "SceMotion", TAI_ANY_LIBRARY,
0xBDB32767, SceMotion_sceMotionGetState_hook_func);

SceKernelMemPoolCreateOpt opt;
SceKernelHeapCreateOpt opt;
opt.size = 0x1C;
opt.uselock = 0x100;
opt.field_8 = 0x10000;
Expand All @@ -612,7 +612,7 @@ int module_start(SceSize argc, const void *args)
opt.field_14 = 0;
opt.field_18 = 0;

bt_mempool_uid = ksceKernelMemPoolCreate("ds4vita_mempool", 0x100, &opt);
bt_mempool_uid = ksceKernelCreateHeap("ds4vita_mempool", 0x100, &opt);
LOG("Bluetooth mempool UID: 0x%08X\n", bt_mempool_uid);

bt_thread_uid = ksceKernelCreateThread("ds4vita_bt_thread", ds4vita_bt_thread,
Expand All @@ -639,7 +639,7 @@ int module_stop(SceSize argc, const void *args)
}

if (bt_mempool_uid > 0) {
ksceKernelMemPoolDestroy(bt_mempool_uid);
ksceKernelDeleteHeap(bt_mempool_uid);
}

if (SceBt_sub_22999C8_hook_uid > 0) {
Expand Down

0 comments on commit 529635e

Please sign in to comment.