Skip to content

Commit

Permalink
static xfb to reduce mem frag
Browse files Browse the repository at this point in the history
  • Loading branch information
dborth committed Jun 20, 2010
1 parent a5dd37f commit 49450b8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions source/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,6 @@ static void SetupVideoMode(GXRModeObj * mode)
VIDEO_Configure (mode);
VIDEO_Flush();

// Allocate the video buffers
if(xfb[0]) free(MEM_K1_TO_K0(xfb[0]));
if(xfb[1]) free(MEM_K1_TO_K0(xfb[1]));
xfb[0] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (mode));
xfb[1] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (mode));

// Clear framebuffers etc.
VIDEO_ClearFrameBuffer (mode, xfb[0], COLOR_BLACK);
VIDEO_ClearFrameBuffer (mode, xfb[1], COLOR_BLACK);
Expand Down Expand Up @@ -408,6 +402,11 @@ void
InitializeVideo ()
{
VIDEO_Init();

// Allocate the video buffers
xfb[0] = (u32 *) MEM_K0_TO_K1 (memalign(32, 640*574*2));
xfb[1] = (u32 *) MEM_K0_TO_K1 (memalign(32, 640*574*2));

GXRModeObj *rmode = FindVideoMode();
SetupVideoMode(rmode);

Expand Down

0 comments on commit 49450b8

Please sign in to comment.