12#ifndef YAZE_SRC_CLI_SERVICE_AGENT_TOOLS_CODE_GEN_TOOL_H_
13#define YAZE_SRC_CLI_SERVICE_AGENT_TOOLS_CODE_GEN_TOOL_H_
20#include "absl/status/status.h"
21#include "absl/status/statusor.h"
83 void AddInfo(
const std::string& message, uint32_t address = 0) {
87 void AddWarning(
const std::string& message, uint32_t address = 0) {
91 void AddError(
const std::string& message, uint32_t address = 0) {
116 std::vector<FreeSpaceRegion>
DetectFreeSpace(
Rom* rom,
size_t min_size = 0x100)
const;
124 const std::string& template_code,
125 const std::map<std::string, std::string>& params)
const;
130 absl::StatusOr<AsmTemplate>
GetTemplate(
const std::string&
name)
const;
175 std::string
GetName()
const override {
return "codegen-asm-hook"; }
178 return "Generate ASM hook at ROM address";
182 return "codegen-asm-hook --address=0x008040 --label=MyHook [--nop-fill=N] [--format=<json|text>]";
206 std::string
GetName()
const override {
return "codegen-freespace-patch"; }
209 return "Generate patch using detected free regions";
213 return "codegen-freespace-patch --label=MyCode --size=0x100 [--prefer-bank=N] [--format=<json|text>]";
237 std::string
GetName()
const override {
return "codegen-sprite-template"; }
240 return "Generate sprite ASM from template";
244 return "codegen-sprite-template --name=MySprite [--init-code=\"...\"] [--main-code=\"...\"] [--format=<json|text>]";
268 std::string
GetName()
const override {
return "codegen-event-handler"; }
271 return "Generate event handler code";
275 return "codegen-event-handler --type=<nmi|irq|reset> --label=MyHandler [--custom-code=\"...\"] [--format=<json|text>]";
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Utility for parsing common CLI argument patterns.
absl::Status RequireArgs(const std::vector< std::string > &required) const
Validate that required arguments are present.
Base class for CLI command handlers.