Skip to content

Commit

Permalink
Merge pull request #70 from wally4000/Cleanup_Reset
Browse files Browse the repository at this point in the history
Cleanup reset
  • Loading branch information
z2442 authored Aug 15, 2024
2 parents da2e046 + bb4cf85 commit 8072b78
Show file tree
Hide file tree
Showing 143 changed files with 583 additions and 844 deletions.
4 changes: 3 additions & 1 deletion Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ if(INTRAFONT)
message("Using Intrafont")
add_compile_definitions(INTRAFONT)
else()
message("using SDL2_TTF")
if(DAEDALUS_PSP)
message("Not using intrafont")
add_compile_definitions(DAEDALUS_SDL)
endif()
endif()
28 changes: 0 additions & 28 deletions Source/Base/Path.h

This file was deleted.

22 changes: 13 additions & 9 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ else()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
add_compile_definitions(DAEDALUS_CONFIG_VERSION="Release") ## Show the build type in the UI
option(DAEDALUS_SILENT "Shhh, no debug console message, on by default" ON)
endif()

option(DAEDALUS_DEBUG_CONSOLE "Enable Debug Console" OFF)
message (${CMAKE_CXX_FLAGS_RELEASE})
if(DAEDALUS_CTR)
set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
endif()
endif()
#Determine Dynarec compatibility and link in appropriate Dynarec
#Todo: Move all relevant Dynarec to the Dynarec/arch folder and enable here when correct platform is detected
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64" )
Expand Down Expand Up @@ -75,7 +81,7 @@ endif()
# General options

option(DAEDALUS_BATCH_TEST_ENABLED "Enable batch testing for compatibility" OFF)
option(DAEDALUS_ENABLE_OS_HOOKS "Enable High Level Emulation Hooks" ON) ## Per platform?

option(DAEDALUS_COMPRESSED_ROM_SUPPORT "Enable Compressed ROM Support" OFF) ## Probably should be a default option.
option(DAEDALUS_LOG "Log stuff " OFF) ## NEeds to be off on the PSP unless debugging

Expand Down Expand Up @@ -112,10 +118,10 @@ endif()
option(DAEDALUS_SIM_DOUBLES "Simulate Doubles" ON)
option(INTRAFONT "Use Native Fonts" ON) #If this is off, SDL will be enabled
option(DAEDALUS_SDL "Enable SDL" OFF)
option(DAEDALUS_ENABLE_OS_HOOKS "Enable High Level Emulation Hooks" ON)

elseif(UNIX)
option(DAEDALUS_SDL "SDL Build" ON)
option(DAEDALUS_ENABLE_DYNAREC "Enable Dynamic Recompilation, Disable if system not supported" OFF)
option(DAEDALUS_POSIX "Posix specific options" ON)
option(DAEDALUS_ACCURATE_TMEM "Accurate TMEM" ON)
option(DAEDALUS_128BIT_MULT "128 Bit Multiplication, not supported on PSP" ON)
Expand All @@ -126,15 +132,13 @@ endif()
option(DAED_USE_VIRTUAL_ALLOC "Use Windows Memory specifiers" ON) # We probably need to remove and simplfy this using modern C++
option(DAEDALUS_ACCURATE_CVT "Convert using the rounding mode specified in the Floating Control/Status register (FCSR)" ON)
option(DAEDALUS_W32 "Windows specific Options" ON)
option(DAEDALUS_ENABLE_DYNAREC "Enable Dynamic Recompilation, Disable if system not supported" ON)
option(DAEDALUS_ACCURATE_TMEM "Accurate TMEM" ON)
option(DAEDALUS_BREAKPOINTS_ENABLED "Enable Breakpoints" OFF)
option(DAEDALUS_GL "OpenGL Renderer" ON)
enable_language(CXX ASM_MASM)
elseif(CTR)
option(DAEDALUS_ENABLE_OS_HOOKS "Enable High Level Emulation Hooks" OFF) ## Causes some weird black screen issues
option(DAEDALUS_CTR "3DS Specific Options" ON)
option(DAEDALUS_ENABLE_DYNAREC "Enable Dynamic Recompilation" ON)
option(DAEDALUS_ENABLE_OS_HOOKS " High Level Emulation Hooks" ON)
endif()

# Needed below the options to post process
Expand Down Expand Up @@ -203,22 +207,22 @@ find_package(ZLIB REQUIRED)
link_libraries(ZLIB::ZLIB)

## Daedalus Core Build
add_subdirectory(Config)
add_subdirectory(Core)
add_subdirectory(Debug)
add_subdirectory(DynaRec)
add_subdirectory(Graphics)
add_subdirectory(HLEAudio)
add_subdirectory(HLEGraphics)
add_subdirectory(Interface)
add_subdirectory(Input)
add_subdirectory(Math)
add_subdirectory(OSHLE)
add_subdirectory(RomFile)
add_subdirectory(System)
add_subdirectory(Test)
add_subdirectory(Utility)
if(NOT CTR)
add_subdirectory(UI)

