map007.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  ** map7.c
21  **
22  ** mapper 7 interface
23  ** $Id: map007.c,v 1.2 2001/04/27 14:37:11 neil Exp $
24  */
25  
26  #include "noftypes.h"
27  #include "nes_mmc.h"
28  #include "nes_ppu.h"
29  #include "log.h"
30  
31  /* mapper 7: AOROM */
32  static void map7_write(uint32 address, uint8 value)
33  {
34     int mirror;
35     UNUSED(address);
36  
37     mmc_bankrom(32, 0x8000, value);
38     mirror = (value & 0x10) >> 4;
39     ppu_mirror(mirror, mirror, mirror, mirror);
40  }
41  
42  static void map7_init(void)
43  {
44     mmc_bankrom(32, 0x8000, 0);
45  }
46  
47  static const map_memwrite map7_memwrite[] =
48  {
49     { 0x8000, 0xFFFF, map7_write },
50     {     -1,     -1, NULL }
51  };
52  
53  const mapintf_t map7_intf =
54  {
55     7, /* mapper number */
56     "AOROM", /* mapper name */
57     map7_init, /* init routine */
58     NULL, /* vblank callback */
59     NULL, /* hblank callback */
60     NULL, /* get state (snss) */
61     NULL, /* set state (snss) */
62     NULL, /* memory read structure */
63     map7_memwrite, /* memory write structure */
64     NULL /* external sound device */
65  };
66  
67  /*
68  ** $Log: map007.c,v $
69  ** Revision 1.2  2001/04/27 14:37:11  neil
70  ** wheeee
71  **
72  ** Revision 1.1  2001/04/27 12:54:40  neil
73  ** blah
74  **
75  ** Revision 1.1.1.1  2001/04/27 07:03:54  neil
76  ** initial
77  **
78  ** Revision 1.1  2000/10/24 12:19:32  matt
79  ** changed directory structure
80  **
81  ** Revision 1.6  2000/10/22 19:17:46  matt
82  ** mapper cleanups galore
83  **
84  ** Revision 1.5  2000/10/22 15:03:13  matt
85  ** simplified mirroring
86  **
87  ** Revision 1.4  2000/10/21 19:33:38  matt
88  ** many more cleanups
89  **
90  ** Revision 1.3  2000/08/16 02:50:11  matt
91  ** random mapper cleanups
92  **
93  ** Revision 1.2  2000/07/06 02:48:43  matt
94  ** clearly labelled structure members
95  **
96  ** Revision 1.1  2000/07/04 23:11:45  matt
97  ** initial revision
98  **
99  */