yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
message_data.h File Reference
#include <optional>
#include <regex>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>
#include <nlohmann/json.hpp>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/match.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_replace.h"
#include "rom/rom.h"

Go to the source code of this file.

Classes

struct  yaze::editor::MessageParseResult
 
struct  yaze::editor::DictionaryEntry
 
struct  yaze::editor::MessageData
 
struct  yaze::editor::MessageBundleEntry
 
struct  yaze::editor::TextElement
 
struct  yaze::editor::ParsedElement
 

Namespaces

namespace  yaze
 
namespace  yaze::editor
 Editors are the view controllers for the application.
 

Enumerations

enum class  yaze::editor::MessageBank { yaze::editor::kVanilla , yaze::editor::kExpanded }
 

Functions

uint8_t yaze::editor::FindMatchingCharacter (char value)
 
int8_t yaze::editor::FindDictionaryEntry (uint8_t value)
 
std::vector< uint8_t > yaze::editor::ParseMessageToData (std::string str)
 
MessageParseResult yaze::editor::ParseMessageToDataWithDiagnostics (std::string_view str)
 
std::string yaze::editor::MessageBankToString (MessageBank bank)
 
absl::StatusOr< MessageBankyaze::editor::MessageBankFromString (std::string_view value)
 
std::vector< DictionaryEntryyaze::editor::BuildDictionaryEntries (Rom *rom)
 
std::string yaze::editor::ReplaceAllDictionaryWords (std::string str, const std::vector< DictionaryEntry > &dictionary)
 
DictionaryEntry yaze::editor::FindRealDictionaryEntry (uint8_t value, const std::vector< DictionaryEntry > &dictionary)
 
std::optional< TextElementyaze::editor::FindMatchingCommand (uint8_t b)
 
std::optional< TextElementyaze::editor::FindMatchingSpecial (uint8_t value)
 
ParsedElement yaze::editor::FindMatchingElement (const std::string &str)
 
std::string yaze::editor::ParseTextDataByte (uint8_t value)
 
absl::StatusOr< MessageDatayaze::editor::ParseSingleMessage (const std::vector< uint8_t > &rom_data, int *current_pos)
 
std::vector< std::string > yaze::editor::ParseMessageData (std::vector< MessageData > &message_data, const std::vector< DictionaryEntry > &dictionary_entries)
 
std::vector< MessageDatayaze::editor::ReadAllTextData (uint8_t *rom, int pos, int max_pos)
 
absl::Status yaze::editor::LoadExpandedMessages (std::string &expanded_message_path, std::vector< std::string > &parsed_messages, std::vector< MessageData > &expanded_messages, std::vector< DictionaryEntry > &dictionary)
 
nlohmann::json yaze::editor::SerializeMessagesToJson (const std::vector< MessageData > &messages)
 
absl::Status yaze::editor::ExportMessagesToJson (const std::string &path, const std::vector< MessageData > &messages)
 
nlohmann::json yaze::editor::SerializeMessageBundle (const std::vector< MessageData > &vanilla, const std::vector< MessageData > &expanded)
 
absl::Status yaze::editor::ExportMessageBundleToJson (const std::string &path, const std::vector< MessageData > &vanilla, const std::vector< MessageData > &expanded)
 
absl::StatusOr< std::vector< MessageBundleEntry > > yaze::editor::ParseMessageBundleJson (const nlohmann::json &json)
 
absl::StatusOr< std::vector< MessageBundleEntry > > yaze::editor::LoadMessageBundleFromJson (const std::string &path)
 
std::vector< std::string > yaze::editor::ValidateMessageLineWidths (const std::string &message)
 
std::optional< std::pair< int, std::string > > yaze::editor::ParseOrgHeader (const std::string &line)
 
std::vector< std::pair< int, std::string > > yaze::editor::ParseOrgContent (const std::string &content)
 
std::string yaze::editor::ExportToOrgFormat (const std::vector< std::pair< int, std::string > > &messages, const std::vector< std::string > &labels)
 
int yaze::editor::GetExpandedTextDataStart ()
 
int yaze::editor::GetExpandedTextDataEnd ()
 
std::vector< MessageDatayaze::editor::ReadExpandedTextData (uint8_t *rom, int pos)
 
absl::Status yaze::editor::WriteExpandedTextData (Rom *rom, int start, int end, const std::vector< std::string > &messages)
 
absl::Status yaze::editor::WriteExpandedTextData (uint8_t *rom, int start, int end, const std::vector< std::string > &messages)
 
absl::Status yaze::editor::WriteAllTextData (Rom *rom, const std::vector< MessageData > &messages)
 

Variables

const std::string yaze::editor::kBankToken = "BANK"
 
const std::string yaze::editor::DICTIONARYTOKEN = "D"
 
constexpr uint8_t yaze::editor::kMessageTerminator = 0x7F
 
constexpr uint8_t yaze::editor::DICTOFF = 0x88
 
constexpr uint8_t yaze::editor::kWidthArraySize = 100
 
constexpr uint8_t yaze::editor::kBankSwitchCommand = 0x80
 
constexpr int yaze::editor::kTextData = 0xE0000
 
constexpr int yaze::editor::kTextDataEnd = 0xE7FFF
 
constexpr int yaze::editor::kNumDictionaryEntries = 0x61
 
constexpr int yaze::editor::kPointersDictionaries = 0x74703
 
constexpr uint8_t yaze::editor::kScrollVertical = 0x73
 
constexpr uint8_t yaze::editor::kLine1 = 0x74
 
constexpr uint8_t yaze::editor::kLine2 = 0x75
 
constexpr uint8_t yaze::editor::kLine3 = 0x76
 
const std::string yaze::editor::CHEESE = "\uBEBE"
 
constexpr int yaze::editor::kMessageBundleVersion = 1
 
constexpr int yaze::editor::kTextData2 = 0x75F40
 
constexpr int yaze::editor::kTextData2End = 0x773FF
 
constexpr int yaze::editor::kMaxLineWidth = 32
 
constexpr int yaze::editor::kExpandedTextDataDefault = 0x178000
 
constexpr int yaze::editor::kExpandedTextDataEndDefault = 0x17FFFF