RetroArch/gfx/state_tracker.h

93 lines
2.0 KiB
C
Raw Normal View History

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
*
2012-04-21 21:13:50 +00:00
* 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.
*
2012-04-21 21:13:50 +00:00
* 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.
*
2012-04-21 21:31:57 +00:00
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
2012-04-21 21:25:32 +00:00
#ifndef __RARCH_SNES_TRACKER_H
#define __RARCH_SNES_TRACKER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <boolean.h>
#ifdef HAVE_CONFIG_H
2014-08-29 19:35:56 +00:00
#include "../config.h"
#endif
2012-04-07 10:17:40 +00:00
enum state_tracker_type
{
RARCH_STATE_CAPTURE = 0,
2012-04-21 21:25:32 +00:00
RARCH_STATE_CAPTURE_PREV,
RARCH_STATE_TRANSITION,
RARCH_STATE_TRANSITION_COUNT,
RARCH_STATE_TRANSITION_PREV,
RARCH_STATE_PYTHON
};
2012-04-07 10:17:40 +00:00
enum state_ram_type
{
2012-04-21 21:25:32 +00:00
RARCH_STATE_NONE,
RARCH_STATE_WRAM,
RARCH_STATE_INPUT_SLOT1,
RARCH_STATE_INPUT_SLOT2
};
2012-04-07 10:17:40 +00:00
struct state_tracker_uniform_info
{
char id[64];
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;
};
2012-04-07 10:17:40 +00:00
struct state_tracker_info
{
const uint8_t *wram;
2012-04-07 10:17:40 +00:00
const struct state_tracker_uniform_info *info;
unsigned info_elem;
#ifdef HAVE_PYTHON
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;
#endif
};
2012-04-07 10:17:40 +00:00
struct state_tracker_uniform
{
const char *id;
float value;
};
2012-04-07 10:17:40 +00:00
typedef struct state_tracker state_tracker_t;
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
2012-04-07 10:17:40 +00:00
void state_tracker_free(state_tracker_t *tracker);
2014-09-08 15:57:18 +00:00
unsigned state_get_uniform(state_tracker_t *tracker,
struct state_tracker_uniform *uniforms,
unsigned elem, unsigned frame_count);
#ifdef __cplusplus
}
#endif
#endif