Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/default.gcw0.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ Exec=fbasdl.dge
Terminal=false
Type=Application
StartupNotify=true
Icon=skin/fba_icon
Icon=fbasdl
X-OD-Manual=readme.txt
X-OD-NeedsDownscaling=true
Categories=emulators;

1 change: 1 addition & 0 deletions src/sdl-dingux/burner.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ typedef struct
int vsync;
int rescale;
int rotate;
int hwscaling;
int showfps;
int frameskip;
int m68kcore;
Expand Down
3 changes: 3 additions & 0 deletions src/sdl-dingux/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void ConfigGameDefault()
options.vsync = 0;
options.rescale = 0; // no scaling by default
options.rotate = 0;
options.hwscaling = 0; // no HW scaling by default
options.showfps = 0;
options.frameskip = -1; // auto frameskip by default
options.create_lists = 0;
Expand Down Expand Up @@ -215,6 +216,7 @@ int ConfigGameLoad(FILE * f)
if(strcmp(arg1, "FBA_VSYNC") == 0) options.vsync = argd;
if(strcmp(arg1, "FBA_RESCALE") == 0) options.rescale = argd;
if(strcmp(arg1, "FBA_ROTATE") == 0) options.rotate = argd;
if(strcmp(arg1, "FBA_HWSCALING") == 0) options.hwscaling = argd;
if(strcmp(arg1, "FBA_SHOWFPS") == 0) options.showfps = argd;
if(strcmp(arg1, "FBA_FRAMESKIP") == 0) options.frameskip = argd;
if(strcmp(arg1, "FBA_M68KCORE") == 0) options.m68kcore = argd;
Expand Down Expand Up @@ -301,6 +303,7 @@ int ConfigGameSave(FILE * fp)
fprintf(fp, "FBA_VSYNC %d\n", options.vsync);
fprintf(fp, "FBA_RESCALE %d\n", options.rescale);
fprintf(fp, "FBA_ROTATE %d\n", options.rotate);
fprintf(fp, "FBA_HWSCALING %d\n", options.hwscaling);
fprintf(fp, "FBA_SHOWFPS %d\n", options.showfps);
fprintf(fp, "FBA_FRAMESKIP %d\n", options.frameskip);
fprintf(fp, "FBA_M68KCORE %d\n", options.m68kcore);
Expand Down
32 changes: 30 additions & 2 deletions src/sdl-dingux/gui_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ SELECTOR sel;

unsigned char joy_speed[4]={0,1,3,7};

