Core: Revert Unaligned DMA to fix some hacks

This commit is contained in:
zilmar 2022-12-26 15:15:28 +10:30
parent f380d326fe
commit f6e4443dda
23 changed files with 337 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -287,6 +287,7 @@
# 538# "32-বিট ইঞ্জিন" " # 538# "32-বিট ইঞ্জিন" "
# 539# "বিলম্ব ডিপি বাধা" # 539# "বিলম্ব ডিপি বাধা"
# 5400# "ওভারক্লক মডিফায়ার:" # 5400# "ওভারক্লক মডিফায়ার:"
# 5410# "স্বীকৃত ডিএমএ"
# 5420# "এলোমেলো সি/পিআই বাধা" # 5420# "এলোমেলো সি/পিআই বাধা"
# 5440# "ডিস্কের সময় নির্ধারণ করুন:" # 5440# "ডিস্কের সময় নির্ধারণ করুন:"
# 5441# "টার্বো" # 5441# "টার্বো"

View File

@ -287,6 +287,7 @@
#538# "Motor de 32 bits" #538# "Motor de 32 bits"
#539# "Atrasar a interrupção do DP" #539# "Atrasar a interrupção do DP"
#5400# "Modificador overclock:" #5400# "Modificador overclock:"
#5410# "DMA desalinhado"
#5420# "Aleatorizar as interrupções SI/PI" #5420# "Aleatorizar as interrupções SI/PI"
#5440# "Tempo de busca no disco:" #5440# "Tempo de busca no disco:"
#5441# "Turbo" #5441# "Turbo"

View File

@ -307,6 +307,7 @@
#538# "32 位引擎" #538# "32 位引擎"
#539# "延迟 DP 中断" #539# "延迟 DP 中断"
#5400# "超频修改器:" #5400# "超频修改器:"
#5410# "不对齐 DMA"
#5420# "随机化 SI/PI 中断" #5420# "随机化 SI/PI 中断"
#5440# "磁盘搜索计时:" #5440# "磁盘搜索计时:"
#5441# "快速" #5441# "快速"

View File

@ -287,6 +287,7 @@
#538# "32-bit engine" #538# "32-bit engine"
#539# "Delay DP interrupt" #539# "Delay DP interrupt"
#5400# "Overclock modifier:" #5400# "Overclock modifier:"
#5410# "Unaligned DMA"
#5420# "Randomize SI/PI interrupts" #5420# "Randomize SI/PI interrupts"
#5440# "Disk seek timing:" #5440# "Disk seek timing:"
#5441# "Turbo" #5441# "Turbo"

View File

@ -309,6 +309,8 @@
#5441# "Rapide" #5441# "Rapide"
#5442# "Lente" #5442# "Lente"
#5410# "DMA non alignée"
//Core Styles //Core Styles
#540# "Interpréteur" #540# "Interpréteur"
#541# "Recompilateur" #541# "Recompilateur"

View File

@ -287,6 +287,7 @@
#538# "mesin 32-bit" #538# "mesin 32-bit"
#539# "Menunda interupsi DP" #539# "Menunda interupsi DP"
#5400# "Pengubah overclock:" #5400# "Pengubah overclock:"
#5410# "DMA Tidak Sejajar"
#5420# "Acak interupsi SI/PI" #5420# "Acak interupsi SI/PI"
#5440# "Waktu pencarian disk:" #5440# "Waktu pencarian disk:"
#5441# "Turbo" #5441# "Turbo"

View File

@ -287,6 +287,7 @@
#538# "32bitエンジン" #538# "32bitエンジン"
#539# "DP割り込み遅延" #539# "DP割り込み遅延"
#5400# "Overclock modifier:" #5400# "Overclock modifier:"
#5410# "非整列DMA"
#5420# "SI/PI割り込みのランダム化" #5420# "SI/PI割り込みのランダム化"
#5440# "ディスクシークのタイミング:" #5440# "ディスクシークのタイミング:"
#5441# "ターボ" #5441# "ターボ"

View File

@ -287,6 +287,7 @@
#538# "Engine de 32 bits" #538# "Engine de 32 bits"
#539# "Atrasar a interrupção do DP" #539# "Atrasar a interrupção do DP"
#5400# "Modificador overclock:" #5400# "Modificador overclock:"
#5410# "DMA desalinhado"
#5420# "Aleatorizar as interrupções SI/PI" #5420# "Aleatorizar as interrupções SI/PI"
#5440# "Tempo de busca em disco:" #5440# "Tempo de busca em disco:"
#5441# "Turbo" #5441# "Turbo"

