Skip to content

Commit

Permalink
cosmetic fixes for pandora port
Browse files Browse the repository at this point in the history
  • Loading branch information
notaz committed Dec 2, 2023
1 parent a0ecb29 commit 457a928
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions platform/pandora/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ static int menu_loop_cscaler(int id, int keys)

inp = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT
|PBTN_R|PBTN_MOK|PBTN_MBACK, NULL, 40);
if (inp & PBTN_UP) g_layer_cy--;
if (inp & PBTN_DOWN) g_layer_cy++;
if (inp & PBTN_LEFT) g_layer_cx--;
if (inp & PBTN_RIGHT) g_layer_cx++;
if (!(inp & PBTN_R)) {
if (inp & PBTN_R) {
if (inp & PBTN_UP) g_layer_cy--;
if (inp & PBTN_DOWN) g_layer_cy++;
if (inp & PBTN_LEFT) g_layer_cx--;
if (inp & PBTN_RIGHT) g_layer_cx++;
} else {
if (inp & PBTN_UP) g_layer_ch += 2;
if (inp & PBTN_DOWN) g_layer_ch -= 2;
if (inp & PBTN_LEFT) g_layer_cw += 2;
Expand Down
13 changes: 7 additions & 6 deletions platform/pandora/plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,17 @@

static struct vout_fbdev *main_fb, *layer_fb;
// g_layer_* - in use, g_layer_c* - configured custom
int g_layer_cx, g_layer_cy, g_layer_cw, g_layer_ch;
int g_layer_cx = 80, g_layer_cy, g_layer_cw = 640, g_layer_ch = 480;
static int g_layer_x, g_layer_y;
static int g_layer_w = 320, g_layer_h = 240;
static int g_osd_fps_x, g_osd_y, doing_bg_frame;
static int g_osd_start_x, g_osd_fps_x, g_osd_y, doing_bg_frame;

static unsigned char __attribute__((aligned(4))) fb_copy[320 * 240 * 2];
static void *temp_frame;
const char *renderer_names[] = { NULL };
const char *renderer_names32x[] = { NULL };

static const char * const pandora_gpio_keys[KEY_MAX + 1] = {
[0 ... KEY_MAX] = NULL,
[KEY_UP] = "Up",
[KEY_LEFT] = "Left",
[KEY_RIGHT] = "Right",
Expand Down Expand Up @@ -165,7 +164,7 @@ static void draw_cd_leds(void)
void pemu_finalize_frame(const char *fps, const char *notice)
{
if (notice && notice[0])
emu_osd_text16(2, g_osd_y, notice);
emu_osd_text16(2 + g_osd_start_x, g_osd_y, notice);
if (fps && fps[0] && (currentConfig.EmuOpt & EOPT_SHOW_FPS))
emu_osd_text16(g_osd_fps_x, g_osd_y, fps);
if ((PicoIn.AHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS))
Expand Down Expand Up @@ -340,7 +339,7 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co

fb_w = col_count;
fb_left = start_col;
fb_right = 320 - (fb_w+fb_left);;
fb_right = 320 - (fb_w + fb_left);

switch (currentConfig.scaling) {
case SCALE_1x1:
Expand Down Expand Up @@ -380,7 +379,8 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co
fb_h = line_count;
break;
}
g_osd_fps_x = col_count < 320 ? 232 : 264;
g_osd_start_x = start_col;
g_osd_fps_x = start_col + col_count - 5*8 - 2;
g_osd_y = fb_top + fb_h - 8;

pnd_setup_layer(1, g_layer_x, g_layer_y, g_layer_w, g_layer_h);
Expand Down Expand Up @@ -411,6 +411,7 @@ void pemu_loop_prep(void)

void pemu_loop_end(void)
{
memset(fb_copy, 0, sizeof(fb_copy));
/* do one more frame for menu bg */
pemu_forced_frame(0, 1);

Expand Down

0 comments on commit 457a928

Please sign in to comment.