2012-04-21 21:13:50 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-01-22 12:40:32 +00:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2011-05-25 13:15:20 +00:00
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2011-05-25 13:15:20 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2011-05-25 13:15:20 +00:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 21:31:57 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2011-05-25 13:15:20 +00:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2015-01-12 15:00:13 +00:00
|
|
|
#ifndef __VIDEO_STATE_TRACKER_H
|
|
|
|
#define __VIDEO_STATE_TRACKER_H
|
2011-05-25 13:15:20 +00:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2016-06-03 03:43:49 +00:00
|
|
|
|
2014-10-21 03:05:52 +00:00
|
|
|
#include <boolean.h>
|
2016-06-03 03:43:49 +00:00
|
|
|
#include <retro_common_api.h>
|
2011-05-25 13:15:20 +00:00
|
|
|
|
2016-06-03 03:43:49 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
|
|
|
|
2012-04-07 10:17:40 +00:00
|
|
|
enum state_tracker_type
|
2011-05-25 13:15:20 +00:00
|
|
|
{
|
2013-04-06 09:30:56 +00:00
|
|
|
RARCH_STATE_CAPTURE = 0,
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_STATE_CAPTURE_PREV,
|
|
|
|
RARCH_STATE_TRANSITION,
|
|
|
|
RARCH_STATE_TRANSITION_COUNT,
|
2013-04-06 09:30:56 +00:00
|
|
|
RARCH_STATE_TRANSITION_PREV,
|
|
|
|
RARCH_STATE_PYTHON
|
2011-05-25 13:15:20 +00:00
|
|
|
};
|
|
|
|
|
2012-04-07 10:17:40 +00:00
|
|
|
enum state_ram_type
|
2011-05-25 13:15:20 +00:00
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_STATE_NONE,
|
|
|
|
RARCH_STATE_WRAM,
|
|
|
|
RARCH_STATE_INPUT_SLOT1,
|
|
|
|
RARCH_STATE_INPUT_SLOT2
|
2011-05-25 13:15:20 +00:00
|
|
|
};
|
|
|
|
|
2012-04-07 10:17:40 +00:00
|
|
|
struct state_tracker_uniform_info
|
2011-05-25 13:15:20 +00:00
|
|
|
{
|
2011-05-25 13:58:12 +00:00
|
|
|
char id[64];
|
2011-05-25 13:15:20 +00:00
|
|
|
uint32_t addr;
|
2012-04-07 10:17:40 +00:00
|
|
|
enum state_tracker_type type;
|
|
|
|
enum state_ram_type ram_type;
|
2012-02-12 17:05:33 +00:00
|
|
|
uint16_t mask;
|
|
|
|
uint16_t equal;
|
2011-05-25 13:15:20 +00:00
|
|
|
};
|
|
|
|
|
2012-04-07 10:17:40 +00:00
|
|
|
struct state_tracker_info
|
2011-05-25 13:15:20 +00:00
|
|
|
{
|
|
|
|
const uint8_t *wram;
|
|
|
|
|
2012-04-07 10:17:40 +00:00
|
|
|
const struct state_tracker_uniform_info *info;
|
2011-05-25 13:15:20 +00:00
|
|
|
unsigned info_elem;
|
2011-06-06 15:44:05 +00:00
|
|
|
|
|
|
|
const char *script;
|
2011-06-06 16:50:36 +00:00
|
|
|
const char *script_class;
|
2011-06-07 13:33:29 +00:00
|
|
|
bool script_is_file;
|
2011-05-25 13:15:20 +00:00
|
|
|
};
|
|
|
|
|
2012-04-07 10:17:40 +00:00
|
|
|
struct state_tracker_uniform
|
2011-05-25 13:15:20 +00:00
|
|
|
{
|
|
|
|
const char *id;
|
2011-10-26 08:26:09 +00:00
|
|
|
float value;
|
2011-05-25 13:15:20 +00:00
|
|
|
};
|
|
|
|
|
2012-04-07 10:17:40 +00:00
|
|
|
typedef struct state_tracker state_tracker_t;
|
2011-05-25 13:15:20 +00:00
|
|
|
|
2015-01-11 21:39:50 +00:00
|
|
|
/**
|
|
|
|
* state_tracker_init:
|
|
|
|
* @info : State tracker info handle.
|
|
|
|
*
|
|
|
|
* Creates and initializes graphics state tracker.
|
|
|
|
*
|
|
|
|
* Returns: new state tracker handle if successful, otherwise NULL.
|
|
|
|
**/
|
2012-04-07 10:17:40 +00:00
|
|
|
state_tracker_t* state_tracker_init(const struct state_tracker_info *info);
|
2014-09-08 15:57:18 +00:00
|
|
|
|
2015-01-11 21:39:50 +00:00
|
|
|
/**
|
|
|
|
* state_tracker_free:
|
|
|
|
* @tracker : State tracker handle.
|
|
|
|
*
|
|
|
|
* Frees a state tracker handle.
|
|
|
|
**/
|
2012-04-07 10:17:40 +00:00
|
|
|
void state_tracker_free(state_tracker_t *tracker);
|
2011-05-25 13:15:20 +00:00
|
|
|
|
2015-01-11 21:39:50 +00:00
|
|
|
/**
|
2015-01-12 01:15:35 +00:00
|
|
|
* state_tracker_get_uniform:
|
2015-01-11 21:39:50 +00:00
|
|
|
* @tracker : State tracker handle.
|
|
|
|
* @uniforms : State tracker uniforms.
|
|
|
|
* @elem : Amount of uniform elements.
|
|
|
|
* @frame_count : Frame count.
|
|
|
|
*
|
|
|
|
* Calls update_input(), and updates each uniform
|
|
|
|
* element accordingly.
|
|
|
|
*
|
|
|
|
* Returns: Amount of state elements (either equal to @elem
|
|
|
|
* or equal to @tracker->info_eleme).
|
|
|
|
**/
|
2015-01-12 01:15:35 +00:00
|
|
|
unsigned state_tracker_get_uniform(state_tracker_t *tracker,
|
2014-09-08 15:57:18 +00:00
|
|
|
struct state_tracker_uniform *uniforms,
|
|
|
|
unsigned elem, unsigned frame_count);
|
2011-05-25 13:15:20 +00:00
|
|
|
|
2016-06-03 03:43:49 +00:00
|
|
|
RETRO_END_DECLS
|
2012-11-04 21:55:11 +00:00
|
|
|
|
2011-05-25 13:15:20 +00:00
|
|
|
#endif
|