diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-07-15 08:55:57 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-12-12 07:31:52 +0100 |
| commit | c6c9aa4e5f3e5a01fcb9ccabf6dbd2f6da277650 (patch) | |
| tree | 55f205062606664d3f17ff762e475a7895ceefee /crates | |
| parent | 587dd5bb80364688419bb43aba4afc044ac0ef48 (diff) | |
| download | tools.nes-c6c9aa4e5f3e5a01fcb9ccabf6dbd2f6da277650.tar.gz tools.nes-c6c9aa4e5f3e5a01fcb9ccabf6dbd2f6da277650.zip | |
Add the notion of mapping
Mappings and segments are fundamental blocks on how code is distributed
both on the actual ROM File and in the memory layout.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/nasm/Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/nasm/src/main.rs | 10 | ||||
| -rw-r--r-- | crates/ncount/Cargo.toml | 8 | ||||
| -rw-r--r-- | crates/ncount/TODO | 0 | ||||
| -rw-r--r-- | crates/ncount/src/main.rs | 3 | ||||
| -rw-r--r-- | crates/nfind/TODO | 0 | ||||
| -rw-r--r-- | crates/ngrep/Cargo.toml | 8 | ||||
| -rw-r--r-- | crates/ngrep/src/main.rs | 3 |
8 files changed, 32 insertions, 1 deletions
diff --git a/crates/nasm/Cargo.toml b/crates/nasm/Cargo.toml index e1f3e88..b89b48c 100644 --- a/crates/nasm/Cargo.toml +++ b/crates/nasm/Cargo.toml @@ -2,6 +2,7 @@ name = "nasm" version = "0.1.0" edition = "2021" +authors = ["Miquel Sabaté Solà <mikisabate@gmail.com>"] [dependencies] anyhow = "1.0.82" diff --git a/crates/nasm/src/main.rs b/crates/nasm/src/main.rs index 9f26417..579ec02 100644 --- a/crates/nasm/src/main.rs +++ b/crates/nasm/src/main.rs @@ -3,6 +3,8 @@ use clap::Parser as ClapParser; use std::fs::File; use std::io::{self, Read, Write}; use xixanta::assembler::Assembler; +use xixanta::instruction::Fill; +use xixanta::mapping::Segment; /// Assembler for the 6502 microprocessor that targets the NES. #[derive(ClapParser, Debug)] @@ -30,7 +32,13 @@ struct Args { fn main() -> Result<()> { let args = Args::parse(); - let mut assembler = Assembler::new(); + // TODO: provide a handier way for this. + let mut assembler = Assembler::new(vec![Segment { + name: String::from("CODE"), + start: 0x00, + size: 0x10000, + fill_value: Some(Fill { value: 0x00 }), + }]); // Select the input stream. let input: Box<dyn Read> = match args.file { diff --git a/crates/ncount/Cargo.toml b/crates/ncount/Cargo.toml new file mode 100644 index 0000000..1bb3f7e --- /dev/null +++ b/crates/ncount/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "ncount" +version = "0.0.1" +authors = ["Miquel Sabaté Solà <mikisabate@gmail.com>"] +edition = "2021" + +[dependencies] +xixanta.workspace = true diff --git a/crates/ncount/TODO b/crates/ncount/TODO deleted file mode 100644 index e69de29..0000000 --- a/crates/ncount/TODO +++ /dev/null diff --git a/crates/ncount/src/main.rs b/crates/ncount/src/main.rs new file mode 100644 index 0000000..b70f821 --- /dev/null +++ b/crates/ncount/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("TBD"); +} diff --git a/crates/nfind/TODO b/crates/nfind/TODO deleted file mode 100644 index e69de29..0000000 --- a/crates/nfind/TODO +++ /dev/null diff --git a/crates/ngrep/Cargo.toml b/crates/ngrep/Cargo.toml new file mode 100644 index 0000000..d206cc7 --- /dev/null +++ b/crates/ngrep/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "ngrep" +version = "0.0.1" +authors = ["Miquel Sabaté Solà <mikisabate@gmail.com>"] +edition = "2021" + +[dependencies] +xixanta.workspace = true diff --git a/crates/ngrep/src/main.rs b/crates/ngrep/src/main.rs new file mode 100644 index 0000000..b70f821 --- /dev/null +++ b/crates/ngrep/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("TBD"); +} |
