map079.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 ** map78.c 21 ** 22 ** mapper 78 interface 23 ** $Id: map079.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 30 /* mapper 79: NINA-03/06 */ 31 static void map79_write(uint32 address, uint8 value) 32 { 33 if ((address & 0x5100) == 0x4100) 34 { 35 mmc_bankrom(32, 0x8000, (value >> 3) & 1); 36 mmc_bankvrom(8, 0x0000, value & 7); 37 } 38 } 39 40 static void map79_init(void) 41 { 42 mmc_bankrom(32, 0x8000, 0); 43 mmc_bankvrom(8, 0x0000, 0); 44 } 45 46 static const map_memwrite map79_memwrite[] = 47 { 48 { 0x4100, 0x5FFF, map79_write }, /* ????? incorrect range ??? */ 49 { -1, -1, NULL } 50 }; 51 52 const mapintf_t map79_intf = 53 { 54 79, /* mapper number */ 55 "NINA-03/06", /* mapper name */ 56 map79_init, /* init routine */ 57 NULL, /* vblank callback */ 58 NULL, /* hblank callback */ 59 NULL, /* get state (snss) */ 60 NULL, /* set state (snss) */ 61 NULL, /* memory read structure */ 62 map79_memwrite, /* memory write structure */ 63 NULL /* external sound device */ 64 }; 65 66 /* 67 ** $Log: map079.c,v $ 68 ** Revision 1.2 2001/04/27 14:37:11 neil 69 ** wheeee 70 ** 71 ** Revision 1.1 2001/04/27 12:54:40 neil 72 ** blah 73 ** 74 ** Revision 1.1.1.1 2001/04/27 07:03:54 neil 75 ** initial 76 ** 77 ** Revision 1.1 2000/10/24 12:19:33 matt 78 ** changed directory structure 79 ** 80 ** Revision 1.4 2000/10/22 19:17:47 matt 81 ** mapper cleanups galore 82 ** 83 ** Revision 1.3 2000/10/21 19:33:38 matt 84 ** many more cleanups 85 ** 86 ** Revision 1.2 2000/07/06 02:48:43 matt 87 ** clearly labelled structure members 88 ** 89 ** Revision 1.1 2000/07/06 01:01:56 matt 90 ** initial revision 91 ** 92 */