yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::anonymous_namespace{rom.cc} Namespace Reference

Functions

bool HasInternalHeaderAt (const uint8_t *data, size_t size, size_t offset)
 
bool HasInternalHeader (const uint8_t *data, size_t size, size_t base)
 
void MaybeStripCopierHeader (std::vector< uint8_t > &rom_data, std::vector< uint8_t > &header, CopierHeaderReason &reason)
 
std::string MakeSafeTimestamp (std::time_t now_c)
 
absl::StatusOr< std::filesystem::path > GetAvailableBackupPath (const std::filesystem::path &requested_path)
 
void BestEffortFsyncFile (const std::filesystem::path &path)
 
void BestEffortFsyncParentDir (const std::filesystem::path &file_path)
 
absl::Status CreateRequiredBackup (const std::filesystem::path &source_path, const std::filesystem::path &requested_backup_path)
 
absl::StatusOr< std::filesystem::path > WriteExclusiveRomTemp (const std::filesystem::path &target_path, const std::vector< uint8_t > &bytes)
 

Variables

constexpr size_t kCopierHeaderAlignment = 0x8000
 SNES ROM images are multiples of 32 KB; a copier header adds 0x200.
 
constexpr size_t kLoRomInternalHeader = 0x7FC0
 
constexpr size_t kHiRomInternalHeader = 0xFFC0
 
std::atomic< bool > g_fail_rom_staging_for_testing {false}
 

Function Documentation

◆ HasInternalHeaderAt()

bool yaze::anonymous_namespace{rom.cc}::HasInternalHeaderAt ( const uint8_t * data,
size_t size,
size_t offset )

Definition at line 59 of file rom.cc.

References HasInternalHeaderAt().

Referenced by HasInternalHeader(), and HasInternalHeaderAt().

Here is the call graph for this function:

◆ HasInternalHeader()

bool yaze::anonymous_namespace{rom.cc}::HasInternalHeader ( const uint8_t * data,
size_t size,
size_t base )

Definition at line 69 of file rom.cc.

References HasInternalHeader(), HasInternalHeaderAt(), kHiRomInternalHeader, and kLoRomInternalHeader.

Referenced by HasInternalHeader().

Here is the call graph for this function:

◆ MaybeStripCopierHeader()

void yaze::anonymous_namespace{rom.cc}::MaybeStripCopierHeader ( std::vector< uint8_t > & rom_data,
std::vector< uint8_t > & header,
CopierHeaderReason & reason )

Definition at line 74 of file rom.cc.

References yaze::CopierHeaderReasonName(), yaze::DetectCopierHeader(), yaze::kCopierHeaderSize, yaze::kNone, LOG_INFO, and MaybeStripCopierHeader().

Referenced by MaybeStripCopierHeader().

Here is the call graph for this function:

◆ MakeSafeTimestamp()

std::string yaze::anonymous_namespace{rom.cc}::MakeSafeTimestamp ( std::time_t now_c)

Definition at line 88 of file rom.cc.

References MakeSafeTimestamp().

Referenced by MakeSafeTimestamp().

Here is the call graph for this function:

◆ GetAvailableBackupPath()

absl::StatusOr< std::filesystem::path > yaze::anonymous_namespace{rom.cc}::GetAvailableBackupPath ( const std::filesystem::path & requested_path)

Definition at line 116 of file rom.cc.

References GetAvailableBackupPath().

Referenced by CreateRequiredBackup(), and GetAvailableBackupPath().

Here is the call graph for this function:

◆ BestEffortFsyncFile()

void yaze::anonymous_namespace{rom.cc}::BestEffortFsyncFile ( const std::filesystem::path & path)

Definition at line 335 of file rom.cc.

References BestEffortFsyncFile().

Referenced by BestEffortFsyncFile(), and CreateRequiredBackup().

Here is the call graph for this function:

◆ BestEffortFsyncParentDir()

void yaze::anonymous_namespace{rom.cc}::BestEffortFsyncParentDir ( const std::filesystem::path & file_path)

Definition at line 357 of file rom.cc.

References BestEffortFsyncParentDir().

Referenced by BestEffortFsyncParentDir(), and CreateRequiredBackup().

Here is the call graph for this function:

◆ CreateRequiredBackup()

absl::Status yaze::anonymous_namespace{rom.cc}::CreateRequiredBackup ( const std::filesystem::path & source_path,
const std::filesystem::path & requested_backup_path )

Definition at line 142 of file rom.cc.

References BestEffortFsyncFile(), BestEffortFsyncParentDir(), CreateRequiredBackup(), and GetAvailableBackupPath().

Referenced by CreateRequiredBackup().

Here is the call graph for this function:

◆ WriteExclusiveRomTemp()

absl::StatusOr< std::filesystem::path > yaze::anonymous_namespace{rom.cc}::WriteExclusiveRomTemp ( const std::filesystem::path & target_path,
const std::vector< uint8_t > & bytes )

Definition at line 193 of file rom.cc.

References g_fail_rom_staging_for_testing, and WriteExclusiveRomTemp().

Referenced by WriteExclusiveRomTemp().

Here is the call graph for this function:

Variable Documentation

◆ kCopierHeaderAlignment

constexpr size_t yaze::anonymous_namespace{rom.cc}::kCopierHeaderAlignment = 0x8000
constexpr

SNES ROM images are multiples of 32 KB; a copier header adds 0x200.

Definition at line 53 of file rom.cc.

◆ kLoRomInternalHeader

constexpr size_t yaze::anonymous_namespace{rom.cc}::kLoRomInternalHeader = 0x7FC0
constexpr

Definition at line 54 of file rom.cc.

Referenced by HasInternalHeader().

◆ kHiRomInternalHeader

constexpr size_t yaze::anonymous_namespace{rom.cc}::kHiRomInternalHeader = 0xFFC0
constexpr

Definition at line 55 of file rom.cc.

Referenced by HasInternalHeader().

◆ g_fail_rom_staging_for_testing

std::atomic<bool> yaze::anonymous_namespace{rom.cc}::g_fail_rom_staging_for_testing {false}

Definition at line 191 of file rom.cc.

Referenced by WriteExclusiveRomTemp().