]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
68060 custom register byte write bug emulation fix
authorToni Wilen <twilen@winuae.net>
Mon, 12 Feb 2024 19:08:41 +0000 (21:08 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 12 Feb 2024 19:08:41 +0000 (21:08 +0200)
custom.cpp

index 04d88605f32217853d631e6812ab767526702e85..07c7bc98ef0343d841c50be9a8ec15a12abcbfee 100644 (file)
@@ -15415,7 +15415,7 @@ static void REGPARAM2 custom_bput (uaecptr addr, uae_u32 value)
                if (addr & 1) {
                        rval = value & 0xff;
                } else {
-                       rval = (value << 8) | (value & 0xFF);
+                       rval = (value << 8) | (value & 0xff);
                }
        } else {
                rval = (value << 8) | (value & 0xff);
@@ -15423,11 +15423,11 @@ static void REGPARAM2 custom_bput (uaecptr addr, uae_u32 value)
 
        if (currprefs.cs_bytecustomwritebug) {
                if (addr & 1)
-                       custom_wput (addr & ~1, rval);
+                       custom_wput(addr & ~1, rval | (rval << 8));
                else
-                       custom_wput (addr, value << 8);
+                       custom_wput(addr, value << 8);
        } else {
-               custom_wput (addr & ~1, rval);
+               custom_wput(addr & ~1, rval);
        }
 }