4343#include " EmuShared.h"
4444#include " core\hle\D3D8\Direct3D9\Direct3D9.h" // For CxbxInitWindow, EmuD3DInit
4545#include " core\hle\DSOUND\DirectSound\DirectSound.hpp" // For CxbxInitAudio
46- #ifdef CHIHIRO_WORK
4746#include " core\hle\JVS\JVS.h" // For JVS_Init
48- #endif
4947#include " core\hle\Intercept.hpp"
5048#include " core\kernel\memory-manager\VMManager.h"
5149#include " CxbxDebugger.h"
@@ -589,9 +587,11 @@ static bool CxbxrKrnlXbeSystemSelector(int BootFlags,
589587 // Clear emulation system from reserved systems so all unneeded memory ranges can be freed.
590588 reserved_systems &= ~emulate_system;
591589
592- #ifdef CHIHIRO_WORK
593590 // If the Xbe is Chihiro, and we were not launched by SEGABOOT, we need to load SEGABOOT from the Chihiro Media Board rom instead!
594- if (BootFlags == BOOT_NONE && emulate_system == SYSTEM_CHIHIRO) {
591+ // All checks are absolutely necessary in order to support both "auto select" and forced chihiro mode.
592+ if (BootFlags == BOOT_NONE &&
593+ emulate_system == SYSTEM_CHIHIRO &&
594+ std::filesystem::exists (xbeDirectory / " boot.id" )) {
595595
596596 std::string chihiroMediaBoardRom = g_DataFilePath + " /EmuDisk/" + MediaBoardRomFile;
597597 if (!std::filesystem::exists (chihiroMediaBoardRom)) {
@@ -653,7 +653,6 @@ static bool CxbxrKrnlXbeSystemSelector(int BootFlags,
653653 CxbxLaunchNewXbe (chihiroSegaBootNew);
654654 CxbxrShutDown (true );
655655 }
656- #endif // Chihiro wip block
657656
658657 // Once we have determine which system type to run as, enforce it in future reboots.
659658 if ((BootFlags & BOOT_QUICK_REBOOT) == 0 ) {
@@ -677,17 +676,11 @@ static bool CxbxrKrnlXbeSystemSelector(int BootFlags,
677676 hardwareModel = HardwareModel::Revision1_6;
678677 }
679678
680- #ifdef CHIHIRO_WORK
681679 // If this is a Chihiro title, we need to patch the init flags to disable HDD setup
682680 // The Chihiro kernel does this, so we should too!
683681 if (g_bIsChihiro) {
684682 CxbxKrnl_Xbe->m_Header .dwInitFlags .bDontSetupHarddisk = true ;
685683 }
686- #else
687- if (g_bIsChihiro) {
688- CxbxrAbort (" Emulating Chihiro mode does not work yet. Please use different title to emulate." );
689- }
690- #endif
691684
692685 CxbxrKrnlSetupMemorySystem (BootFlags, emulate_system, reserved_systems, blocks_reserved);
693686 return true ;
@@ -1412,12 +1405,10 @@ static void CxbxrKrnlInitHacks()
14121405
14131406 EmuInitFS ();
14141407
1415- #ifdef CHIHIRO_WORK
14161408 // If this title is Chihiro, Setup JVS
14171409 if (g_bIsChihiro) {
14181410 JVS_Init ();
14191411 }
1420- #endif
14211412
14221413 EmuX86_Init ();
14231414 // Start the event thread
0 commit comments