static char *abreviation_cf[10][7]={
static char *abreviation_cf[11][7]={
{"Disable","Enable","","","","",""},
{"Original","Fullscreen","","","","",""},
{"Off","Auto","Manual","","","",""},
Expand All @@ -85,7 +85,8 @@ static char *abreviation_cf[10][7]={
{"Off","LIBAO","SDL","SDL old","","",""},
{"11025", "16000", "22050", "32000", "44100", "", ""},
{"No","Yes","","","","",""},
{"No","Yes","","","","",""}
{"No","Yes","","","","",""},
{"Off","Aspect","Fullscr","","","",""}
};

void load_lastsel();
Expand Down Expand Up @@ -805,6 +806,10 @@ void put_option_line(int first, unsigned char num, unsigned char y)
sprintf((char*)g_string, "Rotate vertical game: %s", abreviation_cf[9][options.rotate]);
put_string( g_string , OPTIONS_START_X , y , BLANC , gui_screen );
break;
case OPTION_GUI_DEF_RUN_HWSCALING:
sprintf((char*)g_string, "Hardware scaling: %s", abreviation_cf[10][options.hwscaling]);
put_string( g_string , OPTIONS_START_X , y , BLANC , gui_screen );
break;
case OPTION_GUI_DEF_RUN_VSYNC:
sprintf((char*)g_string, "Vertical sync: %s", abreviation_cf[5][options.vsync]);
put_string( g_string , OPTIONS_START_X , y , BLANC , gui_screen );
Expand Down Expand Up @@ -1015,6 +1020,10 @@ void ss_prg_options(int first, int last)
case OPTION_GUI_DEF_RUN_ROTATE:
options.rotate ^= 1;
break;
case OPTION_GUI_DEF_RUN_HWSCALING:
options.hwscaling--;
if(options.hwscaling < 0) options.hwscaling = 2;
break;
case OPTION_GUI_DEF_RUN_VSYNC:
options.vsync ^= 1;
break;
Expand Down Expand Up @@ -1114,6 +1123,10 @@ void ss_prg_options(int first, int last)
case OPTION_GUI_DEF_RUN_ROTATE:
options.rotate ^= 1;
break;
case OPTION_GUI_DEF_RUN_HWSCALING:
options.hwscaling++;
if(options.hwscaling > 2) options.hwscaling = 0;
break;
case OPTION_GUI_DEF_RUN_VSYNC:
options.vsync ^= 1;
break;
Expand Down Expand Up @@ -1215,6 +1228,9 @@ static int run_options_static[] = {
OPTION_FBA_SOUND,
OPTION_FBA_SAMPLERATE,
OPTION_FBA_ROTATE,
#ifdef OPTIONS_FOR_GCW0
OPTION_FBA_HWSCALING,
#endif
OPTION_FBA_VSYNC,
OPTION_FBA_SHOWFPS,
OPTION_FBA_68K,
Expand Down Expand Up @@ -1250,6 +1266,10 @@ void put_run_option_line(unsigned char num, unsigned char y)
put_string("Rotate vertical game", OPTIONS_START_X, y, BLANC, gui_screen);
put_string(abreviation_cf[9][options.rotate], CONF_START_X, y, VERT, gui_screen);
break;
case OPTION_FBA_HWSCALING:
put_string("Hardware scaling", OPTIONS_START_X, y, BLANC, gui_screen);
put_string(abreviation_cf[10][options.hwscaling], CONF_START_X, y, VERT, gui_screen);
break;
case OPTION_FBA_VSYNC:
put_string("Vertical sync", OPTIONS_START_X, y, BLANC, gui_screen);
put_string(abreviation_cf[5][options.vsync], CONF_START_X, y, VERT, gui_screen);
Expand Down Expand Up @@ -1367,6 +1387,10 @@ void ss_prog_run(void)
case OPTION_FBA_ROTATE:
options.rotate ^= 1;
break;
case OPTION_FBA_HWSCALING:
options.hwscaling--;
if(options.hwscaling < 0) options.hwscaling = 2;
break;
case OPTION_FBA_VSYNC:
options.vsync ^= 1;
break;
Expand Down Expand Up @@ -1404,6 +1428,10 @@ void ss_prog_run(void)
case OPTION_FBA_ROTATE:
options.rotate ^= 1;
break;
case OPTION_FBA_HWSCALING:
options.hwscaling++;
if(options.hwscaling > 2) options.hwscaling = 0;
break;
case OPTION_FBA_VSYNC:
options.vsync ^= 1;
break;
Expand Down
24 changes: 13 additions & 11 deletions src/sdl-dingux/gui_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@
#define OPTION_FBA_SOUND 2
#define OPTION_FBA_SAMPLERATE 3
#define OPTION_FBA_ROTATE 4
#define OPTION_FBA_VSYNC 5
#define OPTION_FBA_SHOWFPS 6
#define OPTION_FBA_68K 7
#define OPTION_FBA_Z80 8
#define OPTION_FBA_ANALOG 9
#define OPTION_FBA_FAVORITE 10
#define OPTION_FBA_HWSCALING 5
#define OPTION_FBA_VSYNC 6
#define OPTION_FBA_SHOWFPS 7
#define OPTION_FBA_68K 8
#define OPTION_FBA_Z80 9
#define OPTION_FBA_ANALOG 10
#define OPTION_FBA_FAVORITE 11

#define OPTION_FBA_FIRST OPTION_FBA_RUN
#define OPTION_FBA_LAST OPTION_FBA_FAVORITE
Expand Down Expand Up @@ -141,11 +142,12 @@
#define OPTION_GUI_DEF_RUN_SOUND 600
#define OPTION_GUI_DEF_RUN_SAMPLERATE 601
#define OPTION_GUI_DEF_RUN_ROTATE 602
#define OPTION_GUI_DEF_RUN_VSYNC 603
#define OPTION_GUI_DEF_RUN_SHOWFPS 604
#define OPTION_GUI_DEF_RUN_CORE 605
#define OPTION_GUI_DEF_RUN_ANALOG 606
#define OPTION_GUI_DEF_RUN_RETURN 607
#define OPTION_GUI_DEF_RUN_HWSCALING 603
#define OPTION_GUI_DEF_RUN_VSYNC 604
#define OPTION_GUI_DEF_RUN_SHOWFPS 605
#define OPTION_GUI_DEF_RUN_CORE 606
#define OPTION_GUI_DEF_RUN_ANALOG 607
#define OPTION_GUI_DEF_RUN_RETURN 608

#define OPTION_DEF_RUN_FIRST OPTION_GUI_DEF_RUN_SOUND
#define OPTION_DEF_RUN_LAST OPTION_GUI_DEF_RUN_RETURN
Expand Down
8 changes: 8 additions & 0 deletions src/sdl-dingux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void parse_cmd(int argc, char *argv[], char *path)
{"vsync", 0, &options.vsync, 1},
{"scaling", required_argument, 0, 'a'},
{"rotate", required_argument, 0, 'o'},
{"hwscaling", required_argument, 0, 'h'},
{"sense", required_argument, 0, 'd'},
{"showfps", 0, &options.showfps, 1},
{"no-showfps", 0, &options.showfps, 0},
Expand Down Expand Up @@ -206,6 +207,13 @@ void parse_cmd(int argc, char *argv[], char *path)
if ((z2>2) || (z2<0)) z2=0;
options.rotate = z2;
break;
case 'h':
if(!optarg) continue;
z2=0;
sscanf(optarg,"%d",&z2);
if ((z2>2) || (z2<0)) z2=0;
options.hwscaling = z2;
break;
case 'd':
if(!optarg) continue;
z2=0;
Expand Down
16 changes: 14 additions & 2 deletions src/sdl-dingux/sdl_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,20 +366,32 @@ void gui_Run()
{
struct timeval s, e;
extern struct timeval start;
#ifdef DEVICE_GCW0
int hwscale = options.hwscaling;
#endif

#ifdef FBA_DEBUG
debug = 1;
#endif
gettimeofday(&s, NULL);

#ifdef DEVICE_GCW0
if (hwscale > 0 && (screen->w != 320 || screen->h != 240)) {
VideoInitForce320x240(); // sets video mode to 320x240 so the menu screen looks right when a game uses a resolution different than 320x240
}
#endif
VideoClear();
SDL_EnableKeyRepeat(/*SDL_DEFAULT_REPEAT_DELAY*/ 150, /*SDL_DEFAULT_REPEAT_INTERVAL*/30);
gui_MainMenu.itemCur = 0;
gui_MenuRun(&gui_MainMenu);
SDL_EnableKeyRepeat(0, 0);
ConfigGameSave();
VideoClear();

#ifdef DEVICE_GCW0
if (hwscale > 0) {
VideoInit(); // when menu is closed to return to the game, video mode is set to the appropiate resolution for the game
VideoClear();
}
#endif
gettimeofday(&e, NULL);
start.tv_sec += e.tv_sec - s.tv_sec;
start.tv_usec += e.tv_usec - s.tv_usec;
Expand Down
2 changes: 2 additions & 0 deletions src/sdl-dingux/sdl_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
*/

#define DEVICE_GCW0

#ifndef _SDL_MENU_H_
#define _SDL_MENU_H_

Expand Down
19 changes: 18 additions & 1 deletion src/sdl-dingux/sdl_run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,21 @@ void RunEmulator(int drvnum)
if(options.sense < 100) {
nAnalogSpeed = 0x100 / 100 * options.sense;
}
#ifdef DEVICE_GCW0
int hwscale = options.hwscaling;
#endif

gui_Init();

VideoInit();
#ifdef DEVICE_GCW0
if (hwscale > 0) {
VideoInitForce320x240(); // sets video mode to 320x240 so the loading screen looks right when a game uses a resolution different than 320x240
} else {
#endif
VideoInit();
#ifdef DEVICE_GCW0
}
#endif

printf("Attempt to initialise '%s'\n", BurnDrvGetTextA(DRV_FULLNAME));

Expand All @@ -94,6 +105,12 @@ void RunEmulator(int drvnum)
goto finish;
}

#ifdef DEVICE_GCW0
if (hwscale > 0) {
VideoInit(); // after loading screen ends, video mode is set to the appropiate resolution for the game
}
#endif

RunReset();

GameLooping = true;
Expand Down
2 changes: 2 additions & 0 deletions src/sdl-dingux/sdl_run.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
*/

#define DEVICE_GCW0

#ifndef _SDL_RUN_H_
#define _SDL_RUN_H_

Expand Down
Loading