From WikiPrizm
Revision as of 06:44, 17 March 2022 by Dr-carlos (talk | contribs) (Use GetVRAMAddress not 0xA8000000)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Plots a point at (x,y) on the screen with a specified color

Source code

#include <fxcg/display.h>
void plot(unsigned x,unsigned y,unsigned short color){
	unsigned short*s=(unsigned short*) GetVRAMAddress;


x - Specifies the x coordinate of the pixel in range of [0,383]
y - Specifies the y coordinate of the pixel in range of [0,215]
color - Specifies what color the plotted pixel will be. It is in RGB 565 format.


Given the minimal nature of this function, call overhead can easily be a non-trivial factor in obtaining reasonable performance. Marking it as static inline and declaring it in a single header file may be appropriate to help ensure this function is inlined.


Function written by ProgrammerNerd