[libgens] Vdp::writeCtrlMD(): The DMA Enabled bit is Set2 & 0x10, not Set2 & 0x04.
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Thu, 31 Mar 2016 01:51:38 +0000 (21:51 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Thu, 31 Mar 2016 01:55:37 +0000 (21:55 -0400)
This fixes broken menus and a black screen in-game in "Bubba 'N' Stix".

This bug was reported by Alfonso on the Sega Retro Gens/GS II
compatibility list: http://segaretro.org/Gens/GS_II_Compatibility_List

This fixes a regression from commit a214b411413a4bd884fbfd9e0b2b8d4d24565afd.
(VdpReg.hpp: Initial codeword refactoring.)

src/libgens/Vdp/VdpIo.cpp

index 61c3b93..25da2bb 100644 (file)
@@ -525,7 +525,7 @@ void Vdp::writeCtrlMD(uint16_t ctrl)
         * when the second control word is processed.
         *
         * NOTE 2: CD5 is only updated if DMA Enabled == 1.
-        * (VDP_Reg.m5.Set2 & 0x04)
+        * (VDP_Reg.m5.Set2 & 0x10)
         *
         * NOTE 3: A16 is only used if 128 KB mode is enabled.
         */
@@ -542,7 +542,7 @@ void Vdp::writeCtrlMD(uint16_t ctrl)
        // Update the VDP access code register: CD(4..2)
        d->VDP_Ctrl.code &= ~0x1C;
        d->VDP_Ctrl.code |= ((ctrl >> 2) & 0x1C);
-       if (d->VDP_Reg.m5.Set2 & 0x04) {
+       if (d->VDP_Reg.m5.Set2 & 0x10) {
                // DMA is enabled. Update CD5.
                d->VDP_Ctrl.code &= ~VdpTypes::CD_DMA_ENABLE;
                d->VDP_Ctrl.code |= ((ctrl >> 2) & VdpTypes::CD_DMA_ENABLE);