platforms, display pad overlay and storyware pages for Pico

This commit is contained in:
kub 2024-03-20 23:43:10 +01:00
parent da4148881e
commit 15cc45c0da
14 changed files with 260 additions and 109 deletions

View file

@ -1,6 +1,7 @@
/*
* PicoDrive
* (C) notaz, 2006,2009
* (C) irixxxx, 2022
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.

View file

@ -1,6 +1,7 @@
/*
* PicoDrive
* (C) notaz, 2006-2010
* (C) irixxxx, 2019-2024
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
@ -92,14 +93,18 @@ static void draw_pico_ptr(void)
int pitch = g_screen_ppitch;
u16 *p = g_screen_ptr;
int x = pico_pen_x, y = pico_pen_y;
// storyware pages are actually squished, 2:1
int h = (pico_inp_mode == 1 ? 160 : out_h);
if (h < 224) y++;
x = (x * out_w * ((1ULL<<32) / 320 + 1)) >> 32;
y = (y * out_h * ((1ULL<<32) / 224 + 1)) >> 32;
y = (y * h * ((1ULL<<32) / 224 + 1)) >> 32;
p += (screen_y+y)*pitch + (screen_x+x);
p[-pitch-1] ^= _; p[-pitch] ^= o; p[-pitch+1] ^= _;
p[-1] ^= o; p[0] ^= o; p[1] ^= o;
p[pitch-1] ^= _; p[pitch] ^= o; p[pitch+1] ^= _;
p[-pitch-1] ^= o; p[-pitch] ^= _; p[-pitch+1] ^= _; p[-pitch+2] ^= o;
p[-1] ^= _; p[0] ^= o; p[1] ^= o; p[2] ^= _;
p[pitch-1] ^= _; p[pitch] ^= o; p[pitch+1] ^= o; p[pitch+2] ^= _;
p[2*pitch-1]^= o; p[2*pitch]^= _; p[2*pitch+1]^= _; p[2*pitch+2]^= o;
}
/* render/screen buffer handling:
@ -194,6 +199,7 @@ void pemu_finalize_frame(const char *fps, const char *notice)
u16 *ps = ghost_buf;
int y, h = currentConfig.vscaling == EOPT_SCALE_SW ? 240:out_h;
int w = currentConfig.scaling == EOPT_SCALE_SW ? 320:out_w;
if (currentConfig.ghosting == 1)
for (y = 0; y < h; y++) {
v_blend((u32 *)pd, (u32 *)ps, w/2, p_075_round);
@ -208,8 +214,17 @@ void pemu_finalize_frame(const char *fps, const char *notice)
}
}
if ((PicoIn.AHW & PAHW_PICO) && (currentConfig.EmuOpt & EOPT_PICO_PEN))
if (pico_inp_mode) draw_pico_ptr();
if (PicoIn.AHW & PAHW_PICO) {
int h = currentConfig.vscaling == EOPT_SCALE_SW ? 240:out_h;
int w = currentConfig.scaling == EOPT_SCALE_SW ? 320:out_w;
u16 *pd = screen_buffer(g_screen_ptr) + out_y*g_screen_ppitch + out_x;
if (pico_inp_mode)
emu_pico_overlay(pd, w, h, g_screen_ppitch);
if (pico_inp_mode /*== 2 || overlay*/)
draw_pico_ptr();
}
if (notice)
emu_osd_text16(4, g_screen_height - 8, notice);
if (currentConfig.EmuOpt & EOPT_SHOW_FPS)