From 1c13f607ee1e641357ab7affdebaca1939bfe396 Mon Sep 17 00:00:00 2001 From: JJ Bliss Date: Wed, 13 May 2026 12:16:45 -0400 Subject: [PATCH] More cleaning up screen.ha --- uxn/screen.ha | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/uxn/screen.ha b/uxn/screen.ha index 7a5eddd..9b3ece9 100644 --- a/uxn/screen.ha +++ b/uxn/screen.ha @@ -11,7 +11,7 @@ fn draw_pixel(value: u8, state: *uxn) void = { if(!fill){ const auto = state.dev[0x26]; - let count = ((auto & 0xf0) >> 4): i8; + const count = ((auto & 0xf0) >> 4): i8; const auto_x = (auto & 0b00000001) != 0; const auto_y = (auto & 0b00000010) != 0; const auto_a = (auto & 0b00000100) != 0; @@ -84,7 +84,7 @@ fn regenerate_palettes(state: *uxn) void = { fn draw_sprite(value: u8, state: *uxn) void = { const colors = value & 0b00001111; const auto = state.dev[0x26]; - let count = ((auto & 0xf0) >> 4): u8; + const count = ((auto & 0xf0) >> 4): u8; const auto_x = (auto & 0b00000001) != 0; const auto_y = (auto & 0b00000010) != 0; const auto_a = (auto & 0b00000100) != 0; @@ -142,7 +142,6 @@ fn draw_sprite(value: u8, state: *uxn) void = { }; if(auto_x) { const new_x = if(flipx) { yield x - 8; } else { yield x + 8; }; - // const new_x = x + 8; state.dev[0x28] = (new_x >> 8): u8; state.dev[0x29] = (new_x): u8; }; @@ -165,8 +164,7 @@ fn copy_sprite_to_screen(bpp2: bool, colors: u8, x: u16, y: u16, addr: u16, flip else {yield get_pixels_from_1bpp_sprite(addr,state);}; for(let p .. pixels){ - let color = colormodes[p][colors]; - + const color = colormodes[p][colors]; if(drawZero || p > 0){ set_pixel(layer1,x+xoff,y+yoff,color,state); @@ -194,7 +192,7 @@ fn get_pixels_from_1bpp_sprite(addr: u16, state: *uxn) []u8 = { let pixels: [64]u8 = [0...]; for(let i = 0; i < 8; i+=1){ - let data: u8 = state.ram[addr + i: u16]; + const data: u8 = state.ram[addr + i: u16]; pixels[i*8 +0] = (data & 0b10000000) >> 7; pixels[i*8 +1] = (data & 0b01000000) >> 6; pixels[i*8 +2] = (data & 0b00100000) >> 5;