diff options
| -rw-r--r-- | README.md | 24 | ||||
| -rw-r--r-- | lib/xixanta/src/mapping.rs | 2 | ||||
| -rw-r--r-- | lib/xixanta/src/mappings/mmc1.cfg | 8 |
3 files changed, 17 insertions, 17 deletions
@@ -29,23 +29,13 @@ $ nasm --stdout awesome.s | hexdump -C By default it will assume the configuration for an `NROM` mapper, but this can be changed with the `-c/--configuration` flag, which accepts the following -values: - -- [empty](./lib/xixanta/src/mappings/empty.toml): just `HEADER` and `CODE`. - Useful for one-liners (e.g. "how is this instruction encoded in binary?"). -- [nrom](./lib/xixanta/src/mappings/nrom.toml): the default configuration. - It has the following segments: `HEADER`, `CODE`, `VECTORS`, and `CHARS`. -- [nrom65](./lib/xixanta/src/mappings/nrom65.toml): same as `nrom` but it - also has `STARTUP` for compatibility with the default linker configuration - from [cc65](https://github.com/cc65/cc65). -- [unrom or uxrom](./lib/xixanta/src/mappings/unrom.toml): a configuration for - UxROM chips, with seven swappable banks bound at 0x8000 and 16KB of size - (`PRG0`..`PRG6`), and a fixed bank on 0xC000 and 16KB of size as well - (`FIXED`). - -Alternatively, you can also pass a path to a configuration of your own. Check -out the [ones already bundled](./lib/xixanta/src/mappings) on this application -for reference. +values: `empty`, `nrom`, `nrom65`, `unrom`, `uxrom` and `mmc1`. These values +correspond to the configurations [already bundled](./lib/xixanta/src/mappings) +on this application, which follow a simplified syntax from the +[ld65](https://www.cc65.org/doc/ld65-5.html) one. Alternatively, you can also +pass the path to a configuration file to this flag. This file can either follow +the same [ld65](https://www.cc65.org/doc/ld65-5.html) syntax, or the simplified +one. ## `xa65` diff --git a/lib/xixanta/src/mapping.rs b/lib/xixanta/src/mapping.rs index b3d22c7..6a439d3 100644 --- a/lib/xixanta/src/mapping.rs +++ b/lib/xixanta/src/mapping.rs @@ -2,6 +2,7 @@ use crate::cfg::{parse_cfg_file, parse_nasm_cfg_file}; use crate::object::Bundle; const EMPTY_CONFIG: &str = include_str!("mappings/empty.cfg"); +const MMC1_CONFIG: &str = include_str!("mappings/mmc1.cfg"); const NROM_CONFIG: &str = include_str!("mappings/nrom.cfg"); const NROM65_CONFIG: &str = include_str!("mappings/nrom65.cfg"); const UXROM_CONFIG: &str = include_str!("mappings/unrom.cfg"); @@ -115,6 +116,7 @@ pub fn get_mapping_configuration(name: &str) -> Result<Vec<Mapping>, String> { } else { let text = match name.to_lowercase().as_str() { "empty" => EMPTY_CONFIG, + "mmc1" => MMC1_CONFIG, "nrom" => NROM_CONFIG, "nrom65" => NROM65_CONFIG, "uxrom" | "unrom" => UXROM_CONFIG, diff --git a/lib/xixanta/src/mappings/mmc1.cfg b/lib/xixanta/src/mappings/mmc1.cfg new file mode 100644 index 0000000..7409827 --- /dev/null +++ b/lib/xixanta/src/mappings/mmc1.cfg @@ -0,0 +1,8 @@ +#!nasmcfg + +HEADER: start = $0000, size = $0010, fillval = $00, segments = [HEADER]; +PRG0: start = $8000, size = $4000, fillval = $F8, segments = [BANK0]; +PRG1: start = $C000, size = $3FFA, fillval = $F9, segments = [BANK1]; +ROMV: start = $FFFA, size = $0006, fillval = $00, segments = [VECTORS]; +ROM2_0: start = $0000, size = $2000, fillval = $11, segments = [CHR0]; +ROM2_1: start = $2000, size = $2000, fillval = $22, segments = [CHR1]; |
