]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Small fixes and cleanups.
authorToni Wilen <twilen@winuae.net>
Wed, 19 Jul 2017 12:14:20 +0000 (15:14 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 19 Jul 2017 12:14:20 +0000 (15:14 +0300)
cfgfile.cpp
custom.cpp
expansion.cpp
ide.cpp
ini.cpp
newcpu.cpp
scsi.cpp

index 771f2f04a02443f034391c6160773cb2d5eef870..3f04c54851948b0a0f6f183015310c71f4e189b6 100644 (file)
@@ -4462,11 +4462,18 @@ static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, int type, TCHA
                                                uci.physical_geometry = false;
                                        }
                                        if (tmpp2[0]) {
-                                               n = cfgfile_unescape (tmpp2, &end, 0);
-                                               if (!n)
-                                                       goto invalid_fs;
-                                               _tcscpy(uci.geometry, n);
-                                               xfree(n);
+                                               if (tmpp2[0] == '\"') {
+                                                       n = cfgfile_unescape (tmpp2, &end, 0);
+                                                       if (!n)
+                                                               goto invalid_fs;
+                                                       _tcscpy(uci.geometry, n);
+                                                       xfree(n);
+                                               } else {
+                                                       tmpp = _tcschr (tmpp2, ',');
+                                                       if (tmpp)
+                                                               *tmpp++ = 0;
+                                                       _tcscpy (uci.geometry, tmpp2);
+                                               }
                                        }
                                }
                        }
index 4e6dc89d8788ba349cdee0bc5d27755f4794943a..fd1ca75d83f8eb8725725223ed79f163a3dab777 100644 (file)
@@ -735,7 +735,7 @@ static void reset_dbplh_all (int hpos)
                        reset_dbplh(hpos, num);
                }
                dbplpth_on2 = 0;
-       }       
+       }
 }
 
 static void reset_dbpll (int hpos, int num)
@@ -754,7 +754,7 @@ static void reset_dbpll_all (int hpos)
                        reset_dbpll(hpos, num);
                }
                dbplptl_on2 = 0;
-       }       
+       }
 }
 #endif
 
index 94c51a35d226aeda0782fcc561196638bae9f12b..b02fa187e8300826068f1f7cd4b48af4d6b34adf 100644 (file)
@@ -4577,7 +4577,7 @@ const struct expansionromtype expansionroms[] = {
        },
        {
                _T("comspec1000"), _T("SA-1000"), _T("Comspec"),
-               NULL, comspec_init, NULL, comspec_add_scsi_unit, ROMTYPE_COMSPEC, 0, 0, BOARD_AUTOCONFIG_Z2, true,
+               comspec_preinit, comspec_init, NULL, comspec_add_scsi_unit, ROMTYPE_COMSPEC, 0, 0, BOARD_AUTOCONFIG_Z2, true,
                NULL, 0,
                true, EXPANSIONTYPE_SCSI,
                0, 0, 0, false, NULL,
diff --git a/ide.cpp b/ide.cpp
index 8d0c8f7d0fc9a85f5ec1aa1fe6e49e2a9b5c5c64..099a6b0827519e7cb96dbb1b619498ba856beb2b 100644 (file)
--- a/ide.cpp
+++ b/ide.cpp
@@ -72,7 +72,7 @@ void ata_parse_identity(uae_u8 *out, struct uaedev_config_info *uci, bool *lba48
 
        v = (out[59 * 2 + 0] << 8) | (out[59 * 2 + 1] << 0);
        if (v & 1) { // multiple mode?
-               *max_multiple = (out[47 * 2 + 0] << 8) | (out[47 * 2 + 1] << 0);
+               *max_multiple = ((out[47 * 2 + 0] << 8) | (out[47 * 2 + 1] << 0)) & 0xff;
        }
 
        v = (out[53 * 2 + 0] << 8) | (out[53 * 2 + 1] << 0);
@@ -463,7 +463,7 @@ static void ide_identity_buffer(struct ide_hdf *ide)
 
        if (ata_get_identity(ide->hdhfd.hfd.geometry, ide->secbuf, true)) {
 
-               if (ide->byteswap)
+               if (!ide->byteswap)
                        ata_byteswapidentity(ide->secbuf);
 
        } else {
diff --git a/ini.cpp b/ini.cpp
index b2b1b2fba1a688c9c263b58afb85f962d2024fcf..c190e0ce939a7a2a4ed3be55b525d83de949392f 100644 (file)
--- a/ini.cpp
+++ b/ini.cpp
@@ -199,7 +199,6 @@ struct ini_data *ini_load(const TCHAR *path)
                                                otxt = xrealloc(TCHAR, otxt, len);
                                        }
                                        _tcscat(otxt, s3);
-                                       xfree(s3);
                                        s3 = NULL;
                                        if (!nl)
                                                break;
index dc41d9dcdeee64f73ef1e08f7664097cd556180b..9cd433482d462ed217031725b318bff5ba33282b 100644 (file)
@@ -6178,7 +6178,7 @@ static int asm_parse_mode(TCHAR *s, uae_u8 *reg, uae_u32 *v, uae_u16 *ext)
                                if (endptr == startptr || endptr[0] != ',')
                                        return -1;
                                s2 = endptr + 1;
-                       } else if ((asm_isareg(s + 1) >= 0 || asm_ispc(s + 1)) && s[3] == ',' || (asm_isdreg(s + 4) >= 0 || asm_isareg(s + 4) >= 0)) {
+                       } else if (((asm_isareg(s + 1) >= 0 || asm_ispc(s + 1)) && s[3] == ',') || (asm_isdreg(s + 4) >= 0 || asm_isareg(s + 4) >= 0)) {
                                if (dots != 1)
                                        return -1;
                                s2 = s + 1;
@@ -7110,9 +7110,11 @@ void m68k_dumpstate (uaecptr pc, uaecptr *nextpc)
                struct instr *dp;
                struct mnemolookup *lookup1, *lookup2;
                dp = table68k + regs.irc;
-               for (lookup1 = lookuptab; lookup1->mnemo != dp->mnemo; lookup1++);
+               for (lookup1 = lookuptab; lookup1->mnemo != dp->mnemo; lookup1++)
+                       ;
                dp = table68k + regs.ir;
-               for (lookup2 = lookuptab; lookup2->mnemo != dp->mnemo; lookup2++);
+               for (lookup2 = lookuptab; lookup2->mnemo != dp->mnemo; lookup2++)
+                       ;
                console_out_f (_T("Prefetch %04x (%s) %04x (%s) Chip latch %08X\n"), regs.irc, lookup1->name, regs.ir, lookup2->name, regs.chipset_latch_rw);
        }
 
index 0364a56049d4a43d2a9abc47748328a076460814..79a540ecf20dc5ab087f33d954edb19083254d3c 100644 (file)
--- a/scsi.cpp
+++ b/scsi.cpp
@@ -4593,4 +4593,4 @@ bool addhard_init(struct autoconfig_info *aci)
 void addhard_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc)
 {
        generic_soft_scsi_add(ch, ci, rc, NCR5380_ADDHARD, 65536, 32768, ROMTYPE_ADDHARD);
-}
\ No newline at end of file
+}