View File

@ -287,6 +287,7 @@
#538# "32-ਬਿੱਟ ਇੰਜਣ" #538# "32-ਬਿੱਟ ਇੰਜਣ"
#539# "ਡੀਪੀ ਰੁਕਾਵਟ ਵਿੱਚ ਦੇਰੀ" #539# "ਡੀਪੀ ਰੁਕਾਵਟ ਵਿੱਚ ਦੇਰੀ"
#5400# "ਓਵਰਕਲਾਕ ਮੋਡੀਫਾਇਰ:" #5400# "ਓਵਰਕਲਾਕ ਮੋਡੀਫਾਇਰ:"
#5410# "ਅਨਲਾਈਨ ਡੀਐਮਏ"
#5420# "SI/PI ਰੁਕਾਵਟਾਂ ਨੂੰ ਰੈਂਡਮਾਈਜ਼ ਕਰੋ" #5420# "SI/PI ਰੁਕਾਵਟਾਂ ਨੂੰ ਰੈਂਡਮਾਈਜ਼ ਕਰੋ"
#5440# "ਡਿਸਕ ਖੋਜ ਸਮਾਂ:" #5440# "ਡਿਸਕ ਖੋਜ ਸਮਾਂ:"
#5441# "ਟਰਬੋ" #5441# "ਟਰਬੋ"

View File

@ -290,6 +290,8 @@
#5441# "Turbo" #5441# "Turbo"
#5442# "Lento" #5442# "Lento"
#5410# "DMA desalineado"
// Core styles // Core styles
#540# "Interpretador" #540# "Interpretador"
#541# "Recompilador" #541# "Recompilador"

View File

@ -287,6 +287,7 @@
# 538 # "Động cơ 32-bit" # 538 # "Động cơ 32-bit"
# 539 # "Trì hoãn ngắt DP" # 539 # "Trì hoãn ngắt DP"
# 5400 # "Công cụ sửa đổi ép xung:" # 5400 # "Công cụ sửa đổi ép xung:"
# 5410 # "DMA không dấu"
# 5420 # "Ngẫu nhiên ngắt SI / PI" # 5420 # "Ngẫu nhiên ngắt SI / PI"
# 5440 # "Thời gian tìm kiếm đĩa:" # 5440 # "Thời gian tìm kiếm đĩa:"
# 5441 # "Turbo" # 5441 # "Turbo"

View File

@ -323,6 +323,7 @@ enum LanguageStringID
ROM_32BIT = 538, ROM_32BIT = 538,
ROM_DELAY_DP = 539, ROM_DELAY_DP = 539,
ROM_OVER_CLOCK_MODIFIER = 5400, ROM_OVER_CLOCK_MODIFIER = 5400,
ROM_UNALIGNED_DMA = 5410,
ROM_RANDOMIZE_SIPI_INTERRUPTS = 5420, ROM_RANDOMIZE_SIPI_INTERRUPTS = 5420,
ROM_DISK_SEEK_TIMING = 5440, ROM_DISK_SEEK_TIMING = 5440,
ROM_DISK_SEEK_TIMING_TURBO = 5441, ROM_DISK_SEEK_TIMING_TURBO = 5441,

View File

@ -271,6 +271,7 @@ void CLanguage::LoadDefaultStrings(void)
DEF_STR(ROM_32BIT, "32-bit engine:"); DEF_STR(ROM_32BIT, "32-bit engine:");
DEF_STR(ROM_DELAY_DP, "Delay DP interrupt:"); DEF_STR(ROM_DELAY_DP, "Delay DP interrupt:");
DEF_STR(ROM_OVER_CLOCK_MODIFIER, "Overclock modifier:"); DEF_STR(ROM_OVER_CLOCK_MODIFIER, "Overclock modifier:");
DEF_STR(ROM_UNALIGNED_DMA, "Unaligned DMA");
DEF_STR(ROM_RANDOMIZE_SIPI_INTERRUPTS, "Randomize SI/PI interrupts"); DEF_STR(ROM_RANDOMIZE_SIPI_INTERRUPTS, "Randomize SI/PI interrupts");
DEF_STR(ROM_DISK_SEEK_TIMING, "Disk seek timing:"); DEF_STR(ROM_DISK_SEEK_TIMING, "Disk seek timing:");
DEF_STR(ROM_DISK_SEEK_TIMING_TURBO, "Turbo"); DEF_STR(ROM_DISK_SEEK_TIMING_TURBO, "Turbo");

View File

