X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/8b8f49b713d64065775fe538232f8639083601bd..35a7d633d3f16c1e0539af6ca5d8e7482926cd93:/lunaix-os/hal/gfxa/vga/vga_mmio_ops.c diff --git a/lunaix-os/hal/gfxa/vga/vga_mmio_ops.c b/lunaix-os/hal/gfxa/vga/vga_mmio_ops.c index 4ec8c3e..5e2193e 100644 --- a/lunaix-os/hal/gfxa/vga/vga_mmio_ops.c +++ b/lunaix-os/hal/gfxa/vga/vga_mmio_ops.c @@ -63,7 +63,7 @@ vga_mmio_set_regs(struct vga* v, u32_t type, size_t off, u32_t* seq, size_t len) } static void -vga_mmio_set_dacp(struct vga* v) +vga_mmio_set_dacp(struct vga* v, u32_t* lut, size_t len) { #define R(c) (u8_t)(((c) & 0xff0000) >> 16) #define G(c) (u8_t)(((c) & 0x00ff00) >> 8) @@ -72,11 +72,9 @@ vga_mmio_set_dacp(struct vga* v) vga_reg8* reg_ix = regaddr(VGA_DACX, VGA_REG_X, v); vga_reg8* reg_dat = regaddr(VGA_DACX, VGA_REG_D, v); - u32_t* color_map = v->lut.colors; - *reg_ix = 0; - for (size_t i = 0; i < v->lut.len; i++) { - u32_t color = color_map[i]; + for (size_t i = 0; i < len; i++) { + u32_t color = lut[i]; *reg_dat = R(color); *reg_dat = G(color); *reg_dat = B(color);