map066.c
 1  /*
 2  ** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
 3  **
 4  **
 5  ** This program is free software; you can redistribute it and/or
 6  ** modify it under the terms of version 2 of the GNU Library General 
 7  ** Public License as published by the Free Software Foundation.
 8  **
 9  ** This program is distributed in the hope that it will be useful, 
10  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12  ** Library General Public License for more details.  To obtain a 
13  ** copy of the GNU Library General Public License, write to the Free 
14  ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15  **
16  ** Any permitted reproduction of these routines, in whole or in part,
17  ** must bear this legend.
18  **
19  **
20  ** map66.c
21  **
22  ** mapper 66 interface
23  ** $Id: map066.c,v 1.2 2001/04/27 14:37:11 neil Exp $
24  */
25  
26  #include "noftypes.h"
27  #include "nes_mmc.h"
28  
29  /* mapper 66: GNROM */
30  static void map66_write(uint32 address, uint8 value)
31  {
32     UNUSED(address);
33  
34     mmc_bankrom(32, 0x8000, (value >> 4) & 3);
35     mmc_bankvrom(8, 0x0000, value & 3);
36  }
37  
38  static void map66_init(void)
39  {
40     mmc_bankrom(32, 0x8000, 0);
41     mmc_bankvrom(8, 0x0000, 0);
42  }
43  
44  
45  static const map_memwrite map66_memwrite[] =
46  {
47     { 0x8000, 0xFFFF, map66_write },
48     {     -1,     -1, NULL }
49  };
50  
51  const mapintf_t map66_intf =
52  {
53     66, /* mapper number */
54     "GNROM", /* mapper name */
55     map66_init, /* init routine */
56     NULL, /* vblank callback */
57     NULL, /* hblank callback */
58     NULL, /* get state (snss) */
59     NULL, /* set state (snss) */
60     NULL, /* memory read structure */
61     map66_memwrite, /* memory write structure */
62     NULL /* external sound device */
63  };
64  
65  /*
66  ** $Log: map066.c,v $
67  ** Revision 1.2  2001/04/27 14:37:11  neil
68  ** wheeee
69  **
70  ** Revision 1.1  2001/04/27 12:54:40  neil
71  ** blah
72  **
73  ** Revision 1.1.1.1  2001/04/27 07:03:54  neil
74  ** initial
75  **
76  ** Revision 1.1  2000/10/24 12:19:33  matt
77  ** changed directory structure
78  **
79  ** Revision 1.5  2000/10/22 19:17:46  matt
80  ** mapper cleanups galore
81  **
82  ** Revision 1.4  2000/10/21 19:33:38  matt
83  ** many more cleanups
84  **
85  ** Revision 1.3  2000/08/16 02:50:11  matt
86  ** random mapper cleanups
87  **
88  ** Revision 1.2  2000/07/06 02:48:43  matt
89  ** clearly labelled structure members
90  **
91  ** Revision 1.1  2000/07/05 05:05:18  matt
92  ** initial revision
93  **
94  */