RetroArch/dingux/dingux_utils.h

116 lines
3.7 KiB
C
Raw Normal View History

2020-10-01 14:54:11 +00:00
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2019-2020 - James Leaver
*
* 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.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _DINGUX_UTILS_H
#define _DINGUX_UTILS_H
#include <retro_common_api.h>
#include <libretro.h>
#include <boolean.h>
2022-05-06 15:28:39 +00:00
#include <frontend/frontend_driver.h>
2020-10-01 14:54:11 +00:00
RETRO_BEGIN_DECLS
/* Specifies all possible image filtering
* methods when using the IPU hardware scaler
* > Note: We do not allow 'fine tuning' of the
* bicubic sharpness factor, since anything
* other than the default value looks terrible... */
enum dingux_ipu_filter_type
{
DINGUX_IPU_FILTER_BICUBIC = 0,
DINGUX_IPU_FILTER_BILINEAR,
DINGUX_IPU_FILTER_NEAREST,
DINGUX_IPU_FILTER_LAST
};
2021-04-06 13:02:40 +00:00
#if defined(DINGUX_BETA)
/* Specifies all video refresh rates supported
* by OpenDingux Beta */
enum dingux_refresh_rate
{
DINGUX_REFRESH_RATE_60HZ = 0,
DINGUX_REFRESH_RATE_50HZ,
DINGUX_REFRESH_RATE_LAST
};
#endif
2020-10-01 14:54:11 +00:00
/* Enables/disables downscaling when using
* the IPU hardware scaler */
bool dingux_ipu_set_downscaling_enable(bool enable);
2021-03-23 12:46:25 +00:00
/* Sets the video scaling mode when using the
* IPU hardware scaler
* - keep_aspect: When 'true', aspect ratio correction
* (1:1 PAR) is applied. When 'false', image is
* stretched to full screen dimensions
* - integer_scale: When 'true', enables integer
* scaling. This implicitly sets keep_aspect to
* 'true' (since integer scaling is by definition
* 1:1 PAR)
* Note: OpenDingux stock firmware allows keep_aspect
* and integer_scale to be set independently, hence
* separate boolean values. OpenDingux beta properly
* groups the settings into a single scaling type
* parameter. When supporting both firmwares, it would
* be cleaner to refactor this function to accept one
* enum rather than 2 booleans - but this would break
* users' existing configs, so we maintain the old
* format... */
bool dingux_ipu_set_scaling_mode(bool keep_aspect, bool integer_scale);
/* Sets the image filtering method when
* using the IPU hardware scaler */
bool dingux_ipu_set_filter_type(enum dingux_ipu_filter_type filter_type);
2021-04-06 13:02:40 +00:00
#if defined(DINGUX_BETA)
/* Sets the refresh rate of the integral LCD panel.
* If specified value is invalid, will set refresh
* rate to 60 Hz.
* Returns a floating point representation of the
* resultant hardware refresh rate. In the event
* that a refresh rate cannot be set (i.e. hardware
* error), returns 0.0 */
float dingux_set_video_refresh_rate(enum dingux_refresh_rate refresh_rate);
/* Gets the currently set refresh rate of the
* integral LCD panel.
* Returns false if hardware is in an undefined
* state. */
bool dingux_get_video_refresh_rate(enum dingux_refresh_rate *refresh_rate);
#endif
2021-03-23 12:46:25 +00:00
/* Resets the IPU hardware scaler to the
* default configuration */
bool dingux_ipu_reset(void);
2020-10-01 14:54:11 +00:00
/* Fetches internal battery level */
int dingux_get_battery_level(void);
2022-05-06 15:28:39 +00:00
/* Fetches internal battery level */
int retrofw_get_battery_level(enum frontend_powerstate *source);
/* Fetches the path of the base 'retroarch'
* directory */
void dingux_get_base_path(char *path, size_t len);
2020-10-01 14:54:11 +00:00
RETRO_END_DECLS
#endif