yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::app::core Namespace Reference

Core application logic and utilities. More...

Namespaces

namespace  anonymous_namespace{common.cc}
 
namespace  anonymous_namespace{controller.cc}
 

Classes

class  Controller
 Main controller for the application. More...
 
class  ExperimentFlags
 A class to manage experimental feature flags. More...
 
class  FileDialogWrapper
 
struct  FolderItem
 
class  Logger
 
class  NotifyValue
 A class to manage a value that can be modified and notify when it changes. More...
 
class  Renderer
 The Renderer class represents the renderer for the Yaze application. More...
 
struct  SDL_Deleter
 Deleter for SDL_Window and SDL_Renderer. More...
 
struct  SDL_Surface_Deleter
 Deleter for SDL_Surface. More...
 
struct  SDL_Texture_Deleter
 Deleter for SDL_Texture. More...
 

Typedefs

typedef struct FolderItem FolderItem
 

Enumerations

enum class  Platform {
  kUnknown , kMacOS , kiOS , kWindows ,
  kLinux
}
 

Functions

std::string UppercaseHexByte (uint8_t byte, bool leading)
 
std::string UppercaseHexWord (uint16_t word, bool leading)
 
std::string UppercaseHexLong (uint32_t dword)
 
std::string UppercaseHexLongLong (uint64_t qword)
 
bool StringReplace (std::string &str, const std::string &from, const std::string &to)
 
uint32_t Get24LocalFromPC (uint8_t *data, int addr, bool pc)
 
void stle16b_i (uint8_t *const p_arr, size_t const p_index, uint16_t const p_val)
 Store little endian 16-bit value using a byte pointer, offset by an index before dereferencing.
 
void stle16b (uint8_t *const p_arr, uint16_t const p_val)
 
uint16_t ldle16b (uint8_t const *const p_arr)
 
uint16_t ldle16b_i (uint8_t const *const p_arr, size_t const p_index)
 Load little endian halfword (16-bit) dereferenced from an arrays of bytes. This version provides an index that will be multiplied by 2 and added to the base address.
 
void CreateBpsPatch (const std::vector< uint8_t > &source, const std::vector< uint8_t > &target, std::vector< uint8_t > &patch)
 
void ApplyBpsPatch (const std::vector< uint8_t > &source, const std::vector< uint8_t > &patch, std::vector< uint8_t > &target)
 
absl::StatusOr< std::string > CheckVersion (const char *version)
 
uint32_t SnesToPc (uint32_t addr) noexcept
 
uint32_t PcToSnes (uint32_t addr)
 
int AddressFromBytes (uint8_t bank, uint8_t high, uint8_t low) noexcept
 
uint32_t MapBankToWordAddress (uint8_t bank, uint16_t addr) noexcept
 
void CopyImageToClipboard (const std::vector< uint8_t > &data)
 
void GetImageFromClipboard (std::vector< uint8_t > &data, int &width, int &height)
 
std::string GetBundleResourcePath ()
 GetBundleResourcePath returns the path to the bundle resource directory. Specific to MacOS.
 
absl::Status LoadPackageFonts ()
 
void LoadSystemFonts ()
 
std::string GetFileExtension (const std::string &filename)
 
std::string GetFileName (const std::string &filename)
 
std::string LoadFile (const std::string &filename, Platform platform)
 
void SaveFile (const std::string &filename, const std::string &contents, Platform platform)
 
std::string GetConfigDirectory (Platform platform)
 

Variables

constexpr std::string_view kYazeVersion = "0.2.1"
 
constexpr uint32_t kFastRomRegion = 0x808000
 

Detailed Description

Core application logic and utilities.

Typedef Documentation

◆ FolderItem

typedef struct FolderItem yaze::app::core::FolderItem

Definition at line 284 of file common.h.

Enumeration Type Documentation

◆ Platform

enum class yaze::app::core::Platform
strong
Enumerator
kUnknown 
kMacOS 
kiOS 
kWindows 
kLinux 

Definition at line 10 of file file_util.h.

Function Documentation

◆ UppercaseHexByte()

◆ UppercaseHexWord()

◆ UppercaseHexLong()

◆ UppercaseHexLongLong()

std::string yaze::app::core::UppercaseHexLongLong ( uint64_t qword)

Definition at line 123 of file common.cc.

Referenced by yaze::app::editor::EditorManager::DrawInfoPopup().

◆ StringReplace()

bool yaze::app::core::StringReplace ( std::string & str,
const std::string & from,
const std::string & to )

Definition at line 128 of file common.cc.

◆ Get24LocalFromPC()

uint32_t yaze::app::core::Get24LocalFromPC ( uint8_t * data,
int addr,
bool pc )

Definition at line 139 of file common.cc.

References PcToSnes(), and SnesToPc().

Referenced by yaze::app::editor::MessageEditor::ReadAllTextData(), and yaze::app::editor::MessageEditor::ReadAllTextDataV2().

Here is the call graph for this function:

◆ stle16b_i()

