diff --git a/Source/Project64-core/N64System/Mips/Disk.cpp b/Source/Project64-core/N64System/Mips/Disk.cpp index 9205c6433..8b8bf6e7f 100644 --- a/Source/Project64-core/N64System/Mips/Disk.cpp +++ b/Source/Project64-core/N64System/Mips/Disk.cpp @@ -8,6 +8,7 @@ * GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * * * ****************************************************************************/ +// Based from MAME's N64DD driver code by Happy_ #pragma once #include "stdafx.h" #include "Disk.h" @@ -20,8 +21,6 @@ bool dd_reset_hold; uint32_t dd_track_offset, dd_zone; uint32_t dd_start_block, dd_current; -uint8_t dd_buffer[0x100]; - void DiskCommand() { //ASIC_CMD_STATUS - Commands @@ -149,7 +148,8 @@ void DiskGapSectorCheck() if (SECTORS_PER_BLOCK < dd_current) { g_Reg->ASIC_STATUS &= ~DD_STATUS_BM_INT; - g_Reg->FAKE_CAUSE_REGISTER &= ~CAUSE_IP3; + if (!(g_Reg->ASIC_STATUS & DD_STATUS_MECHA_INT) && !(g_Reg->ASIC_STATUS & DD_STATUS_BM_INT)) + g_Reg->FAKE_CAUSE_REGISTER &= ~CAUSE_IP3; DiskBMUpdate(); } } @@ -214,7 +214,7 @@ void DiskBMUpdate() g_Reg->ASIC_STATUS &= ~DD_STATUS_DATA_RQ; g_Reg->ASIC_BM_STATUS |= DD_BM_STATUS_MICRO; } - else if (dd_current == 0) + else if (dd_current < SECTORS_PER_BLOCK) { DiskBMRead(); dd_current += 1; diff --git a/Source/Project64-core/N64System/Mips/Disk.h b/Source/Project64-core/N64System/Mips/Disk.h index b7742ab72..27084a63b 100644 --- a/Source/Project64-core/N64System/Mips/Disk.h +++ b/Source/Project64-core/N64System/Mips/Disk.h @@ -8,6 +8,7 @@ * GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * * * ****************************************************************************/ +// Based from MAME's N64DD driver code by Happy_ #pragma once #include @@ -26,8 +27,6 @@ extern bool dd_reset_hold; extern uint32_t dd_track_offset, dd_zone; extern uint32_t dd_start_block, dd_current; -extern uint8_t dd_buffer[0x100]; - const uint32_t ddZoneSecSize[16] = { 232, 216, 208, 192, 176, 160, 144, 128, 216, 208, 192, 176, 160, 144, 128, 112 }; const uint32_t ddZoneTrackSize[16] = { 158, 158, 149, 149, 149, 149, 149, 114, diff --git a/Source/Project64-core/N64System/Mips/Dma.cpp b/Source/Project64-core/N64System/Mips/Dma.cpp index 1ccc377d8..e2d6cb6f8 100644 --- a/Source/Project64-core/N64System/Mips/Dma.cpp +++ b/Source/Project64-core/N64System/Mips/Dma.cpp @@ -77,7 +77,7 @@ void CDMA::PI_DMA_READ() //64DD C2 Sectors (don't care) g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; - DiskBMUpdate(); + g_Reg->CheckInterrupts(); return; } @@ -93,7 +93,7 @@ void CDMA::PI_DMA_READ() } g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; - DiskBMUpdate(); + g_Reg->CheckInterrupts(); return; } diff --git a/Source/Project64-core/Settings/SettingsClass.cpp b/Source/Project64-core/Settings/SettingsClass.cpp index bec50785c..bd9aa60fc 100644 --- a/Source/Project64-core/Settings/SettingsClass.cpp +++ b/Source/Project64-core/Settings/SettingsClass.cpp @@ -134,7 +134,7 @@ void CSettings::AddHowToHandleSetting() AddHandler(Setting_RememberCheats, new CSettingTypeApplication("", "Remember Cheats", (uint32_t)false)); AddHandler(Setting_CurrentLanguage, new CSettingTypeApplication("", "Current Language", "")); - AddHandler(Setting_EnableDisk, new CSettingTypeApplication("", "Enable Disk", (uint32_t)false)); + AddHandler(Setting_EnableDisk, new CSettingTypeApplication("", "Enable Disk", (uint32_t)true)); AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang", "")); AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Directory", "Lang", Setting_LanguageDirDefault));