@ -126,7 +126,7 @@ bool PeripheralInterfaceHandler::Write32(uint32_t Address, uint32_t Value, uint3
{ {
case 0x04600000: PI_DRAM_ADDR_REG = ((PI_DRAM_ADDR_REG & ~Mask) | (Value & Mask)) & 0x00FFFFFE; break; case 0x04600000: PI_DRAM_ADDR_REG = ((PI_DRAM_ADDR_REG & ~Mask) | (Value & Mask)) & 0x00FFFFFE; break;
case 0x04600004: case 0x04600004:
PI_CART_ADDR_REG = ((PI_CART_ADDR_REG & ~Mask) | (Value & Mask)) & 0xFFFFFFFE; PI_CART_ADDR_REG = ((PI_CART_ADDR_REG & ~Mask) | (Value & Mask)) & (UnalignedDMA() ? 0xFFFFFFFF : 0xFFFFFFFE);
if (EnableDisk()) if (EnableDisk())
{ {
DiskDMACheck(); DiskDMACheck();

View File

@ -175,6 +175,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Rdb_AudioResetOnLoad, new CSettingTypeRDBYesNo("AudioResetOnLoad", false)); AddHandler(Rdb_AudioResetOnLoad, new CSettingTypeRDBYesNo("AudioResetOnLoad", false));
AddHandler(Rdb_AllowROMWrites, new CSettingTypeRDBYesNo("AllowROMWrites", false)); AddHandler(Rdb_AllowROMWrites, new CSettingTypeRDBYesNo("AllowROMWrites", false));
AddHandler(Rdb_CRC_Recalc, new CSettingTypeRDBYesNo("CRC-Recalc", false)); AddHandler(Rdb_CRC_Recalc, new CSettingTypeRDBYesNo("CRC-Recalc", false));
AddHandler(Rdb_UnalignedDMA, new CSettingTypeRomDatabase("Unaligned DMA", false));
AddHandler(Rdb_RandomizeSIPIInterrupts, new CSettingTypeRomDatabase("Randomize SI/PI Interrupts", Default_RandomizeSIPIInterrupts)); AddHandler(Rdb_RandomizeSIPIInterrupts, new CSettingTypeRomDatabase("Randomize SI/PI Interrupts", Default_RandomizeSIPIInterrupts));
AddHandler(Rdb_DiskSeekTiming, new CSettingTypeRomDatabase("DiskSeekTiming", Default_DiskSeekTiming)); AddHandler(Rdb_DiskSeekTiming, new CSettingTypeRomDatabase("DiskSeekTiming", Default_DiskSeekTiming));
@ -233,6 +234,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Game_LoadSaveAtStart, new CSettingTypeTempBool(false)); AddHandler(Game_LoadSaveAtStart, new CSettingTypeTempBool(false));
AddHandler(Game_OverClockModifier, new CSettingTypeGame("OverClockModifier", (uint32_t)1)); AddHandler(Game_OverClockModifier, new CSettingTypeGame("OverClockModifier", (uint32_t)1));
AddHandler(Game_FullSpeed, new CSettingTypeTempBool(true, "Full Speed")); AddHandler(Game_FullSpeed, new CSettingTypeTempBool(true, "Full Speed"));
AddHandler(Game_UnalignedDMA, new CSettingTypeGame("Unaligned DMA", Rdb_UnalignedDMA));
AddHandler(Game_RandomizeSIPIInterrupts, new CSettingTypeGame("Randomize SI/PI Interrupts", Rdb_RandomizeSIPIInterrupts)); AddHandler(Game_RandomizeSIPIInterrupts, new CSettingTypeGame("Randomize SI/PI Interrupts", Rdb_RandomizeSIPIInterrupts));
AddHandler(Game_RPCKey, new CSettingTypeTempString("")); AddHandler(Game_RPCKey, new CSettingTypeTempString(""));
AddHandler(Game_DiskSeekTiming, new CSettingTypeGame("DiskSeekTiming", Rdb_DiskSeekTiming)); AddHandler(Game_DiskSeekTiming, new CSettingTypeGame("DiskSeekTiming", Rdb_DiskSeekTiming));

View File

@ -33,6 +33,7 @@ DISK_SEEK_TYPE CGameSettings::m_DiskSeekTimingType = DiskSeek_Turbo;
bool CGameSettings::m_EnhancmentOverClock = false; bool CGameSettings::m_EnhancmentOverClock = false;
uint32_t CGameSettings::m_EnhancmentOverClockModifier = 1; uint32_t CGameSettings::m_EnhancmentOverClockModifier = 1;
bool CGameSettings::m_EnableDisk = false; bool CGameSettings::m_EnableDisk = false;
bool CGameSettings::m_UnalignedDMA = false;
int32_t CGameSettings::m_RefCount = 0; int32_t CGameSettings::m_RefCount = 0;
@ -99,6 +100,7 @@ void CGameSettings::RefreshGameSettings()
m_OverClockModifier = 20; m_OverClockModifier = 20;
} }
m_DiskSeekTimingType = (DISK_SEEK_TYPE)g_Settings->LoadDword(Game_DiskSeekTiming); m_DiskSeekTimingType = (DISK_SEEK_TYPE)g_Settings->LoadDword(Game_DiskSeekTiming);
m_UnalignedDMA = g_Settings->LoadBool(Game_UnalignedDMA);
RefreshSyncToAudio(); RefreshSyncToAudio();
WriteTrace(TraceN64System, TraceDebug, "Done"); WriteTrace(TraceN64System, TraceDebug, "Done");
} }

