File: pokemem.h

package info (click to toggle)
fuse-emulator 1.6.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 9,228 kB
  • sloc: ansic: 93,856; sh: 4,334; perl: 3,921; makefile: 998; yacc: 245; lex: 139
file content (67 lines) | stat: -rw-r--r-- 2,199 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* pokemem.h: help with handling pokes
   Copyright (c) 2011 Philip Kendall, Sergio BaldovĂ­

   This program 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 Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program 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 this program; if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

   Author contact information:

   E-mail: philip-fuse@shadowmagic.org.uk

*/

#ifndef POKEMEM_H
#define POKEMEM_H

#include <config.h>

#ifdef HAVE_LIB_GLIB
#include <glib.h>
#endif				/* #ifdef HAVE_LIB_GLIB */

#include <libspectrum.h>

extern GSList *trainer_list;

typedef struct trainer_t {
  char *name;
  int disabled;               /* malformed trainer or pokes? */
  int ask_value;              /* request user for a value */
  libspectrum_byte value;     /* user's custom value */
  int active;                 /* pokes applied? */
  GSList *poke_list;
} trainer_t;

typedef struct poke_t {
  libspectrum_byte bank;      /* 8 means ignore bank */
  libspectrum_word address;   /* address to poke */
  libspectrum_word value;     /* 256 means request to user */
  libspectrum_byte restore;   /* original value before poke */
} poke_t;

void pokemem_clear( void );
void pokemem_end( void );
int pokemem_set_pokfile( const char *filename );
int pokemem_find_pokfile( const char *filename );
int pokemem_autoload_pokfile( void );
int pokemem_read_from_file( const char *filename );

trainer_t *pokemem_trainer_list_add( libspectrum_byte bank,
                                     libspectrum_word address,
                                     libspectrum_word value );

int pokemem_trainer_activate( trainer_t *trainer );
int pokemem_trainer_deactivate( trainer_t *trainer );

#endif