@@ -203,7 +203,7 @@ u32 Draw_SetupFramebuffer(void)
203203 GPU_FB_BOTTOM_ADDR_1 = GPU_FB_BOTTOM_ADDR_2 = FB_BOTTOM_VRAM_PA ;
204204 GPU_FB_BOTTOM_FMT = format ;
205205 GPU_FB_BOTTOM_STRIDE = 240 * 2 ;
206-
206+
207207 gpuSavedFillColor = LCD_BOT_FILLCOLOR ;
208208 LCD_BOT_FILLCOLOR = 0 ;
209209
@@ -214,7 +214,7 @@ void Draw_RestoreFramebuffer(void)
214214{
215215 memcpy (FB_BOTTOM_VRAM_ADDR , framebufferCache , FB_BOTTOM_SIZE );
216216 Draw_FlushFramebuffer ();
217-
217+
218218 LCD_BOT_FILLCOLOR = gpuSavedFillColor ;
219219 GPU_FB_BOTTOM_ADDR_1 = gpuSavedFramebufferAddr1 ;
220220 GPU_FB_BOTTOM_ADDR_2 = gpuSavedFramebufferAddr2 ;
@@ -350,6 +350,7 @@ typedef struct FrameBufferConvertArgs {
350350 u32 width ;
351351 u8 startingLine ;
352352 u8 numLines ;
353+ u8 scaleFactorY ;
353354 bool top ;
354355 bool left ;
355356} FrameBufferConvertArgs ;
@@ -367,16 +368,19 @@ static void Draw_ConvertFrameBufferLinesKernel(const FrameBufferConvertArgs *arg
367368
368369 for (u32 y = args -> startingLine ; y < args -> startingLine + args -> numLines ; y ++ )
369370 {
370- for ( u32 x = 0 ; x < width ; x ++ )
371+ for ( u8 i = 0 ; i < args -> scaleFactorY ; i ++ )
371372 {
372- __builtin_prefetch (addr + x * stride + y * formatSizes [fmt ], 0 , 3 );
373- Draw_ConvertPixelToBGR8 (args -> buf + (x + width * y ) * 3 , addr + x * stride + y * formatSizes [fmt ], fmt );
373+ for (u32 x = 0 ; x < width ; x ++ )
374+ {
375+ __builtin_prefetch (addr + x * stride + y * formatSizes [fmt ], 0 , 3 );
376+ Draw_ConvertPixelToBGR8 (args -> buf + (x + width * (args -> scaleFactorY * y + i )) * 3 , addr + x * stride + y * formatSizes [fmt ], fmt );
377+ }
374378 }
375379 }
376380}
377381
378- void Draw_ConvertFrameBufferLines (u8 * buf , u32 width , u32 startingLine , u32 numLines , bool top , bool left )
382+ void Draw_ConvertFrameBufferLines (u8 * buf , u32 width , u32 startingLine , u32 numLines , u32 scaleFactorY , bool top , bool left )
379383{
380- FrameBufferConvertArgs args = { buf , width , (u8 )startingLine , (u8 )numLines , top , left };
384+ FrameBufferConvertArgs args = { buf , width , (u8 )startingLine , (u8 )numLines , ( u8 ) scaleFactorY , top , left };
381385 svcCustomBackdoor (Draw_ConvertFrameBufferLinesKernel , & args );
382386}
0 commit comments