FillArea

From WikiPrizm
Revision as of 21:28, 17 April 2014 by ProgrammerNerd (talk | contribs) (Adding functions based on the useful Prizm routines thread.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Fills a rectangular area of (width,height) with upper-left corner at (x,y)

void fillArea(unsigned x,unsigned y,unsigned w,unsigned h,unsigned short col){
	unsigned short*s=(unsigned short*)0xA8000000;
	s+=(y*384)+x;
	while(h--){
		unsigned w2=w;
		while(w2--)
			*s++=col;
		s+=384-w;
	}
}