mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 02:43:03 +00:00
commit
535215eefa
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,6 +1,6 @@
|
||||
[submodule "deps/glslang/glslang"]
|
||||
path = deps/glslang/glslang
|
||||
url = git://github.com/KhronosGroup/glslang.git
|
||||
url = https://github.com/KhronosGroup/glslang.git
|
||||
[submodule "deps/SPIRV-Cross"]
|
||||
path = deps/SPIRV-Cross
|
||||
url = git://github.com/KhronosGroup/SPIRV-Cross
|
||||
url = https://github.com/KhronosGroup/SPIRV-Cross
|
||||
|
@ -246,7 +246,8 @@ OBJ += intl/msg_hash_de.o \
|
||||
intl/msg_hash_nl.o \
|
||||
intl/msg_hash_pl.o \
|
||||
intl/msg_hash_pt.o \
|
||||
intl/msg_hash_ru.o
|
||||
intl/msg_hash_ru.o \
|
||||
intl/msg_hash_vn.o
|
||||
|
||||
endif
|
||||
|
||||
|
@ -12,6 +12,7 @@ OBJ += wiiu/dynamic_libs/fs_functions.o
|
||||
OBJ += wiiu/dynamic_libs/padscore_functions.o
|
||||
OBJ += wiiu/dynamic_libs/vpad_functions.o
|
||||
OBJ += wiiu/system/memory.o
|
||||
OBJ += wiiu/system/exception_handler.o
|
||||
OBJ += wiiu/dynamic_libs/gx2_functions.o
|
||||
OBJ += wiiu/dynamic_libs/socket_functions.o
|
||||
OBJ += wiiu/fs/fs_utils.o
|
||||
@ -100,20 +101,20 @@ LIBDIRS := -L.
|
||||
|
||||
CFLAGS := -mrvl -mcpu=750 -meabi -mhard-float
|
||||
LDFLAGS :=
|
||||
#LDFLAGS := $(CFLAGS)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
LDFLAGS := $(CFLAGS)
|
||||
|
||||
ASFLAGS := $(CFLAGS) -mregnames
|
||||
|
||||
CFLAGS += -ffast-math -Werror=implicit-function-declaration
|
||||
#CFLAGS += -fomit-frame-pointer -mword-relocations
|
||||
#CFLAGS += -Wall
|
||||
CFLAGS += -DWIIU
|
||||
CFLAGS += -DWIIU -DMSB_FIRST
|
||||
CFLAGS += -DHAVE_MAIN
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE -DSINC_LOWEST_QUALITY
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2012-2015 - Michael Lelli
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2015 - Jason Fetters
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2015 - Jason Fetters
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* Copyright (C) 2016 - Brad Parker */
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2015 - Jason Fetters
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2015 - Jason Fetters
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -43,10 +43,15 @@
|
||||
#include "dynamic_libs/vpad_functions.h"
|
||||
#include "dynamic_libs/padscore_functions.h"
|
||||
#include "dynamic_libs/socket_functions.h"
|
||||
//#include "dynamic_libs/curl_functions.h"
|
||||
#include "dynamic_libs/ax_functions.h"
|
||||
//#include "dynamic_libs/aoc_functions.h"
|
||||
//#include "dynamic_libs/acp_functions.h"
|
||||
#include "fs/fs_utils.h"
|
||||
#include "fs/sd_fat_devoptab.h"
|
||||
#include "system/memory.h"
|
||||
#include "system/exception_handler.h"
|
||||
#include "system/exception.h"
|
||||
#include "utils/logger.h"
|
||||
#include "utils/utils.h"
|
||||
#include "common/common.h"
|
||||
@ -224,6 +229,10 @@ static int log_write(struct _reent *r, int fd, const char *ptr, size_t len)
|
||||
|
||||
return len;
|
||||
}
|
||||
void net_print(const char* str)
|
||||
{
|
||||
log_write(NULL, 0, str, strlen(str));
|
||||
}
|
||||
|
||||
static devoptab_t dotab_stdout = {
|
||||
"stdout", // device name
|
||||
@ -257,13 +266,24 @@ int __entry_menu(int argc, char **argv)
|
||||
InitSocketFunctionPointers();
|
||||
|
||||
log_init("10.42.0.1");
|
||||
|
||||
devoptab_list[STD_OUT] = &dotab_stdout;
|
||||
devoptab_list[STD_ERR] = &dotab_stdout;
|
||||
|
||||
InitFSFunctionPointers();
|
||||
InitGX2FunctionPointers();
|
||||
InitSysFunctionPointers();
|
||||
InitVPadFunctionPointers();
|
||||
InitPadScoreFunctionPointers();
|
||||
InitAXFunctionPointers();
|
||||
// InitCurlFunctionPointers();
|
||||
// InitAocFunctionPointers();
|
||||
// InitACPFunctionPointers();
|
||||
|
||||
|
||||
memoryInitialize();
|
||||
mount_sd_fat("sd");
|
||||
// setup_os_exceptions();
|
||||
InstallExceptionHandler();
|
||||
VPADInit();
|
||||
OSScreenInit();
|
||||
|
||||
@ -287,8 +307,8 @@ int __entry_menu(int argc, char **argv)
|
||||
unsigned sleep_ms = 0;
|
||||
int ret = runloop_iterate(&sleep_ms);
|
||||
|
||||
if (ret == 1 && sleep_ms > 0)
|
||||
retro_sleep(sleep_ms);
|
||||
// if (ret == 1 && sleep_ms > 0)
|
||||
// retro_sleep(sleep_ms);
|
||||
task_queue_ctl(TASK_QUEUE_CTL_CHECK, NULL);
|
||||
if (ret == -1)
|
||||
break;
|
||||
|
@ -37,6 +37,9 @@ static frontend_ctx_driver_t *frontend_ctx_drivers[] = {
|
||||
#if defined(GEKKO)
|
||||
&frontend_ctx_gx,
|
||||
#endif
|
||||
#if defined(WIIU)
|
||||
&frontend_ctx_wiiu,
|
||||
#endif
|
||||
#if defined(__QNX__)
|
||||
&frontend_ctx_qnx,
|
||||
#endif
|
||||
|
@ -92,6 +92,7 @@ typedef struct frontend_ctx_driver
|
||||
} frontend_ctx_driver_t;
|
||||
|
||||
extern frontend_ctx_driver_t frontend_ctx_gx;
|
||||
extern frontend_ctx_driver_t frontend_ctx_wiiu;
|
||||
extern frontend_ctx_driver_t frontend_ctx_ps3;
|
||||
extern frontend_ctx_driver_t frontend_ctx_xdk;
|
||||
extern frontend_ctx_driver_t frontend_ctx_qnx;
|
||||
|
@ -39,22 +39,23 @@ typedef struct
|
||||
int width;
|
||||
int height;
|
||||
bool enable;
|
||||
}menu;
|
||||
} menu;
|
||||
|
||||
void* texture;
|
||||
int tex_width;
|
||||
int tex_height;
|
||||
|
||||
}wiiu_video_t;
|
||||
} wiiu_video_t;
|
||||
|
||||
static void *wiiu_gfx_init(const video_info_t *video,
|
||||
const input_driver_t **input, void **input_data)
|
||||
static void* wiiu_gfx_init(const video_info_t* video,
|
||||
const input_driver_t** input, void** input_data)
|
||||
{
|
||||
*input = NULL;
|
||||
*input_data = NULL;
|
||||
|
||||
wiiu_video_t* wiiu = calloc(1, sizeof(*wiiu));
|
||||
if(!wiiu)
|
||||
|
||||
if (!wiiu)
|
||||
return NULL;
|
||||
|
||||
wiiu->screen_buffer0_size = OSScreenGetBufferSizeEx(0);
|
||||
@ -101,11 +102,11 @@ static void *wiiu_gfx_init(const video_info_t *video,
|
||||
|
||||
return wiiu;
|
||||
}
|
||||
static void wiiu_gfx_free(void *data)
|
||||
static void wiiu_gfx_free(void* data)
|
||||
{
|
||||
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
||||
|
||||
if(!wiiu)
|
||||
if (!wiiu)
|
||||
return;
|
||||
|
||||
MEM1_free(wiiu->screen_buffer0);
|
||||
@ -117,9 +118,9 @@ static void wiiu_gfx_free(void *data)
|
||||
|
||||
}
|
||||
|
||||
static bool wiiu_gfx_frame(void *data, const void *frame,
|
||||
unsigned width, unsigned height, uint64_t frame_count,
|
||||
unsigned pitch, const char *msg)
|
||||
static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
unsigned width, unsigned height, uint64_t frame_count,
|
||||
unsigned pitch, const char* msg)
|
||||
{
|
||||
(void)frame;
|
||||
(void)width;
|
||||
@ -135,33 +136,51 @@ static bool wiiu_gfx_frame(void *data, const void *frame,
|
||||
snprintf(frames_str, sizeof(frames_str), "frames : %i", frames++);
|
||||
|
||||
OSScreenClearBufferEx(1, 0);
|
||||
// OSScreenPutFontEx(1, 0, 0, "Hello world on DRC!!!");
|
||||
|
||||
const uint16_t* src = (uint16_t*)wiiu->menu.texture;
|
||||
uint32_t* dst = (uint32_t*)((uint8_t*)wiiu->screen_buffer1 + wiiu->screen_buffer1_id * wiiu->screen_buffer1_size / 2);
|
||||
// for (i = 0; i < wiiu->menu.height; i++)
|
||||
// {
|
||||
// memcpy(dst, src, wiiu->menu.width * sizeof(uint16_t));
|
||||
// dst += 896;
|
||||
// src += wiiu->menu.tex_width;
|
||||
// }
|
||||
|
||||
dst += 896 * (480 - wiiu->menu.height) / 2 + (896 - wiiu->menu.width) / 2;
|
||||
int x, y;
|
||||
for(y = 0; y < wiiu->menu.height; y++)
|
||||
if (wiiu->menu.enable)
|
||||
{
|
||||
for(x = 0; x < wiiu->menu.width; x++)
|
||||
const uint16_t* src = (uint16_t*)wiiu->menu.texture;
|
||||
uint32_t* dst = (uint32_t*)((uint8_t*)wiiu->screen_buffer1 + wiiu->screen_buffer1_id * wiiu->screen_buffer1_size / 2);
|
||||
|
||||
dst += 896 * (480 - wiiu->menu.height) / 2 + (896 - wiiu->menu.width) / 2;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < wiiu->menu.height; y++)
|
||||
{
|
||||
int r = ((src[x] >> 12) & 0xF) << 4;
|
||||
int g = ((src[x] >> 8) & 0xF) << 4;
|
||||
int b = ((src[x] >> 4) & 0xF) << 4;
|
||||
// r = 0;
|
||||
// g = 0;
|
||||
// b = 0;
|
||||
dst[x] = (r << 0) | (b << 8) | (g << 16);
|
||||
for (x = 0; x < wiiu->menu.width; x++)
|
||||
{
|
||||
int r = ((src[x] >> 12) & 0xF) << 4;
|
||||
int g = ((src[x] >> 8) & 0xF) << 4;
|
||||
int b = ((src[x] >> 4) & 0xF) << 4;
|
||||
dst[x] = (r << 0) | (b << 8) | (g << 16);
|
||||
}
|
||||
|
||||
src += wiiu->menu.tex_width;
|
||||
dst += 896;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
const uint16_t* src = (uint16_t*)frame;
|
||||
uint32_t* dst = (uint32_t*)((uint8_t*)wiiu->screen_buffer1 + wiiu->screen_buffer1_id * wiiu->screen_buffer1_size / 2);
|
||||
|
||||
dst += (896 * (480 - height) + width) / 2;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
for (x = 0; x < width; x++)
|
||||
{
|
||||
int r = ((src[x] >> 11) & 0x1F) << 3;
|
||||
int g = ((src[x] >> 5) & 0x3F) << 2;
|
||||
int b = ((src[x] >> 0) & 0x1F) << 3;
|
||||
dst[x] = (r << 0) | (b << 8) | (g << 16);
|
||||
}
|
||||
|
||||
src += pitch/2;
|
||||
dst += 896;
|
||||
}
|
||||
src += wiiu->menu.tex_width;
|
||||
dst += 896;
|
||||
}
|
||||
|
||||
|
||||
@ -177,39 +196,39 @@ static bool wiiu_gfx_frame(void *data, const void *frame,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void wiiu_gfx_set_nonblock_state(void *data, bool toggle)
|
||||
static void wiiu_gfx_set_nonblock_state(void* data, bool toggle)
|
||||
{
|
||||
(void)data;
|
||||
(void)toggle;
|
||||
}
|
||||
|
||||
static bool wiiu_gfx_alive(void *data)
|
||||
static bool wiiu_gfx_alive(void* data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool wiiu_gfx_focus(void *data)
|
||||
static bool wiiu_gfx_focus(void* data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool wiiu_gfx_suppress_screensaver(void *data, bool enable)
|
||||
static bool wiiu_gfx_suppress_screensaver(void* data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool wiiu_gfx_has_windowed(void *data)
|
||||
static bool wiiu_gfx_has_windowed(void* data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool wiiu_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path)
|
||||
static bool wiiu_gfx_set_shader(void* data,
|
||||
enum rarch_shader_type type, const char* path)
|
||||
{
|
||||
(void)data;
|
||||
(void)type;
|
||||
@ -218,21 +237,21 @@ static bool wiiu_gfx_set_shader(void *data,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void wiiu_gfx_set_rotation(void *data,
|
||||
unsigned rotation)
|
||||
static void wiiu_gfx_set_rotation(void* data,
|
||||
unsigned rotation)
|
||||
{
|
||||
(void)data;
|
||||
(void)rotation;
|
||||
}
|
||||
|
||||
static void wiiu_gfx_viewport_info(void *data,
|
||||
struct video_viewport *vp)
|
||||
static void wiiu_gfx_viewport_info(void* data,
|
||||
struct video_viewport* vp)
|
||||
{
|
||||
(void)data;
|
||||
(void)vp;
|
||||
}
|
||||
|
||||
static bool wiiu_gfx_read_viewport(void *data, uint8_t *buffer)
|
||||
static bool wiiu_gfx_read_viewport(void* data, uint8_t* buffer)
|
||||
{
|
||||
(void)data;
|
||||
(void)buffer;
|
||||
@ -240,12 +259,12 @@ static bool wiiu_gfx_read_viewport(void *data, uint8_t *buffer)
|
||||
return true;
|
||||
}
|
||||
|
||||
static uintptr_t wiiu_load_texture(void *video_data, void *data,
|
||||
bool threaded, enum texture_filter_type filter_type)
|
||||
static uintptr_t wiiu_load_texture(void* video_data, void* data,
|
||||
bool threaded, enum texture_filter_type filter_type)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static void wiiu_unload_texture(void *data, uintptr_t handle)
|
||||
static void wiiu_unload_texture(void* data, uintptr_t handle)
|
||||
{
|
||||
|
||||
}
|
||||
@ -271,19 +290,21 @@ static void wiiu_viewport_info(void* data, struct video_viewport* vp)
|
||||
vp->y = 0;
|
||||
}
|
||||
static void wiiu_set_texture_frame(void* data, const void* frame, bool rgb32,
|
||||
unsigned width, unsigned height, float alpha)
|
||||
unsigned width, unsigned height, float alpha)
|
||||
{
|
||||
int i;
|
||||
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
||||
if(!wiiu)
|
||||
|
||||
if (!wiiu)
|
||||
return;
|
||||
|
||||
if(!frame || !width || !height)
|
||||
if (!frame || !width || !height)
|
||||
return;
|
||||
|
||||
if(width > wiiu->menu.tex_width)
|
||||
if (width > wiiu->menu.tex_width)
|
||||
width = wiiu->menu.tex_width;
|
||||
if(height > wiiu->menu.tex_height)
|
||||
|
||||
if (height > wiiu->menu.tex_height)
|
||||
height = wiiu->menu.tex_height;
|
||||
|
||||
wiiu->menu.width = width;
|
||||
@ -291,6 +312,7 @@ static void wiiu_set_texture_frame(void* data, const void* frame, bool rgb32,
|
||||
|
||||
const uint16_t* src = frame;
|
||||
uint16_t* dst = (uint16_t*)wiiu->menu.texture;
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
memcpy(dst, src, width * sizeof(uint16_t));
|
||||
@ -307,8 +329,8 @@ static void wiiu_set_texture_enable(void* data, bool state, bool full_screen)
|
||||
|
||||
}
|
||||
|
||||
static void wiiu_set_osd_msg(void *data, const char *msg,
|
||||
const struct font_params *params, void *font)
|
||||
static void wiiu_set_osd_msg(void* data, const char* msg,
|
||||
const struct font_params* params, void* font)
|
||||
{
|
||||
}
|
||||
|
||||
@ -337,8 +359,8 @@ static const video_poke_interface_t wiiu_poke_interface =
|
||||
NULL
|
||||
};
|
||||
|
||||
static void wiiu_gfx_get_poke_interface(void *data,
|
||||
const video_poke_interface_t **iface)
|
||||
static void wiiu_gfx_get_poke_interface(void* data,
|
||||
const video_poke_interface_t** iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &wiiu_poke_interface;
|
||||
@ -362,7 +384,7 @@ video_driver_t video_wiiu =
|
||||
wiiu_gfx_read_viewport,
|
||||
NULL, /* read_frame_raw */
|
||||
#ifdef HAVE_OVERLAY
|
||||
NULL, /* overlay_interface */
|
||||
NULL, /* overlay_interface */
|
||||
#endif
|
||||
wiiu_gfx_get_poke_interface,
|
||||
wiiu_gfx_get_poke_interface,
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -817,6 +817,7 @@ RETROARCH
|
||||
#include "../intl/msg_hash_pt.c"
|
||||
#include "../intl/msg_hash_pl.c"
|
||||
#include "../intl/msg_hash_ru.c"
|
||||
#include "../intl/msg_hash_vn.c"
|
||||
#endif
|
||||
|
||||
#include "../intl/msg_hash_us.c"
|
||||
|
@ -268,7 +268,7 @@ static int16_t cocoa_input_state(void *data,
|
||||
const struct retro_keybind **binds, unsigned port,
|
||||
unsigned device, unsigned idx, unsigned id)
|
||||
{
|
||||
int16_t ret;
|
||||
int16_t ret = 0;
|
||||
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
|
||||
|
||||
if (!apple || !apple->joypad)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "string.h"
|
||||
|
||||
#include "dynamic_libs/vpad_functions.h"
|
||||
#include "wiiu_dbg.h"
|
||||
|
||||
#ifndef MAX_PADS
|
||||
#define MAX_PADS 1
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -625,7 +626,7 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
{
|
||||
/* Work around C89 limitations */
|
||||
char u[501];
|
||||
const char * t =
|
||||
const char * t =
|
||||
"RetroArch relies on an unique form of\n"
|
||||
"audio/video synchronization where it needs to be\n"
|
||||
"calibrated against the refresh rate of your\n"
|
||||
@ -4171,9 +4172,9 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
|
||||
case MENU_ENUM_LABEL_VALUE_CHEAT_FILE:
|
||||
return "Cheat File";
|
||||
case MENU_ENUM_LABEL_VALUE_CHEAT_FILE_LOAD:
|
||||
return "Cheat File Load";
|
||||
return "Load Cheat File";
|
||||
case MENU_ENUM_LABEL_VALUE_CHEAT_FILE_SAVE_AS:
|
||||
return "Cheat File Save As";
|
||||
return "Save Cheat File As";
|
||||
case MENU_ENUM_LABEL_VALUE_CORE_COUNTERS:
|
||||
return "Core Counters";
|
||||
case MENU_ENUM_LABEL_VALUE_TAKE_SCREENSHOT:
|
||||
@ -4632,6 +4633,8 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
|
||||
return "Chinese (Simplified)";
|
||||
case MENU_ENUM_LABEL_VALUE_LANG_ESPERANTO:
|
||||
return "Esperanto";
|
||||
case MENU_ENUM_LABEL_VALUE_LANG_VIETNAMESE:
|
||||
return "Vietnamese";
|
||||
case MENU_ENUM_LABEL_VALUE_LEFT_ANALOG:
|
||||
return "Left Analog";
|
||||
case MENU_ENUM_LABEL_VALUE_RIGHT_ANALOG:
|
||||
|
4824
intl/msg_hash_vn.c
Normal file
4824
intl/msg_hash_vn.c
Normal file
File diff suppressed because it is too large
Load Diff
1
lakka.h
1
lakka.h
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -354,7 +354,10 @@ end:
|
||||
if (handle)
|
||||
{
|
||||
if (handle->backend)
|
||||
handle->backend->stream_free(handle->stream);
|
||||
{
|
||||
if (handle->backend->stream_free)
|
||||
handle->backend->stream_free(handle->stream);
|
||||
}
|
||||
|
||||
if (handle->data)
|
||||
free(handle->data);
|
||||
@ -426,7 +429,8 @@ int file_archive_parse_file_iterate(
|
||||
}
|
||||
if (state->stream && state->backend)
|
||||
{
|
||||
state->backend->stream_free(state->stream);
|
||||
if (state->backend->stream_free)
|
||||
state->backend->stream_free(state->stream);
|
||||
|
||||
if (state->stream)
|
||||
free(state->stream);
|
||||
|
@ -431,22 +431,18 @@ static int zip_parse_file_iterate_step_internal(
|
||||
}
|
||||
|
||||
static int zip_parse_file_iterate_step(file_archive_transfer_t *state,
|
||||
const char *valid_exts, struct archive_extract_userdata *userdata, file_archive_file_cb file_cb)
|
||||
const char *valid_exts, struct archive_extract_userdata *userdata,
|
||||
file_archive_file_cb file_cb)
|
||||
{
|
||||
char filename[PATH_MAX_LENGTH];
|
||||
int ret;
|
||||
const uint8_t *cdata = NULL;
|
||||
uint32_t checksum = 0;
|
||||
uint32_t size = 0;
|
||||
uint32_t csize = 0;
|
||||
unsigned cmode = 0;
|
||||
unsigned payload = 0;
|
||||
|
||||
filename[0] = '\0';
|
||||
|
||||
ret = zip_parse_file_iterate_step_internal(state, filename,
|
||||
&cdata, &cmode, &size, &csize,
|
||||
&checksum, &payload);
|
||||
char filename[PATH_MAX_LENGTH] = {0};
|
||||
const uint8_t *cdata = NULL;
|
||||
uint32_t checksum = 0;
|
||||
uint32_t size = 0;
|
||||
uint32_t csize = 0;
|
||||
unsigned cmode = 0;
|
||||
unsigned payload = 0;
|
||||
int ret = zip_parse_file_iterate_step_internal(
|
||||
state, filename, &cdata, &cmode, &size, &csize, &checksum, &payload);
|
||||
|
||||
if (ret != 1)
|
||||
return ret;
|
||||
|
@ -399,6 +399,7 @@ static config_file_t *config_file_new_internal(
|
||||
free(conf->path);
|
||||
goto error;
|
||||
}
|
||||
setvbuf(file, NULL, _IOFBF, 0x4000);
|
||||
|
||||
while (!feof(file))
|
||||
{
|
||||
@ -890,6 +891,7 @@ bool config_file_write(config_file_t *conf, const char *path)
|
||||
file = fopen(path, "w");
|
||||
if (!file)
|
||||
return false;
|
||||
setvbuf(file, NULL, _IOFBF, 0x4000);
|
||||
}
|
||||
else
|
||||
file = stdout;
|
||||
|
@ -244,6 +244,7 @@ enum retro_language
|
||||
RETRO_LANGUAGE_CHINESE_SIMPLIFIED = 11,
|
||||
RETRO_LANGUAGE_ESPERANTO = 12,
|
||||
RETRO_LANGUAGE_POLISH = 13,
|
||||
RETRO_LANGUAGE_VIETNAMESE = 14,
|
||||
RETRO_LANGUAGE_LAST,
|
||||
|
||||
/* Ensure sizeof(enum) == sizeof(int) */
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
*
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
@ -97,7 +97,9 @@ void cheat_manager_apply_cheats(void)
|
||||
core_set_cheat(&cheat_info);
|
||||
}
|
||||
}
|
||||
|
||||
runloop_msg_queue_push("Applying cheat changes.", 1, 180, true);
|
||||
RARCH_LOG("Applying cheat changes.\n");
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
data_bool = idx != 0;
|
||||
cheevos_apply_cheats(&data_bool);
|
||||
@ -137,7 +139,7 @@ bool cheat_manager_save(const char *path)
|
||||
path, sizeof(buf));
|
||||
|
||||
fill_pathname_noext(cheats_file, buf, ".cht", sizeof(cheats_file));
|
||||
|
||||
|
||||
conf = config_file_new(cheats_file);
|
||||
|
||||
if (!conf)
|
||||
@ -340,7 +342,7 @@ void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx)
|
||||
|
||||
snprintf(msg, sizeof(msg), "Cheat: #%u [%s]: %s",
|
||||
handle_idx, handle->cheats[handle_idx].state ? "ON" : "OFF",
|
||||
(handle->cheats[handle_idx].desc) ?
|
||||
(handle->cheats[handle_idx].desc) ?
|
||||
(handle->cheats[handle_idx].desc) : (handle->cheats[handle_idx].code)
|
||||
);
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
|
@ -1545,12 +1545,16 @@ static void menu_action_setting_disp_set_label_setting_bool(file_list_t* list,
|
||||
{
|
||||
rarch_setting_t *setting = menu_setting_find(list->list[i].label);
|
||||
|
||||
*s = '\0';
|
||||
*w = 19;
|
||||
|
||||
if (*setting->value.target.boolean)
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON), len);
|
||||
else
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
|
||||
if (setting)
|
||||
{
|
||||
if (*setting->value.target.boolean)
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON), len);
|
||||
else
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
|
||||
}
|
||||
|
||||
strlcpy(s2, path, len2);
|
||||
}
|
||||
@ -1581,11 +1585,12 @@ static void menu_action_setting_disp_set_label_setting_path(file_list_t* list,
|
||||
char *s2, size_t len2)
|
||||
{
|
||||
rarch_setting_t *setting = menu_setting_find(list->list[i].label);
|
||||
const char *basename = path_basename(setting->value.target.string);
|
||||
const char *basename = setting ? path_basename(setting->value.target.string) : NULL;
|
||||
|
||||
*w = 19;
|
||||
|
||||
strlcpy(s, basename, len);
|
||||
if (!string_is_empty(basename))
|
||||
strlcpy(s, basename, len);
|
||||
|
||||
strlcpy(s2, path, len2);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2012-2015 - Michael Lelli
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2012-2015 - Michael Lelli
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2014-2015 - Jean-André Santoni
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -2722,19 +2724,19 @@ static int menu_displaylist_parse_load_content_settings(
|
||||
MENU_ENUM_LABEL_SHADER_OPTIONS,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
#endif
|
||||
|
||||
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_CORE),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE),
|
||||
MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_GAME),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME),
|
||||
MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
if(settings->cheevos.enable)
|
||||
menu_entries_append_enum(info->list,
|
||||
@ -3038,6 +3040,11 @@ static int menu_displaylist_parse_options_cheats(
|
||||
if (!cheat_manager_alloc_if_empty())
|
||||
return -1;
|
||||
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEAT_APPLY_CHANGES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_APPLY_CHANGES),
|
||||
MENU_ENUM_LABEL_CHEAT_APPLY_CHANGES,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEAT_FILE_LOAD),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_FILE_LOAD),
|
||||
@ -3053,11 +3060,6 @@ static int menu_displaylist_parse_options_cheats(
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_NUM_PASSES),
|
||||
MENU_ENUM_LABEL_CHEAT_NUM_PASSES,
|
||||
0, 0, 0);
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEAT_APPLY_CHANGES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_APPLY_CHANGES),
|
||||
MENU_ENUM_LABEL_CHEAT_APPLY_CHANGES,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
for (i = 0; i < cheat_manager_get_size(); i++)
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -216,14 +217,13 @@ enum menu_settings_type
|
||||
typedef struct
|
||||
{
|
||||
char deferred_path[PATH_MAX_LENGTH];
|
||||
|
||||
char scratch_buf[PATH_MAX_LENGTH];
|
||||
char scratch2_buf[PATH_MAX_LENGTH];
|
||||
|
||||
uint64_t state;
|
||||
struct
|
||||
{
|
||||
char msg[PATH_MAX_LENGTH];
|
||||
char msg[255];
|
||||
} menu_state;
|
||||
|
||||
char db_playlist_file[PATH_MAX_LENGTH];
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -468,6 +470,7 @@ static void setting_get_string_representation_uint_user_language(void *data,
|
||||
modes[RETRO_LANGUAGE_CHINESE_SIMPLIFIED] = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LANG_CHINESE_SIMPLIFIED);
|
||||
modes[RETRO_LANGUAGE_ESPERANTO] = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LANG_ESPERANTO);
|
||||
modes[RETRO_LANGUAGE_POLISH] = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LANG_POLISH);
|
||||
modes[RETRO_LANGUAGE_VIETNAMESE] = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LANG_VIETNAMESE);
|
||||
|
||||
if (settings)
|
||||
strlcpy(s, modes[settings->user_language], len);
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -64,6 +65,9 @@ int menu_hash_get_help_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
case RETRO_LANGUAGE_JAPANESE:
|
||||
ret = menu_hash_get_help_jp_enum(msg, s, len);
|
||||
break;
|
||||
case RETRO_LANGUAGE_VIETNAMESE:
|
||||
ret = menu_hash_get_help_vn_enum(msg, s, len);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -117,6 +121,9 @@ const char *msg_hash_to_str(enum msg_hash_enums msg)
|
||||
case RETRO_LANGUAGE_JAPANESE:
|
||||
ret = msg_hash_to_str_jp(msg);
|
||||
break;
|
||||
case RETRO_LANGUAGE_VIETNAMESE:
|
||||
ret = msg_hash_to_str_vn(msg);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -1858,6 +1859,7 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_VALUE_LANG_CHINESE_SIMPLIFIED,
|
||||
MENU_ENUM_LABEL_VALUE_LANG_ESPERANTO,
|
||||
MENU_ENUM_LABEL_VALUE_LANG_POLISH,
|
||||
MENU_ENUM_LABEL_VALUE_LANG_VIETNAMESE,
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_NONE,
|
||||
|
||||
@ -2237,6 +2239,9 @@ int menu_hash_get_help_pl_enum(enum msg_hash_enums msg, char *s, size_t len);
|
||||
const char *msg_hash_to_str_nl(enum msg_hash_enums msg);
|
||||
int menu_hash_get_help_nl_enum(enum msg_hash_enums msg, char *s, size_t len);
|
||||
|
||||
const char *msg_hash_to_str_vn(enum msg_hash_enums msg);
|
||||
int menu_hash_get_help_vn_enum(enum msg_hash_enums msg, char *s, size_t len);
|
||||
|
||||
const char *msg_hash_to_str_us(enum msg_hash_enums msg);
|
||||
int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2015-2016 - Andre Leiradella
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2012-2015 - Michael Lelli
|
||||
* Copyright (C) 2014-2015 - Jay McCarthy
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -80,6 +80,8 @@ rarch_setting_t setting_terminator_setting(void)
|
||||
result.enforce_minrange = false;
|
||||
result.enforce_maxrange = false;
|
||||
|
||||
result.dont_use_enum_idx_representation = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -742,6 +744,7 @@ static rarch_setting_t setting_group_setting(enum setting_type type, const char*
|
||||
result.enforce_minrange = false;
|
||||
result.enforce_maxrange = false;
|
||||
|
||||
result.dont_use_enum_idx_representation = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2015 - Michael Lelli
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2015 - Michael Lelli
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2016 - Jean-André Santoni
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
|
40
wiiu/dynamic_libs/acp_functions.c
Normal file
40
wiiu/dynamic_libs/acp_functions.c
Normal file
@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "acp_functions.h"
|
||||
|
||||
unsigned int acp_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(void, GetMetaXml, void * _ACPMetaXml);
|
||||
|
||||
void InitAcquireACP(void)
|
||||
{
|
||||
OSDynLoad_Acquire("nn_acp.rpl", &acp_handle);
|
||||
}
|
||||
|
||||
void InitACPFunctionPointers(void)
|
||||
{
|
||||
InitAcquireACP();
|
||||
OSDynLoad_FindExport(acp_handle,0,"GetMetaXml__Q2_2nn3acpFP11_ACPMetaXml",&GetMetaXml);
|
||||
}
|
42
wiiu/dynamic_libs/acp_functions.h
Normal file
42
wiiu/dynamic_libs/acp_functions.h
Normal file
@ -0,0 +1,42 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __ACP_FUNCTIONS_H_
|
||||
#define __ACP_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
extern unsigned int acp_handle;
|
||||
|
||||
void InitACPFunctionPointers(void);
|
||||
void InitAcquireACP(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __VPAD_FUNCTIONS_H_
|
58
wiiu/dynamic_libs/aoc_functions.c
Normal file
58
wiiu/dynamic_libs/aoc_functions.c
Normal file
@ -0,0 +1,58 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "aoc_functions.h"
|
||||
|
||||
unsigned int aoc_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(s32, AOC_Initialize, void);
|
||||
EXPORT_DECL(s32, AOC_Finalize, void);
|
||||
EXPORT_DECL(u32, AOC_CalculateWorkBufferSize, u32 num_titles);
|
||||
EXPORT_DECL(s32, AOC_ListTitle, u32 * num_titles, void * titles, u32 max_titles, void * buffer, u32 buffer_size);
|
||||
EXPORT_DECL(s32, AOC_OpenTitle, char* aoc_path, void * title, void * buffer, u32 buffer_size);
|
||||
EXPORT_DECL(s32, AOC_CloseTitle, void * title);
|
||||
EXPORT_DECL(s32, AOC_DeleteContent, u64 title_id, u16 contentIndexes[], u32 numberOfContent, void* buffer, u32 buffer_size);
|
||||
EXPORT_DECL(s32, AOC_GetPurchaseInfo, u32 * bResult, u64 title_id, u16 contentIndexes[], u32 numberOfContent, void * buffer, u32 buffer_size);
|
||||
|
||||
void InitAcquireAoc(void)
|
||||
{
|
||||
OSDynLoad_Acquire("nn_aoc.rpl", &aoc_handle);
|
||||
}
|
||||
|
||||
void InitAocFunctionPointers(void)
|
||||
{
|
||||
InitAcquireAoc();
|
||||
if(aoc_handle == 0)
|
||||
return;
|
||||
|
||||
//! assigning those is not mandatory and it does not always work to load them
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_Initialize", &AOC_Initialize);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_Finalize", &AOC_Finalize);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_CalculateWorkBufferSize", &AOC_CalculateWorkBufferSize);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_ListTitle", &AOC_ListTitle);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_OpenTitle", &AOC_OpenTitle);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_CloseTitle", &AOC_CloseTitle);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_DeleteContent", &AOC_DeleteContent);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_GetPurchaseInfo", &AOC_GetPurchaseInfo);
|
||||
}
|
58
wiiu/dynamic_libs/aoc_functions.h
Normal file
58
wiiu/dynamic_libs/aoc_functions.h
Normal file
@ -0,0 +1,58 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __AOC_FUNCTIONS_H_
|
||||
#define __AOC_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern unsigned int aoc_handle;
|
||||
|
||||
#define AOC_TITLE_SIZE 104
|
||||
|
||||
typedef struct {
|
||||
u64 title_ID;
|
||||
u32 group_ID;
|
||||
u16 version;
|
||||
char path[88];
|
||||
} AOC_TitleListType;
|
||||
|
||||
|
||||
void InitAocFunctionPointers(void);
|
||||
void InitAcquireAoc(void);
|
||||
|
||||
extern s32 (* AOC_Initialize)(void);
|
||||
extern s32 (* AOC_Finalize)(void);
|
||||
extern u32 (* AOC_CalculateWorkBufferSize)(u32 num_titles);
|
||||
extern s32 (* AOC_ListTitle)(u32 * num_titles, void * titles, u32 max_titles, void * buffer, u32 buffer_size);
|
||||
extern s32 (* AOC_OpenTitle)(char* aoc_path, void * title, void * buffer, u32 buffer_size);
|
||||
extern s32 (* AOC_CloseTitle)(void * title);
|
||||
extern s32 (* AOC_DeleteContent)(u64 title_id, u16 contentIndexes[], u32 numberOfContent, void * buffer, u32 buffer_size);
|
||||
extern s32 (* AOC_GetPurchaseInfo)(u32 * bResult, u64 title_id, u16 contentIndexes[], u32 numberOfContent, void * buffer, u32 buffer_size);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __AOC_FUNCTIONS_H_
|
@ -21,10 +21,14 @@
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "common/common.h"
|
||||
#include "os_functions.h"
|
||||
#include "ax_functions.h"
|
||||
|
||||
unsigned int sound_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(void, AXInitWithParams, u32 * params);
|
||||
EXPORT_DECL(void, AXInit, void);
|
||||
EXPORT_DECL(void, AXQuit, void);
|
||||
EXPORT_DECL(u32, AXGetInputSamplesPerSec, void);
|
||||
EXPORT_DECL(u32, AXGetInputSamplesPerFrame, void);
|
||||
@ -45,15 +49,35 @@ EXPORT_DECL(u32, AXGetVoiceLoopCount, void *v);
|
||||
EXPORT_DECL(void, AXSetVoiceEndOffset, void *v, u32 offset);
|
||||
EXPORT_DECL(void, AXSetVoiceLoopOffset, void *v, u32 offset);
|
||||
|
||||
void InitAcquireAX(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
|
||||
if(OS_FIRMWARE >= 400)
|
||||
{
|
||||
AXInit = 0;
|
||||
|
||||
OSDynLoad_Acquire("sndcore2.rpl", &sound_handle);
|
||||
OS_FIND_EXPORT(sound_handle, AXInitWithParams);
|
||||
OS_FIND_EXPORT(sound_handle, AXGetInputSamplesPerSec);
|
||||
}
|
||||
else
|
||||
{
|
||||
AXInitWithParams = 0;
|
||||
AXGetInputSamplesPerSec = 0;
|
||||
|
||||
OSDynLoad_Acquire("snd_core.rpl", &sound_handle);
|
||||
OS_FIND_EXPORT(sound_handle, AXInit);
|
||||
}
|
||||
}
|
||||
|
||||
void InitAXFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int sound_handle;
|
||||
OSDynLoad_Acquire("sndcore2.rpl", &sound_handle);
|
||||
|
||||
OS_FIND_EXPORT(sound_handle, AXInitWithParams);
|
||||
InitAcquireAX();
|
||||
|
||||
OS_FIND_EXPORT(sound_handle, AXQuit);
|
||||
OS_FIND_EXPORT(sound_handle, AXGetInputSamplesPerSec);
|
||||
OS_FIND_EXPORT(sound_handle, AXVoiceBegin);
|
||||
OS_FIND_EXPORT(sound_handle, AXVoiceEnd);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceType);
|
||||
@ -72,3 +96,23 @@ void InitAXFunctionPointers(void)
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceLoopOffset);
|
||||
}
|
||||
|
||||
void ProperlyEndTransitionAudio(void)
|
||||
{
|
||||
bool (* check_os_audio_transition_flag_old)(void);
|
||||
void (* AXInit_old)(void);
|
||||
void (* AXQuit_old)(void);
|
||||
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int sound_handle;
|
||||
OSDynLoad_Acquire("snd_core.rpl", &sound_handle);
|
||||
|
||||
OS_FIND_EXPORT_EX(sound_handle, check_os_audio_transition_flag, check_os_audio_transition_flag_old);
|
||||
OS_FIND_EXPORT_EX(sound_handle, AXInit, AXInit_old);
|
||||
OS_FIND_EXPORT_EX(sound_handle, AXQuit, AXQuit_old);
|
||||
|
||||
if (check_os_audio_transition_flag_old())
|
||||
{
|
||||
AXInit_old();
|
||||
AXQuit_old();
|
||||
}
|
||||
}
|
||||
|
@ -30,9 +30,14 @@ extern "C" {
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
extern unsigned int sound_handle;
|
||||
|
||||
void InitAXFunctionPointers(void);
|
||||
void InitAcquireAX(void);
|
||||
void ProperlyEndTransitionAudio(void);
|
||||
|
||||
extern void (* AXInitWithParams)(u32 * params);
|
||||
extern void (* AXInit)(void);
|
||||
extern void (* AXQuit)(void);
|
||||
extern u32 (* AXGetInputSamplesPerSec)(void);
|
||||
extern s32 (* AXVoiceBegin)(void *v);
|
||||
|
54
wiiu/dynamic_libs/curl_functions.c
Normal file
54
wiiu/dynamic_libs/curl_functions.c
Normal file
@ -0,0 +1,54 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "curl_functions.h"
|
||||
|
||||
unsigned int libcurl_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(CURLcode, n_curl_global_init, long flags);
|
||||
EXPORT_DECL(CURL *, n_curl_easy_init, void);
|
||||
EXPORT_DECL(CURLcode, n_curl_easy_setopt, CURL *curl, CURLoption option, ...);
|
||||
EXPORT_DECL(CURLcode, n_curl_easy_perform, CURL *curl);
|
||||
EXPORT_DECL(void, n_curl_easy_cleanup, CURL *curl);
|
||||
EXPORT_DECL(CURLcode, n_curl_easy_getinfo, CURL *curl, CURLINFO info, ...);
|
||||
|
||||
void InitAcquireCurl(void)
|
||||
{
|
||||
OSDynLoad_Acquire("nlibcurl", &libcurl_handle);
|
||||
}
|
||||
|
||||
void InitCurlFunctionPointers(void)
|
||||
{
|
||||
InitAcquireCurl();
|
||||
unsigned int *funcPointer = 0;
|
||||
|
||||
OS_FIND_EXPORT_EX(libcurl_handle, curl_global_init, n_curl_global_init);
|
||||
OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_init, n_curl_easy_init);
|
||||
OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_setopt, n_curl_easy_setopt);
|
||||
OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_perform, n_curl_easy_perform);
|
||||
OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_cleanup, n_curl_easy_cleanup);
|
||||
OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_getinfo, n_curl_easy_getinfo);
|
||||
|
||||
n_curl_global_init(CURL_GLOBAL_ALL);
|
||||
}
|
51
wiiu/dynamic_libs/curl_functions.h
Normal file
51
wiiu/dynamic_libs/curl_functions.h
Normal file
@ -0,0 +1,51 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __CURL_FUNCTIONS_H_
|
||||
#define __CURL_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
#include "socket_functions.h"
|
||||
typedef int socklen_t;
|
||||
#include <curl/curl.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
void InitCurlFunctionPointers(void);
|
||||
void InitAcquireCurl(void);
|
||||
|
||||
extern CURLcode (* n_curl_global_init)(long flags);
|
||||
extern CURL * (* n_curl_easy_init)(void);
|
||||
extern CURLcode (* n_curl_easy_setopt)(CURL *curl, CURLoption option, ...);
|
||||
extern CURLcode (* n_curl_easy_perform)(CURL *curl);
|
||||
extern void (* n_curl_easy_cleanup)(CURL *curl);
|
||||
extern CURLcode (* n_curl_easy_getinfo)(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __CURL_FUNCTIONS_H_
|
61
wiiu/dynamic_libs/fs_defs.h
Normal file
61
wiiu/dynamic_libs/fs_defs.h
Normal file
@ -0,0 +1,61 @@
|
||||
#ifndef FS_DEFS_H
|
||||
#define FS_DEFS_H
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* FS defines and types */
|
||||
#define FS_MAX_LOCALPATH_SIZE 511
|
||||
#define FS_MAX_MOUNTPATH_SIZE 128
|
||||
#define FS_MAX_FULLPATH_SIZE (FS_MAX_LOCALPATH_SIZE + FS_MAX_MOUNTPATH_SIZE)
|
||||
#define FS_MAX_ARGPATH_SIZE FS_MAX_FULLPATH_SIZE
|
||||
|
||||
#define FS_STATUS_OK 0
|
||||
#define FS_RET_UNSUPPORTED_CMD 0x0400
|
||||
#define FS_RET_NO_ERROR 0x0000
|
||||
#define FS_RET_ALL_ERROR (unsigned int)(-1)
|
||||
|
||||
#define FS_STAT_FLAG_IS_DIRECTORY 0x80000000
|
||||
|
||||
/* max length of file/dir name */
|
||||
#define FS_MAX_ENTNAME_SIZE 256
|
||||
|
||||
#define FS_SOURCETYPE_EXTERNAL 0
|
||||
#define FS_SOURCETYPE_HFIO 1
|
||||
|
||||
#define FS_MOUNT_SOURCE_SIZE 0x300
|
||||
#define FS_CLIENT_SIZE 0x1700
|
||||
#define FS_CMD_BLOCK_SIZE 0xA80
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t flag;
|
||||
uint32_t permission;
|
||||
uint32_t owner_id;
|
||||
uint32_t group_id;
|
||||
uint32_t size;
|
||||
uint32_t alloc_size;
|
||||
uint64_t quota_size;
|
||||
uint32_t ent_id;
|
||||
uint64_t ctime;
|
||||
uint64_t mtime;
|
||||
uint8_t attributes[48];
|
||||
} __attribute__((packed)) FSStat;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FSStat stat;
|
||||
char name[FS_MAX_ENTNAME_SIZE];
|
||||
} FSDirEntry;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FS_DEFS_H */
|
||||
|
@ -23,7 +23,6 @@
|
||||
***************************************************************************/
|
||||
#include "fs_functions.h"
|
||||
#include "os_functions.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
EXPORT_DECL(int, FSInit, void);
|
||||
EXPORT_DECL(int, FSShutdown, void);
|
||||
@ -69,6 +68,12 @@ EXPORT_DECL(int, FSGetStatFile, void *pClient, void *pCmd, int fd, void *buffer,
|
||||
EXPORT_DECL(int, FSSetPosFile, void *pClient, void *pCmd, int fd, int pos, int error);
|
||||
EXPORT_DECL(int, FSWriteFile, void *pClient, void *pCmd, const void *source, int block_size, int block_count, int fd, int flag, int error);
|
||||
|
||||
EXPORT_DECL(int, FSBindMount, void *pClient, void *pCmd, char *source, char *target, int error);
|
||||
EXPORT_DECL(int, FSBindUnmount, void *pClient, void *pCmd, char *target, int error);
|
||||
|
||||
EXPORT_DECL(int, FSMakeQuota, void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling);
|
||||
EXPORT_DECL(int, FSMakeQuotaAsync ,void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling,const void *asyncParams);
|
||||
|
||||
void InitFSFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
@ -117,4 +122,10 @@ void InitFSFunctionPointers(void)
|
||||
OS_FIND_EXPORT(coreinit_handle, FSGetStatFile);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSSetPosFile);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSWriteFile);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSBindMount);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSBindUnmount);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSMakeQuota);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSMakeQuotaAsync);
|
||||
}
|
||||
|
@ -28,7 +28,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "common/fs_defs.h"
|
||||
#include <gctypes.h>
|
||||
#include "fs_defs.h"
|
||||
|
||||
void InitFSFunctionPointers(void);
|
||||
|
||||
@ -80,6 +81,13 @@ extern int (* FSGetStatFile)(void *pClient, void *pCmd, int fd, void *buffer, in
|
||||
extern int (* FSSetPosFile)(void *pClient, void *pCmd, int fd, int pos, int error);
|
||||
extern int (* FSWriteFile)(void *pClient, void *pCmd, const void *source, int block_size, int block_count, int fd, int flag, int error);
|
||||
|
||||
extern int (* FSBindMount)(void *pClient, void *pCmd, char *source, char *target, int error);
|
||||
extern int (* FSBindUnmount)(void *pClient, void *pCmd, char *target, int error);
|
||||
|
||||
extern int (* FSMakeQuota)( void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling);
|
||||
extern int (* FSMakeQuotaAsync)(void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling,const void *asyncParams);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -23,7 +23,8 @@
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "gx2_types.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
unsigned int gx2_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(void, GX2Init, u32 * init_attribs);
|
||||
EXPORT_DECL(void, GX2Shutdown, void);
|
||||
@ -37,6 +38,7 @@ EXPORT_DECL(void, GX2SetContextState, const GX2ContextState* state);
|
||||
EXPORT_DECL(void, GX2DrawEx, s32 primitive_type, u32 count, u32 first_vertex, u32 instances_count);
|
||||
EXPORT_DECL(void, GX2DrawIndexedEx, s32 primitive_type, u32 count, s32 index_format, const void* idx, u32 first_vertex, u32 instances_count);
|
||||
EXPORT_DECL(void, GX2ClearDepthStencilEx, GX2DepthBuffer *depthBuffer, f32 depth_value, u8 stencil_value, s32 clear_mode);
|
||||
EXPORT_DECL(void, GX2SetClearDepthStencil, GX2DepthBuffer *depthBuffer, f32 depth_value, u8 stencil_value);
|
||||
EXPORT_DECL(void, GX2CopyColorBufferToScanBuffer, const GX2ColorBuffer *colorBuffer, s32 scan_target);
|
||||
EXPORT_DECL(void, GX2SwapScanBuffers, void);
|
||||
EXPORT_DECL(void, GX2SetTVEnable, s32 enable);
|
||||
@ -89,13 +91,19 @@ EXPORT_DECL(void, GX2SetDRCGamma, f32 gam);
|
||||
EXPORT_DECL(s32, GX2GetSystemTVScanMode, void);
|
||||
EXPORT_DECL(s32, GX2GetSystemDRCScanMode, void);
|
||||
EXPORT_DECL(void, GX2RSetAllocator, void * (* allocFunc)(u32, u32, u32), void (* freeFunc)(u32, void*));
|
||||
EXPORT_DECL(void, GX2CopySurface, GX2Surface * srcSurface,u32 srcMip,u32 srcSlice,GX2Surface * dstSurface,u32 dstMip,u32 dstSlice );
|
||||
|
||||
EXPORT_DECL(void, GX2ClearBuffersEx, GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,int clearFlags);
|
||||
|
||||
void InitAcquireGX2(void)
|
||||
{
|
||||
OSDynLoad_Acquire("gx2.rpl", &gx2_handle);
|
||||
}
|
||||
|
||||
void InitGX2FunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int gx2_handle;
|
||||
OSDynLoad_Acquire("gx2.rpl", &gx2_handle);
|
||||
InitAcquireGX2();
|
||||
|
||||
OS_FIND_EXPORT(gx2_handle, GX2Init);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2Shutdown);
|
||||
@ -159,4 +167,7 @@ void InitGX2FunctionPointers(void)
|
||||
OS_FIND_EXPORT(gx2_handle, GX2GetSystemTVScanMode);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2GetSystemDRCScanMode);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2RSetAllocator);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2CopySurface);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2ClearBuffersEx);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetClearDepthStencil);
|
||||
}
|
||||
|
@ -30,7 +30,10 @@ extern "C" {
|
||||
|
||||
#include "gx2_types.h"
|
||||
|
||||
extern unsigned int gx2_handle;
|
||||
|
||||
void InitGX2FunctionPointers(void);
|
||||
void InitAcquireGX2(void);
|
||||
|
||||
extern void (* GX2Init)(u32 * init_attribs);
|
||||
extern void (* GX2Shutdown)(void);
|
||||
@ -44,6 +47,7 @@ extern void (* GX2SetContextState)(const GX2ContextState* state);
|
||||
extern void (* GX2DrawEx)(s32 primitive_type, u32 count, u32 first_vertex, u32 instances_count);
|
||||
extern void (* GX2DrawIndexedEx)(s32 primitive_type, u32 count, s32 index_format, const void* idx, u32 first_vertex, u32 instances_count);
|
||||
extern void (* GX2ClearDepthStencilEx)(GX2DepthBuffer *depthBuffer, f32 depth_value, u8 stencil_value, s32 clear_mode);
|
||||
extern void (* GX2SetClearDepthStencil)(GX2DepthBuffer *depthBuffer, f32 depth_value, u8 stencil_value);
|
||||
extern void (* GX2CopyColorBufferToScanBuffer)(const GX2ColorBuffer *colorBuffer, s32 scan_target);
|
||||
extern void (* GX2SwapScanBuffers)(void);
|
||||
extern void (* GX2SetTVEnable)(s32 enable);
|
||||
@ -96,6 +100,8 @@ extern void (* GX2SetDRCGamma)(f32 val);
|
||||
extern s32 (* GX2GetSystemTVScanMode)(void);
|
||||
extern s32 (* GX2GetSystemDRCScanMode)(void);
|
||||
extern void (* GX2RSetAllocator)(void * (*allocFunc)(u32, u32, u32), void (*freeFunc)(u32, void*));
|
||||
extern void (* GX2CopySurface)(GX2Surface * srcSurface,u32 srcMip,u32 srcSlice,GX2Surface * dstSurface,u32 dstMip,u32 dstSlice );
|
||||
extern void (* GX2ClearBuffersEx)(GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,int clearFlags);
|
||||
|
||||
static inline void GX2InitDepthBuffer(GX2DepthBuffer *depthBuffer, s32 dimension, u32 width, u32 height, u32 depth, s32 format, s32 aa)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "common/common.h"
|
||||
#include "os_functions.h"
|
||||
|
||||
unsigned int coreinit_handle = 0;
|
||||
unsigned int coreinit_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Lib handle functions
|
||||
@ -32,6 +32,11 @@ unsigned int coreinit_handle = 0;
|
||||
EXPORT_DECL(int, OSDynLoad_Acquire, const char* rpl, u32 *handle);
|
||||
EXPORT_DECL(int, OSDynLoad_FindExport, u32 handle, int isdata, const char *symbol, void *address);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Security functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(int, OSGetSecurityLevel, void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Thread functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@ -45,6 +50,9 @@ EXPORT_DECL(int, OSJoinThread, void * thread, int * ret_val);
|
||||
EXPORT_DECL(void, OSDetachThread, void * thread);
|
||||
EXPORT_DECL(void, OSSleepTicks, u64 ticks);
|
||||
EXPORT_DECL(u64, OSGetTick, void);
|
||||
EXPORT_DECL(u64, OSGetTime, void);
|
||||
EXPORT_DECL(void, OSTicksToCalendarTime, u64 time, OSCalendarTime * calendarTime);
|
||||
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Mutex functions
|
||||
@ -58,6 +66,7 @@ EXPORT_DECL(int, OSTryLockMutex, void* mutex);
|
||||
//! System functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(u64, OSGetTitleID, void);
|
||||
EXPORT_DECL(void, OSGetArgcArgv, int* argc, char*** argv);
|
||||
EXPORT_DECL(void, __Exit, void);
|
||||
EXPORT_DECL(void, OSFatal, const char* msg);
|
||||
EXPORT_DECL(void, OSSetExceptionCallback, u8 exceptionType, exception_callback newCallback);
|
||||
@ -65,6 +74,7 @@ EXPORT_DECL(void, DCFlushRange, const void *addr, u32 length);
|
||||
EXPORT_DECL(void, ICInvalidateRange, const void *addr, u32 length);
|
||||
EXPORT_DECL(void*, OSEffectiveToPhysical, const void*);
|
||||
EXPORT_DECL(int, __os_snprintf, char* s, int n, const char * format, ...);
|
||||
EXPORT_DECL(int *, __gh_errno_ptr, void);
|
||||
|
||||
EXPORT_DECL(void, OSScreenInit, void);
|
||||
EXPORT_DECL(unsigned int, OSScreenGetBufferSizeEx, unsigned int bufferNum);
|
||||
@ -81,6 +91,7 @@ EXPORT_VAR(unsigned int *, pMEMAllocFromDefaultHeapEx);
|
||||
EXPORT_VAR(unsigned int *, pMEMAllocFromDefaultHeap);
|
||||
EXPORT_VAR(unsigned int *, pMEMFreeToDefaultHeap);
|
||||
|
||||
EXPORT_DECL(int, MEMGetSizeForMBlockExpHeap, void* ptr);
|
||||
EXPORT_DECL(int, MEMGetBaseHeapHandle, int mem_arena);
|
||||
EXPORT_DECL(unsigned int, MEMGetAllocatableSizeForFrmHeapEx, int heap, int align);
|
||||
EXPORT_DECL(void *, MEMAllocFromFrmHeapEx, int heap, unsigned int size, int align);
|
||||
@ -90,33 +101,79 @@ EXPORT_DECL(int , MEMCreateExpHeapEx, void* address, unsigned int size, unsigned
|
||||
EXPORT_DECL(void *, MEMDestroyExpHeap, int heap);
|
||||
EXPORT_DECL(void, MEMFreeToExpHeap, int heap, void* ptr);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! MCP functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(int, MCP_Open, void);
|
||||
EXPORT_DECL(int, MCP_Close, int handle);
|
||||
EXPORT_DECL(int, MCP_GetOwnTitleInfo, int handle, void * data);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Loader functions (not real rpl)
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(int, LiWaitIopComplete, int unknown_syscall_arg_r3, int * remaining_bytes);
|
||||
EXPORT_DECL(int, LiWaitIopCompleteWithInterrupts, int unknown_syscall_arg_r3, int * remaining_bytes);
|
||||
EXPORT_DECL(void, addr_LiWaitOneChunk, void);
|
||||
EXPORT_DECL(void, addr_sgIsLoadingBuffer, void);
|
||||
EXPORT_DECL(void, addr_gDynloadInitialized, void);
|
||||
|
||||
void InitOSFunctionPointers(void)
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Kernel function addresses
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(void, addr_PrepareTitle_hook, void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Other function addresses
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(void, DCInvalidateRange, void *buffer, uint32_t length);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Energy Saver functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//Burn-in Reduction
|
||||
EXPORT_DECL(int, IMEnableDim,void);
|
||||
EXPORT_DECL(int, IMDisableDim,void);
|
||||
EXPORT_DECL(int, IMIsDimEnabled,int * result);
|
||||
//Auto power down
|
||||
EXPORT_DECL(int, IMEnableAPD,void);
|
||||
EXPORT_DECL(int, IMDisableAPD,void);
|
||||
EXPORT_DECL(int, IMIsAPDEnabled,int * result);
|
||||
EXPORT_DECL(int, IMIsAPDEnabledBySysSettings,int * result);
|
||||
|
||||
void InitAcquireOS(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Lib handle functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_FUNC_WRITE(OSDynLoad_Acquire, (int (*)(const char*, unsigned *))OS_SPECIFICS->addr_OSDynLoad_Acquire);
|
||||
EXPORT_FUNC_WRITE(OSDynLoad_FindExport, (int (*)(u32, int, const char *, void *))OS_SPECIFICS->addr_OSDynLoad_FindExport);
|
||||
|
||||
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
|
||||
}
|
||||
|
||||
void InitOSFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
|
||||
InitAcquireOS();
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Security functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OS_FIND_EXPORT(coreinit_handle, OSGetSecurityLevel);
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! System functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OS_FIND_EXPORT(coreinit_handle, OSFatal);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSGetTitleID);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSGetArgcArgv);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSSetExceptionCallback);
|
||||
OS_FIND_EXPORT(coreinit_handle, DCFlushRange);
|
||||
OS_FIND_EXPORT(coreinit_handle, ICInvalidateRange);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSEffectiveToPhysical);
|
||||
OS_FIND_EXPORT(coreinit_handle, __os_snprintf);
|
||||
OS_FIND_EXPORT(coreinit_handle, __gh_errno_ptr);
|
||||
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "_Exit", &__Exit);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, OSScreenInit);
|
||||
@ -139,6 +196,9 @@ void InitOSFunctionPointers(void)
|
||||
OS_FIND_EXPORT(coreinit_handle, OSDetachThread);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSSleepTicks);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSGetTick);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSGetTime);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSTicksToCalendarTime);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Mutex functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@ -146,6 +206,12 @@ void InitOSFunctionPointers(void)
|
||||
OS_FIND_EXPORT(coreinit_handle, OSLockMutex);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSUnlockMutex);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSTryLockMutex);
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! MCP functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OS_FIND_EXPORT(coreinit_handle, MCP_Open);
|
||||
OS_FIND_EXPORT(coreinit_handle, MCP_Close);
|
||||
OS_FIND_EXPORT(coreinit_handle, MCP_GetOwnTitleInfo);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Memory functions
|
||||
@ -154,6 +220,7 @@ void InitOSFunctionPointers(void)
|
||||
OSDynLoad_FindExport(coreinit_handle, 1, "MEMAllocFromDefaultHeap", &pMEMAllocFromDefaultHeap);
|
||||
OSDynLoad_FindExport(coreinit_handle, 1, "MEMFreeToDefaultHeap", &pMEMFreeToDefaultHeap);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMGetSizeForMBlockExpHeap);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMGetBaseHeapHandle);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMGetAllocatableSizeForFrmHeapEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMAllocFromFrmHeapEx);
|
||||
@ -162,5 +229,100 @@ void InitOSFunctionPointers(void)
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMCreateExpHeapEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMDestroyExpHeap);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMFreeToExpHeap);
|
||||
}
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Other function addresses
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OS_FIND_EXPORT(coreinit_handle, DCInvalidateRange);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Energy Saver functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//Burn-in Reduction
|
||||
OS_FIND_EXPORT(coreinit_handle, IMEnableDim);
|
||||
OS_FIND_EXPORT(coreinit_handle, IMDisableDim);
|
||||
OS_FIND_EXPORT(coreinit_handle, IMIsDimEnabled);
|
||||
//Auto power down
|
||||
OS_FIND_EXPORT(coreinit_handle, IMEnableAPD);
|
||||
OS_FIND_EXPORT(coreinit_handle, IMDisableAPD);
|
||||
OS_FIND_EXPORT(coreinit_handle, IMIsAPDEnabled);
|
||||
OS_FIND_EXPORT(coreinit_handle, IMIsAPDEnabledBySysSettings);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Special non library functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if(OS_FIRMWARE == 532 || OS_FIRMWARE == 540)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100FFA4); // loader.elf
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100FE90); // loader.elf
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007EC); // loader.elf
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF18558); // kernel.elf
|
||||
|
||||
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19D00); // loader.elf
|
||||
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13C3C); // loader.elf
|
||||
}
|
||||
else if(OS_FIRMWARE == 500 || OS_FIRMWARE == 510)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100FBC4);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100FAB0);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007EC);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF18534);
|
||||
|
||||
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19D00);
|
||||
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13C3C);
|
||||
}
|
||||
else if(OS_FIRMWARE == 410)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100F78C);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100F678);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007F8);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF166DC);
|
||||
|
||||
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19CC0);
|
||||
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13BFC);
|
||||
}
|
||||
else if(OS_FIRMWARE == 400) //same for 402 and 403
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100F78C);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100F678);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007F8);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15E70);
|
||||
|
||||
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19CC0);
|
||||
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13BFC);
|
||||
}
|
||||
else if(OS_FIRMWARE == 550)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x01010180);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0101006C);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x0100080C);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF184E4);
|
||||
|
||||
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19E80);
|
||||
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13DBC);
|
||||
}
|
||||
else if(OS_FIRMWARE == 310)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100C4E4);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100C3D4);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010004D8);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15A0C);
|
||||
|
||||
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19340);
|
||||
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE1329C);
|
||||
}
|
||||
else if(OS_FIRMWARE == 300)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100C4E4);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100C3D4);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010004D8);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15974);
|
||||
|
||||
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19340);
|
||||
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE1329C);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSFatal("Missing all OS specific addresses.");
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include <gctypes.h>
|
||||
#include "common/os_defs.h"
|
||||
#include "os_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -33,10 +34,8 @@ extern "C" {
|
||||
|
||||
#define BUS_SPEED 248625000
|
||||
//#define SECS_TO_TICKS(sec) (((unsigned long long)(sec)) * (BUS_SPEED/4))
|
||||
#define SECS_TO_TICKS(sec) sec
|
||||
#define MILLISECS_TO_TICKS(msec) (SECS_TO_TICKS(msec) / 1000)
|
||||
//#define MILLISECS_TO_TICKS(msec) (SECS_TO_TICKS(msec) / 1000)
|
||||
//#define MICROSECS_TO_TICKS(usec) (SECS_TO_TICKS(usec) / 1000000)
|
||||
#define MICROSECS_TO_TICKS(usec) usec
|
||||
|
||||
//#define usleep(usecs) OSSleepTicks(MICROSECS_TO_TICKS(usecs))
|
||||
//#define sleep(secs) OSSleepTicks(SECS_TO_TICKS(secs))
|
||||
@ -68,6 +67,7 @@ extern "C" {
|
||||
/* Handle for coreinit */
|
||||
extern unsigned int coreinit_handle;
|
||||
void InitOSFunctionPointers(void);
|
||||
void InitAcquireOS(void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Lib handle functions
|
||||
@ -75,6 +75,11 @@ void InitOSFunctionPointers(void);
|
||||
extern int (* OSDynLoad_Acquire)(const char* rpl, u32 *handle);
|
||||
extern int (* OSDynLoad_FindExport)(u32 handle, int isdata, const char *symbol, void *address);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Security functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int (* OSGetSecurityLevel)(void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Thread functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@ -88,6 +93,8 @@ extern int (* OSSetThreadPriority)(void * thread, int priority);
|
||||
extern void (* OSDetachThread)(void * thread);
|
||||
extern void (* OSSleepTicks)(u64 ticks);
|
||||
extern u64 (* OSGetTick)(void);
|
||||
extern u64 (* OSGetTime)(void);
|
||||
extern void (*OSTicksToCalendarTime)(u64 time, OSCalendarTime *calendarTime);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Mutex functions
|
||||
@ -101,12 +108,14 @@ extern int (* OSTryLockMutex)(void* mutex);
|
||||
//! System functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern u64 (* OSGetTitleID)(void);
|
||||
extern void (* OSGetArgcArgv)(int* argc, char*** argv);
|
||||
extern void (* __Exit)(void);
|
||||
extern void (* OSFatal)(const char* msg);
|
||||
extern void (* DCFlushRange)(const void *addr, u32 length);
|
||||
extern void (* ICInvalidateRange)(const void *addr, u32 length);
|
||||
extern void* (* OSEffectiveToPhysical)(const void*);
|
||||
extern int (* __os_snprintf)(char* s, int n, const char * format, ...);
|
||||
extern int * (* __gh_errno_ptr)(void);
|
||||
|
||||
extern void (*OSScreenInit)(void);
|
||||
extern unsigned int (*OSScreenGetBufferSizeEx)(unsigned int bufferNum);
|
||||
@ -119,9 +128,44 @@ extern int (*OSScreenEnableEx)(unsigned int bufferNum, int enable);
|
||||
typedef unsigned char (*exception_callback)(void * interruptedContext);
|
||||
extern void (* OSSetExceptionCallback)(u8 exceptionType, exception_callback newCallback);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! MCP functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int (* MCP_Open)(void);
|
||||
extern int (* MCP_Close)(int handle);
|
||||
extern int (* MCP_GetOwnTitleInfo)(int handle, void * data);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! LOADER functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int (* LiWaitIopComplete)(int unknown_syscall_arg_r3, int * remaining_bytes);
|
||||
extern int (* LiWaitIopCompleteWithInterrupts)(int unknown_syscall_arg_r3, int * remaining_bytes);
|
||||
extern void (* addr_LiWaitOneChunk)(void);
|
||||
extern void (* addr_sgIsLoadingBuffer)(void);
|
||||
extern void (* addr_gDynloadInitialized)(void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Kernel function addresses
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern void (* addr_PrepareTitle_hook)(void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Other function addresses
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern void (*DCInvalidateRange)(void *buffer, uint32_t length);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Energy Saver functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
////Burn-in Reduction
|
||||
extern int (*IMEnableDim)(void);
|
||||
extern int (*IMDisableDim)(void);
|
||||
extern int (*IMIsDimEnabled)(int * result);
|
||||
//Auto power down
|
||||
extern int (*IMEnableAPD)(void);
|
||||
extern int (*IMDisableAPD)(void);
|
||||
extern int (*IMIsAPDEnabled)(int * result);
|
||||
extern int (*IMIsAPDEnabledBySysSettings)(int * result);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
27
wiiu/dynamic_libs/os_types.h
Normal file
27
wiiu/dynamic_libs/os_types.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef _OS_TYPES_H_
|
||||
#define _OS_TYPES_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
typedef struct _OSCalendarTime {
|
||||
int sec;
|
||||
int min;
|
||||
int hour;
|
||||
int mday;
|
||||
int mon;
|
||||
int year;
|
||||
int wday;
|
||||
int yday;
|
||||
int msec;
|
||||
int usec;
|
||||
} OSCalendarTime;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -24,27 +24,38 @@
|
||||
#include "os_functions.h"
|
||||
#include "padscore_functions.h"
|
||||
|
||||
unsigned int padscore_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(void, KPADInit, void);
|
||||
EXPORT_DECL(void, WPADInit, void);
|
||||
EXPORT_DECL(s32, WPADProbe, s32 chan, u32 * pad_type);
|
||||
EXPORT_DECL(s32, WPADSetDataFormat, s32 chan, s32 format);
|
||||
EXPORT_DECL(void, WPADEnableURCC, s32 enable);
|
||||
EXPORT_DECL(void, WPADRead, s32 chan, void * data);
|
||||
EXPORT_DECL(s32, KPADRead, s32 chan, void * data, u32 size);
|
||||
EXPORT_DECL(void,WPADSetAutoSleepTime,u8 minute);
|
||||
EXPORT_DECL(void,WPADDisconnect,s32 chan);
|
||||
|
||||
void InitAcquirePadScore(void)
|
||||
{
|
||||
OSDynLoad_Acquire("padscore.rpl", &padscore_handle);
|
||||
}
|
||||
|
||||
void InitPadScoreFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int padscore_handle;
|
||||
OSDynLoad_Acquire("padscore.rpl", &padscore_handle);
|
||||
InitAcquirePadScore();
|
||||
|
||||
OS_FIND_EXPORT(padscore_handle, WPADInit);
|
||||
OS_FIND_EXPORT(padscore_handle, KPADInit);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADProbe);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADSetDataFormat);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADEnableURCC);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADRead);
|
||||
OS_FIND_EXPORT(padscore_handle, KPADRead);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADSetAutoSleepTime);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADDisconnect);
|
||||
|
||||
KPADInit();
|
||||
WPADEnableURCC(1);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "dynamic_libs/vpad_functions.h"
|
||||
|
||||
extern unsigned int padscore_handle;
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define WPAD_BUTTON_LEFT 0x0001
|
||||
@ -60,8 +64,34 @@ extern "C" {
|
||||
#define WPAD_CLASSIC_BUTTON_DOWN 0x4000
|
||||
#define WPAD_CLASSIC_BUTTON_RIGHT 0x8000
|
||||
|
||||
void InitPadScoreFunctionPointers(void);
|
||||
#define WPAD_PRO_BUTTON_UP 0x00000001
|
||||
#define WPAD_PRO_BUTTON_LEFT 0x00000002
|
||||
#define WPAD_PRO_TRIGGER_ZR 0x00000004
|
||||
#define WPAD_PRO_BUTTON_X 0x00000008
|
||||
#define WPAD_PRO_BUTTON_A 0x00000010
|
||||
#define WPAD_PRO_BUTTON_Y 0x00000020
|
||||
#define WPAD_PRO_BUTTON_B 0x00000040
|
||||
#define WPAD_PRO_TRIGGER_ZL 0x00000080
|
||||
#define WPAD_PRO_RESERVED 0x00000100
|
||||
#define WPAD_PRO_TRIGGER_R 0x00000200
|
||||
#define WPAD_PRO_BUTTON_PLUS 0x00000400
|
||||
#define WPAD_PRO_BUTTON_HOME 0x00000800
|
||||
#define WPAD_PRO_BUTTON_MINUS 0x00001000
|
||||
#define WPAD_PRO_TRIGGER_L 0x00002000
|
||||
#define WPAD_PRO_BUTTON_DOWN 0x00004000
|
||||
#define WPAD_PRO_BUTTON_RIGHT 0x00008000
|
||||
#define WPAD_PRO_BUTTON_STICK_R 0x00010000
|
||||
#define WPAD_PRO_BUTTON_STICK_L 0x00020000
|
||||
|
||||
#define WPAD_PRO_STICK_L_EMULATION_UP 0x00200000
|
||||
#define WPAD_PRO_STICK_L_EMULATION_DOWN 0x00100000
|
||||
#define WPAD_PRO_STICK_L_EMULATION_LEFT 0x00040000
|
||||
#define WPAD_PRO_STICK_L_EMULATION_RIGHT 0x00080000
|
||||
|
||||
#define WPAD_PRO_STICK_R_EMULATION_UP 0x02000000
|
||||
#define WPAD_PRO_STICK_R_EMULATION_DOWN 0x01000000
|
||||
#define WPAD_PRO_STICK_R_EMULATION_LEFT 0x00400000
|
||||
#define WPAD_PRO_STICK_R_EMULATION_RIGHT 0x00800000
|
||||
|
||||
typedef struct _KPADData
|
||||
{
|
||||
@ -78,7 +108,7 @@ typedef struct _KPADData
|
||||
u8 device_type;
|
||||
u8 wpad_error;
|
||||
u8 pos_valid;
|
||||
u8 unused_4[1];
|
||||
u8 format;
|
||||
|
||||
union
|
||||
{
|
||||
@ -101,19 +131,38 @@ typedef struct _KPADData
|
||||
f32 rtrigger;
|
||||
} classic;
|
||||
|
||||
struct
|
||||
{
|
||||
u32 btns_h;
|
||||
u32 btns_d;
|
||||
u32 btns_r;
|
||||
f32 lstick_x;
|
||||
f32 lstick_y;
|
||||
f32 rstick_x;
|
||||
f32 rstick_y;
|
||||
int charging;
|
||||
int wired;
|
||||
} pro;
|
||||
|
||||
u32 unused_6[20];
|
||||
};
|
||||
u32 unused_7[16];
|
||||
} KPADData;
|
||||
void InitPadScoreFunctionPointers(void);
|
||||
void InitAcquirePadScore(void);
|
||||
|
||||
typedef void (* wpad_connect_callback_t)(s32 chan, s32 status);
|
||||
|
||||
extern void (* KPADInit)(void);
|
||||
extern void (* WPADInit)(void);
|
||||
extern s32 (* WPADProbe)(s32 chan, u32 * pad_type);
|
||||
extern s32 (* WPADSetDataFormat)(s32 chan, s32 format);
|
||||
extern void (* WPADEnableURCC)(s32 enable);
|
||||
extern void (* WPADRead)(s32 chan, void * data);
|
||||
extern s32 (* KPADRead)(s32 chan, void * data, u32 size);
|
||||
extern s32 (* KPADReadEx)(s32 chan, KPADData * data, u32 size, s32 *error);
|
||||
extern void (*WPADSetAutoSleepTime)(u8 time);
|
||||
extern void (*WPADDisconnect)( s32 chan );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
u32 hostIpAddress = 0;
|
||||
|
||||
unsigned int nsysnet_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(void, socket_lib_init, void);
|
||||
EXPORT_DECL(int, socket, int domain, int type, int protocol);
|
||||
EXPORT_DECL(int, socketclose, int s);
|
||||
@ -35,27 +37,26 @@ EXPORT_DECL(int, listen, s32 s,u32 backlog);
|
||||
EXPORT_DECL(int, accept, s32 s,struct sockaddr *addr,s32 *addrlen);
|
||||
EXPORT_DECL(int, send, int s, const void *buffer, int size, int flags);
|
||||
EXPORT_DECL(int, recv, int s, void *buffer, int size, int flags);
|
||||
EXPORT_DECL(int, recvfrom,int sockfd, void *buf, int len, int flags,struct sockaddr *src_addr, int *addrlen);
|
||||
EXPORT_DECL(int, sendto, int s, const void *buffer, int size, int flags, const struct sockaddr *dest, int dest_len);
|
||||
EXPORT_DECL(int, setsockopt, int s, int level, int optname, void *optval, int optlen);
|
||||
EXPORT_DECL(char *, inet_ntoa, struct in_addr in);
|
||||
EXPORT_DECL(int, inet_aton, const char *cp, struct in_addr *inp);
|
||||
|
||||
EXPORT_DECL(int, NSSLWrite, int connection, const void* buf, int len,int * written);
|
||||
EXPORT_DECL(int, NSSLRead, int connection, const void* buf, int len,int * read);
|
||||
EXPORT_DECL(int, NSSLCreateConnection, int context, const char* host, int hotlen,int options,int sock,int block);
|
||||
|
||||
void InitAcquireSocket(void)
|
||||
{
|
||||
OSDynLoad_Acquire("nsysnet.rpl", &nsysnet_handle);
|
||||
}
|
||||
|
||||
void InitSocketFunctionPointers(void)
|
||||
{
|
||||
unsigned int nsysnet_handle;
|
||||
unsigned int *funcPointer = 0;
|
||||
OSDynLoad_Acquire("nsysnet.rpl", &nsysnet_handle);
|
||||
|
||||
unsigned int nn_ac_handle;
|
||||
int(*ACInitialize)();
|
||||
int(*ACGetStartupId) (unsigned int *id);
|
||||
int(*ACConnectWithConfigId) (unsigned int id);
|
||||
int(*ACGetAssignedAddress) (u32 * ip);
|
||||
OSDynLoad_Acquire("nn_ac.rpl", &nn_ac_handle);
|
||||
OSDynLoad_FindExport(nn_ac_handle, 0, "ACInitialize", &ACInitialize);
|
||||
OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetStartupId", &ACGetStartupId);
|
||||
OSDynLoad_FindExport(nn_ac_handle, 0, "ACConnectWithConfigId",&ACConnectWithConfigId);
|
||||
OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetAssignedAddress",&ACGetAssignedAddress);
|
||||
InitAcquireSocket();
|
||||
|
||||
OS_FIND_EXPORT(nsysnet_handle, socket_lib_init);
|
||||
OS_FIND_EXPORT(nsysnet_handle, socket);
|
||||
@ -66,17 +67,15 @@ void InitSocketFunctionPointers(void)
|
||||
OS_FIND_EXPORT(nsysnet_handle, accept);
|
||||
OS_FIND_EXPORT(nsysnet_handle, send);
|
||||
OS_FIND_EXPORT(nsysnet_handle, recv);
|
||||
OS_FIND_EXPORT(nsysnet_handle, recvfrom);
|
||||
OS_FIND_EXPORT(nsysnet_handle, sendto);
|
||||
OS_FIND_EXPORT(nsysnet_handle, setsockopt);
|
||||
OS_FIND_EXPORT(nsysnet_handle, inet_ntoa);
|
||||
OS_FIND_EXPORT(nsysnet_handle, inet_aton);
|
||||
|
||||
unsigned int nn_startupid;
|
||||
ACInitialize();
|
||||
ACGetStartupId(&nn_startupid);
|
||||
ACConnectWithConfigId(nn_startupid);
|
||||
ACGetAssignedAddress(&hostIpAddress);
|
||||
OS_FIND_EXPORT(nsysnet_handle, NSSLWrite);
|
||||
OS_FIND_EXPORT(nsysnet_handle, NSSLRead);
|
||||
OS_FIND_EXPORT(nsysnet_handle, NSSLCreateConnection);
|
||||
|
||||
socket_lib_init();
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern unsigned int nsysnet_handle;
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define INADDR_ANY 0
|
||||
@ -47,6 +49,10 @@ extern "C" {
|
||||
#define SO_REUSEADDR 0x0004
|
||||
#define SO_NONBLOCK 0x1016
|
||||
#define SO_MYADDR 0x1013
|
||||
#define SO_RCVTIMEO 0x1006
|
||||
|
||||
#define SOL_SOCKET -1
|
||||
#define MSG_DONTWAIT 32
|
||||
|
||||
#define htonl(x) x
|
||||
#define htons(x) x
|
||||
@ -72,6 +78,7 @@ struct sockaddr
|
||||
|
||||
|
||||
void InitSocketFunctionPointers(void);
|
||||
void InitAcquireSocket(void);
|
||||
|
||||
extern void (*socket_lib_init)(void);
|
||||
extern int (*socket)(int domain, int type, int protocol);
|
||||
@ -82,9 +89,15 @@ extern int (*listen)(s32 s,u32 backlog);
|
||||
extern int (*accept)(s32 s,struct sockaddr *addr,s32 *addrlen);
|
||||
extern int (*send)(int s, const void *buffer, int size, int flags);
|
||||
extern int (*recv)(int s, void *buffer, int size, int flags);
|
||||
extern int (*recvfrom)(int sockfd, void *buf, int len, int flags,struct sockaddr *src_addr, int *addrlen);
|
||||
|
||||
extern int (*sendto)(int s, const void *buffer, int size, int flags, const struct sockaddr *dest, int dest_len);
|
||||
extern int (*setsockopt)(int s, int level, int optname, void *optval, int optlen);
|
||||
|
||||
extern int (* NSSLWrite)(int connection, const void* buf, int len,int * written);
|
||||
extern int (* NSSLRead)(int connection, const void* buf, int len,int * read);
|
||||
extern int (* NSSLCreateConnection)(int context, const char* host, int hotlen,int options,int sock,int block);
|
||||
|
||||
extern char * (*inet_ntoa)(struct in_addr in);
|
||||
extern int (*inet_aton)(const char *cp, struct in_addr *inp);
|
||||
|
||||
|
@ -23,18 +23,27 @@
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
|
||||
EXPORT_DECL(void, _SYSLaunchTitleByPathFromLauncher, const char* path, int len, int zero);
|
||||
EXPORT_DECL(int, SYSRelaunchTitle, int argc, char* argv);
|
||||
unsigned int sysapp_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(int, _SYSLaunchTitleByPathFromLauncher, const char* path, int len, int zero);
|
||||
EXPORT_DECL(int, SYSRelaunchTitle, int argc, char** argv);
|
||||
EXPORT_DECL(int, SYSLaunchMenu, void);
|
||||
EXPORT_DECL(int, SYSCheckTitleExists, u64 titleId);
|
||||
EXPORT_DECL(int, SYSLaunchTitle, u64 titleId);
|
||||
|
||||
void InitAcquireSys(void)
|
||||
{
|
||||
OSDynLoad_Acquire("sysapp.rpl", &sysapp_handle);
|
||||
}
|
||||
|
||||
void InitSysFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int sysapp_handle;
|
||||
OSDynLoad_Acquire("sysapp.rpl", &sysapp_handle);
|
||||
InitAcquireSys();
|
||||
|
||||
OS_FIND_EXPORT(sysapp_handle, _SYSLaunchTitleByPathFromLauncher);
|
||||
OS_FIND_EXPORT(sysapp_handle, SYSRelaunchTitle);
|
||||
OS_FIND_EXPORT(sysapp_handle, SYSLaunchMenu);
|
||||
OS_FIND_EXPORT(sysapp_handle, SYSCheckTitleExists);
|
||||
OS_FIND_EXPORT(sysapp_handle, SYSLaunchTitle);
|
||||
}
|
||||
|
||||
|
@ -28,11 +28,16 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void InitSysFunctionPointers(void);
|
||||
extern unsigned int sysapp_handle;
|
||||
|
||||
extern void(*_SYSLaunchTitleByPathFromLauncher)(const char* path, int len, int zero);
|
||||
extern int (* SYSRelaunchTitle)(int argc, char* argv);
|
||||
void InitSysFunctionPointers(void);
|
||||
void InitAcquireSys(void);
|
||||
|
||||
extern int(*_SYSLaunchTitleByPathFromLauncher)(const char* path, int len, int zero);
|
||||
extern int (* SYSRelaunchTitle)(int argc, char** argv);
|
||||
extern int (* SYSLaunchMenu)(void);
|
||||
extern int (* SYSCheckTitleExists)(u64 titleId);
|
||||
extern int (* SYSLaunchTitle)(u64 titleId);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
78
wiiu/dynamic_libs/syshid_functions.c
Normal file
78
wiiu/dynamic_libs/syshid_functions.c
Normal file
@ -0,0 +1,78 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "syshid_functions.h"
|
||||
|
||||
unsigned int syshid_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(int, HIDSetup,void);
|
||||
EXPORT_DECL(int, HIDTeardown,void);
|
||||
|
||||
EXPORT_DECL(int, HIDAddClient,HIDClient *p_client, HIDAttachCallback attach_callback);
|
||||
EXPORT_DECL(int, HIDDelClient,HIDClient *p_client);
|
||||
|
||||
EXPORT_DECL(int, HIDGetDescriptor,unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
|
||||
EXPORT_DECL(int, HIDSetDescriptor,unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
|
||||
|
||||
EXPORT_DECL(int, HIDSetProtocol,unsigned int handle,u8 interface_index,u8 protocol, HIDCallback hc, void *p_user);
|
||||
EXPORT_DECL(int, HIDGetProtocol,unsigned int handle,u8 interface_index,u8 * protocol, HIDCallback hc, void *p_user);
|
||||
|
||||
EXPORT_DECL(int, HIDGetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
|
||||
EXPORT_DECL(int, HIDSetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
|
||||
|
||||
EXPORT_DECL(int, HIDSetIdle,unsigned int handle, u8 interface_index,u8 duration, HIDCallback hc, void *p_user);
|
||||
|
||||
EXPORT_DECL(int, HIDRead,unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
|
||||
EXPORT_DECL(int, HIDWrite,unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
|
||||
|
||||
void InitAcquireSysHID(void)
|
||||
{
|
||||
OSDynLoad_Acquire("nsyshid.rpl", &syshid_handle);
|
||||
}
|
||||
|
||||
void InitSysHIDFunctionPointers(void)
|
||||
{
|
||||
InitAcquireSysHID();
|
||||
|
||||
if(syshid_handle == 0){
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int funcPointer = 0;
|
||||
|
||||
//! assigning those is not mandatory and it does not always work to load them
|
||||
OS_FIND_EXPORT(syshid_handle, HIDSetup);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDTeardown);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDAddClient);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDDelClient);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDGetDescriptor);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDSetDescriptor);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDRead);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDWrite);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDSetProtocol);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDGetProtocol);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDSetIdle);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDGetReport);
|
||||
OS_FIND_EXPORT(syshid_handle, HIDSetReport);
|
||||
}
|
90
wiiu/dynamic_libs/syshid_functions.h
Normal file
90
wiiu/dynamic_libs/syshid_functions.h
Normal file
@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __SYSHID_FUNCTIONS_H_
|
||||
#define __SYSHID_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern unsigned int syshid_handle;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int handle;
|
||||
unsigned int physical_device_inst;
|
||||
unsigned short vid;
|
||||
unsigned short pid;
|
||||
unsigned char interface_index;
|
||||
unsigned char sub_class;
|
||||
unsigned char protocol;
|
||||
|
||||
unsigned short max_packet_size_rx;
|
||||
unsigned short max_packet_size_tx;
|
||||
|
||||
} HIDDevice;
|
||||
|
||||
typedef struct _HIDClient HIDClient;
|
||||
|
||||
#define HID_DEVICE_DETACH 0
|
||||
#define HID_DEVICE_ATTACH 1
|
||||
|
||||
typedef int (*HIDAttachCallback)(HIDClient *p_hc,HIDDevice *p_hd,unsigned int attach);
|
||||
|
||||
struct _HIDClient
|
||||
{
|
||||
HIDClient *next;
|
||||
HIDAttachCallback attach_cb;
|
||||
};
|
||||
|
||||
typedef void (*HIDCallback)(unsigned int handle,int error,unsigned char *p_buffer,unsigned int bytes_transferred,void *p_user);
|
||||
|
||||
void InitSysHIDFunctionPointers(void);
|
||||
void InitAcquireSysHID(void);
|
||||
|
||||
extern int(*HIDSetup)(void);
|
||||
extern int(*HIDTeardown)(void);
|
||||
|
||||
extern int(*HIDAddClient)(HIDClient *p_client, HIDAttachCallback attach_callback);
|
||||
extern int(*HIDDelClient)(HIDClient *p_client);
|
||||
|
||||
extern int(*HIDGetDescriptor)(unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
|
||||
extern int(*HIDSetDescriptor)(unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
|
||||
|
||||
extern int(*HIDGetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
|
||||
extern int(*HIDSetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
|
||||
|
||||
extern int(*HIDSetIdle)(unsigned int handle, u8 interface_index,u8 duration, HIDCallback hc, void *p_user);
|
||||
|
||||
extern int(* HIDSetProtocol)(unsigned int handle,u8 interface_index,u8 protocol, HIDCallback hc, void *p_user);
|
||||
extern int(* HIDGetProtocol)(unsigned int handle,u8 interface_index,u8 * protocol, HIDCallback hc, void *p_user);
|
||||
|
||||
extern int(*HIDRead)(unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
|
||||
extern int(*HIDWrite)(unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __SYSHID_FUNCTIONS_H_
|
@ -24,16 +24,32 @@
|
||||
#include "os_functions.h"
|
||||
#include "vpad_functions.h"
|
||||
|
||||
unsigned int vpad_handle __attribute__((section(".data"))) = 0;
|
||||
unsigned int vpadbase_handle __attribute__((section(".data"))) = 0;
|
||||
|
||||
EXPORT_DECL(void, VPADInit, void);
|
||||
EXPORT_DECL(void, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error);
|
||||
EXPORT_DECL(int, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error);
|
||||
EXPORT_DECL(int, VPADGetLcdMode, int padnum, int *lcdmode);
|
||||
EXPORT_DECL(int, VPADSetLcdMode, int padnum, int lcdmode);
|
||||
EXPORT_DECL(int, VPADBASEGetMotorOnRemainingCount, int padnum);
|
||||
EXPORT_DECL(int, VPADBASESetMotorOnRemainingCount, int padnum, int counter);
|
||||
|
||||
void InitAcquireVPad(void)
|
||||
{
|
||||
OSDynLoad_Acquire("vpad.rpl", &vpad_handle);
|
||||
OSDynLoad_Acquire("vpadbase.rpl", &vpadbase_handle);
|
||||
}
|
||||
|
||||
void InitVPadFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int vpad_handle;
|
||||
OSDynLoad_Acquire("vpad.rpl", &vpad_handle);
|
||||
|
||||
InitAcquireVPad();
|
||||
|
||||
OS_FIND_EXPORT(vpad_handle, VPADInit);
|
||||
OS_FIND_EXPORT(vpad_handle, VPADRead);
|
||||
OS_FIND_EXPORT(vpad_handle, VPADGetLcdMode);
|
||||
OS_FIND_EXPORT(vpad_handle, VPADSetLcdMode);
|
||||
OS_FIND_EXPORT(vpadbase_handle, VPADBASEGetMotorOnRemainingCount);
|
||||
OS_FIND_EXPORT(vpadbase_handle, VPADBASESetMotorOnRemainingCount);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern unsigned int vpad_handle;
|
||||
extern unsigned int vpadbase_handle;
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define VPAD_BUTTON_A 0x8000
|
||||
@ -50,16 +53,20 @@ extern "C" {
|
||||
#define VPAD_BUTTON_STICK_L 0x00040000
|
||||
#define VPAD_BUTTON_TV 0x00010000
|
||||
|
||||
#define VPAD_STICK_R_EMULATION_LEFT 0x04000000
|
||||
#define VPAD_STICK_R_EMULATION_RIGHT 0x02000000
|
||||
#define VPAD_STICK_R_EMULATION_UP 0x01000000
|
||||
#define VPAD_STICK_R_EMULATION_DOWN 0x00800000
|
||||
#define VPAD_STICK_R_EMULATION_LEFT 0x04000000
|
||||
#define VPAD_STICK_R_EMULATION_RIGHT 0x02000000
|
||||
#define VPAD_STICK_R_EMULATION_UP 0x01000000
|
||||
#define VPAD_STICK_R_EMULATION_DOWN 0x00800000
|
||||
|
||||
#define VPAD_STICK_L_EMULATION_LEFT 0x40000000
|
||||
#define VPAD_STICK_L_EMULATION_RIGHT 0x20000000
|
||||
#define VPAD_STICK_L_EMULATION_UP 0x10000000
|
||||
#define VPAD_STICK_L_EMULATION_DOWN 0x08000000
|
||||
#define VPAD_STICK_L_EMULATION_LEFT 0x40000000
|
||||
#define VPAD_STICK_L_EMULATION_RIGHT 0x20000000
|
||||
#define VPAD_STICK_L_EMULATION_UP 0x10000000
|
||||
#define VPAD_STICK_L_EMULATION_DOWN 0x08000000
|
||||
|
||||
//! Own definitions
|
||||
#define VPAD_BUTTON_TOUCH 0x00080000
|
||||
#define VPAD_MASK_EMULATED_STICKS 0x7F800000
|
||||
#define VPAD_MASK_BUTTONS ~VPAD_MASK_EMULATED_STICKS
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -91,9 +98,14 @@ typedef struct
|
||||
} VPADData;
|
||||
|
||||
void InitVPadFunctionPointers(void);
|
||||
void InitAcquireVPad(void);
|
||||
|
||||
extern int (* VPADRead)(int chan, VPADData *buffer, u32 buffer_size, s32 *error);
|
||||
extern int (* VPADGetLcdMode)(int padnum, int *lcdmode);
|
||||
extern int (* VPADSetLcdMode)(int padnum, int lcdmode);
|
||||
extern void (* VPADInit)(void);
|
||||
extern void (* VPADRead)(int chan, VPADData *buffer, u32 buffer_size, s32 *error);
|
||||
extern int (* VPADBASEGetMotorOnRemainingCount)(int lcdmode);
|
||||
extern int (* VPADBASESetMotorOnRemainingCount)(int lcdmode,int counter);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include "common/fs_defs.h"
|
||||
#include "dynamic_libs/fs_functions.h"
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user