Skip to content
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c8ce9b1
feat(swf): add Stage 1 SWF v10+ exporter, ADR 0135, and file.export_swf
rcoenen Nov 28, 2026
af0e407
feat(avm2): add clean-room AVM2 DoABC writer, AS3 IR lowering, and ve…
rcoenen Nov 28, 2026
b1ecdfe
docs(guide): add SWF export user guide and update legal compliance
rcoenen Nov 28, 2026
dda6bf1
feat(swf-as3c): add SWC packager, SymbolClass injection, AS3 stubs, a…
rcoenen Nov 28, 2026
e04aa72
Merge branch 'feat/swf-as3-docs' into feat/swf-as3-export
rcoenen Nov 28, 2026
9d11dad
Merge branch 'feat/swf-as3-avm2' into feat/swf-as3-export
rcoenen Nov 28, 2026
92635f1
Merge branch 'feat/swf-as3-external' into feat/swf-as3-export
rcoenen Nov 28, 2026
abe35b7
feat(swf): integrate native AVM2 DoABC, external AS3 compiler mode, a…
rcoenen Nov 28, 2026
5267be1
feat(ui): add SWF movie to Publish Settings and wire Save dialog for …
rcoenen Nov 28, 2026
ddd8c58
fix(swf): align SWF v19 records, DefineShape4, PlaceObject3, and 1-ba…
rcoenen Nov 28, 2026
9f9e6dc
feat(swf): add clean-room AVM1 (AS1/AS2) compiler and dual AVM1/AVM2 …
rcoenen Nov 28, 2026
8d8dc43
feat(swf): compile sibling AS2 classes (DoInitAction), #include, BOM/…
rcoenen Nov 28, 2026
5e1b0b0
fix(fla): allow non-zero linkage flags when decoding symbol metadata
rcoenen Nov 28, 2026
57d6edb
fix(avm1): resolve implicit this and static member references inside …
rcoenen Nov 28, 2026
3d2a06f
fix(swf): emit PlaceObject3 color and blend reset when returning to i…
rcoenen Nov 28, 2026
69d4803
fix(swf): export Text and Symbol children inside DefineButton2 states
rcoenen Nov 28, 2026
614b067
fix(fla): accept MFC class references with index >= 256 and non-zero …
rcoenen Nov 28, 2026
d55e8ff
fix(swf): fall back to Up/Over frames for missing Hit/Down states in …
rcoenen Nov 28, 2026
182e564
fix(fla): accept Flash 8 media_at flags (0x107) and pre-payload marke…
rcoenen Nov 28, 2026
652fe7a
fix(fla): scan MFC class references for subsequent scenes in multi-sc…
rcoenen Nov 28, 2026
aa5e2dd
fix(avm1): emit ActionStopSounds (0x09) opcode for stopAllSounds()
rcoenen Nov 28, 2026
0258d4c
fix(swf): remove live objects from previous scene before starting nex…
rcoenen Nov 28, 2026
21ae5ad
fix(swf): freeze Graphic symbols with LoopMode::SingleFrame at first_…
rcoenen Nov 28, 2026
4eee5f9
feat(swf): complete AVM1 built-in opcodes, DefineEditText font/layout…
rcoenen Nov 28, 2026
8cbe7da
chore(avm1): update Cargo.lock for anicraft-avm1 workspace crate
rcoenen Nov 28, 2026
9ab2982
docs(guide): regenerate commands reference with SWF export command
rcoenen Nov 28, 2026
66942a0
Merge remote-tracking branch 'origin/main' into feat/swf-as3-export
rcoenen Nov 28, 2026
0d85acd
docs(guide): regenerate commands reference after merging origin/main
rcoenen Nov 29, 2026
779a45a
feat(swf): emit DefineButtonSound (tag 17) for sounds on button state…
rcoenen Nov 29, 2026
efb8921
feat(swf): emit ButtonHasFilterList and ButtonHasBlendMode in DefineB…
rcoenen Nov 29, 2026
1dcec62
feat(swf): preserve Sound linkage from legacy .fla and emit in Export…
rcoenen Nov 29, 2026
97b82cb
fix(swf): cap FILTERLIST count to u8::MAX, avoid caching failed sound…
rcoenen Nov 29, 2026
87e1098
Merge remote-tracking branch 'origin/main' into feat/swf-as3-export
rcoenen Dec 4, 2026
2e9fe04
chore: refresh Cargo.lock after merging main
rcoenen Dec 4, 2026
8a17f23
chore(swf-as3c): align craft-zip rev with workspace craft-libs
rcoenen Dec 4, 2026
d73f9f6
fix(swf): add Shape::primitive and Keyframe::effects fields in tests …
rcoenen Dec 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,16 @@ crates/audio L0 WAV, Ogg Vorbis and MP3 decoding, mixing, resampling, peaks
crates/actions L0 Timeline action IR, button events, frame scripts (ADR 0024)
crates/guide L0 docs/guide as a bundled HTML book, with link checks (ADR 0069)
crates/flamedia L0 Animate's bitmap and sound payloads, shared by xfl and fla
crates/avm1 L1 Clean-room AVM1 (AS1/AS2) compiler, bytecode writer, and verifier
crates/avm2 L1 Clean-room AVM2 ABC (DoABC) writer, AS3 script IR lowering, SymbolClass (ADR 0135)
crates/doc L1 Document model, easing, timeline evaluation, player, sample scene
crates/text L1 System fonts, shaping, line layout into outlines (ADR 0012)
crates/render L2 CPU oracle renderer (coverage, paints, strokes, PNG)
crates/xfl L2 XFL/FLA import with its own XML and zip readers (ADR 0009)
crates/svg L2 SVG import; clips and masks become mask layers
crates/fla L2 Legacy Flash 8–CS4 .fla import, its container read by craft-cfb (ADR 0120)
crates/swf L2 SWF v10+ (FWS/CWS) writer and document-to-SWF export (ADR 0135)
crates/swf-as3c L2 External AS3 compiler orchestration and SWC asset packaging (ADR 0135)
crates/engine L3 Session, undo, command registry, .anicraft format
crates/gpu L3 wgpu stage renderer, the default (ADR 0019, 0029, 0032)
crates/cli L4 anicraft-cli, including serve and mcp
Expand Down
40 changes: 40 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ anicraft-render = { path = "crates/render" }
anicraft-engine = { path = "crates/engine" }
anicraft-xfl = { path = "crates/xfl" }
anicraft-fla = { path = "crates/fla" }
anicraft-swf = { path = "crates/swf" }
anicraft-xml = { path = "crates/xml" }
anicraft-flamedia = { path = "crates/flamedia" }
anicraft-svg = { path = "crates/svg" }
anicraft-swf-as3c = { path = "crates/swf-as3c" }
anicraft-text = { path = "crates/text" }
anicraft-plugins = { path = "crates/plugins" }
anicraft-audio = { path = "crates/audio" }
Expand Down Expand Up @@ -61,6 +63,8 @@ naga = { version = "30", features = ["wgsl-in"] }
pollster = "1"
bytemuck = "1"
anicraft-actions = { path = "crates/actions" }
anicraft-avm1 = { path = "crates/avm1" }
anicraft-avm2 = { path = "crates/avm2" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
Expand Down
11 changes: 11 additions & 0 deletions crates/avm1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "anicraft-avm1"
version.workspace = true
edition.workspace = true
license.workspace = true
publish.workspace = true
repository.workspace = true
rust-version.workspace = true

[lints]
workspace = true
139 changes: 139 additions & 0 deletions crates/avm1/src/ast.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
//! Clean-room AST for ActionScript 1.0 & 2.0.

#[derive(Clone, Debug)]
pub enum Stmt {
Empty,
Block(Vec<Stmt>),
Expr(Expr),
Var(Vec<(String, Option<Expr>)>),
If { cond: Expr, then_branch: Box<Stmt>, else_branch: Option<Box<Stmt>> },
While { cond: Expr, body: Box<Stmt> },
DoWhile { body: Box<Stmt>, cond: Expr },
For { init: Option<Box<Stmt>>, cond: Option<Expr>, update: Option<Expr>, body: Box<Stmt> },
ForIn { var_name: String, is_local: bool, object: Expr, body: Box<Stmt> },
Switch { expr: Expr, cases: Vec<(Option<Expr>, Vec<Stmt>)> },
Return(Option<Expr>),
Break,
Continue,
Function { name: String, params: Vec<String>, body: Vec<Stmt> },
Throw(Expr),
}

#[derive(Clone, Debug)]
pub enum Expr {
Number(f64),
Str(String),
Bool(bool),
Null,
Undefined,
This,
Ident(String),
Unary { op: UnaryOp, expr: Box<Expr> },
Update { op: UpdateOp, prefix: bool, target: Box<Expr> },
Binary { op: BinOp, left: Box<Expr>, right: Box<Expr> },
Assign { op: AssignOp, target: Box<Expr>, value: Box<Expr> },
Ternary { cond: Box<Expr>, then_expr: Box<Expr>, else_expr: Box<Expr> },
Call { callee: Box<Expr>, args: Vec<Expr> },
New { callee: Box<Expr>, args: Vec<Expr> },
Member { object: Box<Expr>, prop: String },
Index { object: Box<Expr>, index: Box<Expr> },
ArrayLit(Vec<Expr>),
ObjectLit(Vec<(String, Expr)>),
FunctionLit { params: Vec<String>, body: Vec<Stmt> },
Seq(Vec<Expr>),
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UnaryOp {
Neg,
Pos,
Not,
BitNot,
TypeOf,
Delete,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UpdateOp {
Inc,
Dec,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BinOp {
Add,
Sub,
Mul,
Div,
Mod,
Lt,
Le,
Gt,
Ge,
Eq,
Ne,
StrictEq,
StrictNe,
And,
Or,
BitAnd,
BitOr,
BitXor,
Shl,
Shr,
Ushr,
InstanceOf,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AssignOp {
Set,
Add,
Sub,
Mul,
Div,
Mod,
BitAnd,
BitOr,
BitXor,
Shl,
Shr,
Ushr,
}

#[derive(Clone, Debug)]
pub struct ParsedButtonHandler {
pub cond_flags: u16,
pub body: Vec<Stmt>,
}

#[derive(Clone, Debug)]
pub struct ParsedClipHandler {
pub event_flags: u32,
pub key_code: Option<u8>,
pub body: Vec<Stmt>,
}

#[derive(Clone, Debug)]
pub struct As2Class {
pub name: String,
pub extends: Option<String>,
pub ctor: Option<(Vec<String>, Vec<Stmt>)>,
pub methods: Vec<As2Method>,
pub fields: Vec<As2Field>,
}

#[derive(Clone, Debug)]
pub struct As2Method {
pub name: String,
pub is_static: bool,
pub params: Vec<String>,
pub body: Vec<Stmt>,
}

#[derive(Clone, Debug)]
pub struct As2Field {
pub name: String,
pub is_static: bool,
pub init: Option<Expr>,
}
Loading
Loading