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 |
Core application logic and utilities.
|
strong |
Enumerator | |
---|---|
kUnknown | |
kMacOS | |
kiOS | |
kWindows | |
kLinux |
Definition at line 10 of file file_util.h.
std::string yaze::app::core::UppercaseHexByte | ( | uint8_t | byte, |
bool | leading ) |
Definition at line 103 of file common.cc.
Referenced by yaze::app::zelda3::overworld::OverworldMap::DrawAnimatedTiles(), yaze::app::editor::ScreenEditor::DrawDungeonMapsTabs(), yaze::app::editor::DungeonEditor::DrawEntranceSelector(), yaze::app::editor::OverworldEditor::DrawOverworldEntrances(), yaze::app::editor::OverworldEditor::DrawOverworldExits(), yaze::app::editor::DungeonEditor::DrawRoomSelector(), yaze::app::editor::SpriteEditor::DrawSpritesList(), yaze::app::editor::HandleEntityDragging(), yaze::app::editor::Tile16Editor::InitBlockset(), yaze::app::editor::ScreenEditor::LoadDungeonMaps(), yaze::app::zelda3::overworld::Overworld::SaveOverworldMaps(), yaze::app::editor::OverworldEditor::UpdateUsageStats(), yaze::app::Rom::WriteByte(), and yaze::app::Rom::WriteVector().
std::string yaze::app::core::UppercaseHexWord | ( | uint16_t | word, |
bool | leading ) |
Definition at line 111 of file common.cc.
Referenced by yaze::app::editor::MessageEditor::DrawDictionary(), yaze::app::editor::MessageEditor::DrawMessageList(), yaze::app::editor::MessageEditor::ReadAllTextData(), yaze::app::editor::MessageEditor::ReadAllTextDataV2(), yaze::app::Rom::WriteColor(), yaze::app::Rom::WriteShort(), and yaze::app::Rom::WriteWord().
std::string yaze::app::core::UppercaseHexLong | ( | uint32_t | dword | ) |
Definition at line 119 of file common.cc.
Referenced by yaze::app::editor::MessageEditor::DrawMessageList(), yaze::app::editor::MessageEditor::Initialize(), yaze::app::zelda3::overworld::Overworld::SaveOverworldMaps(), and yaze::app::Rom::WriteLong().
std::string yaze::app::core::UppercaseHexLongLong | ( | uint64_t | qword | ) |
Definition at line 123 of file common.cc.
Referenced by yaze::app::editor::EditorManager::DrawInfoPopup().
bool yaze::app::core::StringReplace | ( | std::string & | str, |
const std::string & | from, | ||
const std::string & | to ) |
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().
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().
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().
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().
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().
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().
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().
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().
|
inlinenoexcept |
Definition at line 226 of file common.h.
References kFastRomRegion.
Referenced by yaze::app::editor::BuildDictionaryEntries(), yaze::app::zelda3::overworld::Overworld::DecompressAllMapTiles(), Get24LocalFromPC(), yaze::app::anonymous_namespace{rom.cc}::GetGraphicsAddress(), yaze::cli::SnesToPc::handle(), yaze::app::zelda3::dungeon::Room::LoadAnimatedGraphics(), yaze::app::zelda3::dungeon::Room::LoadChests(), yaze::app::editor::ScreenEditor::LoadDungeonMaps(), yaze::app::zelda3::dungeon::Room::LoadHeader(), yaze::app::zelda3::overworld::Overworld::LoadItems(), yaze::app::zelda3::dungeon::Room::LoadObjects(), yaze::app::zelda3::dungeon::Room::LoadRoomFromROM(), yaze::app::zelda3::dungeon::Room::LoadSprites(), yaze::app::zelda3::overworld::Overworld::LoadSpritesFromMap(), yaze::app::zelda3::screen::TitleScreen::LoadTitleScreen(), yaze::app::editor::ScreenEditor::SaveDungeonMaps(), yaze::app::zelda3::overworld::Overworld::SaveMap16Expanded(), and yaze::app::editor::MemoryEditorWithDiffChecker::Update().
|
inline |
Definition at line 234 of file common.h.
Referenced by Get24LocalFromPC(), yaze::cli::PcToSnes::handle(), yaze::app::zelda3::overworld::Overworld::SaveItems(), yaze::app::zelda3::overworld::Overworld::SaveMap16Expanded(), yaze::app::zelda3::overworld::Overworld::SaveMap32Expanded(), and yaze::app::zelda3::overworld::Overworld::SaveOverworldMaps().
|
inlinenoexcept |
Definition at line 247 of file common.h.
Referenced by yaze::app::anonymous_namespace{rom.cc}::GetGraphicsAddress().
|
inlinenoexcept |
void yaze::app::core::CopyImageToClipboard | ( | const std::vector< uint8_t > & | data | ) |
Definition at line 10 of file clipboard.cc.
Referenced by yaze::app::editor::GraphicsEditor::DrawGfxEditToolset(), and yaze::app::editor::OverworldEditor::DrawToolset().
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().
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().
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().
void yaze::app::core::LoadSystemFonts | ( | ) |
std::string yaze::app::core::GetFileExtension | ( | const std::string & | filename | ) |
Definition at line 17 of file file_util.cc.
std::string yaze::app::core::GetFileName | ( | const std::string & | filename | ) |
Definition at line 25 of file file_util.cc.
std::string yaze::app::core::LoadFile | ( | const std::string & | filename, |
Platform | platform ) |
Definition at line 33 of file file_util.cc.
References GetConfigDirectory().
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().
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().
|
constexpr |
Definition at line 22 of file common.h.
Referenced by CheckVersion(), yaze::app::editor::EditorManager::DrawAboutPopup(), and yaze::app::editor::EditorManager::DrawYazeMenu().
|
constexpr |
Definition at line 224 of file common.h.
Referenced by SnesToPc().