Critical bug in plotting pixels

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Critical bug in plotting pixels

Post by austanss »

Dare I say it: my display driver is broken.

I already had an issue with plotting pixels to the double buffer, but now the same issue has arised in plotting pixels to the framebuffer.

This is a big-time issue, ofc.

I am however unsure what level this issue is at. I can memset the double buffer a certain color, and buffer it, and it works.

Plotting pixels using the function, doesn't appear to work properly.

Rendering text, the text's pixels are spaced out by ~4 pixels.

I've worked my way through the functions from the top layer to the bottom and haven't found the bug.

Anyone have a clue?

Interesting source files:
https://github.com/microNET-OS/microCOR ... rc/gfx.cxx
https://github.com/microNET-OS/microCOR ... rminal.cxx
https://github.com/microNET-OS/microCOR ... /kmain.cxx
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
ilmmatias
Member
Member
Posts: 35
Joined: Fri Jun 02, 2017 3:01 pm
Contact:

Re: Critical bug in plotting pixels

Post by ilmmatias »

Shouldn't it be

Code: Select all

gop.pixels_per_scan_line * posi.y
instead of

Code: Select all

4 * gop.pixels_per_scan_line * posi.y
(gfx.cxx, lines 57 and 62)?
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Re: Critical bug in plotting pixels

Post by austanss »

I didn't think so, because the every 4 bytes is one pixel, so I thought I would be compensating for that, but now I am unsure.
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
ilmmatias
Member
Member
Posts: 35
Joined: Fri Jun 02, 2017 3:01 pm
Contact:

Re: Critical bug in plotting pixels

Post by ilmmatias »

pixels_per_scan_line (if it's the same one from the EFI GOP) is already is multiplied by the pixel size (as it is supposed to be the size of a whole line in bytes).
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Re: Critical bug in plotting pixels

Post by austanss »

Well now I am using

Code: Select all

gop.framebuffer_base[gop.x_resolution * posi.y + posi.x] = pixel;
which accounts for the size of the pixels and I am still getting this bug, which makes it appear it is the plotter, not the plotting, which in this case is the terminal driver.
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Re: Critical bug in plotting pixels

Post by austanss »

OK, issue resolved.

I was applying fixes, but my build system was not updating the kernel.
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
Post Reply