diff --git a/implementations/uvm-ncc/GNUmakefile b/implementations/uvm-ncc/GNUmakefile index aa43115..72d57dd 100644 --- a/implementations/uvm-ncc/GNUmakefile +++ b/implementations/uvm-ncc/GNUmakefile @@ -7,7 +7,7 @@ UVM_VM=$(UVM)/vm run: $(UVM_NCC)/out.asm cd $(UVM_VM) ; cargo run $(UVM_NCC)/out.asm -$(UVM_NCC)/out.asm: $(UVM_JOY)/xerblin.c $(UVM_JOY)/font/font.h +$(UVM_NCC)/out.asm: $(UVM_JOY)/xerblin.c $(UVM_JOY)/graphics.h $(UVM_JOY)/font/font.h cd $(UVM_NCC) ; cargo run $(UVM_JOY)/xerblin.c $(UVM_JOY)/font/font.h: diff --git a/implementations/uvm-ncc/graphics.h b/implementations/uvm-ncc/graphics.h index a915d1c..47a36ad 100644 --- a/implementations/uvm-ncc/graphics.h +++ b/implementations/uvm-ncc/graphics.h @@ -4,12 +4,11 @@ draw_background(u32* buffer, size_t w, size_t h) { for (size_t x = 0; x < w; ++x) { for (size_t y = 0; y < h; ++y) { - u32* pix_ptr = frame_buffer + w * y + x; u8 blue = x & 255; u8 green = y & 255; u8 red = (x + y + 128) & 255; - u8 alpha = 123; - *pix_ptr = (alpha << 24) | (red << 16) | (green << 8) | blue; + u32* pix_ptr = buffer + w * y + x; + *pix_ptr = (red << 16) | (green << 8) | blue; } } }