yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
rom.cc File Reference
#include "rom.h"
#include <algorithm>
#include <atomic>
#include <cerrno>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <new>
#include <string>
#include <system_error>
#include <vector>
#include "absl/cleanup/cleanup.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "app/gfx/types/snes_color.h"
#include "app/gfx/types/snes_tile.h"
#include "rom/write_fence.h"
#include "util/hex.h"
#include "util/log.h"
#include "util/macro.h"
#include <fcntl.h>
#include <unistd.h>

Go to the source code of this file.

Namespaces

namespace  yaze
 
namespace  yaze::anonymous_namespace{rom.cc}
 

Functions

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

Variables

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