summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Fix cobalt binary againdevBen Bridle2024-12-16
|
* Fix cobalt binaryBen Bridle2024-12-16
|
* Temporary, release stuffBen Bridle2024-12-16
|
* Update phosphor dependency to v3.2.1Ben Bridle2024-12-16
| | | | | This includes a fix to prevent the cursor from being marked as inactive while at least one mouse button is still being held.
* Update metadata and parser to match current specificationBen Bridle2024-12-16
| | | | | | | The metadata specification has changed to use '/' as the separator between the program name and program version in the name string, and each author line is now no longer followed by the year in which the author last contributed to the program.
* Fix reported address of debug instruction in debug outputBen Bridle2024-12-16
| | | | | | | | | | Because the program counter is incremented immediately after an instruction byte is loaded, the value of the program counter reported by a debug instruction was actually the address of the following byte. This made the SYM symbol name line in the debug output report the wrong symbol name in some situations. This was fixed by decrementing the value used.
* Fix file device cached child issueBen Bridle2024-11-24
| | | | | | | | | | When opening the previously-visited directory in the file device, the directory data is read from a cache, preventing the need to have it regenerated from scratch. The directory data includes the selected child, which meant that instead of child 0 being selected as per the specification, the previously-selected child was selected instead. To fix this, the child is deselected as the directory data is cached.
* Increase default page limit in memory deviceBen Bridle2024-11-20
| | | | | This was erroneously set to 0 from before the memory device was implemented.
* Cache transformed sprite dataBen Bridle2024-11-20
| | | | | | | | In programs where the same sprite is drawn many times repeatedly, a lot of time is saved by caching the transformed sprite data instead of having to recalculate it for every draw operation. No testing has been done on the efficiency improvements this offers, but it doesn't seem like it could have any downsides.
* Fix file device cached write issueBen Bridle2024-11-13
| | | | | Writing a value to the pointer and length ports wasn't working, because the cached write was never getting committed.
* Fix line drawing issueBen Bridle2024-11-13
| | | | | | | | | | | An overflow error was causing the line drawing method to loop forever any time a line of length 0x4000 (16384) or longer was drawn. The issue was occurring because both e1 and dx (or dy) would have a value of at least 0x4000, and so on lines 291/292 the sum would exceed 0x8000, the maximum value of an i16. The value would then wrap and break the assumptions of the line drawing algorithm, causing it to loop forever. This was fixed by increasing the size of the affected types.
* Fix vertical scrolling issueBen Bridle2024-11-13
| | | | | A copy-paste error made all vertical scroll events register instead as horizontal scroll events.
* Fix source code merge orderBen Bridle2024-11-06
| | | | | | This commit updates bedrock-asm to v4.0.6, 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.
* Fix issue when drawing textured shapes off-screenBen Bridle2024-11-04
| | | | | | | | | | | | When determining whether or not to draw each pixel of a textured line or rectangle, the modulo-by-eight operation was being performed on a signed value, which was returning a negative value when the pixel being drawn was off-screen. When the negative value was then converted to an unsigned value, the result was close to usize::MAX, and was causing an out-of-bounds array access. To fix this, the value is converted to an unsigned value before taking the modulo.
* Prevent empty source files from being mergedBen Bridle2024-11-01
| | | | | This commit updates bedrock-asm to v4.0.5, which adds a change where empty source files will no longer be merged into the final source file.
* Print debug messages as info-level log messagesBen Bridle2024-10-31
| | | | | Debug messages are now printed with a blue [INFO] prefix, to match the style of the information messages printed by the rest of the project.
* Only print stack debug information in debug modeBen Bridle2024-10-31
| | | | | The stack state when halting was previously being printed even outside of debug mode.
* Flush standard output before printing halt messageBen Bridle2024-10-31
| | | | | This ensures that no additional program output will be printed after the debug-mode halt message is printed.
* Suppress errors when flushing file and stream dataBen Bridle2024-10-31
| | | | | | | | File and stream data is flushed on drop, and if flushing fails a panic is thrown, which prints a crash message to the terminal. Since we can't do anything if the write fails, and because file and stream writes are approached with a best-effort attitude, we suppress the errors to prevent the user from seeing them and getting concerned.
* Fix reported source location for redefined symbol errorsBen Bridle2024-10-31
| | | | | | This commit updates bedrock-asm to v4.0.4, which fixes an issue where the reported source location of the original definition of a redefined symbol was incorrect.
* Don't clear input stream queue when starting transmissionBen Bridle2024-10-31
| | | | | | 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.
* Fix source code merge orderBen Bridle2024-10-31
| | | | | | 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.
* Show memory address on SYM line in emulator debug outputBen Bridle2024-10-31
| | | | | | | | | 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.
* Canonicalize program paths before loading a programBen Bridle2024-10-31
| | | | | | | | | | | 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.
* Remove bolding from info messagesBen Bridle2024-10-31
| | | | | | | | 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.
* Fix issue with clock device returning UTC time instead of local timeBen Bridle2024-10-31
| | | | | | | | | | | | | | | | 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.
* Change error message formatBen Bridle2024-10-30
| | | | | Removed trailing periods, removed "exiting" from error messages, and made error details print not in bold.
* Update source merging strategyBen Bridle2024-10-30
| | | | | This updates the bedrock-asm dependency so that we can use the new source merging strategy added in version 4.0.2.
* Add colours to info and error messagesBen Bridle2024-10-30
| | | | | | This is to match the message format printed by the bedrock-asm crate. fix
* Load and display symbols in debug informationBen Bridle2024-10-30
| | | | | | 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.
* Add option to show mouse cursorBen Bridle2024-10-29
| | | | | | 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.
* Divide the default screen dimensions by the zoom factorBen Bridle2024-10-29
| | | | | 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.
* Canonicalize the source path for the assemblerBen Bridle2024-10-29
| | | | | | | | | | 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.
* Make configuration code less confusingBen Bridle2024-10-29
| | | | | | | | 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.
* Rename --encode-stdin option to --decode-stdinBen Bridle2024-10-29
| | | | This more accurately reflects its function.
* Rewrite emulatorv1.0.0-alpha1Ben Bridle2024-10-28
| | | | | | | | | | | | | | | 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.
* Fix mapping of draw operations in screen deviceBen Bridle2024-09-10
| | | | | The mapping of draw codes to draw operations didn't match the screen device specification. This error was introduced in commit 6b3796c.
* Update version to 0.5.0v0.5.0Ben Bridle2024-09-07
|
* Update bedrock_core dependency to v4.0.0Ben Bridle2024-09-07
| | | | | This version of bedrock_core conforms to the final Bedrock core specification, which will not be changed from this point forward.
* Implement DB4 instruction for unit testsBen Bridle2024-09-07
| | | | | | | | | | 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.
* Update version to 0.4.1v0.4.1Ben Bridle2024-08-19
|
* Improve performance of hierarchical file navigationBen Bridle2024-08-13
| | | | | | | | 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.
* Prevent unused variable warning on LinuxBen Bridle2024-08-11
| | | | | The base variable is only used when compiling on Windows, so an unused variable warning is raised when compiling on Linux.
* Update version to 0.4.0v0.4.0Ben Bridle2024-08-10
|
* Update phosphor dependency to v2.0.0Ben Bridle2024-08-10
|
* Fix panic in ReadOnlyTextBufferBen Bridle2024-08-10
| | | | | | | | | 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.
* Fix ascend-to-parent behaviour of file deviceBen Bridle2024-08-10
| | | | | | | 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.
* Refactor the file deviceBen Bridle2024-08-07
| | | | | | | | 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.
* Refactor the file deviceBen Bridle2024-08-06
| | | | | | | | | | | | | | | | 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.
* Increase frame time to 8msBen Bridle2024-08-05
| | | | | This is slightly more efficient on the CPU, while not making any visible difference to the user.