1#ifndef YAZE_ZELDA3_MUSIC_SPC_SERIALIZER_H
2#define YAZE_ZELDA3_MUSIC_SPC_SERIALIZER_H
8#include "absl/status/statusor.h"
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);
Serializes MusicSong to N-SPC byte format for direct ARAM upload.
static int CalculateRequiredSpace(const MusicSong &song)
static std::vector< uint8_t > SerializeNote(const Note ¬e, uint8_t *current_duration)
static std::vector< uint8_t > SerializeCommand(const MusicCommand &command)
static absl::StatusOr< SerializeResult > SerializeSong(const MusicSong &song, uint16_t base_address)
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 void ApplyBaseAddress(SerializeResult *result, uint16_t new_base_address)
static std::vector< uint8_t > SerializeTrack(const MusicTrack &track)
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
std::vector< uint16_t > relocations
std::vector< uint8_t > data