Fixed code and credited Happy_

Good timing needed to fully work. (Not figured out)
This commit is contained in:
luigiblood 2016-01-22 03:17:25 +01:00
parent 0501eb70da
commit 305f4cfb16
4 changed files with 8 additions and 9 deletions

View File

@ -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;

View File

@ -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 <Common/stdtypes.h>
@ -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,

View File

@ -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;
}

View File

@ -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));