/*
¥Ç¥Ð¥¤¥¹¥ê¥¹¥È
*/
-//0x80 °Ê¹ß¤ÏËÜÅö¤Î¥Ç¥Ð¥¤¥¹½ÅÊ£¤·¤Ê¤¤¤È»×¤¦. 狼 JEDEC ¤Î¤È¤³¤ò¤·¤é¤Ù¤Æ.
-static const struct flash_driver DRIVER_SRAM256K = {
- .name = "SRAM256K",
- .capacity = 0x8000,
+enum{MEGA = 0x20000};
+static const struct flash_driver DRIVER_SRAM = {
+ .name = "SRAM",
+ .capacity = 4 * MEGA,
.pagesize = 0,
.erase_wait = 0,
.command_mask = 0,
static const struct flash_driver DRIVER_DUMMY = {
.name = "dummy",
- .capacity = 0x40000,
+ .capacity = 16 * MEGA,
.pagesize = 0,
.erase_wait = 0,
.command_mask = 0,
static const struct flash_driver DRIVER_W29C020 = {
.name = "W29C020",
- .capacity = 0x40000,
+ .capacity = 2 * MEGA,
.pagesize = 0x80,
.erase_wait = 50,
.command_mask = 0x7fff,
static const struct flash_driver DRIVER_W29C040 = {
.name = "W29C040",
- .capacity = 0x80000,
+ .capacity = 4 * MEGA,
.pagesize = 0x100,
.erase_wait = 50,
.command_mask = 0x7fff,
static const struct flash_driver DRIVER_W49F002 = {
.name = "W49F002",
- .capacity = 0x40000,
+ .capacity = 2 * MEGA,
.pagesize = 0,
.erase_wait = 1000, //typ 0.1, max 0.2 sec
.command_mask = 0x7fff,
*/
static const struct flash_driver DRIVER_EN29F002T = {
.name = "EN29F002T",
- .capacity = 0x40000,
+ .capacity = 2 * MEGA,
.pagesize = 0,
.erase_wait = 3000, //typ 2, max 5 sec
.command_mask = 0x07ff,
static const struct flash_driver DRIVER_AM29F040B = {
.name = "AM29F040B",
- .capacity = 0x80000,
+ .capacity = 4 * MEGA,
.pagesize = 0,
.erase_wait = 8000, //typ 8, max 64 sec
.command_mask = 0x07ff,
static const struct flash_driver *DRIVER_LIST[] = {
&DRIVER_W29C020, &DRIVER_W29C040,
&DRIVER_W49F002, &DRIVER_EN29F002T, &DRIVER_AM29F040B,
- &DRIVER_SRAM256K,
+ &DRIVER_SRAM,
&DRIVER_DUMMY,
NULL
};
};
const struct flash_driver *flash_driver_get(const char *name);
+
+//0x80 °Ê¹ß¤ÏËÜÅö¤Î¥Ç¥Ð¥¤¥¹½ÅÊ£¤·¤Ê¤¤¤È»×¤¦. 狼 JEDEC ¤Î¤È¤³¤ò¤·¤é¤Ù¤Æ.
enum{
FLASH_ID_DEVICE_SRAM = 0xf0,
FLASH_ID_DEVICE_DUMMY
data_port_latch(DATA_SELECT_CONTROL, c);
//WE up
c = bit_set(c, BITNUM_PPU_RW);
- c = bit_set(c, BITNUM_WRITEDATA_OUTPUT);
- data_port_latch(DATA_SELECT_CONTROL, c);
//CS up
+ c = bit_set(c, BITNUM_WRITEDATA_OUTPUT);
data_port_latch(DATA_SELECT_CONTROL, BUS_CONTROL_BUS_STANDBY);
}
*/
static const char LOGICAL_ERROR_PREFIX[] = "logical error:";
+static void logical_print_capacityerror(int line, const char *area)
+{
+ printf("%d: %s %s area flash memory capacity error\n", line, LOGICAL_ERROR_PREFIX, area);
+}
+
static inline void logical_print_illgalarea(int line, const char *area, long address)
{
printf("%d:%s illgal %s area $%06x\n", line, LOGICAL_ERROR_PREFIX, area, (int) address);
//flash memory capacity check
//¤¤¤Þ¤Î¤È¤³¤í == ¤Ë¤·¤Æ¾®¤µ¤¤ÍÆÎ̤⤽¤Î¤¦¤ÁÂбþ
else if((c->mode == MODE_ROM_PROGRAM) && (size > c->cpu_flash_driver->capacity)){
- printf("%s flash memory capacity error\n", LOGICAL_ERROR_PREFIX);
+ logical_print_capacityerror(s->line, r->cpu_rom.name);
error += 1;
}
}break;
error += 1;
}
else if((c->mode == MODE_ROM_PROGRAM) && (size > c->ppu_flash_driver->capacity)){
- printf("%s flash memory capacity error\n", LOGICAL_ERROR_PREFIX);
+ logical_print_capacityerror(s->line, r->ppu_rom.name);
error += 1;
}
}