Brought back Vertical Offset option in PanelDisplay

This commit is contained in:
Dimitris Panokostas 2017-12-25 00:15:51 +01:00
parent ed876469c7
commit 541af31644
6 changed files with 52 additions and 99 deletions

View file

@ -49,8 +49,6 @@
#include "audio.h"
#include "devices.h"
#define VERTICAL_OFFSET 18
#define RENDER_SIGNAL_PARTIAL 1
#define RENDER_SIGNAL_FRAME_DONE 2
#define RENDER_SIGNAL_QUIT 3
@ -1525,7 +1523,7 @@ static void init_aspect_maps(void)
if (amiga2aspect_line_map[i] == -1)
continue;
for (int j = amiga2aspect_line_map[i]; j < h && native2amiga_line_map[j] == -1; j++)
native2amiga_line_map[j] = (i + VERTICAL_OFFSET) >> linedbl;
native2amiga_line_map[j] = i + currprefs.vertical_offset >> linedbl;
}
}
@ -1906,11 +1904,7 @@ static void center_image(void)
max_drawn_amiga_line_tmp = gfxvidinfo.drawbuffer.outheight;
max_drawn_amiga_line_tmp >>= linedbl;
#ifdef PANDORA
thisframe_y_adjust = minfirstline + currprefs.pandora_vertical_offset;
#else
thisframe_y_adjust = minfirstline + VERTICAL_OFFSET;
#endif
thisframe_y_adjust = minfirstline + currprefs.vertical_offset;
/* Make sure the value makes sense */
if (thisframe_y_adjust + max_drawn_amiga_line_tmp > maxvpos + maxvpos / 2)

View file

@ -419,11 +419,12 @@ struct uae_prefs {
int scaling_method;
#endif
int vertical_offset;
TCHAR open_gui[256];
TCHAR quit_amiberry[256];
#ifdef PANDORA
int pandora_vertical_offset;
int pandora_cpu_speed;
int pandora_hide_idle_led;
int pandora_tapDelay;

View file

@ -238,8 +238,7 @@ void target_default_options(struct uae_prefs* p, int type)
#ifdef PANDORA
p->gfx_size.width = 320;
p->gfx_size.height = 240;
p->gfx_resolution = RES_LORES;
p->pandora_vertical_offset = OFFSET_Y_ADJUST;
p->gfx_resolution = RES_LORES;
p->pandora_cpu_speed = defaultCpuSpeed;
p->pandora_hide_idle_led = 0;
p->pandora_tapDelay = 10;
@ -256,6 +255,8 @@ void target_default_options(struct uae_prefs* p, int type)
p->kbd_led_num = -1; // No status on numlock
p->kbd_led_scr = -1; // No status on scrollock
p->vertical_offset = OFFSET_Y_ADJUST;
#ifdef USE_SDL1
p->gfx_correct_aspect = 1;
p->gfx_fullscreen_ratio = 100;
@ -330,9 +331,10 @@ void target_save_options(struct zfile* f, struct uae_prefs* p)
cfgfile_write(f, "amiberry.cpu_speed", "%d", p->pandora_cpu_speed);
cfgfile_write(f, "amiberry.hide_idle_led", "%d", p->pandora_hide_idle_led);
cfgfile_write(f, "amiberry.tap_delay", "%d", p->pandora_tapDelay);
cfgfile_write(f, "amiberry.move_y", "%d", p->pandora_vertical_offset - OFFSET_Y_ADJUST);
#endif //PANDORA
cfgfile_write(f, "amiberry.vertical_offset", "%d", p->vertical_offset - OFFSET_Y_ADJUST);
#ifdef USE_SDL1
cfgfile_write(f, _T("amiberry.gfx_correct_aspect"), _T("%d"), p->gfx_correct_aspect);
cfgfile_write(f, _T("amiberry.gfx_fullscreen_ratio"), _T("%d"), p->gfx_fullscreen_ratio);
@ -409,10 +411,6 @@ int target_parse_option(struct uae_prefs* p, const char* option, const char* val
return 1;
if (cfgfile_intval(option, value, "tap_delay", &p->pandora_tapDelay, 1)
return 1;
if (cfgfile_intval(option, value, "move_y", &p->pandora_vertical_offset, 1) {
p->pandora_vertical_offset += OFFSET_Y_ADJUST;
return 1;
}
#endif //PANDORA
#ifdef ANDROIDSDL
@ -458,6 +456,11 @@ int target_parse_option(struct uae_prefs* p, const char* option, const char* val
if (cfgfile_intval(option, value, "kbd_led_scr", &p->kbd_led_scr, 1))
return 1;
if (cfgfile_intval(option, value, "vertical_offset", &p->vertical_offset, 1))
{
p->vertical_offset += OFFSET_Y_ADJUST;
return 1;
}
#ifdef USE_SDL1
if (cfgfile_intval(option, value, "gfx_correct_aspect", &p->gfx_correct_aspect, 1))
return 1;
@ -986,7 +989,7 @@ void target_shutdown(void)
int main(int argc, char* argv[])
{
struct sigaction action{};
printf("Amiberry v2.6, by Dimitris (MiDWaN) Panokostas, Dom (Horace&TheSpider) Cresswell and TomB\n");
printf("Amiberry v2.7, by Dimitris (MiDWaN) Panokostas, Dom (Horace&TheSpider) Cresswell and TomB\n");
max_uae_width = 1920;
max_uae_height = 1080;

View file

@ -39,11 +39,7 @@ static NavigationMap navMap[] =
{ "RAM", "Chipmem", "Chipmem", "ROM", "Floppy drives" },
{ "Floppy drives", "cmdSel0", "DF0:", "RAM", "Hard drives/CD" },
{ "Hard drives/CD", "cmdCreateHDF", "cmdAddDir", "Floppy drives", "Display"},
#ifdef USE_SDL1
{ "Display", "sldWidth", "sldWidth", "Hard drives/CD", "Sound" },
#elif USE_SDL2
{ "Display", "Frameskip", "Frameskip", "Hard drives/CD", "Sound" },
#endif
{ "Sound", "sndDisable", "sndDisable", "Display", "Input" },
{ "Input", "cboPort0mode", "cboPort0", "Sound", "Custom controls" },
{ "Custom controls", "Right Trigger", "0: Mouse", "Input", "Miscellaneous" },
@ -214,18 +210,21 @@ static NavigationMap navMap[] =
// PanelDisplay
#ifdef USE_SDL1
{ "sldWidth", "", "", "Frameskip", "sldHeight" },
{ "sldHeight", "", "", "sldWidth", "sldVertPos" },
{ "sldVertPos", "", "", "sldHeight", "FSRatio" },
{ "FSRatio", "", "", "sldVertPos", "4by3Ratio" },
{ "4by3Ratio", "Display", "Display", "FSRatio", "Line doubling" },
{ "Line doubling", "Display", "Display", "4by3Ratio", "Frameskip" },
{ "Frameskip", "Display", "Display", "Line doubling", "sldWidth" },
{ "sldWidth", "", "", "Frameskip", "sldHeight" },
{ "sldHeight", "", "", "sldWidth", "sldVertPos" },
{ "sldVertPos", "", "", "sldHeight", "FSRatio" },
{ "FSRatio", "", "", "sldVertPos", "4by3Ratio" },
{ "4by3Ratio", "Display", "Display", "FSRatio", "Line doubling" },
{ "Line doubling", "Display", "Display", "4by3Ratio", "Frameskip" },
{ "Frameskip", "Display", "Display", "Line doubling", "sldWidth" },
#elif USE_SDL2
{"Frameskip", "Display", "Display", "Linear (smooth)", "Auto"},
{"Auto", "Display", "Display", "Frameskip", "Nearest Neighbor (pixelated)"},
{ "Nearest Neighbor (pixelated)", "Display", "Display", "Auto", "Linear (smooth)"},
{"Linear (smooth)", "Display", "Display", "Nearest Neighbor (pixelated)", "Frameskip"},
{ "sldWidth", "", "", "Linear (smooth)","sldHeight" },
{ "sldHeight", "", "", "sldWidth", "sldVertPos" },
{ "sldVertPos", "", "", "sldHeight", "Frameskip" },
{ "Frameskip", "Display", "Display", "Linear (smooth)", "Auto" },
{ "Auto", "Display", "Display", "Frameskip", "Nearest Neighbor (pixelated)" },
{ "Nearest Neighbor (pixelated)", "Display", "Display", "Auto", "Linear (smooth)" },
{ "Linear (smooth)", "Display", "Display", "Nearest Neighbor (pixelated)", "Frameskip" },
#endif
//PanelSound
@ -243,7 +242,6 @@ static NavigationMap navMap[] =
// active move left move right move up move down
// PanelInput
#ifdef AMIBERRY
{ "cboPort0", "Input", "cboPort0mode", "cboAutofire", "cboPort1" },
{ "cboPort0mode", "cboPort0", "Input", "cboTapDelay", "cboPort1mode" },
{ "cboPort1", "Input", "cboPort1mode", "cboPort0", "cboPort2" },
@ -256,34 +254,7 @@ static NavigationMap navMap[] =
{ "cboPort1mousemode","MouseHack", "Input", "cboPort0mousemode","cboTapDelay" },
{ "cboAutofire", "Input", "cboTapDelay", "MouseHack", "cboPort0" },
{ "cboTapDelay", "cboAutofire", "Input", "cboPort1mousemode","cboPort0mode" },
#else
{ "cboPort0", "Input", "cboPort0mode", "cboLeft", "cboPort1" },
{ "cboPort0mode", "cboPort0", "cboPort0mousemode", "cboLeft", "cboPort1mode" },
{ "cboPort1", "Input", "cboPort1mode", "cboPort0", "MouseSpeed" },
{ "cboPort1mode", "cboPort1", "Input", "cboPort0mode", "MouseSpeed" },
{ "cboAutofire", "cboPort1", "Input", "cboPort1mousemode","cboTapDelay" },
{ "MouseSpeed", "", "", "cboPort1", "MouseHack" },
{ "MouseHack", "Input", "cboTapDelay", "MouseSpeed", "CustomCtrl" },
{ "cboTapDelay", "cboAutofire", "Input", "cboAutofire", "cboB" },
#endif
#ifdef PANDORA
{ "CustomCtrl", "Input", "Input", "MouseHack", "cboA" },
{ "cboA", "Input", "cboB", "CustomCtrl", "cboX" },
{ "cboB", "cboA", "Input", "cboTapDelay", "cboY" },
{ "cboX", "Input", "cboY", "cboA", "cboL" },
{ "cboY", "cboX", "Input", "cboB", "cboR" },
{ "cboL", "Input", "cboR", "cboX", "cboUp" },
{ "cboR", "cboL", "Input", "cboY", "cboDown" },
{ "cboUp", "Input", "cboDown", "cboL", "cboLeft" },
{ "cboDown", "cboUp", "Input", "cboR", "cboRight" },
{ "cboLeft", "Input", "cboRight", "cboUp", "cboPort0" },
{ "cboRight", "cboLeft", "Input", "cboDown", "cboPort0mode" },
#endif
#ifndef PANDORA
// PanelCustom
{ "0: Mouse", "Custom controls", "1: Joystick", "cboCustomAction13", "None" },
{ "1: Joystick", "0: Mouse", "2: Parallel 1", "cboCustomAction13", "HotKey" },
@ -311,7 +282,6 @@ static NavigationMap navMap[] =
{ "cboCustomAction12", "cboCustomAction5", "Custom controls", "cboCustomAction11", "cboCustomAction13" },
{ "cboCustomAction13", "cboCustomAction6", "Custom controls", "cboCustomAction12", "1: Joystick" },
#endif
// PanelMisc
// active move left move right move up move down
@ -501,12 +471,13 @@ void PushFakeKey(const SDLKey inKey)
}
#elif USE_SDL2
void PushFakeKey(const SDL_Keycode inKey)
{ SDL_Event nuevent;
nuevent.type = SDL_KEYDOWN; // and the key up
nuevent.key.keysym.sym = inKey;
gui_input->pushInput(nuevent); // Fire key down
nuevent.type = SDL_KEYUP; // and the key up
gui_input->pushInput(nuevent); // Fire key down
{
SDL_Event nuevent;
nuevent.type = SDL_KEYDOWN; // and the key up
nuevent.key.keysym.sym = inKey;
gui_input->pushInput(nuevent); // Fire key down
nuevent.type = SDL_KEYUP; // and the key up
gui_input->pushInput(nuevent); // Fire key down
}
#endif

View file

@ -47,11 +47,9 @@ static gcn::Label* lblAmigaHeight;
static gcn::Label* lblAmigaHeightInfo;
static gcn::Slider* sldAmigaHeight;
#ifdef PANDORA
static gcn::Label* lblVertPos;
static gcn::Label* lblVertPosInfo;
static gcn::Slider* sldVertPos;
#endif
static gcn::UaeCheckBox* chkLineDbl;
static gcn::UaeCheckBox* chkFrameskip;
@ -85,16 +83,14 @@ public:
RefreshPanelDisplay();
}
}
#ifdef PANDORA
else if (actionEvent.getSource() == sldVertPos)
{
if (changed_prefs.pandora_vertical_offset != (int)(sldVertPos->getValue()) + OFFSET_Y_ADJUST)
if (changed_prefs.vertical_offset != int(sldVertPos->getValue()) + OFFSET_Y_ADJUST)
{
changed_prefs.pandora_vertical_offset = (int)(sldVertPos->getValue()) + OFFSET_Y_ADJUST;
changed_prefs.vertical_offset = int(sldVertPos->getValue()) + OFFSET_Y_ADJUST;
RefreshPanelDisplay();
}
}
#endif
else
if (actionEvent.getSource() == chkFrameskip)
{
@ -166,8 +162,7 @@ void InitPanelDisplay(const struct _ConfigCategory& category)
sldAmigaHeight->addActionListener(amigaScreenActionListener);
lblAmigaHeightInfo = new gcn::Label("200");
#ifdef PANDORA
lblVertPos = new gcn::Label("Vert. offset:");
lblVertPos = new gcn::Label("V. offset:");
lblVertPos->setAlignment(gcn::Graphics::RIGHT);
sldVertPos = new gcn::Slider(-16, 16);
sldVertPos->setSize(160, SLIDER_HEIGHT);
@ -177,7 +172,6 @@ void InitPanelDisplay(const struct _ConfigCategory& category)
sldVertPos->setId("sldVertPos");
sldVertPos->addActionListener(amigaScreenActionListener);
lblVertPosInfo = new gcn::Label("000");
#endif //PANDORA
#ifdef USE_SDL1
lblFSRatio = new gcn::Label("Ratio:");
@ -203,21 +197,21 @@ void InitPanelDisplay(const struct _ConfigCategory& category)
grpAmigaScreen = new gcn::Window("Amiga Screen");
grpAmigaScreen->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
grpAmigaScreen->add(lblAmigaWidth, DISTANCE_BORDER, posY);
grpAmigaScreen->add(sldAmigaWidth, lblAmigaWidth->getX() + lblAmigaWidth->getWidth() + DISTANCE_NEXT_Y, posY);
grpAmigaScreen->add(lblAmigaWidthInfo, sldAmigaWidth->getX() + sldAmigaWidth->getWidth() + DISTANCE_NEXT_Y, posY);
grpAmigaScreen->add(sldAmigaWidth, lblAmigaWidth->getX() + lblAmigaWidth->getWidth() + DISTANCE_NEXT_X, posY);
grpAmigaScreen->add(lblAmigaWidthInfo, sldAmigaWidth->getX() + sldAmigaWidth->getWidth() + DISTANCE_NEXT_X, posY);
posY += sldAmigaWidth->getHeight() + DISTANCE_NEXT_Y;
grpAmigaScreen->add(lblAmigaHeight, DISTANCE_BORDER, posY);
grpAmigaScreen->add(sldAmigaHeight, lblAmigaHeight->getX() + lblAmigaHeight->getWidth() + DISTANCE_NEXT_Y, posY);
grpAmigaScreen->add(lblAmigaHeightInfo, sldAmigaHeight->getX() + sldAmigaHeight->getWidth() + DISTANCE_NEXT_Y, posY);
grpAmigaScreen->add(sldAmigaHeight, lblAmigaHeight->getX() + lblAmigaHeight->getWidth() + DISTANCE_NEXT_X, posY);
grpAmigaScreen->add(lblAmigaHeightInfo, sldAmigaHeight->getX() + sldAmigaHeight->getWidth() + DISTANCE_NEXT_X, posY);
posY += sldAmigaHeight->getHeight() + DISTANCE_NEXT_Y;
#ifdef PANDORA
grpAmigaScreen->add(lblVertPos, DISTANCE_BORDER, posY);
grpAmigaScreen->add(sldVertPos, lblVertPos->getX() + lblVertPos->getWidth() + DISTANCE_NEXT_Y, posY);
grpAmigaScreen->add(sldVertPos, lblVertPos->getX() + lblVertPos->getWidth() + DISTANCE_NEXT_X, posY);
grpAmigaScreen->add(lblVertPosInfo, sldVertPos->getX() + sldVertPos->getWidth() + 12, posY);
posY += sldVertPos->getHeight() + DISTANCE_NEXT_Y;
#endif
#ifdef USE_SDL1
grpAmigaScreen->add(lblFSRatio, DISTANCE_BORDER, posY);
@ -227,7 +221,7 @@ void InitPanelDisplay(const struct _ConfigCategory& category)
#endif
grpAmigaScreen->setMovable(false);
grpAmigaScreen->setSize(lblAmigaHeightInfo->getX() + lblAmigaHeightInfo->getWidth() + DISTANCE_BORDER, posY + DISTANCE_BORDER);
grpAmigaScreen->setSize(lblVertPos->getX() + lblVertPos->getWidth() + sldVertPos->getX() + sldVertPos->getWidth() + lblVertPosInfo->getX() + lblVertPosInfo->getWidth() + DISTANCE_BORDER, posY + DISTANCE_BORDER);
grpAmigaScreen->setBaseColor(gui_baseCol);
category.panel->add(grpAmigaScreen);
@ -260,7 +254,6 @@ void InitPanelDisplay(const struct _ConfigCategory& category)
grpScalingMethod->setBaseColor(gui_baseCol);
category.panel->add(grpScalingMethod);
posY += DISTANCE_BORDER + grpScalingMethod->getHeight() + DISTANCE_NEXT_Y;
#endif
@ -282,13 +275,9 @@ void ExitPanelDisplay()
delete lblAmigaHeight;
delete sldAmigaHeight;
delete lblAmigaHeightInfo;
#ifdef PANDORA
delete lblVertPos;
delete sldVertPos;
delete lblVertPosInfo;
#endif
delete grpAmigaScreen;
#ifdef USE_SDL1
@ -361,11 +350,9 @@ void RefreshPanelDisplay()
optLinear->setSelected(true);
#endif
#ifdef PANDORA
sldVertPos->setValue(changed_prefs.pandora_vertical_offset - OFFSET_Y_ADJUST);
snprintf(tmp, 32, "%d", changed_prefs.pandora_vertical_offset - OFFSET_Y_ADJUST);
sldVertPos->setValue(changed_prefs.vertical_offset - OFFSET_Y_ADJUST);
snprintf(tmp, 32, "%d", changed_prefs.vertical_offset - OFFSET_Y_ADJUST);
lblVertPosInfo->setCaption(tmp);
#endif //PANDORA
}
bool HelpPanelDisplay(std::vector<std::string> &helptext)
@ -382,12 +369,9 @@ bool HelpPanelDisplay(std::vector<std::string> &helptext)
helptext.emplace_back("some distortion if your resolution is not an exact multiple. ");
helptext.emplace_back("\"Linear\" will give you a smoother scaling but some people might find it a bit blurry.");
helptext.emplace_back("");
#ifdef PANDORA
helptext.emplace_back("With \"Vert. offset\" you can adjust the position of the first drawn line of the Amiga ");
helptext.emplace_back("screen. You can also change this during emulation with left and right shoulder button ");
helptext.emplace_back("and dpad up/down.");
helptext.emplace_back("screen.");
helptext.emplace_back("");
#endif //PANDORA
helptext.emplace_back("Activate line doubling to remove flicker in interlace modes.");
helptext.emplace_back("");
helptext.emplace_back("When you activate \"Frameskip\", only every second frame is drawn.");

View file

@ -23,7 +23,7 @@ extern void fix_apmodes(struct uae_prefs *p);
extern int generic_main (int argc, char *argv[]);
#define OFFSET_Y_ADJUST 15
#define OFFSET_Y_ADJUST 18
extern int emulating;