RetroArch/gfx/state_tracker.h

84 lines
2.0 KiB
C
Raw Normal View History

2012-04-03 19:19:18 +02:00
/* SSNES - A frontend for libretro.
2012-01-08 01:08:18 +01:00
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
*
* SSNES 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.
*
* SSNES 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 SSNES.
* If not, see <http://www.gnu.org/licenses/>.
*/
2012-04-07 12:17:40 +02:00
#ifndef __SSNES_SNES_TRACKER_H
#define __SSNES_SNES_TRACKER_H
#include <stdint.h>
2011-12-24 13:46:12 +01:00
#include "../boolean.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
2012-04-07 12:17:40 +02:00
enum state_tracker_type
{
2012-01-24 22:31:26 +01:00
#ifdef HAVE_PYTHON
SSNES_STATE_PYTHON,
#endif
SSNES_STATE_CAPTURE,
2011-05-26 16:23:11 +02:00
SSNES_STATE_CAPTURE_PREV,
2011-06-06 21:32:10 +02:00
SSNES_STATE_TRANSITION,
SSNES_STATE_TRANSITION_COUNT,
2012-01-24 22:31:26 +01:00
SSNES_STATE_TRANSITION_PREV
};
2012-04-07 12:17:40 +02:00
enum state_ram_type
{
SSNES_STATE_NONE,
SSNES_STATE_WRAM,
2011-06-11 20:02:17 +02:00
SSNES_STATE_INPUT_SLOT1,
SSNES_STATE_INPUT_SLOT2
};
2012-04-07 12:17:40 +02:00
struct state_tracker_uniform_info
{
char id[64];
uint32_t addr;
2012-04-07 12:17:40 +02:00
enum state_tracker_type type;
enum state_ram_type ram_type;
2012-02-12 18:05:33 +01:00
uint16_t mask;
uint16_t equal;
};
2012-04-07 12:17:40 +02:00
struct state_tracker_info
{
const uint8_t *wram;
2012-04-07 12:17:40 +02:00
const struct state_tracker_uniform_info *info;
unsigned info_elem;
#ifdef HAVE_PYTHON
const char *script;
2011-06-06 18:50:36 +02:00
const char *script_class;
2011-06-07 15:33:29 +02:00
bool script_is_file;
#endif
};
2012-04-07 12:17:40 +02:00
struct state_tracker_uniform
{
const char *id;
float value;
};
2012-04-07 12:17:40 +02:00
typedef struct state_tracker state_tracker_t;
2012-04-07 12:17:40 +02:00
state_tracker_t* state_tracker_init(const struct state_tracker_info *info);
void state_tracker_free(state_tracker_t *tracker);
2012-04-07 12:17:40 +02:00
unsigned state_get_uniform(state_tracker_t *tracker, struct state_tracker_uniform *uniforms, unsigned elem, unsigned frame_count);
#endif