2 famicom ROM cartridge utility - unagi
5 Copyright (C) 2008 ±·³«È¯¶¨Æ±Áȹç
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 flashmemory.c ¤À¤±¤Î·Ù¹ð
22 ¤³¤Î¥½¡¼¥¹¥³¡¼¥É¤ò»²¹Í¡¢Å¾ÍѤ·¤Æ¥·¥§¥¢¥¦¥§¥¢¤Ê¤É¤ÇÍø±×¤òÆÀ¤Ê¤¤¤³¤È¡£
23 ȽÌÀ¤·¤¿¾ì¹ç¤Ï LGPL ¤¬Å¬ÍѤµ¤ì¡¢³ºÅö²Õ½ê¤Î¥½¡¼¥¹¤ò¸ø³«¤¹¤ëɬÍפ¬¤¢¤ë¡£
25 #ifndef _FLASHMEMORY_H_
26 #define _FLASHMEMORY_H_
29 //JEDEC command ¤ò½¼¤Æ¤ë CPU/PPU ÏÀÍý¥¢¥É¥ì¥¹
30 long command_0000, command_2aaa, command_5555;
32 //struct reader_driver ¤Î´Ø¿ô¥Ý¥¤¥ó¥¿¤òÅϤ¹¾ì½ê
33 void (*flash_write)(long address, long data);
34 void (*read)(long address, long length, u8 *data);
40 long capacity, pagesize;
41 u8 id_manufacurer, id_device;
42 int (*productid_check)(const struct flash_order *d, const struct flash_driver *f);
44 void (*erase)(const struct flash_order *d);
46 void (*init)(const struct flash_order *d);
47 void (*write)(const struct flash_order *d, long address, long length, const struct memory *m);
50 const struct flash_driver *flash_driver_get(const char *name);