diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2024-10-28 20:25:01 +1300 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2024-10-28 20:29:12 +1300 |
commit | 1a830a3d1b9d99653322d5ae49ea8165de7ed9d0 (patch) | |
tree | 798e77b6fcf2438b1c2538a67efe856a2f7cb979 /src/devices/screen/draw_sprite.rs | |
parent | 03c4b069e1806af256730639cefdae115b24401a (diff) | |
download | bedrock-pc-01ba3901441af778d473f44acaee953d185245e7.zip |
Rewrite emulatorv1.0.0-alpha1
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.
Diffstat (limited to 'src/devices/screen/draw_sprite.rs')
-rw-r--r-- | src/devices/screen/draw_sprite.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/devices/screen/draw_sprite.rs b/src/devices/screen/draw_sprite.rs deleted file mode 100644 index 5676335..0000000 --- a/src/devices/screen/draw_sprite.rs +++ /dev/null @@ -1,25 +0,0 @@ -use super::*; - -impl ScreenDevice { - pub fn draw_sprite_1bit(&mut self, params: u8, layer: ScreenLayer) { - let sprite = self.sprite_buffer.get_1bit_sprite(params); - self.draw_sprite(sprite, layer); - } - - pub fn draw_sprite_2bit(&mut self, params: u8, layer: ScreenLayer) { - let sprite = self.sprite_buffer.get_2bit_sprite(params); - self.draw_sprite(sprite, layer); - } - - fn draw_sprite(&mut self, sprite: Sprite, layer: ScreenLayer) { - let mut pos = self.cursor; - for row in sprite { - for colour in row { - self.draw_pixel(colour, layer, pos); - pos.x = pos.x.wrapping_add(1); - } - pos.x = pos.x.wrapping_sub(8); - pos.y = pos.y.wrapping_add(1); - } - } -} |