Add 4/3 schrink in panel misk

This commit is contained in:
Chips-fr 2015-05-23 19:31:44 +00:00
parent 6cbdde5724
commit 0cf597e9aa
2 changed files with 38 additions and 21 deletions

View file

@ -22,7 +22,9 @@
static gcn::UaeCheckBox* chkStatusLine;
static gcn::UaeCheckBox* chkShowGUI;
#ifndef RASPBERRY
#ifdef RASPBERRY
static gcn::UaeCheckBox* chkAspect;
#else
static gcn::Label* lblPandoraSpeed;
static gcn::Label* lblPandoraSpeedInfo;
static gcn::Slider* sldPandoraSpeed;
@ -39,7 +41,10 @@ class MiscActionListener : public gcn::ActionListener
else if (actionEvent.getSource() == chkShowGUI)
changed_prefs.start_gui = chkShowGUI->isSelected();
#ifndef RASPBERRY
#ifdef RASPBERRY
else if (actionEvent.getSource() == chkAspect)
changed_prefs.gfx_correct_aspect = chkAspect->isSelected();
#else
else if (actionEvent.getSource() == sldPandoraSpeed)
{
int newspeed = (int) sldPandoraSpeed->getValue();
@ -60,32 +65,38 @@ void InitPanelMisc(const struct _ConfigCategory& category)
{
miscActionListener = new MiscActionListener();
chkStatusLine = new gcn::UaeCheckBox("Status Line");
chkStatusLine = new gcn::UaeCheckBox("Status Line");
chkStatusLine->addActionListener(miscActionListener);
chkShowGUI = new gcn::UaeCheckBox("Show GUI on startup");
chkShowGUI->setId("ShowGUI");
chkShowGUI = new gcn::UaeCheckBox("Show GUI on startup");
chkShowGUI->setId("ShowGUI");
chkShowGUI->addActionListener(miscActionListener);
#ifndef RASPBERRY
lblPandoraSpeed = new gcn::Label("Pandora Speed:");
#ifdef RASPBERRY
chkAspect = new gcn::UaeCheckBox("4/3 ratio shrink");
chkAspect->addActionListener(miscActionListener);
#else
lblPandoraSpeed = new gcn::Label("Pandora Speed:");
lblPandoraSpeed->setSize(110, LABEL_HEIGHT);
lblPandoraSpeed->setAlignment(gcn::Graphics::RIGHT);
sldPandoraSpeed = new gcn::Slider(500, 1260);
sldPandoraSpeed->setSize(200, SLIDER_HEIGHT);
sldPandoraSpeed->setBaseColor(gui_baseCol);
sldPandoraSpeed->setMarkerLength(20);
sldPandoraSpeed->setStepLength(20);
sldPandoraSpeed->setId("PandSpeed");
sldPandoraSpeed->setMarkerLength(20);
sldPandoraSpeed->setStepLength(20);
sldPandoraSpeed->setId("PandSpeed");
sldPandoraSpeed->addActionListener(miscActionListener);
lblPandoraSpeedInfo = new gcn::Label("1000 MHz");
#endif
int posY = DISTANCE_BORDER;
int posY = DISTANCE_BORDER;
category.panel->add(chkStatusLine, DISTANCE_BORDER, posY);
posY += chkStatusLine->getHeight() + DISTANCE_NEXT_Y;
category.panel->add(chkShowGUI, DISTANCE_BORDER, posY);
posY += chkShowGUI->getHeight() + DISTANCE_NEXT_Y;
#ifndef RASPBERRY
#ifdef RASPBERRY
category.panel->add(chkAspect, DISTANCE_BORDER, posY);
posY += chkAspect->getHeight() + DISTANCE_NEXT_Y;
#else
category.panel->add(lblPandoraSpeed, DISTANCE_BORDER, posY);
category.panel->add(sldPandoraSpeed, DISTANCE_BORDER + lblPandoraSpeed->getWidth() + 8, posY);
category.panel->add(lblPandoraSpeedInfo, sldPandoraSpeed->getX() + sldPandoraSpeed->getWidth() + 12, posY);
@ -99,7 +110,9 @@ void ExitPanelMisc(void)
{
delete chkStatusLine;
delete chkShowGUI;
#ifndef RASPBERRY
#ifdef RASPBERRY
delete chkAspect;
#else
delete lblPandoraSpeed;
delete sldPandoraSpeed;
delete lblPandoraSpeedInfo;
@ -114,7 +127,9 @@ void RefreshPanelMisc(void)
chkStatusLine->setSelected(changed_prefs.leds_on_screen);
chkShowGUI->setSelected(changed_prefs.start_gui);
#ifndef RASPBERRY
#ifdef RASPBERRY
chkAspect->setSelected(changed_prefs.gfx_correct_aspect);
#else
sldPandoraSpeed->setValue(changed_prefs.pandora_cpu_speed);
snprintf(tmp, 20, "%d MHz", changed_prefs.pandora_cpu_speed);
lblPandoraSpeedInfo->setCaption(tmp);

View file

@ -213,7 +213,8 @@ static void open_screen(struct uae_prefs *p)
SDL_ShowCursor(SDL_DISABLE);
// check if resolution hasn't change in menu. otherwise free the resources so that they will be re-generated with new resolution.
if ((dispmanxresource_amigafb_1 != 0) && ((blit_rect.width != width) || (blit_rect.height != height)))
if ((dispmanxresource_amigafb_1 != 0) &&
((blit_rect.width != width) || (blit_rect.height != height) || (currprefs.gfx_correct_aspect != changed_prefs.gfx_correct_aspect)))
{
printf("Emulation resolution change detected.\n");
if(prSDLScreen != NULL )
@ -231,7 +232,7 @@ static void open_screen(struct uae_prefs *p)
if (dispmanxresource_amigafb_1 == 0)
{
printf("Emulation resolution: Width %i Height: %i\n",width,height);
currprefs.gfx_correct_aspect = changed_prefs.gfx_correct_aspect;
prSDLScreen = SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,16,
Dummy_prSDLScreen->format->Rmask,
Dummy_prSDLScreen->format->Gmask,
@ -252,10 +253,10 @@ static void open_screen(struct uae_prefs *p)
vc_dispmanx_rect_set( &src_rect, 0, 0, width << 16, height << 16 );
}
// Currently on fullscreen is available in uae4all2/uae4arm, no 16/9 to 4/3 ratio adaptation is available.
//if (mainMenu_screenformat == 0)
if (1)
// 16/9 to 4/3 ratio adaptation.
if (currprefs.gfx_correct_aspect == 0)
{
// Fullscreen.
vc_dispmanx_rect_set( &dst_rect, (dispmanxdinfo.width * 2)/100,
(dispmanxdinfo.height * 2)/100 ,
dispmanxdinfo.width - (dispmanxdinfo.width * 4)/100 ,
@ -271,9 +272,10 @@ static void open_screen(struct uae_prefs *p)
}
else
{
vc_dispmanx_rect_set( &dst_rect, ((dispmanxdinfo.width * 17)/100) ,
// 4/3 scrink.
vc_dispmanx_rect_set( &dst_rect, ((dispmanxdinfo.width * 13)/100) ,
(dispmanxdinfo.height * 3)/100 ,
(dispmanxdinfo.width - ((dispmanxdinfo.width * 36)/100)) ,
(dispmanxdinfo.width - ((dispmanxdinfo.width * 32)/100)) ,
dispmanxdinfo.height - (dispmanxdinfo.height * 7)/100 );
}