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  AsyncMessageDispatcher
 
class  Controller
 Main controller for the application. More...
 
class  ExperimentFlags
 A class to manage experimental feature flags. More...
 
class  FileDialogWrapper
 
struct  FolderItem
 
class  IMessageListener
 
class  IMessageProtocol
 
class  Logger
 
struct  Message
 
class  MessageDispatcher
 
class  MessageFilter
 
class  NotifyValue
 A class to manage a value that can be modified and notify when it changes. More...
 
class  ObjectFactory
 
class  Reflectable
 
class  Renderer
 The Renderer class represents the renderer for the Yaze application. More...
 
struct  ResourceLabelManager
 
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...
 
class  Swizzler
 

Typedefs

typedef struct FolderItem FolderItem
 
using MessageHandler = std::function<void(const Message&)>
 

Enumerations

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

Functions

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
 
std::string UppercaseHexByte (uint8_t byte, bool leading)
 
std::string UppercaseHexWord (uint16_t word)
 
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)
 
void CopyImageToClipboard (const std::vector< uint8_t > &data)
 
void GetImageFromClipboard (std::vector< uint8_t > &data, int &width, int &height)
 
std::string GetBundleResourcePath ()
 
std::string LoadFile (const std::string &filename)
 
std::string GetFileExtension (const std::string &filename)
 
std::string GetFileName (const std::string &filename)
 

Variables

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

Detailed Description

Core application logic and utilities.

Typedef Documentation

◆ FolderItem

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

Definition at line 281 of file common.h.

◆ MessageHandler

using yaze::app::core::MessageHandler = std::function<void(const Message&)>

Definition at line 47 of file message.h.

Enumeration Type Documentation

◆ Platform

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

Definition at line 26 of file controller.h.

Function Documentation

◆ Get24LocalFromPC()

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

Definition at line 104 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 113 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 118 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 123 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 129 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 133 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 222 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 292 of file common.cc.

References kYazeVersion.

Referenced by yaze_check_version().

◆ SnesToPc()

◆ PcToSnes()

uint32_t yaze::app::core::PcToSnes ( uint32_t addr)
inline

◆ 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 248 of file common.h.

◆ UppercaseHexByte()

◆ UppercaseHexWord()

◆ UppercaseHexLong()

std::string yaze::app::core::UppercaseHexLong ( uint32_t dword)

◆ UppercaseHexLongLong()

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

Definition at line 37 of file labeling.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 42 of file labeling.cc.

◆ 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 ( )

◆ LoadFile()

std::string yaze::app::core::LoadFile ( const std::string & filename)
Todo
Load a file based on the platform and add error handling

Definition at line 17 of file file_util.cc.

◆ GetFileExtension()

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

Definition at line 10 of file file_util.h.

◆ GetFileName()

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

Definition at line 18 of file file_util.h.

Variable Documentation

◆ kFastRomRegion

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

Definition at line 221 of file common.h.

Referenced by SnesToPc().

◆ kYazeVersion

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