endif()
if(UNIX)
add_subdirectory(SysPosix)
add_subdirectory(SysGL)
Expand Down
4 changes: 0 additions & 4 deletions Source/Config/CMakeLists.txt

This file was deleted.

14 changes: 4 additions & 10 deletions Source/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
add_library(Core OBJECT
HvqmTask.cpp
RDRam.cpp
Cheats.cpp


CPU.cpp
DMA.cpp
Dynamo.cpp
Dynamo.cpp
FlashMem.cpp
FramerateLimiter.cpp
Interpret.cpp
Interrupt.cpp
JpegTask.cpp
Memory.cpp
PIF.cpp
PrintOpCode.cpp
R4300.cpp
Registers.cpp
RDRam.cpp
ROM.cpp
ROMBuffer.cpp
ROMImage.cpp
RomSettings.cpp
RSP_HLE.cpp
Save.cpp
TLB.cpp
Expand Down
14 changes: 7 additions & 7 deletions Source/Core/CPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "System/Mutex.h"
#include <cstring>

#include "Config/ConfigOptions.h"
#include "Core/Cheats.h"
#include "Interface/ConfigOptions.h"
#include "Interface/Cheats.h"
#include "Core/Dynamo.h"
#include "Core/Interpret.h"
#include "Core/Interrupt.h"
#include "Core/Memory.h"
#include "Core/R4300.h"
#include "Core/Registers.h" // For REG_?? defines
#include "Debug/Registers.h" // For REG_?? defines
#include "Core/ROM.h"
#include "Core/ROMBuffer.h"
#include "RomFile/ROMBuffer.h"
#include "Core/RSP_HLE.h"
#include "Core/Save.h"
#include "Interface/SaveState.h"
Expand All @@ -47,10 +47,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Ultra/ultra_R4300.h"
#include "System/SystemInit.h"
#include "System/AtomicPrimitives.h"
#include "Core/FramerateLimiter.h"
#include "Utility/FramerateLimiter.h"
#include "Utility/Hash.h"
#include "Base/Macros.h"
#include "Core/PrintOpCode.h"
#include "Debug/PrintOpCode.h"
#include "Debug/Synchroniser.h"
#include "System/Thread.h"

Expand Down Expand Up @@ -678,7 +678,7 @@ void CPU_HANDLE_COUNT_INTERRUPT()
// interrupt the dynamo tracer for instance)
// TODO(strmnnrmn): should register this with CPU_RegisterVblCallback.
if ((gVerticalInterrupts & 0x3F) == 0) { // once every 60 VBLs
// Save_Flush();
Save_Flush();
for (size_t i = 0; i < gVblCallbacks.size(); ++i)
{
VblCallback & callback = gVblCallbacks[i];
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/CPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Core/R4300OpCode.h"
#include "Core/TLB.h"
#include "System/SpinLock.h"
#include "System/IO.h"
#include "Utility/Paths.h"
//*****************************************************************************
//
//*****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DMA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Core/RSP_HLE.h"
#include "Core/CPU.h"
#include "Core/ROM.h"
#include "Core/ROMBuffer.h"
#include "RomFile/ROMBuffer.h"
#include "Core/PIF.h"
#include "Core/Interrupt.h"
#include "Core/Save.h"
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/Dynamo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Core/Memory.h"
#include "Core/Interrupt.h"
#include "Core/R4300.h"
#include "Core/Registers.h"
#include "Config/ConfigOptions.h"
#include "Debug/Registers.h"
#include "Interface/ConfigOptions.h"
#include "Debug/DBGConsole.h"
#include "Debug/DebugLog.h"
#include "DynaRec/DynaRecProfile.h"
Expand All @@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "DynaRec/TraceRecorder.h"
#include "OSHLE/patch.h" // GetCorrectOp
#include "Ultra/ultra_R4300.h"
#include "System/IO.h"

#include "Base/Macros.h"
#include "Utility/Profiler.h"
#include "Debug/Synchroniser.h"
Expand Down Expand Up @@ -305,8 +305,8 @@ bool SortByHitCount( const SAddressHitCount & a, const SAddressHitCount & b )
//*****************************************************************************
void CPU_DumpFragmentCache()
{
std::filesystem::path& dynarecDump = baseDir;
dynarecDump /= "DynarecDump";

std::filesystem::path dynarecDump = setBasePath("DynarecDump");
std::filesystem::create_directory(dynarecDump);

dynarecDump /= "hot_trace_map.html";
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Interpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Base/Types.h"

#include "Core/CPU.h"
#include "Core/Registers.h" // For REG_?? defines
#include "Debug/Registers.h" // For REG_?? defines
#include "Core/Memory.h"
#include "Core/Interpret.h"
#include "Core/Interrupt.h"
#include "Core/ROMBuffer.h"
#include "RomFile/ROMBuffer.h"
#include "Core/R4300.h"
#include "Config/ConfigOptions.h"
#include "Interface/ConfigOptions.h"
#include "Debug/DBGConsole.h"
#include "Debug/DebugLog.h"
#include "OSHLE/patch.h" // GetCorrectOp
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Core/Interrupt.h"
#include "Core/Memory.h"
#include "Core/ROM.h"
#include "Core/ROMBuffer.h"
#include "Config/ConfigOptions.h"
#include "RomFile/ROMBuffer.h"
#include "Interface/ConfigOptions.h"
#include "Debug/DBGConsole.h"
#include "Debug/DebugLog.h"
#include "Debug/DebugLog.h"
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/PIF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ IController::IController() :
mpEepromData( nullptr )
{
#ifdef DAEDALUS_DEBUG_PIF
std::filesystem::path controller_path = baseDir;
controller_path /= "controller.txt";

std::filesystem::path controller_path = setBasePath("controller.txt");
mDebugFile.open(controller_path, std::ios::out);
#endif

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/R4300.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Core/Interrupt.h"
#include "Core/R4300.h"
#include "Core/ROM.h"
#include "Config/ConfigOptions.h"
#include "Core/Registers.h" // For REG_?? defines
#include "Interface/ConfigOptions.h"
#include "Debug/Registers.h" // For REG_?? defines
#include "Debug/DBGConsole.h"
#include "Debug/DebugLog.h"
#include "DynaRec/TraceRecorder.h"
Expand Down
12 changes: 6 additions & 6 deletions Source/Core/ROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
#include <cstring>

#include "Core/Cheats.h"
#include "Interface/Cheats.h"
#include "Core/CPU.h"
#include "Core/PIF.h" // CController
#include "Core/R4300.h"
#include "Core/ROMBuffer.h"
#include "RomFile/ROMBuffer.h"
#include "Core/ROMImage.h"
#include "Core/RomSettings.h"
#include "Config/ConfigOptions.h"
#include "RomFile/RomSettings.h"
#include "Interface/ConfigOptions.h"
#include "Debug/DBGConsole.h"
#include "Debug/DebugLog.h"
#include "Interface/RomDB.h"
Expand All @@ -42,8 +42,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "HLEAudio/AudioPlugin.h"
#include "HLEGraphics/GraphicsPlugin.h"
#include "Utility/CRC.h"
#include "Core/FramerateLimiter.h"
#include "System/IO.h"
#include "Utility/FramerateLimiter.h"

#include "Base/Macros.h"
#include "Interface/Preferences.h"
#include "RomFile/RomFile.h"
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/ROM.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CORE_ROM_H_

#include "Core/ROMImage.h"
#include "System/IO.h"

#include <string>
#include <filesystem>
class RomID
Expand Down Expand Up @@ -82,7 +82,7 @@ class RomID
u8 CountryID;
};

#include "RomSettings.h"
#include "RomFile/RomSettings.h"

struct SRomPreferences;

Expand Down
11 changes: 10 additions & 1 deletion Source/Core/ROMImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#include "Base/Types.h"
#include "Core/ROMImage.h"

#include <sstream>
#include <string>
// Find out the CIC type
ECicType ROM_GenerateCICType( const u8 * p_rom_base )
{
Expand Down Expand Up @@ -58,3 +59,11 @@ const char * ROM_GetCicName( ECicType cic_type )
default: return "?";
}
}

std::string ROM_GetCRC(const ROMHeader& header)
{
// Convert CRC values to strings and concatenate them
std::stringstream crcStream;
crcStream << "{" << std::hex << std::uppercase << header.CRC1 << header.CRC2 << "}";
return crcStream.str();
}
4 changes: 4 additions & 0 deletions Source/Core/ROMImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CORE_ROMIMAGE_H_

#include "Base/Types.h"
#include <sstream>
#include <string>

//const u32 RAMROM_FONTDATA_SIZE = 1152;
//const u32 RAMROM_CLOCKRATE_MASK = 0xfffffff0;
Expand Down Expand Up @@ -72,4 +74,6 @@ ECicType ROM_GenerateCICType( const u8 * rom_base );

const char * ROM_GetCicName( ECicType cic_type );

std::string ROM_GetCRC(const ROMHeader& header);

#endif // CORE_ROMIMAGE_H_
Loading

0 comments on commit 8072b78

Please sign in to comment.