snes-disassembler
Version:
A Super Nintendo (SNES) ROM disassembler for 65816 assembly
102 lines • 3.59 kB
TypeScript
/**
* Automated Documentation Generator
*
* Analyzes SNES ROM data and generates comprehensive MD files with:
* - AI-powered assembly code analysis
* - Pattern recognition insights
* - SNES-specific hardware documentation
* - Contextual explanations for beginners and experts
* - Cross-references to related assets
*/
import { AIConfigManager } from './ai-config';
import { AIPatternRecognizer } from './ai-pattern-recognition';
import { AINameSuggester } from './ai-naming-suggestions';
interface DocumentationDetails {
/** Title for the documentation section */
title: string;
/** High-level summary of the asset or pattern */
summary: string;
/** Detailed analysis and description */
details: string;
/** AI confidence in analysis (0.0 to 1.0) */
confidence: number;
/** Recommended usage or implications */
recommendations?: string[];
/** Assembly code comments if applicable */
codeComments?: AssemblyComment[];
/** Related assets or cross-references */
relatedAssets?: string[];
/** SNES hardware context */
hardwareContext?: HardwareContext;
}
interface AssemblyComment {
/** Instruction or data offset */
offset: number;
/** The actual instruction/data bytes */
data: string;
/** AI-generated comment explaining the purpose */
comment: string;
/** Confidence in this interpretation */
confidence: number;
/** SNES-specific context (registers, memory mapping, etc.) */
snesContext?: string;
}
interface HardwareContext {
/** Relevant SNES registers used */
registers?: string[];
/** Memory mapping mode (LoROM/HiROM) */
mappingMode?: 'LoROM' | 'HiROM' | 'Unknown';
/** Bank usage explanation */
bankUsage?: string;
/** DMA or HDMA usage */
dmaUsage?: string;
/** PPU features involved */
ppuFeatures?: string[];
}
/**
* AI-Enhanced Documentation Generator for SNES ROMs
*/
export declare class AIDocumentationGenerator {
private configManager;
private patternRecognizer;
private nameSuggester;
private snesKnowledge;
constructor(configManager: AIConfigManager, patternRecognizer: AIPatternRecognizer, nameSuggester: AINameSuggester);
/**
* Generate comprehensive documentation for SNES assets
*/
generateDocumentation(data: Uint8Array, offset: number, length: number, assemblyCode?: string): Promise<DocumentationDetails>;
/**
* Generate AI-powered assembly code comments
*/
generateAssemblyComments(assemblyCode: string, data: Uint8Array, baseOffset: number): Promise<AssemblyComment[]>;
/**
* Analyze a single assembly line and generate intelligent comments
*/
private analyzeAssemblyLine;
private parseInstruction;
private generateInstructionComment;
private getSNESContext;
private buildDetailedDocumentation;
private generateSummary;
private generateComprehensiveDetails;
private generateGraphicsDetails;
private generateAudioDetails;
private generateTextDetails;
private generateCompressionDetails;
private extractHardwareContext;
private getPPUFeatures;
private getBankUsageExplanation;
private findRelatedAssets;
private generateRecommendations;
private generateBasicDocumentation;
}
/**
* Markdown file output for generated documentation
*/
export declare class MarkdownExporter {
/** Export documentation to a markdown file */
static exportToMarkdown(doc: DocumentationDetails, outputPath: string): Promise<void>;
}
export {};
//# sourceMappingURL=ai-documentation.d.ts.map