| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
Writing to the input transmission port of the standard input stream no
longer clears the input queue. The only way to clear an input queue is
to write to the associated queue port.
|
|
|
|
|
|
| |
This commit updates bedrock-asm to v4.0.3, which fixes an issue where
the root source unit of a project could sometimes be merged after
library code, preventing the program from running correctly.
|
|
|
|
|
|
|
|
|
| |
The memory address of the most recent symbol is now displayed next to
the name of that symbol in the emulator debug output, to make it easier
to see how close the program counter is to that symbol.
The source location of that symbol is now also shown as dimmed to make
it less distracting.
|
|
|
|
|
|
|
|
|
|
|
| |
In the case that a program with an adjacent symbols file is added to a
system-wide programs folder by symbolically linking to the bytecode
file of the program, and the program is run via the symbolic link, the
symbols file in the original directory will not be found or loaded.
To fix this, the path to the symbolic link will now be resolved to the
path of the bytecode file in the original directory, where the symbols
file can be found.
|
|
|
|
|
|
|
|
| |
Bold should only be used for important messages, such as error and
warning messages.
This commit also moves the white colour change to before the colon, to
match the style used in the bedrock-asm library.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The project previously used the `time` crate for getting the current
time in the local timezone. It was discovered that the time crate would
fail to return the local time when the program used multiple threads,
because of concerns that the other threads could modify timezone-related
environment variables while the timezone was being read from the system
and create a soundness issue. A second program thread was introduced
recently by commit 1a830a3 to provide non-blocking reads of standard
input for the local stream device, and so the time returned by the
clock device was falling back to UTC.
To fix this, the `time` crate has been replaced by the `chrono` crate
which does not suffer from this restriction, and in any case seems to
be the more popular of the two anyway.
|
|
|
|
|
| |
Removed trailing periods, removed "exiting" from error messages, and
made error details print not in bold.
|
|
|
|
|
| |
This updates the bedrock-asm dependency so that we can use the new
source merging strategy added in version 4.0.2.
|
|
|
|
|
|
| |
This is to match the message format printed by the bedrock-asm crate.
fix
|
|
|
|
|
|
| |
The assembler saves out symbols files, which are loaded automatically
by the emulator when present. The name and location of the most recent
label is displayed with the debug information when symbols are loaded.
|
|
|
|
|
|
| |
This is to assist with debugging, when a program hasn't yet implemented
its own mouse cursor. Phosphor had to be updated to properly support
this.
|
|
|
|
|
| |
Without this, the otherwise normal default screen dimensions of 800x600
would be scaled to a physical size of 2400x1800 at a zoom factor of 3.
|
|
|
|
|
|
|
|
|
|
| |
When a relative path with only one path component is passed to the
assembler, the parent of that path cannot be determined and so the
project libraries descending from that parent cannot be included in
the program. To fix this, we canonicalize the path before it is used.
This also makes the path comments generated for the project source
files more stable and readable.
|
|
|
|
|
|
|
|
| |
The unwrap_or for the the dimensions value was to get around the fact
that we don't have guaranteed dimensions at this point. It makes it
look like something more important is happening though, so instead we
just make the config struct mutable and overwrite the dimensions field
with the real value when we get access to it.
|
|
|
|
| |
This more accurately reflects its function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a complete rewrite and restructure of the entire emulator
project, as part of the effort in locking down the Bedrock specification
and in creating much better tooling for creating and using Bedrock
programs.
This commit adds a command-line argument scheme, an embedded assembler,
a headless emulator for use in non-graphical environments, deferred
window creation for programs that do not access the screen device,
and new versions of phosphor and bedrock-core. The new version of
phosphor supports multi-window programs, which will make it possible to
implement program forking in the system device later on, and the new
version of bedrock-core implements the final core specification.
|
|
|
|
|
| |
The mapping of draw codes to draw operations didn't match the screen
device specification. This error was introduced in commit 6b3796c.
|
| |
|
|
|
|
|
| |
This version of bedrock_core conforms to the final Bedrock core
specification, which will not be changed from this point forward.
|
|
|
|
|
|
|
|
|
|
| |
When the DB4 instruction is evaluated, a single '.' character will be
printed to stdout if the return stack is empty and the working stack
contains a single 0xff byte, otherwise a single 'X' character will be
printed to stdout.
This is to facilitate unit testing the instruction set with a Bedrock
program, from within the emulator.
|
| |
|
|
|
|
|
|
|
|
| |
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 is slightly more efficient on the CPU, while not making any
visible difference to the user.
|
|
|
|
|
| |
The most recent Phosphor commit c141d8f unified the is_cursor_visible
and cursor_icon callbacks.
|
|
|
|
| |
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.
|
|
|
|
| |
Pressing F11 toggles emulator fullscreen mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some frames would sporadically lag between on_process and on_render,
because on_process would bail once one frame had elapsed since the end
of the previous on_process, and the processor would not always reach a
sleep point in this time. This was really an issue to do with with the
time taken between the end of the previous on_process and the start of
the current on_process.
To fix this, the on_process invocation will run the processor for a full
frame, without subtracting the time elapsed between frames. This seems
to have no negative effects. It also allows us to remove end_of_process
from the emulator.
The sleep in the Signal::Sleep handler has also been removed, because
it serves no real purpose and will most likely cause issues in the
future.
|
|
|
|
|
|
| |
The window title of the emulator can be set when constructing a new
instance of the emulator. This is useful when a Bedrock program is
baked into the emulator for distribution.
|
|
|
|
|
|
|
| |
The program is vastly more efficient to run, consuming only 1.5% CPU
instead of 13% during testing on Windows 10. Input events are handled
four times as frequently now, which makes for smoother lines when
drawing in Cobalt.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
When the clock device was first in order to be responded to, a fast
enough recurring timer could successfully prevent any other device
from being able to wake the emulator, if a timer was able to expire
in the time it took to run the clock wake handler.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
Without this, text pushed to the stream device before a debug
instruction would often display after the output for that debug
instruction.
|
| |
|
| |
|