1#ifndef YAZE_ZELDA3_MUSIC_SPC_SERIALIZER_H
2#define YAZE_ZELDA3_MUSIC_SPC_SERIALIZER_H
8#include "absl/status/statusor.h"
39 std::vector<uint8_t>
data;
48 uint16_t base_address);
57 const MusicSong& song,
int start_segment, uint16_t base_address);
60 uint16_t new_base_address);
67 uint8_t* current_duration);
static std::vector< uint8_t > SerializeTrack(const MusicTrack &track)
static std::vector< uint8_t > SerializeCommand(const MusicCommand &command)
static absl::StatusOr< SerializeResult > SerializeSong(const MusicSong &song, uint16_t base_address)
static int CalculateRequiredSpace(const MusicSong &song)
static absl::StatusOr< SerializeResult > SerializeSongFromSegment(const MusicSong &song, int start_segment, uint16_t base_address)
Serialize a song starting from a specific segment (for seeking).
static std::vector< uint8_t > SerializeNote(const Note ¬e, uint8_t *current_duration)
static void ApplyBaseAddress(SerializeResult *result, uint16_t new_base_address)
Represents an N-SPC command (opcodes 0xE0-0xFF).
A complete song composed of segments.
One of 8 channels in a music segment.
Represents a single musical note.
uint16_t base_aram_address
Result of serialization with relocation info.
std::vector< uint16_t > relocations
std::vector< uint8_t > data