View File

@ -119,6 +119,10 @@ public:
{ {
return m_EnableDisk; return m_EnableDisk;
} }
inline static bool UnalignedDMA(void)
{
return m_UnalignedDMA;
}
void RefreshSyncToAudio(void); void RefreshSyncToAudio(void);
static void SetOverClockModifier(bool EnhancmentOverClock, uint32_t EnhancmentOverClockModifier); static void SetOverClockModifier(bool EnhancmentOverClock, uint32_t EnhancmentOverClockModifier);
@ -163,5 +167,6 @@ private:
static bool m_EnhancmentOverClock; static bool m_EnhancmentOverClock;
static uint32_t m_EnhancmentOverClockModifier; static uint32_t m_EnhancmentOverClockModifier;
static bool m_EnableDisk; static bool m_EnableDisk;
static bool m_UnalignedDMA;
static int32_t m_RefCount; static int32_t m_RefCount;
}; };

View File

@ -107,6 +107,7 @@ enum SettingID
Rdb_AudioResetOnLoad, Rdb_AudioResetOnLoad,
Rdb_AllowROMWrites, Rdb_AllowROMWrites,
Rdb_CRC_Recalc, Rdb_CRC_Recalc,
Rdb_UnalignedDMA,
Rdb_RandomizeSIPIInterrupts, Rdb_RandomizeSIPIInterrupts,
Rdb_RPCKey, Rdb_RPCKey,
Rdb_DiskSeekTiming, Rdb_DiskSeekTiming,
@ -163,6 +164,7 @@ enum SettingID
Game_LoadSaveAtStart, Game_LoadSaveAtStart,
Game_OverClockModifier, Game_OverClockModifier,
Game_FullSpeed, Game_FullSpeed,
Game_UnalignedDMA,
Game_RandomizeSIPIInterrupts, Game_RandomizeSIPIInterrupts,
Game_RPCKey, Game_RPCKey,
Game_DiskSeekTiming, Game_DiskSeekTiming,

View File

@ -25,6 +25,7 @@ CGameGeneralPage::CGameGeneralPage(HWND hParent, const RECT & rcDispay)
SetDlgItemText(IDC_SYNC_AUDIO, wGS(ROM_SYNC_AUDIO).c_str()); SetDlgItemText(IDC_SYNC_AUDIO, wGS(ROM_SYNC_AUDIO).c_str());
SetDlgItemText(IDC_DELAY_SI, wGS(ROM_DELAY_SI).c_str()); SetDlgItemText(IDC_DELAY_SI, wGS(ROM_DELAY_SI).c_str());
SetDlgItemText(IDC_AUDIO_SIGNAL, wGS(ROM_AUDIO_SIGNAL).c_str()); SetDlgItemText(IDC_AUDIO_SIGNAL, wGS(ROM_AUDIO_SIGNAL).c_str());
SetDlgItemText(IDC_UNALIGNED_DMA, wGS(ROM_UNALIGNED_DMA).c_str());
SetDlgItemText(IDC_RANDOMIZE_SIPI_INTERRUPTS, wGS(ROM_RANDOMIZE_SIPI_INTERRUPTS).c_str()); SetDlgItemText(IDC_RANDOMIZE_SIPI_INTERRUPTS, wGS(ROM_RANDOMIZE_SIPI_INTERRUPTS).c_str());
AddModCheckBox(GetDlgItem(IDC_SYNC_AUDIO), Game_SyncViaAudio); AddModCheckBox(GetDlgItem(IDC_SYNC_AUDIO), Game_SyncViaAudio);
@ -32,6 +33,7 @@ CGameGeneralPage::CGameGeneralPage(HWND hParent, const RECT & rcDispay)
AddModCheckBox(GetDlgItem(IDC_DELAY_DP), Game_DelayDP); AddModCheckBox(GetDlgItem(IDC_DELAY_DP), Game_DelayDP);
AddModCheckBox(GetDlgItem(IDC_DELAY_SI), Game_DelaySI); AddModCheckBox(GetDlgItem(IDC_DELAY_SI), Game_DelaySI);
AddModCheckBox(GetDlgItem(IDC_AUDIO_SIGNAL), Game_RspAudioSignal); AddModCheckBox(GetDlgItem(IDC_AUDIO_SIGNAL), Game_RspAudioSignal);
AddModCheckBox(GetDlgItem(IDC_UNALIGNED_DMA), Game_UnalignedDMA);
AddModCheckBox(GetDlgItem(IDC_RANDOMIZE_SIPI_INTERRUPTS), Game_RandomizeSIPIInterrupts); AddModCheckBox(GetDlgItem(IDC_RANDOMIZE_SIPI_INTERRUPTS), Game_RandomizeSIPIInterrupts);
CModifiedComboBox * ComboBox; CModifiedComboBox * ComboBox;

