yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
collision_source_pairing.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SYSTEM_SESSION_COLLISION_SOURCE_PAIRING_H_
2#define YAZE_APP_EDITOR_SYSTEM_SESSION_COLLISION_SOURCE_PAIRING_H_
3
4#include <filesystem>
5
6#include "absl/status/status.h"
7#include "rom/rom.h"
8
9namespace yaze::editor {
10
11// A project ROM rebind must keep its existing source contract intact. This
12// read-only preflight requires the replacement ROM to reproduce the configured
13// source exactly; it never publishes a new source or changes either ROM.
15 Rom* replacement_rom, const std::filesystem::path& json_path);
16
17// Saves `rom` to its own filename and keeps a tracked custom_collision.json in
18// step with it. Projects that name `custom_collision_json` (Oracle of Secrets)
19// edit collision in the ROM, and their build fails unless the ROM reproduces
20// the tracked JSON exactly.
21//
22// - The JSON is regenerated from the in-memory ROM on every save. When its
23// bytes are unchanged, only the ROM is written and the JSON is untouched.
24// - Otherwise the ROM and the JSON are published as one rollback-protected
25// set: if either write or its readback fails, both files keep their
26// previous bytes. A crash between the two replacements is not covered.
27// - The save is refused, writing nothing, when the JSON on disk matches
28// neither the ROM on disk nor the new ROM: it was changed outside yaze.
30 const std::filesystem::path& json_path);
31
32} // namespace yaze::editor
33
34#endif // YAZE_APP_EDITOR_SYSTEM_SESSION_COLLISION_SOURCE_PAIRING_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:49
Editors are the view controllers for the application.
absl::Status SaveRomWithCollisionSource(Rom *rom, const fs::path &json_path)
absl::Status ValidateRomCollisionSourceBinding(Rom *replacement_rom, const fs::path &json_path)