| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
The most recently closed directory listing is cached instead of being
discarded. The next time a directory is to be opened, if the file path
is the same as the cached directory, the cached directory listing is
used in order to save the entire listing from having to be regenerated.
This is expected to result in performance gains on Windows.
|
|
|
|
|
| |
The base variable is only used when compiling on Windows, so an
unused variable warning is raised when compiling on Linux.
|
|
|
|
|
|
|
|
|
| |
Previously when reading from a ReadOnlyTextBuffer the pointer would
fall off the end and crash the emulator.
This commit also makes the ReadOnlyTextBuffer Unicode-compatible,
rather than the previous behaviour of clamping every character into
the ASCII range.
|
|
|
|
|
|
|
| |
We were finding the parent of the relative path and then passing this
to the BedrockFilePath::from_path constructor, but this constructor
expects to be passed an absolute path and so was unconditionally
returning None.
|
|
|
|
|
|
|
|
| |
This is the Windows side of the refactoring job. The windows crate has
been added as a dependency in order to get a list of available drives
by drive letter, and a virtual top-level root directory has been
implemented in the Windows code to make it possible for programs to
hierarchically navigate between available drives.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The major feature of this refactor is the creation of BedrockFilePath,
a type which can be losslessly converted into an operating-system
specific path or a Bedrock-style byte path. It also prevents file paths
which can't be represented as Bedrock-style byte paths from being
constructed, and allows the use of a base directory which acts as an
inescapable sandbox.
BedrockFilePath will support the creation of a virtual root directory
on Windows which will allow navigation between drive letters via the
standard hierarchical navigation ports.
This commit has been tested on Linux, but not yet Windows. Further work
is expected before the new code will work on Windows.
|
|
|
|
| |
This should have been happening previously, but was missed.
|
|
|
|
|
| |
Some Windows-only library functions were added in during a previous
commit while I was developing on Windows.
|
|
|
|
|
|
|
|
| |
Construction of OsStrings is handled differently between Windows and
Unix, using platform-specific APIs.
The method OsStr::as_bytes was also changed to OsStr::as_encoded_bytes
at some point between Rust versions 1.69 and 1.80.
|
|
|
|
|
|
|
| |
It was previously assumed that every entry in a directory would be
either a file or a directory, but a non-file and non-directory entry
has been encountered in the wild. In this case, just ignore the file,
leaving it out of the directory listing.
|
|
|
|
|
| |
This is to allow the program to detect whether the previous ascend or
descend operation succeeded.
|
| |
|
|
|
|
|
|
| |
This is a temporary fix to make directories more navigable. This will
be removed when Cobalt can hide dot-prefixed filenames from directory
listings by itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removed the sandbox directory of the file device, so the file device is
now sandboxed to the root directory. The sandboxing code has been left
intact for future use.
Permission flags have been added to the file device to allow each
category of file operation to be enabled or disabled in the emulator.
The default directory is set to be the current working directory from
when the emulator boots. This is the directory which is used when the
program attempts to ascend to the parent directory when no entry is
currently open.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
There was confusion between the role of the page_limit variable in the
memory device, where it was being used to mean both the absolute upper
limit of pages that are allowed to be allocated, but also to mean the
number of pages that the program would like to be allocated when needed.
To fix this, the program is now just told the full number of pages that
it is allowed to use, without first requiring that the program request
a particular number of pages.
|
|
|
|
|
|
|
| |
The memory device was never being allocated any memory, the input device
wasn't scrolling correctly, the screen device was rendering sprites
incorrectly, and the device ID of the file device had not been changed
over from 0xA to 0x9.
|
| |
|
|
|
|
|
| |
This is a complete redesign of the file device. The most notable
addition is the ability to ascend and descend the file tree.
|
|
|
|
|
| |
The stream device pointers now use wrapping semantics in order to
prevent overflow errors.
|
|
|
|
|
|
|
|
| |
Wrapping stdin and stdout with BufReader and BufWriter makes reads and
writes more efficient by bundling multiple characters into a single
read or write operation. In practice, this hasn't made a difference to
running the numbers demo, but that demo spends the majority of processor
time converting values to decimal strings.
|
|
|
|
|
| |
An effort to make the code shorter and more readable. This mostly
affects the code for the clock device.
|
|
|
|
|
|
| |
The "Cumulative seconds" port of the CLOCK device has been changed
to be called "Cumulative timer", with the units changing from seconds
to 1/256 second ticks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The vector line drawing operation of the screen device uses optimised
methods when drawing horizontal and vertical lines. The emulator now
interprets the coordinates of these lines as signed values, to allow for
the correct rendering of orthogonal lines where the coordinates of the
left or top edges are off-screen. Diagonal lines are yet to be tackled.
The bounding-box calculations shared by the rectangle and orthogonal
line drawing methods have also been split off into their own method,
significantly reducing the code duplication between all four of the
methods which require this functionality.
This commit also makes aesthetic changes to the code in the
draw_diagonal_line method to improve readability and brevity, as a part
of the changes made to the draw_line method when the points parameter
was removed from each of the three lower line-drawing methods.
|
|
|
|
|
| |
This method was exceeding the 80-character line limit, which was
interfering with the centering behaviour of my text editor.
|
|
|
|
|
| |
The method was between the two draw_sprite methods, but it fits better
just after draw_pixel.
|
|
|
|
|
|
|
| |
The vector+size draw operations of the screen device draw textured and
untextured rectangles. The emulator now interprets the coordinates of
a rectangle as signed values, to allow for the correct rendering of
rectangles where the coordinates of the left or top edges are off-screen.
|
|
|
|
|
|
|
| |
The vector+size+sprite draw operation of the screen device has been
changed in the specification from drawing a 1-bit textured triangle to
drawing a 1-bit textured line. This draw operation had not yet been
implemented, so this commit does not affect emulator functionality.
|
|
|
|
|
|
| |
The order of the two result values from the widening multiply operation
in Rust was reversed, leading to incorrect multiplication results when
using the math device.
|
|
|