[workspace]
members = ["crates/lk201", "crates/ssu"]
resolver = "2"

[package]
name = "blaze-vt"
version = "0.1.0"
edition = "2024"
license = "AGPL-3.0"
description = "A VT420 terminal emulator"
authors = ["Matt Mastracci <matthew@mastracci.com>"]
repository = "https://github.com/mmastrac/blaze"
readme = "README.md"

[dependencies]
clap = { version = "4.6", features = ["derive"] }
type-mapper = "0.1.2"
bytemuck = { version = "1.24", features = ["derive"] }
paste = "1"
#i8051 = { path = "../i8051/crates/i8051" }
#i8051-debug-tui = { path = "../i8051/crates/i8051-debug-tui", optional = true }
#i8051-disassembler = { path = "../i8051/crates/i8051-disassembler" }
i8051 = { version = "0.22.0" }
i8051-debug-tui = { version = "0.22.0", optional = true }
i8051-disassembler = { version = "0.22.0" }
tracing = "0.1.41"
tracing-subscriber = "0.3.20"
hex-literal = "1.1"
lk201 = { path = "crates/lk201", version = "0.1.1" }
ssu = { path = "crates/ssu", default-features = false, features = ["session-config"], version = "0.1.1" }

# features=vram-dump
png = { version = "0.18", optional = true }

# features=tui
ratatui = { version = "0.30.0-beta.0", default-features = false, optional = true }

# features=graphics
pixels = { version = "0.17.1", features = [], optional = true }
game-loop = { version = "=1.3.0", features = ["winit"], optional = true }
winit_input_helper = { version = "=0.17.0", optional = true }
winit = { version = "0.30.13", optional = true }
pollster = { version = "0.4.0", optional = true }

# features=wasm
web-time = { version = "1.1.0", optional = true }

# features=run-wasm
cargo-run-wasm = { version = "0.4.0", optional = true }

vt-push-parser = { version = "0.13.1", optional = true }

[dev-dependencies]
tempfile = "3.23"
rstest = "0.26"
axum = "0.8.7"
tokio = { version = "1", features = ["full"] }
tower-http = { version = "0.7.0", features = ["fs"] }

[profile.release]
debug = true

[features]
default = ["graphics", "tui", "pty", "demo", "vram-dump"]
wasm = ["graphics", "embed-rom", "ssu/wasm", "dep:web-time"]
pc-trace = []
pty = ["ssu/pty"]
tui = ["dep:ratatui", "ratatui/crossterm", "dep:i8051-debug-tui"]
graphics = ["dep:pixels", "dep:winit", "dep:winit_input_helper", "dep:pollster"]
embed-rom = []
run-wasm = ["dep:cargo-run-wasm"]
demo = ["dep:vt-push-parser", "dep:ratatui"]
vram-dump = ["dep:png"]
serial = ["ssu/serial"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = { version = "0.1.7" }
tracing-wasm = { version = "0.2.1" }
wasm-bindgen = { version = "0.2.105" }
wasm-bindgen-futures = { version = "0.4.46" }
web-sys = { version = "0.3.82", features = ["GpuTextureFormat", "Window", "Document", "Element", "HtmlElement", "HtmlCanvasElement", "Event", "CssStyleDeclaration", "Navigator", "Gpu", "Location"] }
js-sys = { version = "0.3.82", features = [] }

[[example]]
name = "disassemble-rom"

[[example]]
name = "run-wasm"
required-features = ["run-wasm"]

[[example]]
name = "wasm-examples"
required-features = ["run-wasm"]
