summaryrefslogtreecommitdiff
path: root/src/devices
Commit message (Collapse)AuthorAge
* Make orthogonal line drawing operations work with signed coordinatesBen Bridle2024-01-06
| | | | | | | | | | | | | | | | | | 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.
* Reduce width of ScreenDevice::draw_sprite methodBen Bridle2024-01-06
| | | | | This method was exceeding the 80-character line limit, which was interfering with the centering behaviour of my text editor.
* Move ScreenDevice::fill_layer methodBen Bridle2024-01-06
| | | | | The method was between the two draw_sprite methods, but it fits better just after draw_pixel.
* Make rectangle drawing operations work with signed valuesBen Bridle2024-01-05
| | | | | | | 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.
* Update screen device code to reflect specification changesBen Bridle2024-01-05
| | | | | | | 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.
* Fix multiplication error in math deviceBen Bridle2023-12-28
| | | | | | 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.
* First commitv0.1.0Ben Bridle2023-12-24