More cleaning up screen.ha
This commit is contained in:
+4
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user