View File

@ -18,6 +18,7 @@ class CGameGeneralPage :
COMMAND_ID_HANDLER_EX(IDC_DELAY_DP, CheckBoxChanged); COMMAND_ID_HANDLER_EX(IDC_DELAY_DP, CheckBoxChanged);
COMMAND_ID_HANDLER_EX(IDC_DELAY_SI, CheckBoxChanged); COMMAND_ID_HANDLER_EX(IDC_DELAY_SI, CheckBoxChanged);
COMMAND_ID_HANDLER_EX(IDC_AUDIO_SIGNAL, CheckBoxChanged); COMMAND_ID_HANDLER_EX(IDC_AUDIO_SIGNAL, CheckBoxChanged);
COMMAND_ID_HANDLER_EX(IDC_UNALIGNED_DMA, CheckBoxChanged);
COMMAND_ID_HANDLER_EX(IDC_RANDOMIZE_SIPI_INTERRUPTS, CheckBoxChanged); COMMAND_ID_HANDLER_EX(IDC_RANDOMIZE_SIPI_INTERRUPTS, CheckBoxChanged);
COMMAND_HANDLER_EX(IDC_VIREFRESH, EN_UPDATE, EditBoxChanged); COMMAND_HANDLER_EX(IDC_VIREFRESH, EN_UPDATE, EditBoxChanged);
COMMAND_HANDLER_EX(IDC_COUNTPERBYTE, EN_UPDATE, EditBoxChanged); COMMAND_HANDLER_EX(IDC_COUNTPERBYTE, EN_UPDATE, EditBoxChanged);

View File

@ -228,6 +228,7 @@ BEGIN
CONTROL "RSP Audio Signal",IDC_AUDIO_SIGNAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,143,91,10 CONTROL "RSP Audio Signal",IDC_AUDIO_SIGNAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,143,91,10
CONTROL "Randomize SI/PI interrupts",IDC_RANDOMIZE_SIPI_INTERRUPTS, CONTROL "Randomize SI/PI interrupts",IDC_RANDOMIZE_SIPI_INTERRUPTS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,143,107,10 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,143,107,10
CONTROL "Unaligned DMA",IDC_UNALIGNED_DMA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,154,91,10
END END
IDD_Settings_Accelerator DIALOGEX 0, 0, 218, 183 IDD_Settings_Accelerator DIALOGEX 0, 0, 218, 183

View File

@ -331,6 +331,7 @@
#define IDC_MEMORY_SIZE_TEXT 1153 #define IDC_MEMORY_SIZE_TEXT 1153
#define IDC_SAVE_TYPE_TEXT 1154 #define IDC_SAVE_TYPE_TEXT 1154
#define IDC_SYNC_AUDIO 1156 #define IDC_SYNC_AUDIO 1156
#define IDC_UNALIGNED_DMA 1158
#define IDC_RANDOMIZE_SIPI_INTERRUPTS 1159 #define IDC_RANDOMIZE_SIPI_INTERRUPTS 1159
#define IDC_PROTECT_MEMORY 1160 #define IDC_PROTECT_MEMORY 1160
#define IDC_R16_EDIT 1165 #define IDC_R16_EDIT 1165