Commit de05b56a authored by Chips-fr's avatar Chips-fr
Browse files

Solve different video resolution

parent eefcd730
# uae4arm-rpi
Port of uae4arm on Raspberry Pi
v0.4:
Merge of latest TomB version for Pandora.
Keep position between file selection
Joystick management improved.
v0.3:
Rework of dispmanX management. It improve picasso
Add 4/3 shrink for 16/9 screen.
Alt key can now be used to switch between mouse and 2nd joystick.
v0.2:
Merge latest TomB improvements from Pandora version (Zorro3 memory, picasso...).
v0.1:
Use dispmanX for fast scaling and double buffering.
Enable hat usage on joystick.
Add Sony 6axis joystick workaround.
How to compile on Raspbian Jessie:
Install following packages:
sudo apt-get install libsdl1.2-dev
sudo apt-get install libguichan-dev
sudo apt-get install libsdl-ttf2.0-dev
sudo apt-get install libsdl-gfx1.2-dev
Then for Raspberry Pi 2:
make
Or for Raspberry Pi 1:
make PLATFORM=rpi1
How to compile on Raspbian Whezzy:
You need to install same packages as Jessie (see above)
and a more updated gcc (otherwise alter Makefile).
In order to do this enter the following in command line:
sudo apt-get install g++-4.8
Then for Raspberry Pi 2:
make CXX=g++-4.8
Or for Raspberry Pi 1:
make PLATFORM=rpi1 CXX=g++-4.8
# uae4arm-libretro
Basic port. Based on rtype version.
......@@ -2,6 +2,10 @@
#include "libretro-core.h"
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#ifndef NO_LIBCO
cothread_t mainThread;
cothread_t emuThread;
......@@ -21,8 +25,6 @@ unsigned short int bmp[400*300];
unsigned amiga_devices[ 2 ];
int autorun=0;
int RETROJOY=0,RETROPT0=0,RETROSTATUS=0,RETRODRVTYPE=0;
int retrojoy_init=0,retro_ui_finalized=0;
......@@ -30,7 +32,6 @@ extern int SHIFTON,pauseg,SND ,snd_sampler;
extern short signed int SNDBUF[1024*2];
extern char RPATH[512];
extern char RETRO_DIR[512];
int cap32_statusbar=0;
int arnold_model=2;
extern int SHOWKEY;
......@@ -80,14 +81,11 @@ void retro_set_environment(retro_environment_t cb)
struct retro_variable variables[] = {
{
"arnold_autorun",
"Autorun; disabled|enabled" ,
},
{
"uae4arm_resolution",
"Internal resolution; 320x240|640x256|640x400|640x480|768x270|800x600|1024x768|1280x960",
"Internal resolution; 320x240|320x256|320x262|640x240|640x256|640x262|640x270|768x270",
},
/*
{
"arnold_Model",
"Model: (restart needed); 6128|464|664|6128s|6128+|kcc",
......@@ -96,37 +94,12 @@ void retro_set_environment(retro_environment_t cb)
"arnold_warp",
"Wrap Factor:; 1|2|3|4|5",
},
/*
{
"cap32_Ram",
"Ram size:; 64|128|192|512|576",
},
{
"cap32_Statusbar",
"Status Bar; disabled|enabled",
},
{
"cap32_Drive",
"Drive:; 0|1",
},
{
"cap32_scr_tube",
"scr_tube; disabled|enabled",
},
{
"cap32_scr_intensity",
"scr_intensity; 5|6|7|8|9|10|11|12|13|14|15",
},
*/
{
"cap32_scr_remanency",
"scr_remanency; disabled|enabled",
"leds_on_screen",
"Led:; on|off",
},
{
"cap32_RetroJoy",
"Retro joy0; disabled|enabled",
},
*/
{ NULL, NULL },
};
......@@ -138,15 +111,6 @@ static void update_variables(void)
struct retro_variable var;
var.key = "arnold_autorun";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "enabled") == 0)
autorun = 1;
}
var.key = "uae4arm_resolution";
var.value = NULL;
......@@ -170,6 +134,10 @@ static void update_variables(void)
//retrow=320;
//retroh=240;
changed_prefs.gfx_size.width = retrow;
changed_prefs.gfx_size.height = retroh;
changed_prefs.gfx_resolution = changed_prefs.gfx_size.width > 600 ? 1 : 0;
LOGI("[libretro-vice]: Got size: %u x %u.\n", retrow, retroh);
CROP_WIDTH =retrow;
......@@ -179,13 +147,23 @@ static void update_variables(void)
//reset_screen();
}
var.key = "leds_on_screen";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "on") == 0) changed_prefs.leds_on_screen = 1;
if (strcmp(var.value, "off") == 0) changed_prefs.leds_on_screen = 0;
}
#if 0
var.key = "arnold_Model";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
char str[100];
int val;
int val;
snprintf(str, sizeof(str), var.value);
val = strtoul(str, NULL, 0);
if (strcmp(var.value, "464") == 0)arnold_model=0;
......@@ -211,115 +189,6 @@ static void update_variables(void)
// CPC_SetWarpFactor(val);
}
#if 0
var.key = "cap32_Ram";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
char str[100];
int val;
snprintf(str, sizeof(str), var.value);
val = strtoul(str, NULL, 0);
if(retro_ui_finalized)
change_ram(val);
}
var.key = "cap32_Statusbar";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if(retro_ui_finalized){
if (strcmp(var.value, "enabled") == 0)
cap32_statusbar=1;
if (strcmp(var.value, "disabled") == 0)
cap32_statusbar=0;
}
else {
if (strcmp(var.value, "enabled") == 0)RETROSTATUS=1;
if (strcmp(var.value, "disabled") == 0)RETROSTATUS=0;
}
}
var.key = "cap32_Drive";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
char str[100];
int val;
snprintf(str, sizeof(str), var.value);
val = strtoul(str, NULL, 0);
if(retro_ui_finalized)
;//set_drive_type(8, val);
else RETRODRVTYPE=val;
}
var.key = "cap32_scr_tube";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if(retro_ui_finalized){
if (strcmp(var.value, "enabled") == 0){
CPC.scr_tube=1;video_set_palette();}
if (strcmp(var.value, "disabled") == 0){
CPC.scr_tube=0;video_set_palette();}
}
}
var.key = "cap32_scr_intensity";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
char str[100];
int val;
snprintf(str, sizeof(str), var.value);
val = strtoul(str, NULL, 0);
if(retro_ui_finalized){
CPC.scr_intensity = val;
video_set_palette();
}
}
/*
var.key = "cap32_scr_remanency";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if(retro_ui_finalized){
if (strcmp(var.value, "enabled") == 0){
CPC.scr_remanency=1;video_set_palette();}//set_truedrive_emultion(1);
if (strcmp(var.value, "disabled") == 0){
CPC.scr_remanency=0;video_set_palette();}//set_truedrive_emultion(0);
}
}
*/
var.key = "cap32_RetroJoy";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if(retrojoy_init){
if (strcmp(var.value, "enabled") == 0)
;//resources_set_int( "RetroJoy", 1);
if (strcmp(var.value, "disabled") == 0)
;//resources_set_int( "RetroJoy", 0);
}
else {
if (strcmp(var.value, "enabled") == 0)RETROJOY=1;
if (strcmp(var.value, "disabled") == 0)RETROJOY=0;
}
}
#endif
}
......
......@@ -27,6 +27,7 @@
#include "fsdb.h"
#include "disk.h"
#if defined(__LIBRETRO__)
extern int retroh,retrow; // Todo: need a proper include
#include "sd-retro/sound.h"
#else
#include "sd-pandora/sound.h"
......@@ -1642,9 +1643,16 @@ void default_prefs (struct uae_prefs *p, int type)
p->optcount[5] = 0;
p->gfx_framerate = 0;
#ifdef RASPBERRY
#ifdef __LIBRETRO__
p->gfx_size.width = retrow;
p->gfx_size.height = retroh;
#else
p->gfx_size.width = 640;
p->gfx_size.height = 256;
#endif
#else
p->gfx_size.width = 320;
p->gfx_size.height = 240;
......@@ -1653,7 +1661,7 @@ void default_prefs (struct uae_prefs *p, int type)
p->gfx_size_win.height = 240;
p->gfx_size_fs.width = 640;
p->gfx_size_fs.height = 480;
p->gfx_resolution = 0;
p->gfx_resolution = p->gfx_size.width > 600 ? 1 : 0;
#ifdef RASPBERRY
p->gfx_correct_aspect = 1;
#endif
......
......@@ -822,7 +822,7 @@ static int drive_insert (drive *drv, struct uae_prefs *p, int dnum, const char *
return 0;
}
strncpy (currprefs.df[dnum], fname, 255);
memmove (currprefs.df[dnum], fname, 255);
currprefs.df[dnum][255] = 0;
strncpy (changed_prefs.df[dnum], fname, 255);
changed_prefs.df[dnum][255] = 0;
......
......@@ -102,7 +102,7 @@ int graphics_setup (void)
void InitAmigaVidMode(struct uae_prefs *p)
{
LOGI("retro:(%d,%d) gfx(%d,%d)\n",retrow,retroh,p->gfx_size.width,p->gfx_size.height);
LOGI("retro:(%d,%d) gfx(%d,%d) res %i\n",retrow,retroh,p->gfx_size.width,p->gfx_size.height,p->gfx_resolution);
/* Initialize structure for Amiga video modes */
gfxvidinfo.pixbytes = 2;
......@@ -145,7 +145,6 @@ static void open_screen(struct uae_prefs *p)
uint32_t vc_image_ptr;
int width;
int height;
#ifdef PICASSO96
if (screen_is_picasso)
{
......@@ -159,14 +158,8 @@ p->gfx_resolution = p->gfx_size.width > 600 ? 1 : 0;
height = p->gfx_size.height;
}
static int iniscr=0;
if(iniscr==0)
// if(prSDLScreen != NULL)
// if(prSDLScreen != NULL)
{
iniscr++;
InitAmigaVidMode(p);
init_row_map();
}
......@@ -177,7 +170,6 @@ static int iniscr=0;
void update_display(struct uae_prefs *p)
{
open_screen(p);
printf("update_display\n");
framecnt = 1; // Don't draw frame before reset done
}
......@@ -185,7 +177,6 @@ void update_display(struct uae_prefs *p)
int check_prefs_changed_gfx (void)
{
int changed = 0;
if(currprefs.gfx_size.height != changed_prefs.gfx_size.height ||
currprefs.gfx_size.width != changed_prefs.gfx_size.width ||
currprefs.gfx_size_fs.width != changed_prefs.gfx_size_fs.width ||
......@@ -212,7 +203,7 @@ int check_prefs_changed_gfx (void)
init_hz ();
changed = 1;
}
return changed;
}
......@@ -392,6 +383,10 @@ int graphics_init (void)
//uae_sem_init (&vsync_wait_sem, 0, 1);
// In case we have load a .uae file, we need to realign retro & gfx resolution...
retrow = currprefs.gfx_size.width;
retroh = currprefs.gfx_size.height;
graphics_subinit ();
......
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