| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
This function already took most of the arguments from the user anyways,
and the list of separate arguments was getting crazier to a point that
even clippy started to freak out.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes detection for:
- Stack underflows (it was theoretically already there but it had never
been properly tested).
- Load/store out of bounds for a given variable known via the .nasm/
directory.
- Load out of bounds on a set of data referenced via a raw label (see
commit aa5174fc055d ("xixanta: Add an hint for the ending of data
labels")).
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
Some raw labels may point at a bunch of data laid out with the .byte
family of statements. Add hints for each of these labels so we also have
a range for them. This way, tools like 'vnf' might be able to detect bad
accesses and these sets of data.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Make the hexadecimal values more cohesive and avoid having a
variable-sized line because of them.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The hard requirement that an .include statement cannot be inside of
another block was, in the end, a bit short-sighted. Imagine the
following block:
.ifdef DEBUG
.include "debug.s"
.endif
This is perfectly sound-looking code, and it should not be punished as
the developer is doing something that is not bending the assembler in
weird ways. Hence, just nuke this check.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The 15th byte from the NES 2.0 header was wilfully ignored, but it can
be relevant to the end user. Hence, add support for it in the 'header'
library, and add the frontend code into 'readrom'.
The point is not to support every single thing out there, but I have
added the stuff that I thought was most relevant, and we can add more
items to it whenever the need appears.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
In theory it's support for any kind of memory mapper, but in practice
only MMC3 has been added.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
For historical reasons, some points of the code were not using this
function, calling eprintln!() and exit() manually instead.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
Allow these to options to be combined, so each segment file is stored
inside the directory specified in the -o option. Note that this can only
be done if the -o option does not refer to an existing file.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
Add also a test to further check corner cases on compare instructions.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
They were the last ones marked with the todo!() macro.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|