aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* header: add Sunsoft's FME-7 mapper chipMiquel Sabaté Solà2026-09-191-0/+3
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* header: add more information on unkown mappersMiquel Sabaté Solà2026-09-191-6/+16
| | | | | | | In particular, allow to optionally add the mapper and submapper ID that was found, so it can be displayed to the user. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* xixanta: simplify evaluate_hexadecimal()Miquel Sabaté Solà2026-09-151-8/+6
| | | | | | | | The 'size' variable can be initialized directly from the value we get from the match statement below. I was probably thinking more on the style of C, but the latest Rust stable channel complained about this. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* fuzz: change names to have dashes instead of underscoreMiquel Sabaté Solà2026-09-156-9/+9
| | | | | | | From the latest update of Rust's stable channel, this was raised as a bad format for fuzz names. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add an option for setting a cycle limitMiquel Sabaté Solà2026-09-082-0/+71
| | | | | | | | This can be quite handy when it comes to checking that a piece of code doesn't exceed a given amount of cycles, or when you are tuning a block of code in order to make it go beyond the current amount of cycles. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: refuse to proceed if the machine is inactiveMiquel Sabaté Solà2026-09-081-1/+13
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* tests: fix break_mark testMiquel Sabaté Solà2026-09-081-0/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: validate the minimum stack valueMiquel Sabaté Solà2026-09-071-5/+10
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: display also the break mark on report()Miquel Sabaté Solà2026-09-074-1/+46
| | | | | | | | When reporting the final instruction, if that was actually a brk (and hence we stopped because of it), show the breaking mark as that could be relevant when debugging. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: add the 'Machine.halt_on_brk' fieldMiquel Sabaté Solà2026-09-073-1/+20
| | | | | | | | This allows developers to use 'brk' as asserts which can then be debugged. This is true by default but it can be turned off via the --no-halting-brk option from runrom. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: convert StatusRegister.break_mark to Option<u8>Miquel Sabaté Solà2026-09-072-12/+14
| | | | | | | Instead of assuming a default value, it's safer to just implement it in Rust's native Option<_> type. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: improve documentationMiquel Sabaté Solà2026-09-073-9/+65
| | | | | | | Provide documentation for the library, and improve the documentation for some of the structs and interfaces. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* tests: add clarification as to what vnf-tests isMiquel Sabaté Solà2026-09-061-0/+6
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* tests: add a test on branching instructionsMiquel Sabaté Solà2026-09-063-0/+205
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: properly document how branching worksMiquel Sabaté Solà2026-09-061-10/+11
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: don't flip the given joypad inputsMiquel Sabaté Solà2026-09-061-5/+1
| | | | | | | | | | I am not sure from where I got this bit flipping part, but I believe things worked because of another bug (see 9c685d5b6ca1 ("vnf: also set the carry on a zero compare")). Fixes: ad77503d9533 ("vnf: add support for standard joypads") Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: also set the carry on a zero compareMiquel Sabaté Solà2026-09-064-1/+62
| | | | | | Add also a test to further check corner cases on compare instructions. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf-tests: set the proper exit code on e2e testsMiquel Sabaté Solà2026-09-061-1/+2
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf-tests: add a visual line for each run testMiquel Sabaté Solà2026-09-061-18/+20
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf-tests: allow to conditionally run testsMiquel Sabaté Solà2026-09-061-4/+19
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf-tests: add support for verbosityMiquel Sabaté Solà2026-09-061-0/+12
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: add support for standard joypadsMiquel Sabaté Solà2026-09-065-21/+256
| | | | | | | | This means adding constants so developers can actually trigger which key presses are available at any given read, as well as a simple interface that allows to add button presses and clear them. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: implement the randomized initialization for memoryMiquel Sabaté Solà2026-09-063-2/+70
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: remove tests modMiquel Sabaté Solà2026-09-061-7/+0
| | | | | | | For now tests on vnf are provided via e2e tests, and via the vnf-tests binary. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Implement the bvc and bvs instructionsMiquel Sabaté Solà2026-09-061-4/+11
| | | | | | They were the last ones marked with the todo!() macro. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Remove the 'affected_on_page' memberMiquel Sabaté Solà2026-09-064-315/+0
| | | | | | | | | | | It was created a long time ago in the hopes that it would be useful whenever I wanted to create an emulator, but when that happened in the form of 'runrom' I've seen that it's really not needed. Remove it as it just pollutes the source code with hundreds of useless lines. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Change the first argument of Machine::from() into a &PathMiquel Sabaté Solà2026-08-273-7/+10
| | | | | | | | This makes for a saner API, and some users (e.g. vnf-tests) don't have to go over backwards to provide a parameter they already had as a PathBuf. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: add support for all stack instructionsMiquel Sabaté Solà2026-08-278-24/+383
| | | | | | | | | | | | This also includes brk and rti, for which we are also storing and exporting the break mark, just in case it can be useful to library users in case they want to add error codes in break marks. This commit also includes a fix for accounting the Z and N flags on transfer instructions, which couldn't easily be split into a separate commit, but it's a fairly simple change. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Implement the Default trait for MemoryInitialValueMiquel Sabaté Solà2026-08-272-12/+13
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Fix cycle count for the plp instructionMiquel Sabaté Solà2026-08-271-2/+2
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* runrom: use Path instead of PathBuf as a parameterMiquel Sabaté Solà2026-08-271-3/+3
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: don't report stack push/pop twice in verboseMiquel Sabaté Solà2026-08-272-14/+14
| | | | | | | | On situations like jsr or rts, we perform two pushes/pops, but this is not to be reported in verbose mode as it's not that clear. Instead, let's report the full address in a single stack line. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* {read,run}rom: fix format of help messageMiquel Sabaté Solà2026-08-262-9/+9
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* readrom: fix help message on --nasmMiquel Sabaté Solà2026-08-261-2/+2
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* {run,read}rom: validate the path from --nasmMiquel Sabaté Solà2026-08-262-9/+27
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* runrom: add tests for --start and --until-addressMiquel Sabaté Solà2026-08-266-0/+1087
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: fix the accounting of cycles on branchesMiquel Sabaté Solà2026-08-251-2/+10
| | | | | | This was broken since the very beginning. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: push/pop the proper address on jsr/rtsMiquel Sabaté Solà2026-08-251-5/+13
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* vnf: fix documentation on 'page_penalty'Miquel Sabaté Solà2026-08-251-1/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Do not account for stack reads on 'rts'Miquel Sabaté Solà2026-08-251-10/+14
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Stop execution if not active in until_address()Miquel Sabaté Solà2026-08-251-1/+1
| | | | | | | | | | | Even if the desired thing is to run until the provided address is reached, abort execution as well if the machine stops being active as well. This is a common scenario when running in function mode and the target end address is something passed that. Fixes: e6c41303c2da ("runrom: add the --until-address option") Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add a couple of notes on contributingMiquel Sabaté Solà2026-08-251-1/+5
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* runrom: add the --until-address optionMiquel Sabaté Solà2026-08-253-47/+80
| | | | | | | | | This allows the user to run execution until a given address is reached. This can, like with the --start option, be coupled with the --nasm option in order to be able to provide an identifier instead of a regular hexadecimal value. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Allow the --start flag to accept identifiersMiquel Sabaté Solà2026-08-242-15/+82
| | | | | | | This is coupled with the new -n/--nasm option, which works in the same way as in `readrom`. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Annotate the no-return from die()Miquel Sabaté Solà2026-08-244-55/+28
| | | | | | | | | | | | In all crates we are using a die() function to print to stderr and quit with a exit status > 0. Apparently in Rust you can annotate the return type with a bang just like the noreturn from the C family. The added bonus is that some useless statements to make the compiler happy without it can be removed altogether as now the compiler is able to understand that it won't return so the returned type is not needed. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* nasm: provide a better layout for the README fileMiquel Sabaté Solà2026-08-231-151/+146
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Improve the description of runromMiquel Sabaté Solà2026-08-231-11/+29
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* nasm: fix typo on the READMEMiquel Sabaté Solà2026-08-181-2/+2
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Do not mark some valid identifiers as invalidMiquel Sabaté Solà2026-08-181-0/+27
| | | | | | | | | | | | | Some identifiers like "@aa" were marked as invalid as "aa" is a potentially hexadecimal value, but the "@" symbol actually disambiguates this situation. Hence, if a non-alphanumeric character (that the parser liked) is actually found, ensure it cannot be considered as an hexadecimal value. Provide also a test of is_valid_identifier(). The list is certainly not exhaustive, but it should be good enough coupled with end-to-end tests. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Validate labels when walking through the contextMiquel Sabaté Solà2026-08-181-3/+32
| | | | | | | | | | | | | | The parser does not validate label names completely (it only takes care of validating that it something that makes sense syntactically). The assembler can tell whether the label is actually taking a reserved name, or an invalid hexadecimal constant, etc. Before this commit a user would get a cryptic "invalid identifier" message when referencing an invalid label (e.g. "jmp 1234"). Fix this by validating the identifier there, but also when the label was defined before any of this. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>