Clearing the VRAM

Graphic based area of development (Graphics Processing Unit), including the Geometry Transform Engine (GTE), TIM, STR (MDEC), etc.
Post Reply
User avatar
C Programming Expert
C Programming Expert
Posts: 140
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Clearing the VRAM

Post by t0rxe » June 3rd, 2013, 6:53 pm

This function makes a 1024x512px rectangle in the framebuffer (coordinates x0, y0) with the colour black (RGB 0,0,0).

It is very useful to ensure no garbage is seen whilst loading in new images, or you wish to clear the entire framebuffer. It should be called (once) in your video mode setup stage.

Code: Select all

void clearVRAM()
     RECT rectTL;
     setRECT(&rectTL, 0, 0, 1024, 512);
     ClearImage2(&rectTL, 0, 0, 0);
     printf("VRAM cleared!\n");
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: Feb 05, 2013

Re: Clearing the VRAM

Post by DEBRO » June 5th, 2013, 10:59 pm

Nice...thanks for the post.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest