Unverified Commit 30344d34 authored by Salvador's avatar Salvador Committed by GitHub
Browse files

add Hide border option (#33)

* hide border
parent 1e2dd489
Pipeline #70198 passed with stages
in 9 minutes and 49 seconds
......@@ -271,6 +271,11 @@ int WinL = NoWinL;
int WinT = NoWinT;
int WinB = NoWinB;
int WinRBN=BlWinR;
int WinLBN=BlWinL;
int WinTBN=BlWinT;
int WinBBN=BlWinB;
static int RasterX = 0;
static int TVW, TVH;
int TVP;
......
......@@ -67,7 +67,7 @@ retro_audio_sample_batch_t audio_cb;
static retro_input_state_t input_state_cb;
struct retro_perf_callback perf_cb;
extern int WinR, WinL, WinT, WinB, TVP;
extern int WinR, WinL, WinT, WinB, WinRBN, WinLBN, WinTBN, WinBBN, TVP;
extern WORD* TVFB;
extern keybovl_t zx81ovl;
......@@ -79,6 +79,7 @@ static const struct retro_variable core_vars[] =
{
{ "81_fast_load", "Tape Fast Load; enabled|disabled" },
{ "81_8_16_contents", "8K-16K Contents; auto|ROM shadow|RAM|dK'tronics 4K Graphics ROM + 4K RAM" },
{ "81_hide_border", "Hide Video Border; disabled|enabled" },
{ "81_highres", "High Resolution; auto|none|WRX" },
{ "81_chroma_81", "Emulate Chroma 81; auto|disabled|enabled" },
{ "81_video_presets", "Video Presets; clean|tv|noisy" },
......@@ -442,8 +443,19 @@ void retro_set_input_poll( retro_input_poll_t cb )
void retro_get_system_av_info( struct retro_system_av_info* info )
{
info->geometry.base_width = WinR - WinL;
info->geometry.base_height = WinB - WinT;
int hide_border = coreopt(env_cb, core_vars, state.sha1, "81_hide_border", NULL);
hide_border += hide_border < 0;
if (hide_border == 1)
{
info->geometry.base_width = WinRBN - WinLBN;
info->geometry.base_height = WinBBN - WinTBN;
}
else
{
info->geometry.base_width = WinR - WinL;
info->geometry.base_height = WinB - WinT;
}
info->geometry.max_width = WinR - WinL;
info->geometry.max_height = WinB - WinT;
info->geometry.aspect_ratio = 0.0f;
......@@ -475,10 +487,21 @@ void retro_run( void )
input_poll_cb();
uint16_t* fb = TVFB + WinL + WinT * TVP / 2;
eo_tick();
keybovl_update( input_state_cb, state.devices, fb, TVP / 2, state.transp, state.scaled, state.ms, 20 );
video_cb( (void*)fb, WinR - WinL, WinB - WinT, TVP );
int hide_border = coreopt(env_cb, core_vars, state.sha1, "81_hide_border", NULL);
hide_border += hide_border < 0;
if (hide_border == 1)
{
fb = TVFB + WinLBN + WinTBN * TVP / 2;
video_cb( (void*)fb, WinRBN - WinLBN, WinBBN - WinTBN, TVP );
}
else
{
video_cb( (void*)fb, WinR - WinL, WinB - WinT, TVP );
}
}
void retro_deinit( void )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment