576p support

This commit is contained in:
fabio.olimpieri 2012-08-12 15:28:08 +00:00
parent 22f91ace59
commit 019e4d8524
5 changed files with 55 additions and 6 deletions

View File

@ -171,6 +171,7 @@ void computer_init () { //Called only on start-up
ordenador.fetch_state =0;
ordenador.last_selected_poke_file[0]='\0';
ordenador.npixels=4;
ordenador.progressive=0;
}
void computer_set_palete() {

View File

@ -38,6 +38,7 @@ struct computer {
unsigned char precision; //If set 1 emulate with more precision
unsigned char npixels; //1, 2 or 4 depending on dblscan and zaurus_mini
unsigned char progressive; //interlace or progressive 576
unsigned int temporal_io;
// screen private global variables

View File

@ -45,6 +45,8 @@
#include <ogc/usbstorage.h>
#include <network.h>
#include <smb.h>
#include <stdio.h>
#include <stdlib.h>
#endif
#ifdef DEBUG
@ -352,6 +354,38 @@ void load_rom(char type) {
size=fread(ordenador.shadowrom,8192,1,fichero);
fclose(fichero);
}
int set_video_mode()
{
#ifdef GEKKO
GXRModeObj *rmode;
rmode = VIDEO_GetPreferredMode(NULL);
if ((rmode->viTVMode)!=VI_TVMODE_PAL_INT) return -1;
switch(ordenador.progressive)
{
case 0: //interlace
rmode=&TVPal576IntDfScale;
break;
case 1: //progressive
rmode=&TVPal576ProgScale;
break;
default:
rmode=&TVPal576IntDfScale;
break;
}
VIDEO_Configure(rmode);
VIDEO_Flush();
VIDEO_WaitVSync();
return 0;
#endif
}
void init_sdl()
{
int retorno, bucle;

View File

@ -51,5 +51,6 @@ FILE *myfopen(char *filename,char *mode);
void init_sdl();
void init_sound();
void init_screen(int resx,int resy,int depth,int fullscreen,int dblbuffer,int hwsurface);
int set_video_mode();
#endif

View File

@ -101,8 +101,11 @@ static const char *screen_messages[] = {
/*03*/ "TV mode",
/*04*/ "^|Color|B&W",
/*05*/ " ",
/*06*/ "Resolution",
/*06*/ "Buffer resolution",
/*07*/ "^|640X480|320X240",
/*08*/ " ",
/*09*/ "576p video mode",
/*10*/ "^|on|off",
NULL
};
@ -409,7 +412,6 @@ static void manage_tape(int which)
case 5: //Create
// Create tape
create_tapfile_sdl();
//msgInfo("Not yet implemented",3000,NULL);
break;
case 6: //Delete
delete_tape();
@ -541,7 +543,7 @@ static void save_load_general_configurations(int);
static void screen_settings(void)
{
unsigned int submenus[3],submenus_old[3];
unsigned int submenus[4],submenus_old[4];
int opt, i;
memset(submenus, 0, sizeof(submenus));
@ -549,8 +551,9 @@ static void screen_settings(void)
submenus[0] = !ordenador.dblscan;
submenus[1] = ordenador.bw;
submenus[2] = ordenador.zaurus_mini?1:0;
submenus[3] = !ordenador.progressive;
for (i=0; i<3; i++) submenus_old[i] = submenus[i];
for (i=0; i<4; i++) submenus_old[i] = submenus[i];
opt = menu_select_title("Screen settings menu",
@ -560,6 +563,7 @@ static void screen_settings(void)
ordenador.dblscan = !submenus[0];
ordenador.bw = submenus[1];
ordenador.progressive = !submenus[3];
if (submenus[0] != submenus_old[0]) update_npixels();
@ -572,6 +576,14 @@ static void screen_settings(void)
update_npixels();
restart_video();
}
if (submenus[3] != submenus_old[3])
{
if (set_video_mode())
{
msgInfo("Only avalaible from 576i PAL",3000,NULL);
ordenador.progressive = 0;
}
}
}
static void setup_joystick(int joy, unsigned int sdl_key, int joy_key)