Depend on graphics.h.
This commit is contained in:
parent
dbc2fe5854
commit
d7db105bc8
|
|
@ -7,7 +7,7 @@ UVM_VM=$(UVM)/vm
|
||||||
run: $(UVM_NCC)/out.asm
|
run: $(UVM_NCC)/out.asm
|
||||||
cd $(UVM_VM) ; cargo 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
|
cd $(UVM_NCC) ; cargo run $(UVM_JOY)/xerblin.c
|
||||||
|
|
||||||
$(UVM_JOY)/font/font.h:
|
$(UVM_JOY)/font/font.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 x = 0; x < w; ++x) {
|
||||||
for (size_t y = 0; y < h; ++y) {
|
for (size_t y = 0; y < h; ++y) {
|
||||||
u32* pix_ptr = frame_buffer + w * y + x;
|
|
||||||
u8 blue = x & 255;
|
u8 blue = x & 255;
|
||||||
u8 green = y & 255;
|
u8 green = y & 255;
|
||||||
u8 red = (x + y + 128) & 255;
|
u8 red = (x + y + 128) & 255;
|
||||||
u8 alpha = 123;
|
u32* pix_ptr = buffer + w * y + x;
|
||||||
*pix_ptr = (alpha << 24) | (red << 16) | (green << 8) | blue;
|
*pix_ptr = (red << 16) | (green << 8) | blue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue