Skip to content

Commit

Permalink
PCE: VDC - Allow VRAM transfers to run at any time when rendering is …
Browse files Browse the repository at this point in the history
…disabled

Fixes issues in movies in both Cosmic Fantasy 4 and Flash Hiders
  • Loading branch information
SourMesen committed Dec 23, 2023
1 parent 935df44 commit 0cb1c2b
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Core/PCE/PceVdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
#include "PCE/PceConstants.h"
#include "PCE/PceConsole.h"
#include "Shared/EmuSettings.h"
#include "Utilities/Serializer.h"
#include "Shared/EventType.h"
#include "Shared/MessageManager.h"
#include "Utilities/Serializer.h"

PceVdc::PceVdc(Emulator* emu, PceConsole* console, PceVpc* vpc, PceVce* vce, bool isVdc2)
{
Expand Down Expand Up @@ -576,7 +577,7 @@ void PceVdc::ProcessSatbTransfer()

void PceVdc::ProcessVramDmaTransfer()
{
if(_vMode == PceVdcModeV::Vdw) {
if(_vMode == PceVdcModeV::Vdw && !_state.BurstModeEnabled) {
return;
}

Expand Down Expand Up @@ -1184,6 +1185,7 @@ void PceVdc::WriteRegister(uint16_t addr, uint8_t value)

case 0x0F:
if(!msb) {
LogDebugIf(_vramDmaRunning, "[VRAM DMA] Write to register while running");
_state.VramSatbIrqEnabled = (value & 0x01) != 0;
_state.VramVramIrqEnabled = (value & 0x02) != 0;
_state.DecrementSrc = (value & 0x04) != 0;
Expand All @@ -1192,9 +1194,18 @@ void PceVdc::WriteRegister(uint16_t addr, uint8_t value)
}
break;

case 0x10: UpdateReg(_state.BlockSrc, value, msb); break;
case 0x11: UpdateReg(_state.BlockDst, value, msb); break;
case 0x10:
LogDebugIf(_vramDmaRunning, "[VRAM DMA] Write to register while running");
UpdateReg(_state.BlockSrc, value, msb);
break;

case 0x11:
LogDebugIf(_vramDmaRunning, "[VRAM DMA] Write to register while running");
UpdateReg(_state.BlockDst, value, msb);
break;

case 0x12:
LogDebugIf(_vramDmaRunning, "[VRAM DMA] Write to register while running");
UpdateReg(_state.BlockLen, value, msb);
if(msb) {
_vramDmaRunning = true;
Expand All @@ -1203,6 +1214,7 @@ void PceVdc::WriteRegister(uint16_t addr, uint8_t value)
break;

case 0x13:
LogDebugIf(_state.SatbTransferRunning, "[Sprite DMA] Write to register while running");
UpdateReg(_state.SatbBlockSrc, value, msb);
if(msb) {
_state.SatbTransferPending = true;
Expand Down

0 comments on commit 0cb1c2b

Please sign in to comment.