Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 5 additions & 62 deletions gfx/drivers/ctr_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ typedef struct ctr_video
bool state_data_exist;
bool bottom_check_idle;
bool bottom_is_idle;
bool bottom_is_fading;
char state_date[CTR_STATE_DATE_SIZE];
} ctr_video_t;

Expand Down Expand Up @@ -250,7 +249,6 @@ typedef struct
* externally, otherwise cannot detect current state
* when reinitialising... */
static bool ctr_bottom_screen_enabled = true;
static int fade_count = 256;

/*
* FORWARD DECLARATIONS
Expand Down Expand Up @@ -1197,15 +1195,11 @@ static void ctr_bottom_menu_control(void* data,
if (ctr->bottom_is_idle)
{
ctr->bottom_is_idle = false;
ctr->bottom_is_fading = false;
fade_count = 256;
ctr_set_bottom_screen_enable(true,true);
}
else if (ctr->bottom_check_idle)
{
ctr->bottom_check_idle = false;
ctr->bottom_is_fading = false;
fade_count = 256;
}

if (ctr->bottom_menu == CTR_BOTTOM_MENU_NOT_AVAILABLE)
Expand Down Expand Up @@ -1567,34 +1561,6 @@ static void ctr_render_bottom_screen(void *data)
}
}

/* graphic function originates from here:
* https://github.com/smealum/3ds_hb_menu/blob/master/source/gfx.c
*/
void ctr_fade_bottom_screen(gfxScreen_t screen, gfx3dSide_t side, u32 f)
{
#ifndef CONSOLE_LOG
int i;
u16 fbWidth, fbHeight;
u8* fbAdr = gfxGetFramebuffer(screen, side, &fbWidth, &fbHeight);

for(i = 0; i < fbWidth * fbHeight / 2; i++)
{
*fbAdr = (*fbAdr * f) >> 8;
fbAdr++;
*fbAdr = (*fbAdr * f) >> 8;
fbAdr++;
*fbAdr = (*fbAdr * f) >> 8;
fbAdr++;
*fbAdr = (*fbAdr * f) >> 8;
fbAdr++;
*fbAdr = (*fbAdr * f) >> 8;
fbAdr++;
*fbAdr = (*fbAdr * f) >> 8;
fbAdr++;
}
#endif
}

static void ctr_set_bottom_screen_idle(ctr_video_t * ctr)
{
u64 elapsed_tick;
Expand All @@ -1605,28 +1571,10 @@ static void ctr_set_bottom_screen_idle(ctr_video_t * ctr)

if ( elapsed_tick > 2000000000 )
{
if (!ctr->bottom_is_fading)
{
ctr->bottom_is_fading = true;
ctr->refresh_bottom_menu = true;
return;
}

if (fade_count > 0)
{
fade_count--;
ctr_fade_bottom_screen(GFX_BOTTOM, GFX_LEFT, fade_count);

if (fade_count <= 128)
{
ctr->bottom_is_idle = true;
ctr->bottom_is_fading = false;
ctr->bottom_check_idle = false;
fade_count = 256;
ctr_set_bottom_screen_enable(false,true);
return;
}
}
ctr->bottom_is_idle = true;
ctr->bottom_check_idle = false;
ctr_set_bottom_screen_enable(false,true);
return;
}
}

Expand Down Expand Up @@ -1817,7 +1765,6 @@ static void* ctr_init(const video_info_t* video,
ctr->prev_bottom_menu = CTR_BOTTOM_MENU_NOT_AVAILABLE;
ctr->bottom_check_idle = false;
ctr->bottom_is_idle = false;
ctr->bottom_is_fading = false;
ctr->idle_timestamp = 0;
ctr->state_slot = settings->ints.state_slot;

Expand Down Expand Up @@ -2476,10 +2423,6 @@ static bool ctr_frame(void* data, const void* frame,
gspPresentBuffer(GFX_BOTTOM, ctr->current_buffer_bottom, bottom, bottom,
stride, GSP_BGR8_OES);
}
else if (ctr->bottom_is_fading)
{
gfxScreenSwapBuffers(GFX_BOTTOM,false);
}
#endif
#else
topFramebufferInfo.
Expand Down Expand Up @@ -2550,7 +2493,7 @@ static bool ctr_frame(void* data, const void* frame,
#endif
#endif
ctr->current_buffer_top ^= 1;
if (ctr->refresh_bottom_menu || ctr->bottom_is_fading)
if (ctr->refresh_bottom_menu)
ctr->current_buffer_bottom ^= 1;

ctr->p3d_event_pending = true;
Expand Down
Loading