]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Add manufacturer id. Fix parallel programming.
authorToni Wilen <twilen@winuae.net>
Wed, 21 Jun 2017 17:40:16 +0000 (20:40 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 21 Jun 2017 17:40:16 +0000 (20:40 +0300)
flashrom.cpp
include/flashrom.h

index 86d71419b470c6840c80675d3541fecfd33dabf6..614838a05cfd280c64042c073dd7fb6f0fb9fee6 100644 (file)
@@ -516,12 +516,12 @@ struct flashrom_data
        int state;
        int modified;
        int sectorsize;
-       uae_u8 devicecode;
+       uae_u8 devicecode, mfgcode;
        int flags;
        struct zfile *zf;
 };
 
-void *flash_new(uae_u8 *rom, int flashsize, int allocsize, uae_u8 devicecode, struct zfile *zf, int flags)
+void *flash_new(uae_u8 *rom, int flashsize, int allocsize, uae_u8 mfgcode, uae_u8 devcode, struct zfile *zf, int flags)
 {
        struct flashrom_data *fd = xcalloc(struct flashrom_data, 1);
        fd->flashsize = flashsize;
@@ -530,8 +530,9 @@ void *flash_new(uae_u8 *rom, int flashsize, int allocsize, uae_u8 devicecode, st
        fd->zf = zf;
        fd->rom = rom;
        fd->flags = flags;
-       fd->devicecode = devicecode;
-       fd->sectorsize = devicecode == 0x20 ? 16384 : 65536;
+       fd->devicecode = devcode;
+       fd->mfgcode = mfgcode;
+       fd->sectorsize = devcode == 0x20 ? 16384 : 65536;
        return fd;
 }
 
@@ -595,7 +596,7 @@ bool flash_write(void *fdv, uaecptr addr, uae_u8 v)
        addr &= fd->mask;
        addr2 = addr & 0xffff;
 
-       if (fd->state == 7) {
+       if (fd->state >= 7 && fd->state < 7 + 64) {
                if (!(fd->flags & FLASHROM_PARALLEL_EEPROM)) {
                        fd->state = 100;
                } else {
@@ -691,7 +692,7 @@ uae_u32 flash_read(void *fdv, uaecptr addr)
        if (fd->state == 3) {
                uae_u8 a = addr & 0xff;
                if (a == 0)
-                       v = 0x01;
+                       v = fd->mfgcode;
                if (a == 1)
                        v = fd->devicecode;
                if (a == 2)
index 3b4c89c8702369e2dc6b6b4a1399cf82a6a488bd..8b447c470078b01d8f54ee6b642c8399069242b9 100644 (file)
@@ -5,7 +5,7 @@
 
 /* FLASH */
 
-void *flash_new(uae_u8 *rom, int flashsize, int allocsize, uae_u8 devicecode, struct zfile *zf, int flags);
+void *flash_new(uae_u8 *rom, int flashsize, int allocsize, uae_u8 mfgcode, uae_u8 devcode, struct zfile *zf, int flags);
 void flash_free(void *fdv);
 
 bool flash_write(void *fdv, uaecptr addr, uae_u8 v);