Skip to content

Commit 9808b0f

Browse files
committed
WS: Fixed regression for SDMA Control port
According to sound_dma, bit 7 can be read as set, but WSHSTest expects bit 7 to be clear after setting it. WSHSTest attempts to start the sound dma while length is 0, which might immediately clear the enable flag.
1 parent 28881c0 commit 9808b0f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Core/Shared/RecordedRomTest.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ void RecordedRomTest::Record(string filename, bool reset)
137137
settings->GetGbaConfig().DisableFrameSkipping = true;
138138

139139
settings->GetGbaConfig().SkipBootScreen = false;
140+
settings->GetWsConfig().UseBootRom = true;
141+
settings->GetWsConfig().LcdShowIcons = true;
140142

141143
//Start recording movie alongside with screenshots
142144
RecordMovieOptions options;
@@ -225,6 +227,8 @@ RomTestResult RecordedRomTest::Run(string filename)
225227
settings->GetGbaConfig().DisableFrameSkipping = true;
226228

227229
settings->GetGbaConfig().SkipBootScreen = false;
230+
settings->GetWsConfig().UseBootRom = true;
231+
settings->GetWsConfig().LcdShowIcons = true;
228232

229233
_emu->Lock();
230234
//Start playing movie

Core/WS/WsDmaController.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ void WsDmaController::RunGeneralDma()
4545

4646
void WsDmaController::ProcessSoundDma()
4747
{
48-
if(!_state.SdmaEnabled || _state.SdmaLength == 0) {
49-
//TODOWS what does enabling when length = 0 do?
48+
if(!_state.SdmaEnabled) {
5049
return;
5150
}
5251

@@ -170,7 +169,12 @@ void WsDmaController::WritePort(uint16_t port, uint8_t value)
170169
break;
171170

172171
case 0x52:
173-
_state.SdmaControl = value & 0x5F;
172+
if(_state.SdmaLength == 0) {
173+
//Clear enable flag if length is 0 (based on sound_dma + WSHSTest results)
174+
value &= ~0x80;
175+
}
176+
177+
_state.SdmaControl = value & 0xDF;
174178

175179
switch(value & 0x03) {
176180
default:

0 commit comments

Comments
 (0)