void yaze::app::core::stle16b_i ( uint8_t *const p_arr,
size_t const p_index,
uint16_t const p_val )

Store little endian 16-bit value using a byte pointer, offset by an index before dereferencing.

Definition at line 148 of file common.cc.

References stle16b().

Referenced by yaze::app::zelda3::music::Tracker::SaveSongs().

Here is the call graph for this function:

◆ stle16b()

void yaze::app::core::stle16b ( uint8_t *const p_arr,
uint16_t const p_val )

Definition at line 153 of file common.cc.

Referenced by stle16b_i(), and yaze::app::gfx::lc_lz2::Uncompress().

◆ ldle16b()

uint16_t yaze::app::core::ldle16b ( uint8_t const *const p_arr)

Definition at line 158 of file common.cc.

Referenced by ldle16b_i(), and yaze::app::gfx::lc_lz2::Uncompress().

◆ ldle16b_i()

uint16_t yaze::app::core::ldle16b_i ( uint8_t const *const p_arr,
size_t const p_index )

Load little endian halfword (16-bit) dereferenced from an arrays of bytes. This version provides an index that will be multiplied by 2 and added to the base address.

Definition at line 164 of file common.cc.

References ldle16b().

Referenced by yaze::app::zelda3::music::Tracker::SaveSongs().

Here is the call graph for this function:

◆ CreateBpsPatch()

void yaze::app::core::CreateBpsPatch ( const std::vector< uint8_t > & source,
const std::vector< uint8_t > & target,
std::vector< uint8_t > & patch )

Definition at line 168 of file common.cc.

Referenced by yaze::cli::CreatePatch::handle().

◆ ApplyBpsPatch()

void yaze::app::core::ApplyBpsPatch ( const std::vector< uint8_t > & source,
const std::vector< uint8_t > & patch,
std::vector< uint8_t > & target )

Definition at line 257 of file common.cc.

Referenced by yaze::cli::ApplyPatch::handle().

◆ CheckVersion()

absl::StatusOr< std::string > yaze::app::core::CheckVersion ( const char * version)

Definition at line 327 of file common.cc.

References kYazeVersion.

Referenced by yaze_check_version().

◆ SnesToPc()

◆ PcToSnes()

◆ AddressFromBytes()

int yaze::app::core::AddressFromBytes ( uint8_t bank,
uint8_t high,
uint8_t low )
inlinenoexcept

◆ MapBankToWordAddress()

uint32_t yaze::app::core::MapBankToWordAddress ( uint8_t bank,
uint16_t addr )
inlinenoexcept

Definition at line 251 of file common.h.

◆ CopyImageToClipboard()

void yaze::app::core::CopyImageToClipboard ( const std::vector< uint8_t > & data)

◆ GetImageFromClipboard()

void yaze::app::core::GetImageFromClipboard ( std::vector< uint8_t > & data,
int & width,
int & height )

Definition at line 11 of file clipboard.cc.

Referenced by yaze::app::editor::GraphicsEditor::DrawGfxEditToolset().

◆ GetBundleResourcePath()

std::string yaze::app::core::GetBundleResourcePath ( )

GetBundleResourcePath returns the path to the bundle resource directory. Specific to MacOS.

Referenced by yaze::app::gui::zeml::LoadFile(), and LoadPackageFonts().

◆ LoadPackageFonts()

absl::Status yaze::app::core::LoadPackageFonts ( )

Definition at line 19 of file font_loader.cc.

References FONT_ICON_FILE_NAME_MD, GetBundleResourcePath(), and ICON_MIN_MD.

Referenced by yaze::app::core::Controller::LoadFontFamilies().

Here is the call graph for this function:

◆ LoadSystemFonts()

void yaze::app::core::LoadSystemFonts ( )

◆ GetFileExtension()

std::string yaze::app::core::GetFileExtension ( const std::string & filename)

Definition at line 17 of file file_util.cc.

◆ GetFileName()

std::string yaze::app::core::GetFileName ( const std::string & filename)

Definition at line 25 of file file_util.cc.

◆ LoadFile()

std::string yaze::app::core::LoadFile ( const std::string & filename,
Platform platform )

Definition at line 33 of file file_util.cc.

References GetConfigDirectory().

Here is the call graph for this function:

◆ SaveFile()

void yaze::app::core::SaveFile ( const std::string & filename,
const std::string & contents,
Platform platform )

Definition at line 46 of file file_util.cc.

References GetConfigDirectory().

Here is the call graph for this function:

◆ GetConfigDirectory()

std::string yaze::app::core::GetConfigDirectory ( Platform platform)

Definition at line 56 of file file_util.cc.

References kLinux, kMacOS, and kWindows.

Referenced by yaze::app::core::Controller::LoadConfigFiles(), LoadFile(), and SaveFile().

Variable Documentation

◆ kYazeVersion

std::string_view yaze::app::core::kYazeVersion = "0.2.1"
constexpr

◆ kFastRomRegion

uint32_t yaze::app::core::kFastRomRegion = 0x808000
constexpr

Definition at line 224 of file common.h.

Referenced by SnesToPc().