summaryrefslogtreecommitdiff
path: root/src/processor.rs
Commit message (Collapse)AuthorAge
* Restructure the libraryBen Bridle2024-10-28
| | | | | | | | | | | | | | | | | | The main type of the library is now the BedrockEmulator type, which contains a new BedrockCore type and an instance of a user-implemented DeviceBus trait. This new structure makes it possible to hot-swap a device bus while a BedrockEmulator is running, which keeps the core and the device bus well separated. This was important when bedrock-pc was going to have two graphical emulator types and upgrade from one to the other once the screen device was accessed. The new structure also vastly simplifies the code previously required with the old Bedrock type, which was parametric over 16 device types and so needed each device type to be enumerated in every place the Bedrock type was stored. The new BedrockEmulator type is only parametric over the particular DeviceBus implementation.
* Simplify conversion of Rust bool to Bedrock boolBen Bridle2024-10-28
| | | | | The new subtract implementation should be a lot more efficient because it avoids branching.
* Record total elapsed processor cyclesBen Bridle2024-10-07
|
* Make Bedrock parametric over devicesBen Bridle2024-09-30
| | | | | | | | | | The core Bedrock struct is now parametric over individual Device structs, rather than over a single DeviceBus. This change was made so that devices can be implemented separately to one another. The implementation of the evaluate method has also been changed to make it potentially slightly more efficient, by replacing pop-then-push combinations with get operations.
* Implement micro optimisations for unary operatorsBen Bridle2024-09-07
| | | | | A 1% speed increase was observed when testing a tight decrementing loop with these optimisations.
* Update instruction set to match final specificationBen Bridle2024-09-07
|
* Improve efficiency of some instructionsBen Bridle2024-09-03
| | | | | | | | When a value is to be read and kept on the stack, instead of popping and immediately pushing it we now use a more efficient `get` stack method. The pop_u16 stack method has also been changed to a variation that assembles to fewer CPU instructions.
* Remove trailing semicolons in stack macrosBen Bridle2024-08-30
| | | | The compiler warned that these are a deprecated syntactic form.
* Fix SHF instructionBen Bridle2024-05-18
| | | | | | | The wrong shifting operation was being used for the SHF operation. The 'wrapping' operations were shifting by the given distance, modulo eight, which was yielding incorrect results for shift distances greater than seven.
* Add expanded debug signalsBen Bridle2024-04-16
|
* Change processor code to match updated Bedrock specificationv2.0.0Ben Bridle2024-01-20
| | | | | | | | | - The LKD and SKD operations have been removed - SHF/SHC have been moved to after LDD/STD - SWP/ROT/DUP/OVR have been rearranged to be DUP/OVR/SWP/ROT - NOT/AND have been rearranged to be AND/NOT - PSK has been added, placed after PSH - SPL has been added, placed after POP
* First commitv1.0.0Ben Bridle2023-12-24