Commit 41090d16 authored by CeRiAl's avatar CeRiAl

COMMON: Re-enabled sdl-gui

parent 944af870
.gitignore # Files to ignore
Makefile.in
aclocal.m4 aclocal.m4
autom4te.cache/ autom4te.cache
.deps
Makefile
Makefile.in
*~
*.o
*.a
configure configure
src/Makefile.in config.log
src/archivers/dms/Makefile.in config.status
src/archivers/zip/Makefile.in sysconfig.h
src/caps/Makefile.in stamp-h1
src/gfx-amigaos/Makefile.in .DS_Store
src/gfx-beos/Makefile.in
src/gfx-cocoa/Makefile.in # Eclipse project files
src/gfx-curses/Makefile.in /.project
src/gfx-sdl/Makefile.in /.cproject
src/gfx-x11/Makefile.in /.settings
src/gui-beos/Makefile.in /.autotools
src/gui-cocoa/Makefile.in
src/gui-gtk/Makefile.in # mingw32/cygwin and mingw32ce (WinCE) related
src/gui-muirexx/Makefile.in *.exe
src/gui-none/Makefile.in /cerial_compile.txt
src/gui-qt/Makefile.in /_testbed_/
src/jd-amigainput/Makefile.in /src/uae.rc
src/jd-amigaos/Makefile.in
src/jd-beos/Makefile.in /df0.adz
src/jd-linuxold/Makefile.in /kick.rom
src/jd-none/Makefile.in /drive_sounds.zip
src/jd-sdl/Makefile.in
src/keymap/Makefile.in /src/gfxdep
src/md-68k/Makefile.in /src/guidep
src/md-amd64-gcc/Makefile.in /src/joydep
src/md-generic/Makefile.in /src/machdep
src/md-i386-gcc/Makefile.in /src/osdep
src/md-ppc-gcc/Makefile.in /src/sounddep
src/md-ppc/Makefile.in /src/threaddep
src/od-amiga/Makefile.in /src/PUAE.app
src/od-beos/Makefile.in /src/od-macosx/Credits.rtf
src/od-generic/Makefile.in /src/od-macosx/Info.plist
src/od-linux/Makefile.in
src/od-macosx/Makefile.in # symbolic links (under cygwin they are real files)
src/od-win32/Makefile.in /src/md-fpp.h
src/sd-alsa/Makefile.in /src/target.h
src/sd-amigaos/Makefile.in /src/tools/blitops.c
src/sd-beos/Makefile.in /src/tools/build68k.c
src/sd-none/Makefile.in /src/tools/cpudefs.c
src/sd-sdl/Makefile.in /src/tools/genblitter.c
src/sd-solaris/Makefile.in /src/tools/gencomp.c
src/sd-uss/Makefile.in /src/tools/gencpu.c
src/td-amigaos/Makefile.in /src/tools/genlinetoscr.c
src/td-beos/Makefile.in /src/tools/missing.c
src/td-none/Makefile.in /src/tools/readcpu.c
src/td-posix/Makefile.in /src/tools/writelog.c
src/td-sdl/Makefile.in /src/tools/build68k
src/td-win32/Makefile.in /src/tools/genblitter
src/test/Makefile.in /src/tools/gencomp
src/tools/autom4te.cache/ /src/tools/gencpu
src/tools/configure /src/tools/genlinetoscr
# generated files
# blitter
/src/blit.h
/src/blitfunc.c
/src/blitfunc.h
/src/blittable.c
/src/linetoscr.c
# cpu
/src/cpudefs.c
/src/cputbl.h
/src/cpustbl.c
/src/compemu.c
/src/comptbl.h
/src/compstbl.c
/src/cpuemu_0.c
/src/cpuemu_11.c
/src/cpuemu_12.c
/src/cpuemu_20.c
/src/cpuemu_21.c
/src/cpuemu_31.c
# jit
/src/compemu.cpp
/src/compstbl.h
/src/compstbl.cpp
#Ignore default Visual Studio build folders
[Dd]ebug/
[Rr]elease/
...@@ -1249,9 +1249,16 @@ dnl ...@@ -1249,9 +1249,16 @@ dnl
if [[ "$GUI_DEP" = "gui-none" ]]; then if [[ "$GUI_DEP" = "gui-none" ]]; then
if [[ "x$HAVE_GTK" = "xno" ]]; then if [[ "x$HAVE_GTK" = "xno" ]]; then
AC_MSG_WARN([UI wanted, but no UI useable target found]) if [[ "x$HAVE_SDL" = "xno" ]]; then
NR_ERRORS=`expr $NR_ERRORS + 1` AC_MSG_WARN([UI wanted, but no UI useable target found])
WANT_UI=no NR_ERRORS=`expr $NR_ERRORS + 1`
WANT_UI=no
else
GUI_DEP=gui-sdl
GUI_LIBS="-lSDL_image -lSDL_ttf $SDL_LIBS"
GUI_NAME="SDL"
GUI_CFLAGS="$CFLAGS"
fi
else else
GUI_DEP=gui-gtk GUI_DEP=gui-gtk
GUI_LIBS="$GTK_LIBS" GUI_LIBS="$GTK_LIBS"
...@@ -2036,6 +2043,7 @@ AC_CONFIG_FILES([Makefile ...@@ -2036,6 +2043,7 @@ AC_CONFIG_FILES([Makefile
src/gui-gtk/Makefile src/gui-gtk/Makefile
src/gui-muirexx/Makefile src/gui-muirexx/Makefile
src/gui-qt/Makefile src/gui-qt/Makefile
src/gui-sdl/Makefile
src/keymap/Makefile src/keymap/Makefile
src/test/Makefile src/test/Makefile
]) ])
......
AM_CPPFLAGS = @UAE_CPPFLAGS@
AM_CPPFLAGS += -I$(top_srcdir)/src/include -I$(top_builddir)/src -I$(top_srcdir)/src
AM_CFLAGS = @UAE_CFLAGS@
AM_CFLAGS += @SDL_CFLAGS@
noinst_LIBRARIES = libguidep.a
libguidep_a_SOURCES = inputmode.c menu.c menu_load.c menu_prefs.c menu_tweak.c vkbd.cpp volumecontrol.c
noinst_HEADERS = inputmode.h menu.h vkbd.h volumecontrol.h
#include <SDL.h> #include <SDL.h>
#include "gp2x.h"
#include "inputmode.h" #include "inputmode.h"
extern char launchDir [256]; extern char launchDir [256];
...@@ -44,7 +43,8 @@ void inputmode_redraw(void) { ...@@ -44,7 +43,8 @@ void inputmode_redraw(void) {
r.h=120; r.h=120;
if (inputMode[0] && inputMode[1]) { if (inputMode[0] && inputMode[1]) {
if (gp2xMouseEmuOn) { // if (gp2xMouseEmuOn) {
if (1) {
surface = inputMode[1]; surface = inputMode[1];
} else { } else {
surface = inputMode[0]; surface = inputMode[0];
......
#include "SDL.h" #include "SDL.h"
#include "SDL_image.h" #include "SDL_image.h"
#include <sys/mman.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -13,15 +12,28 @@ ...@@ -13,15 +12,28 @@
#include "gui.h" #include "gui.h"
#include "zfile.h" #include "zfile.h"
#ifdef TOUCHUI
#include <SDL_TouchUI.h>
#endif
#define GUI_DEBUG
#ifdef GUI_DEBUG
#define DEBUG_LOG write_log ( "%s: ", __func__); write_log
#else
#define DEBUG_LOG(...) do ; while(0)
#endif
#define VIDEO_FLAGS SDL_HWSURFACE #define VIDEO_FLAGS SDL_HWSURFACE
SDL_Surface* tmpSDLScreen = NULL; SDL_Surface* tmpSDLScreen = NULL;
SDL_Surface* display = NULL;
int seciliolan = 0; int menuSelection = 0;
char yol[256]; char yol[256];
char msg[50]; char msg[50];
char msg_status[50]; char msg_status[50];
extern char launchDir[256]; //extern char launchDir[256];
char launchDir[256];
extern int dirz(int parametre); extern int dirz(int parametre);
extern int tweakz(int parametre); extern int tweakz(int parametre);
...@@ -29,38 +41,79 @@ extern int prefz(int parametre); ...@@ -29,38 +41,79 @@ extern int prefz(int parametre);
int soundVolume = 100; int soundVolume = 100;
extern int flashLED; extern int flashLED;
// static int gui_available = 0;
void write_text (int x, int y, char* txt) {
SDL_Surface* pText_Surface = TTF_RenderText_Solid(amiga_font, txt, text_color);
rect.x = x;
rect.y = y;
rect.w = pText_Surface->w;
rect.h = pText_Surface->h;
SDL_BlitSurface (pText_Surface,NULL,tmpSDLScreen,&rect);
SDL_FreeSurface(pText_Surface);
}
void blit_image (SDL_Surface* img, int x, int y) {
SDL_Rect dest;
dest.x = x;
dest.y = y;
SDL_BlitSurface(img, 0, tmpSDLScreen, &dest);
}
void secilimi (int ix, int iy, int mx, int my, SDL_Surface* img, int hangi) {
int secili = 0;
if (mx >= ix && mx <= ix + iconsizex) {
if (my >= iy && my <= iy + iconsizey) {
secili = 1;
}
}
if (secili == 1) {
SDL_SetAlpha(img, SDL_SRCALPHA, 100);
menuSelection = hangi;
} else {
SDL_SetAlpha(img, SDL_SRCALPHA, 255);
}
}
int gui_init (void) { int gui_init (void) {
if (display == NULL) { if (display == NULL) {
SDL_Init (SDL_INIT_VIDEO | SDL_INIT_JOYSTICK); display = SDL_GetVideoSurface();
display = SDL_SetVideoMode(320,240,16,VIDEO_FLAGS); }
if (display) {
SDL_JoystickEventState(SDL_ENABLE);
SDL_JoystickOpen(0);
SDL_ShowCursor(SDL_DISABLE);
TTF_Init();
amiga_font = TTF_OpenFont("fonts/amiga4ever_pro2.ttf",8);
text_color.r = 0;
text_color.g = 0;
text_color.b = 0;
pMenu_Surface = SDL_LoadBMP("images/menu.bmp");
pMouse_Pointer = SDL_LoadBMP("images/mousep.bmp");
SDL_SetColorKey(pMouse_Pointer, SDL_SRCCOLORKEY, SDL_MapRGB(pMouse_Pointer->format, 85, 170,153));
icon_expansion = SDL_LoadBMP("images/icon-expansion.bmp");
icon_preferences= SDL_LoadBMP("images/icon-preferences.bmp");
icon_keymaps = SDL_LoadBMP("images/icon-keymaps.bmp");
icon_floppy = SDL_LoadBMP("images/icon-floppy.bmp");
icon_reset = SDL_LoadBMP("images/icon-reset.bmp");
icon_storage = SDL_LoadBMP("images/icon-storage.bmp");
icon_run = SDL_LoadBMP("images/icon-run.bmp");
icon_exit = SDL_LoadBMP("images/icon-exit.bmp");
icon_tweaks = SDL_LoadBMP("images/icon-tweaks.bmp");
tmpSDLScreen = SDL_CreateRGBSurface(display->flags,display->w,display->h,display->format->BitsPerPixel,display->format->Rmask,display->format->Gmask,display->format->Bmask,display->format->Amask);
#ifdef TOUCHUI
SDL_TUI_Init("sdl_touchui.xml", "keyboard-off");
#endif
return 1;
} }
SDL_JoystickEventState(SDL_ENABLE); return 0;
SDL_JoystickOpen(0);
SDL_ShowCursor(SDL_DISABLE);
TTF_Init();
amiga_font = TTF_OpenFont("fonts/amiga4ever_pro2.ttf",8);
text_color.r = 0;
text_color.g = 0;
text_color.b = 0;
pMenu_Surface = SDL_LoadBMP("images/menu.bmp");
pMouse_Pointer = SDL_LoadBMP("images/mousep.bmp");
SDL_SetColorKey(pMouse_Pointer, SDL_SRCCOLORKEY, SDL_MapRGB(pMouse_Pointer->format, 85, 170,153));
icon_expansion = SDL_LoadBMP("images/icon-expansion.bmp");
icon_preferences= SDL_LoadBMP("images/icon-preferences.bmp");
icon_keymaps = SDL_LoadBMP("images/icon-keymaps.bmp");
icon_floppy = SDL_LoadBMP("images/icon-floppy.bmp");
icon_reset = SDL_LoadBMP("images/icon-reset.bmp");
icon_storage = SDL_LoadBMP("images/icon-storage.bmp");
icon_run = SDL_LoadBMP("images/icon-run.bmp");
icon_exit = SDL_LoadBMP("images/icon-exit.bmp");
icon_tweaks = SDL_LoadBMP("images/icon-tweaks.bmp");
tmpSDLScreen = SDL_CreateRGBSurface(display->flags,display->w,display->h,display->format->BitsPerPixel,display->format->Rmask,display->format->Gmask,display->format->Bmask,display->format->Amask);
return 1;
} }
void gui_exit (void){ void gui_exit (void){
...@@ -83,7 +136,7 @@ void gui_exit (void){ ...@@ -83,7 +136,7 @@ void gui_exit (void){
SDL_Quit; SDL_Quit;
} }
int gui_display(int shortcut){ void gui_display (int shortcut){
SDL_Event event; SDL_Event event;
int menu_exitcode = -1; int menu_exitcode = -1;
...@@ -98,16 +151,24 @@ int gui_display(int shortcut){ ...@@ -98,16 +151,24 @@ int gui_display(int shortcut){
int iconpos_x = 0; int iconpos_x = 0;
int iconpos_y = 0; int iconpos_y = 0;
if (display == NULL) {
gui_init();
}
getcwd(launchDir,256); getcwd(launchDir,256);
while (!mainloopdone) { while (!mainloopdone) {
while (SDL_PollEvent(&event)) { while (SDL_PollEvent(&event)) {
#ifdef TOUCHUI
SDL_TUI_HandleEvent(&event);
#endif
if (event.type == SDL_QUIT) { if (event.type == SDL_QUIT) {
mainloopdone = 1; mainloopdone = 1;
} }
if (event.type == SDL_JOYBUTTONDOWN) { if (event.type == SDL_JOYBUTTONDOWN) {
switch (event.jbutton.button) { switch (event.jbutton.button) {
case GP2X_BUTTON_R: break; #if 0
case GP2X_BUTTON_R: break;
case GP2X_BUTTON_L: break; case GP2X_BUTTON_L: break;
case GP2X_BUTTON_UP: kup = 1; break; case GP2X_BUTTON_UP: kup = 1; break;
case GP2X_BUTTON_DOWN: kdown = 1; break; case GP2X_BUTTON_DOWN: kdown = 1; break;
...@@ -117,6 +178,7 @@ int gui_display(int shortcut){ ...@@ -117,6 +178,7 @@ int gui_display(int shortcut){
case GP2X_BUTTON_B: ksel = 1; break; case GP2X_BUTTON_B: ksel = 1; break;
case GP2X_BUTTON_Y: break; case GP2X_BUTTON_Y: break;
case GP2X_BUTTON_START: mainloopdone = 1; break; case GP2X_BUTTON_START: mainloopdone = 1; break;
#endif
} }
} }
if (event.type == SDL_KEYDOWN) { if (event.type == SDL_KEYDOWN) {
...@@ -135,7 +197,7 @@ int gui_display(int shortcut){ ...@@ -135,7 +197,7 @@ int gui_display(int shortcut){
mouse_y += event.motion.yrel; mouse_y += event.motion.yrel;
} }
if (event.type == SDL_MOUSEBUTTONDOWN) { if (event.type == SDL_MOUSEBUTTONDOWN) {
if (seciliolan == 0) { if (menuSelection == 0) {
if (mouse_x >= 0 && mouse_x <= 20) { if (mouse_x >= 0 && mouse_x <= 20) {
if (mouse_y >= 0 && mouse_y <= 20) { if (mouse_y >= 0 && mouse_y <= 20) {
mainloopdone = 1; mainloopdone = 1;
...@@ -147,43 +209,43 @@ int gui_display(int shortcut){ ...@@ -147,43 +209,43 @@ int gui_display(int shortcut){
} }
} }
if (ksel == 1) { if (ksel == 1) {
if (seciliolan == menu_sel_expansion) { if (menuSelection == menu_sel_expansion) {
sprintf(msg,"%s","Select KickStart ROM"); sprintf(msg,"%s","Select KickStart ROM");
sprintf(msg_status,"%s"," "); sprintf(msg_status,"%s"," ");
sprintf(yol,"%s/roms",launchDir); sprintf(yol,"%s/roms",launchDir);
dirz(1); dirz(1);
} }
if (seciliolan == menu_sel_floppy) { if (menuSelection == menu_sel_floppy) {
sprintf(msg,"%s","Select Disk Image"); sprintf(msg,"%s","Select Disk Image");
sprintf(msg_status,"%s","DF0: B DF1: A"); sprintf(msg_status,"%s","DF0: B DF1: A");
sprintf(yol,"%s/disks",launchDir); sprintf(yol,"%s/disks",launchDir);
dirz(0); dirz(0);
} }
if (seciliolan == menu_sel_prefs) { if (menuSelection == menu_sel_prefs) {
sprintf(msg,"%s"," "); sprintf(msg,"%s"," ");
sprintf(msg_status,"%s"," "); sprintf(msg_status,"%s"," ");
prefz(0); prefz(0);
} }
if (seciliolan == menu_sel_reset) { if (menuSelection == menu_sel_reset) {
//reset amiga //reset amiga
menu_exitcode = 2; menu_exitcode = 2;
mainloopdone = 1; mainloopdone = 1;
} }
if (seciliolan == menu_sel_keymaps) { if (menuSelection == menu_sel_keymaps) {
} }
if (seciliolan == menu_sel_tweaks) { if (menuSelection == menu_sel_tweaks) {
sprintf(msg,"%s","Tweaks"); sprintf(msg,"%s","Tweaks");
sprintf(msg_status,"%s","L/R = -/+ B: Apply"); sprintf(msg_status,"%s","L/R = -/+ B: Apply");
tweakz(0); tweakz(0);
} }
if (seciliolan == menu_sel_storage) { if (menuSelection == menu_sel_storage) {
} }
if (seciliolan == menu_sel_run) { if (menuSelection == menu_sel_run) {
menu_exitcode = 1; menu_exitcode = 1;
mainloopdone = 1; mainloopdone = 1;
} }
if (seciliolan == menu_sel_exit) { if (menuSelection == menu_sel_exit) {
SDL_Quit(); SDL_Quit();
#ifdef GP2X #ifdef GP2X
...@@ -242,7 +304,11 @@ int gui_display(int shortcut){ ...@@ -242,7 +304,11 @@ int gui_display(int shortcut){
secilimi (iconpos_x,iconpos_y,mouse_x,mouse_y, icon_exit, menu_sel_exit); secilimi (iconpos_x,iconpos_y,mouse_x,mouse_y, icon_exit, menu_sel_exit);
blit_image (icon_exit, iconpos_x, iconpos_y); blit_image (icon_exit, iconpos_x, iconpos_y);
// texts // texts
write_text (26,3,"UAE2x 0.1 alpha //GnoStiC");
//char tmpMsg[50];
//sprintf(tmpMsg, "P-UAE %d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV);
//write_text (26, 3, tmpMsg);
write_text (26, 3, "P-UAE 2.3.0");
// mouse pointer ------------------------------ // mouse pointer ------------------------------
if (kleft == 1) { if (kleft == 1) {
...@@ -274,43 +340,140 @@ int gui_display(int shortcut){ ...@@ -274,43 +340,140 @@ int gui_display(int shortcut){
// mouse pointer-end // mouse pointer-end
SDL_BlitSurface (tmpSDLScreen,NULL,display,NULL); SDL_BlitSurface (tmpSDLScreen,NULL,display,NULL);
#ifdef TOUCHUI
SDL_TUI_UpdateAll();
#endif
SDL_Flip(display); SDL_Flip(display);
} //while done } //while done
return menu_exitcode;
} }
void write_text (int x, int y, char* txt) { void gui_handle_events (void)
SDL_Surface* pText_Surface = TTF_RenderText_Solid(amiga_font, txt, text_color); {
if (!gui_available)
return;
#if 0
while (comm_pipe_has_data (&from_gui_pipe)) {
int cmd = read_comm_pipe_int_blocking (&from_gui_pipe);
switch (cmd) {
case UAECMD_EJECTDISK: {
int n = read_comm_pipe_int_blocking (&from_gui_pipe);
uae_sem_wait (&gui_sem);
changed_prefs.floppyslots[n].df[0] = '\0';
uae_sem_post (&gui_sem);
if (pause_uae) {
/* When UAE is running it will notify the GUI when a disk has been inserted
* or removed itself. When UAE is paused, however, we need to do this ourselves
* or the change won't be realized in the GUI until UAE is resumed */
// write_comm_pipe_int (&to_gui_pipe, n, 1);
}
break;
}
case UAECMD_INSERTDISK: {
int n = read_comm_pipe_int_blocking (&from_gui_pipe);
uae_sem_wait (&gui_sem);
strncpy (changed_prefs.floppyslots[n].df, new_disk_string[n], 255);
free (new_disk_string[n]);
new_disk_string[n] = 0;
changed_prefs.floppyslots[n].df[255] = '\0';
uae_sem_post (&gui_sem);
if (pause_uae) {
/* When UAE is running it will notify the GUI when a disk has been inserted
* or removed itself. When UAE is paused, however, we need to do this ourselves
* or the change won't be realized in the GUI until UAE is resumed */
// write_comm_pipe_int (&to_gui_pipe, GUICMD_DISKCHANGE, 0);
// write_comm_pipe_int (&to_gui_pipe, n, 1);
}
break;
}
case UAECMD_RESET:
uae_reset (0);
break;
#ifdef DEBUGGER
case UAECMD_DEBUG:
activate_debugger ();
break;
#endif
case UAECMD_QUIT:
uae_quit ();
break;
case UAECMD_PAUSE:
pause_uae = 1;
uae_pause ();
break;
case UAECMD_RESUME:
pause_uae = 0;
uae_resume ();
break;
case UAECMD_SAVE_CONFIG:
uae_sem_wait (&gui_sem);
//uae_save_config ();
uae_sem_post (&gui_sem);
break;
case UAECMD_SELECT_ROM:
uae_sem_wait (&gui_sem);
strncpy (changed_prefs.romfile, gui_romname, 255);
changed_prefs.romfile[255] = '\0';
free (gui_romname);
uae_sem_post (&gui_sem);
break;
case UAECMD_SELECT_KEY:
uae_sem_wait (&gui_sem);
strncpy (changed_prefs.keyfile, gui_keyname, 255);
changed_prefs.keyfile[255] = '\0';
free (gui_keyname);
uae_sem_post (&gui_sem);
break;
case UAECMD_SAVESTATE_LOAD:
uae_sem_wait (&gui_sem);
savestate_initsave (gui_sstate_name, 0, 0);
savestate_state = STATE_DORESTORE;
write_log ("Restoring state from '%s'...\n", gui_sstate_name);
uae_sem_post (&gui_sem);
break;
case UAECMD_SAVESTATE_SAVE:
uae_sem_wait (&gui_sem);
savestate_initsave (gui_sstate_name, 0, 0);
save_state (gui_sstate_name, "puae");
write_log ("Saved state to '%s'...\n", gui_sstate_name);
uae_sem_post (&gui_sem);
break;
/* case UAECMD_START:
uae_start ();
break;
case UAECMD_STOP:
uae_stop ();
break;*/
}
}
#endif
}
rect.x = x; void gui_message (const char *format,...) {
rect.y = y; char msg[2048];
rect.w = pText_Surface->w; va_list parms;
rect.h = pText_Surface->h;
SDL_BlitSurface (pText_Surface,NULL,tmpSDLScreen,&rect); va_start (parms,format);
SDL_FreeSurface(pText_Surface); vsprintf ( msg, format, parms);
} va_end (parms);
void blit_image (SDL_Surface* img, int x, int y) { write_log (msg);
SDL_Rect dest;
dest.x = x;
dest.y = y;
SDL_BlitSurface(img, 0, tmpSDLScreen, &dest);
} }
void secilimi (int ix, int iy, int mx, int my, SDL_Surface* img, int hangi) { void gui_fps (int fps, int idle) {
int secili = 0; gui_data.fps = fps;
if (mx >= ix && mx <= ix + iconsizex) { gui_data.idle = idle;
if (my >= iy && my <= iy + iconsizey) {
secili = 1;
}
}
if (secili == 1) {
SDL_SetAlpha(img, SDL_SRCALPHA, 100);
seciliolan = hangi;
} else {
SDL_SetAlpha(img, SDL_SRCALPHA, 255);
}
} }
//
int gui_update (void) { return 0; }
void gui_flicker_led (int led, int unitnum, int status) {}
void gui_led (int led, int on) {}
void gui_filename (int num, const char *name) {}
void gui_disk_image_change (int unitnum, const TCHAR *name, bool writeprotected) {}
void gui_lock (void) {}
void gui_unlock (void) {}
void gui_gameport_button_change (int port, int button, int onoff) {}
void gui_gameport_axis_change (int port, int axis, int state, int max) {}
#include <stdio.h> #include <stdio.h>
#include <SDL.h> #include <SDL.h>
#include "SDL_ttf.h" #include "SDL_ttf.h"
#include "gp2x.h"
#define iconsizex 50 #define iconsizex 50
#define iconsizey 60 #define iconsizey 60
......
...@@ -5,12 +5,15 @@ ...@@ -5,12 +5,15 @@
#include "SDL.h" #include "SDL.h"
#include "SDL_image.h" #include "SDL_image.h"
#include "SDL_ttf.h" #include "SDL_ttf.h"
#include "gp2x.h"
#include <dirent.h> #include <dirent.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef TOUCHUI
#include <SDL_TouchUI.h>
#endif
extern void write_text(int x, int y, char* txt); extern void write_text(int x, int y, char* txt);
extern void blit_image(SDL_Surface* img, int x, int y); extern void blit_image(SDL_Surface* img, int x, int y);
extern SDL_Surface* display; extern SDL_Surface* display;
...@@ -19,54 +22,51 @@ extern SDL_Surface* pMenu_Surface; ...@@ -19,54 +22,51 @@ extern SDL_Surface* pMenu_Surface;
extern SDL_Color text_color; extern SDL_Color text_color;
#define MAX_FILES 1024 #define MAX_FILES 1024
extern char launchDir[];
extern char yol[]; extern char yol[];
extern char msg[]; extern char msg[];
extern char msg_status[]; extern char msg_status[];
int dirz (int parametre) { int dirz (int parametre) {
char launchDir[256];
SDL_Event event; SDL_Event event;
int getdir = 1; int getdir = 1;
pMenu_Surface = SDL_LoadBMP("images/menu_load.bmp"); pMenu_Surface = SDL_LoadBMP("images/menu_load.bmp");
int loadloopdone = 0; int loadloopdone = 0;
int num_of_files = 0; int num_of_files = 0;
int seciliolan = 0; int menuSelection = 0;
int q; int q;
int bas = 0; int bas = 0;
int ka = 0; int ka = 0;
int kb = 0; int kb = 0;
char **filez = (char **)malloc(MAX_FILES*sizeof(char *)); char **filez = (char **)malloc(MAX_FILES*sizeof(char *));
if (display == NULL) {
gui_init();
}
int i; int i;
int paging = 18; int paging = 18;
DIR *d=opendir(yol); DIR *d=opendir(yol);
struct dirent *ep; struct dirent *ep;
getcwd(launchDir,256);
if (d != NULL) { if (d != NULL) {
for(i=0;i<MAX_FILES;i++) { for(i=0;i<MAX_FILES;i++) {
ep = readdir(d); ep = readdir(d);
if (ep == NULL) { if (ep == NULL) {
break; break;
} else { } else {
//if ((!strcmp(ep->d_name,".")) || (!strcmp(ep->d_name,"..")) || (!strcmp(ep->d_name,"uae2x.gpe"))) { struct stat sstat;
char *tmp=(char *)calloc(1,256);
struct stat sstat; strcpy(tmp,launchDir);
char *tmp=(char *)calloc(1,256); strcat(tmp,"/");
strcpy(tmp,launchDir); strcat(tmp,ep->d_name);
strcat(tmp,"/");
strcat(tmp,ep->d_name); filez[i]=(char*)malloc(64);
strncpy(filez[i],ep->d_name,64);
//if (!stat(tmp, &sstat)) { num_of_files++;
// if (S_ISDIR(sstat.st_mode)) { free(tmp);
// //folder EKLENECEK
// } else {
filez[i]=(char*)malloc(64);
strncpy(filez[i],ep->d_name,64);
num_of_files++;
// }
//}
free(tmp);
//}
} }
} }
closedir(d); closedir(d);
...@@ -77,68 +77,88 @@ int dirz (int parametre) { ...@@ -77,68 +77,88 @@ int dirz (int parametre) {
while (!loadloopdone) { while (!loadloopdone) {
while (SDL_PollEvent(&event)) { while (SDL_PollEvent(&event)) {
#ifdef TOUCHUI
SDL_TUI_HandleEvent(&event);
#endif
if (event.type == SDL_QUIT) { if (event.type == SDL_QUIT) {
loadloopdone = 1; loadloopdone = 1;
} }
if (event.type == SDL_JOYBUTTONDOWN) { if (event.type == SDL_JOYBUTTONDOWN) {
switch (event.jbutton.button) { switch (event.jbutton.button) {
case GP2X_BUTTON_UP: seciliolan -= 1; break; #if 0
case GP2X_BUTTON_DOWN: seciliolan += 1; break; case GP2X_BUTTON_UP: menuSelection -= 1; break;
case GP2X_BUTTON_DOWN: menuSelection += 1; break;
case GP2X_BUTTON_A: ka = 1; break; case GP2X_BUTTON_A: ka = 1; break;
case GP2X_BUTTON_B: kb = 1; break; case GP2X_BUTTON_B: kb = 1; break;
case GP2X_BUTTON_SELECT: loadloopdone = 1; break; case GP2X_BUTTON_SELECT: loadloopdone = 1; break;
#endif
} }
} }
if (event.type == SDL_KEYDOWN) { if (event.type == SDL_KEYDOWN) {
switch (event.key.keysym.sym) { switch (event.key.keysym.sym) {
case SDLK_ESCAPE: loadloopdone = 1; break; case SDLK_ESCAPE: loadloopdone = 1; break;
case SDLK_UP: seciliolan -= 1; break; case SDLK_UP: menuSelection -= 1; break;
case SDLK_DOWN: seciliolan += 1; break; case SDLK_DOWN: menuSelection += 1; break;
case SDLK_a: ka = 1; break; case SDLK_a: ka = 1; break;
case SDLK_b: kb = 1; break; case SDLK_b: kb = 1; break;
default: break; default: break;
} }
} }
} }
if (ka == 1) { //df1 if (parametre == 0) {
if (parametre == 0) { if (ka == 1) { //df1
// Select Disk Image
char *tmp=(char *)calloc(1,256); char *tmp=(char *)calloc(1,256);
strcpy(tmp,launchDir); //strcpy(tmp,launchDir);
strcat(tmp,"/roms/"); strcat(tmp,"disks/");
strcat(tmp,filez[seciliolan]); strcat(tmp,filez[menuSelection]);
strcpy(currprefs.df[1],tmp); //strcpy(changed_prefs.floppyslots[1].df,tmp);
write_log ("Old Disk Image: %s\n", changed_prefs.floppyslots[1].df);
strncpy(changed_prefs.floppyslots[1].df, tmp, 255);
write_log ("Selected Disk Image: %s\n", changed_prefs.floppyslots[1].df);
free(tmp); free(tmp);
loadloopdone = 1; loadloopdone = 1;
ka = 0;
} }
ka = 0; if (kb == 1) { //df0;
} // Select Disk Image
if (kb == 1) { //df0;
if (parametre == 0) {
char *tmp=(char *)calloc(1,256); char *tmp=(char *)calloc(1,256);
strcpy(tmp,launchDir); //strcpy(tmp,launchDir);
strcat(tmp,"/disks/"); strcat(tmp,"disks/");
strcat(tmp,filez[seciliolan]); strcat(tmp,filez[menuSelection]);
strcpy(currprefs.df[0],tmp); //strcpy(changed_prefs.floppyslots[0].df,tmp);
write_log ("Old Disk Image: %s\n", changed_prefs.floppyslots[0].df);
strncpy(changed_prefs.floppyslots[0].df, tmp, 255);
write_log ("Selected Disk Image: %s\n", changed_prefs.floppyslots[0].df);
free(tmp); free(tmp);
loadloopdone = 1; loadloopdone = 1;
} else { kb = 0;
}
} else {
if (kb == 1) {
// Select KickStart ROM
char *tmp=(char *)calloc(1,256); char *tmp=(char *)calloc(1,256);
strcpy(tmp,launchDir); //strcpy(tmp,launchDir);
strcat(tmp,"/roms/"); strcat(tmp,"roms/");
strcat(tmp,filez[seciliolan]); strcat(tmp,filez[menuSelection]);
strcpy(currprefs.romfile,tmp); //strcpy(changed_prefs.romfile,tmp);
write_log ("Old KickStart ROM: %s\n", changed_prefs.romfile);
strncpy(changed_prefs.romfile, tmp, 255);
write_log ("Selected KickStart ROM: %s\n", changed_prefs.romfile);
free(tmp); free(tmp);
loadloopdone = 1; loadloopdone = 1;
} }
kb = 0; ka = 0;
kb = 0;
} }
if (seciliolan < 0) { seciliolan = 0; }
if (seciliolan >= num_of_files) { seciliolan = num_of_files-1; } if (menuSelection < 0) { menuSelection = 0; }
if (seciliolan > (bas + paging -1)) { bas += 1; } if (menuSelection >= num_of_files) { menuSelection = num_of_files-1; }
if (seciliolan < bas) { bas -= 1; } if (menuSelection > (bas + paging -1)) { bas += 1; }
if (menuSelection < bas) { bas -= 1; }
if ((bas+paging) > num_of_files) { bas = (num_of_files - paging); } if ((bas+paging) > num_of_files) { bas = (num_of_files - paging); }
// background // background
...@@ -147,11 +167,11 @@ int dirz (int parametre) { ...@@ -147,11 +167,11 @@ int dirz (int parametre) {
// texts // texts
int sira = 0; int sira = 0;
for (q=bas; q<(bas+paging); q++) { for (q=bas; q<(bas+paging); q++) {
if (seciliolan == q) { if (menuSelection == q) {
text_color.r = 255; text_color.g = 100; text_color.b = 100; text_color.r = 255; text_color.g = 100; text_color.b = 100;
} }
write_text (10,25+(sira*10),filez[q]); // write_text (10,25+(sira*10),filez[q]); //
if (seciliolan == q) { if (menuSelection == q) {
text_color.r = 0; text_color.g = 0; text_color.b = 0; text_color.r = 0; text_color.g = 0; text_color.b = 0;
} }
sira++; sira++;
...@@ -161,11 +181,14 @@ int dirz (int parametre) { ...@@ -161,11 +181,14 @@ int dirz (int parametre) {
write_text (15,228,msg_status); write_text (15,228,msg_status);
SDL_BlitSurface (tmpSDLScreen,NULL,display,NULL); SDL_BlitSurface (tmpSDLScreen,NULL,display,NULL);
#ifdef TOUCHUI
SDL_TUI_UpdateAll();
#endif
SDL_Flip(display); SDL_Flip(display);
} //while done } //while done
free(filez); free(filez);
pMenu_Surface = SDL_LoadBMP("images/menu.bmp"); pMenu_Surface = SDL_LoadBMP("images/menu.bmp");
return 0; return 0;
} }
...@@ -3,9 +3,12 @@ ...@@ -3,9 +3,12 @@
#include "options.h" #include "options.h"
#include "SDL.h" #include "SDL.h"
#include "gp2x.h"
#include <stdlib.h> #include <stdlib.h>
#ifdef TOUCHUI
#include <SDL_TouchUI.h>
#endif
extern void write_text(int x, int y, char* txt); extern void write_text(int x, int y, char* txt);
extern void blit_image(SDL_Surface* img, int x, int y); extern void blit_image(SDL_Surface* img, int x, int y);
extern SDL_Surface* display; extern SDL_Surface* display;
...@@ -18,13 +21,17 @@ extern char msg_status[50]; ...@@ -18,13 +21,17 @@ extern char msg_status[50];
int prefz (int parametre) { int prefz (int parametre) {
SDL_Event event; SDL_Event event;
pMenu_Surface = SDL_LoadBMP("images/menu_tweak.bmp"); if (display == NULL) {
gui_init();
}
pMenu_Surface = SDL_LoadBMP("images/menu_tweak.bmp");
int prefsloopdone = 0; int prefsloopdone = 0;
int kup = 0; int kup = 0;
int kdown = 0; int kdown = 0;
int kleft = 0; int kleft = 0;
int kright = 0; int kright = 0;
int seciliolan = 0; int menuSelection = 0;
int deger; int deger;
int q; int q;
int w; int w;
...@@ -48,43 +55,51 @@ int prefz (int parametre) { ...@@ -48,43 +55,51 @@ int prefz (int parametre) {
char* p_floppy[]= {"0","100","200","300"}; //3 char* p_floppy[]= {"0","100","200","300"}; //3
int defaults[] = {0,0,0,0,0,0,0,0}; int defaults[] = {0,0,0,0,0,0,0,0};
defaults[0] = currprefs.cpu_level; // defaults[0] = changed_prefs.cpu_level;
if (currprefs.address_space_24 != 0) { defaults[0] = changed_prefs.cpu_model;
if (currprefs.cpu_level == 2) { defaults[0] = 4; } if (changed_prefs.address_space_24 != 0) {
if (currprefs.cpu_level == 3) { defaults[0] = 5; } // if (changed_prefs.cpu_level == 2) { defaults[0] = 4; }
// if (changed_prefs.cpu_level == 3) { defaults[0] = 5; }
if (changed_prefs.cpu_model == 2) { defaults[0] = 4; }
if (changed_prefs.cpu_model == 3) { defaults[0] = 5; }
} }
defaults[1] = currprefs.m68k_speed; defaults[1] = changed_prefs.m68k_speed;
defaults[2] = currprefs.chipset_mask; defaults[2] = changed_prefs.chipset_mask;
defaults[3] = currprefs.chipmem_size; defaults[3] = changed_prefs.chipmem_size;
defaults[4] = currprefs.fastmem_size; defaults[4] = changed_prefs.fastmem_size;
defaults[5] = currprefs.bogomem_size; defaults[5] = changed_prefs.bogomem_size;
defaults[6] = currprefs.produce_sound; defaults[6] = changed_prefs.produce_sound;
defaults[7] = currprefs.gfx_framerate; defaults[7] = changed_prefs.gfx_framerate;
defaults[8] = currprefs.floppy_speed; defaults[8] = changed_prefs.floppy_speed;
char *tmp; char *tmp;
tmp=(char*)malloc(6); tmp=(char*)malloc(6);
while (!prefsloopdone) { while (!prefsloopdone) {
while (SDL_PollEvent(&event)) { while (SDL_PollEvent(&event)) {
#ifdef TOUCHUI
SDL_TUI_HandleEvent(&event);
#endif
if (event.type == SDL_QUIT) { if (event.type == SDL_QUIT) {
prefsloopdone = 1; prefsloopdone = 1;
} }
if (event.type == SDL_JOYBUTTONDOWN) { if (event.type == SDL_JOYBUTTONDOWN) {
switch (event.jbutton.button) { switch (event.jbutton.button) {
case GP2X_BUTTON_UP: seciliolan--; break; #if 0
case GP2X_BUTTON_DOWN: seciliolan++; break; case GP2X_BUTTON_UP: menuSelection--; break;
case GP2X_BUTTON_DOWN: menuSelection++; break;
case GP2X_BUTTON_LEFT: kleft = 1; break; case GP2X_BUTTON_LEFT: kleft = 1; break;
case GP2X_BUTTON_RIGHT: kright = 1; break; case GP2X_BUTTON_RIGHT: kright = 1; break;
case GP2X_BUTTON_SELECT: prefsloopdone = 1; break; case GP2X_BUTTON_SELECT: prefsloopdone = 1; break;
case GP2X_BUTTON_B: prefsloopdone = 1; break; case GP2X_BUTTON_B: prefsloopdone = 1; break;
#endif
} }
} }
if (event.type == SDL_KEYDOWN) { if (event.type == SDL_KEYDOWN) {
switch (event.key.keysym.sym) { switch (event.key.keysym.sym) {
case SDLK_ESCAPE: prefsloopdone = 1; break; case SDLK_ESCAPE: prefsloopdone = 1; break;
case SDLK_UP: seciliolan--; break; case SDLK_UP: menuSelection--; break;
case SDLK_DOWN: seciliolan++; break; case SDLK_DOWN: menuSelection++; break;
case SDLK_LEFT: kleft = 1; break; case SDLK_LEFT: kleft = 1; break;
case SDLK_RIGHT: kright = 1; break; case SDLK_RIGHT: kright = 1; break;
case SDLK_b: prefsloopdone = 1; break; case SDLK_b: prefsloopdone = 1; break;
...@@ -93,30 +108,30 @@ int prefz (int parametre) { ...@@ -93,30 +108,30 @@ int prefz (int parametre) {
} }
} }
if (kleft == 1) { if (kleft == 1) {
defaults[seciliolan]--; defaults[menuSelection]--;
kleft = 0; kleft = 0;
if (seciliolan == 1) { if (menuSelection == 1) {
//cpu_speed_change = 1; //cpu_speed_change = 1;
} }
if (seciliolan == 6) { if (menuSelection == 6) {
//snd_change = 1; //snd_change = 1;
} }
if (seciliolan == 7) { if (menuSelection == 7) {
//gfx_frameskip_change = 1; //gfx_frameskip_change = 1;
} }
} }
if (kright == 1) { if (kright == 1) {
defaults[seciliolan]++; defaults[menuSelection]++;
kright = 0; kright = 0;
if (seciliolan == 1) { if (menuSelection == 1) {
//cpu_speed_change = 1; //cpu_speed_change = 1;
} }
if (seciliolan == 6) { if (menuSelection == 6) {
//snd_change = 1; //snd_change = 1;
} }
if (seciliolan == 7) { if (menuSelection == 7) {
//gfx_frameskip_change = 1; //gfx_frameskip_change = 1;
} }
} }
...@@ -141,8 +156,8 @@ int prefz (int parametre) { ...@@ -141,8 +156,8 @@ int prefz (int parametre) {
if (defaults[7] > 3) defaults[7] = 0; //frameskip if (defaults[7] > 3) defaults[7] = 0; //frameskip
if (defaults[8] > 3) defaults[8] = 0; //floppy if (defaults[8] > 3) defaults[8] = 0; //floppy
if (seciliolan < 0) { seciliolan = 8; } if (menuSelection < 0) { menuSelection = 8; }
if (seciliolan > 8) { seciliolan = 0; } if (menuSelection > 8) { menuSelection = 0; }
// background // background
SDL_BlitSurface (pMenu_Surface,NULL,tmpSDLScreen,NULL); SDL_BlitSurface (pMenu_Surface,NULL,tmpSDLScreen,NULL);
...@@ -150,7 +165,7 @@ int prefz (int parametre) { ...@@ -150,7 +165,7 @@ int prefz (int parametre) {
int sira = 0; int sira = 0;
int skipper = 0; int skipper = 0;
for (q=0; q<9; q++) { for (q=0; q<9; q++) {
if (seciliolan == q) { if (menuSelection == q) {
text_color.r = 150; text_color.g = 50; text_color.b = 50; text_color.r = 150; text_color.g = 50; text_color.b = 50;
} }
write_text (10,skipper+25+(sira*10),prefs[q]); // write_text (10,skipper+25+(sira*10),prefs[q]); //
...@@ -181,7 +196,11 @@ int prefz (int parametre) { ...@@ -181,7 +196,11 @@ int prefz (int parametre) {
write_text (25,6,msg); // write_text (25,6,msg); //
write_text (25,240,msg_status); // write_text (25,240,msg_status); //
SDL_BlitSurface (tmpSDLScreen,NULL,display,NULL); SDL_BlitSurface (tmpSDLScreen,NULL,display,NULL);
#ifdef TOUCHUI
SDL_TUI_UpdateAll();
#endif
SDL_Flip(display); SDL_Flip(display);
} //while done } //while done
/* /*
......
#include "SDL.h" #include "SDL.h"
#include "gp2x.h"
#include <stdlib.h> #include <stdlib.h>
#include "gp2x-cpuctrl/cpuctrl.h"
#ifdef TOUCHUI
#include <SDL_TouchUI.h>
#endif
extern void write_text(int x, int y, char* txt); extern void write_text(int x, int y, char* txt);
extern void blit_image(SDL_Surface* img, int x, int y); extern void blit_image(SDL_Surface* img, int x, int y);
...@@ -22,7 +24,7 @@ int tweakz (int parametre) { ...@@ -22,7 +24,7 @@ int tweakz (int parametre) {
int kleft = 0; int kleft = 0;
int kright = 0; int kright = 0;
int kb = 0; int kb = 0;
int seciliolan = 0; int menuSelection = 0;
int q; int q;
char* tweaks[] = {"CPU Mhz","tRC","tRAS","tWR","tMRD","tRFC","tRP","tRCD","PLL","Timing","Default (200mhz)","Default (266mhz)","Evil Dragon (266mhz)"}; char* tweaks[] = {"CPU Mhz","tRC","tRAS","tWR","tMRD","tRFC","tRP","tRCD","PLL","Timing","Default (200mhz)","Default (266mhz)","Evil Dragon (266mhz)"};
...@@ -33,6 +35,10 @@ int tweakz (int parametre) { ...@@ -33,6 +35,10 @@ int tweakz (int parametre) {
char *tmp; char *tmp;
tmp=(char*)malloc(5); tmp=(char*)malloc(5);
if (display == NULL) {
gui_init();
}
#ifdef GP2X #ifdef GP2X
unsigned sysfreq=0; unsigned sysfreq=0;
int cpufreq; int cpufreq;
...@@ -52,22 +58,27 @@ int tweakz (int parametre) { ...@@ -52,22 +58,27 @@ int tweakz (int parametre) {
while (!tweakloopdone) { while (!tweakloopdone) {
while (SDL_PollEvent(&event)) { while (SDL_PollEvent(&event)) {
#ifdef TOUCHUI
SDL_TUI_HandleEvent(&event);
#endif
if (event.type == SDL_QUIT) { tweakloopdone = 1; } if (event.type == SDL_QUIT) { tweakloopdone = 1; }
if (event.type == SDL_JOYBUTTONDOWN) { if (event.type == SDL_JOYBUTTONDOWN) {
switch (event.jbutton.button) { switch (event.jbutton.button) {
case GP2X_BUTTON_UP: seciliolan--; break; #if 0
case GP2X_BUTTON_DOWN: seciliolan++; break; case GP2X_BUTTON_UP: menuSelection--; break;
case GP2X_BUTTON_DOWN: menuSelection++; break;
case GP2X_BUTTON_LEFT: kleft = 1; break; case GP2X_BUTTON_LEFT: kleft = 1; break;
case GP2X_BUTTON_RIGHT: kright = 1; break; case GP2X_BUTTON_RIGHT: kright = 1; break;
case GP2X_BUTTON_SELECT: tweakloopdone = 1; break; case GP2X_BUTTON_SELECT: tweakloopdone = 1; break;
case GP2X_BUTTON_B: kb =1; break; case GP2X_BUTTON_B: kb =1; break;
#endif
} }
} }
if (event.type == SDL_KEYDOWN) { if (event.type == SDL_KEYDOWN) {
switch (event.key.keysym.sym) { switch (event.key.keysym.sym) {
case SDLK_ESCAPE: tweakloopdone = 1; break; case SDLK_ESCAPE: tweakloopdone = 1; break;
case SDLK_UP: seciliolan--; break; case SDLK_UP: menuSelection--; break;
case SDLK_DOWN: seciliolan++; break; case SDLK_DOWN: menuSelection++; break;
case SDLK_LEFT: kleft = 1; break; case SDLK_LEFT: kleft = 1; break;
case SDLK_RIGHT: kright = 1; break; case SDLK_RIGHT: kright = 1; break;
case SDLK_b: kb = 1; break; case SDLK_b: kb = 1; break;
...@@ -76,16 +87,17 @@ int tweakz (int parametre) { ...@@ -76,16 +87,17 @@ int tweakz (int parametre) {
} }
} }
if (kb == 1) { if (kb == 1) {
if (seciliolan == 10) { if (menuSelection == 10) {
for (q=0; q<10;q++) { defaults[q] = def_slow_tweak[q]; } for (q=0; q<10;q++) { defaults[q] = def_slow_tweak[q]; }
} }
if (seciliolan == 11) { if (menuSelection == 11) {
for (q=0; q<10;q++) { defaults[q] = def_fast_tweak[q]; } for (q=0; q<10;q++) { defaults[q] = def_fast_tweak[q]; }
} }
if (seciliolan == 12) { if (menuSelection == 12) {
for (q=0; q<10;q++) { defaults[q] = evil_tweak[q]; } for (q=0; q<10;q++) { defaults[q] = evil_tweak[q]; }
} }
if (seciliolan < 10) { if (menuSelection < 10) {
#if 0
//apply //apply
//printf("FLCK: %d",0); set_CAS(0); //printf("FLCK: %d",0); set_CAS(0);
printf("FLCK: %d",defaults[0]); set_FCLK(defaults[0]); printf("FLCK: %d",defaults[0]); set_FCLK(defaults[0]);
...@@ -101,16 +113,17 @@ int tweakz (int parametre) { ...@@ -101,16 +113,17 @@ int tweakz (int parametre) {
} else { } else {
printf("ULCD: %d",defaults[9]); set_add_ULCDCLK(defaults[9]-1); printf("ULCD: %d",defaults[9]); set_add_ULCDCLK(defaults[9]-1);
} }
#endif
tweakloopdone = 1; tweakloopdone = 1;
} }
kb = 0; kb = 0;
} }
if (kleft == 1) { if (kleft == 1) {
if (seciliolan < 10) { defaults[seciliolan]--; } if (menuSelection < 10) { defaults[menuSelection]--; }
kleft = 0; kleft = 0;
} }
if (kright == 1) { if (kright == 1) {
if (seciliolan < 10) { defaults[seciliolan]++; } if (menuSelection < 10) { defaults[menuSelection]++; }
kright = 0; kright = 0;
} }
...@@ -135,8 +148,8 @@ int tweakz (int parametre) { ...@@ -135,8 +148,8 @@ int tweakz (int parametre) {
if (defaults[7] == 0) defaults[7] = 16; //trcd if (defaults[7] == 0) defaults[7] = 16; //trcd
if (defaults[8] == 11) defaults[7] = -6; //timing if (defaults[8] == 11) defaults[7] = -6; //timing
if (seciliolan < 0) { seciliolan = 12; } if (menuSelection < 0) { menuSelection = 12; }
if (seciliolan > 12) { seciliolan = 0; } if (menuSelection > 12) { menuSelection = 0; }
// background // background
SDL_BlitSurface (pMenu_Surface,NULL,tmpSDLScreen,NULL); SDL_BlitSurface (pMenu_Surface,NULL,tmpSDLScreen,NULL);
...@@ -146,7 +159,7 @@ int tweakz (int parametre) { ...@@ -146,7 +159,7 @@ int tweakz (int parametre) {
int skipper = 0; int skipper = 0;
for (q=0; q<13; q++) { for (q=0; q<13; q++) {
if (q == 10) { skipper = 30; } if (q == 10) { skipper = 30; }
if (seciliolan == q) { if (menuSelection == q) {
text_color.r = 255; text_color.g = 100; text_color.b = 100; text_color.r = 255; text_color.g = 100; text_color.b = 100;
} }
write_text (10,skipper+25+(sira*10),tweaks[q]); // write_text (10,skipper+25+(sira*10),tweaks[q]); //
...@@ -162,7 +175,7 @@ int tweakz (int parametre) { ...@@ -162,7 +175,7 @@ int tweakz (int parametre) {
} }
write_text (100,skipper+25+(sira*10),tmp); write_text (100,skipper+25+(sira*10),tmp);
} }
if (seciliolan == q) { if (menuSelection == q) {
text_color.r = 0; text_color.g = 0; text_color.b = 0; text_color.r = 0; text_color.g = 0; text_color.b = 0;
} }
sira++; sira++;
...@@ -170,7 +183,11 @@ int tweakz (int parametre) { ...@@ -170,7 +183,11 @@ int tweakz (int parametre) {
write_text (25,3,msg); write_text (25,3,msg);
write_text (15,228,msg_status); write_text (15,228,msg_status);
SDL_BlitSurface (tmpSDLScreen,NULL,display,NULL); SDL_BlitSurface (tmpSDLScreen,NULL,display,NULL);
#ifdef TOUCHUI
SDL_TUI_UpdateAll();
#endif
SDL_Flip(display); SDL_Flip(display);
} //while done } //while done
......
#include <SDL.h> #include <SDL.h>
#include "gp2x.h"
#include "volumecontrol.h" #include "volumecontrol.h"
......
/* src/sysconfig.h.in. Generated from configure.in by autoheader. */ /* src/sysconfig.h.in. Generated from configure.in by autoheader. */
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* CPU is 64bit */
#undef CPU_64_BIT
/* we want ecs_denise */ /* we want ecs_denise */
#undef ECS_DENISE #undef ECS_DENISE
...@@ -165,7 +171,7 @@ ...@@ -165,7 +171,7 @@
/* Define to 1 if you have the `strstr' function. */ /* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR #undef HAVE_STRSTR
/* Define to 1 if `st_blocks' is member of `struct stat'. */ /* Define to 1 if `st_blocks' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLOCKS #undef HAVE_STRUCT_STAT_ST_BLOCKS
/* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use /* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use
...@@ -300,6 +306,9 @@ ...@@ -300,6 +306,9 @@
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME #undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
...@@ -371,29 +380,62 @@ ...@@ -371,29 +380,62 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */ /* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME #undef TM_IN_SYS_TIME
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Version number of package */ /* Version number of package */
#undef VERSION #undef VERSION
/* Define to 1 if your processor stores words with the most significant byte /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
first (like Motorola and SPARC, unlike Intel and VAX). */ significant byte first (like Motorola and SPARC, unlike Intel). */
#undef WORDS_BIGENDIAN #if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif
/* Define to 1 if the X Window System is missing or not being used. */ /* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING #undef X_DISPLAY_MISSING
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Number of bits in a file offset, on hosts where this is settable. */ /* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS #undef _FILE_OFFSET_BITS
/* Define for large files, on AIX-style hosts. */ /* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES #undef _LARGE_FILES
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
#undef const #undef const
......
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