Misc fixes here and there

This commit is contained in:
simon.kagstrom 2009-01-04 14:37:07 +00:00
parent 0f170fd30c
commit b96da79408
7 changed files with 21 additions and 25 deletions

View File

@ -25,7 +25,7 @@ INCLUDES :=
# options for code generation # options for code generation
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE) -I$(DEVKITPRO)/SDL/include -U__unix -DHAVE_SDL CFLAGS = -g -Wall $(MACHDEP) $(INCLUDE) -I$(DEVKITPRO)/SDL/include -U__unix -DHAVE_SDL
CXXFLAGS = $(CFLAGS) CXXFLAGS = $(CFLAGS)
LDFLAGS = -L$(DEVKITPRO)/SDL/lib -g $(MACHDEP) -Wl,-Map,$(notdir $@).map LDFLAGS = -L$(DEVKITPRO)/SDL/lib -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
@ -104,7 +104,8 @@ $(BUILD):
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
clean: clean:
@echo clean ... @echo clean ...
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol Src/sysconfig.h Frodo FrodoPC \
FrodoSC
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
run: run:

View File

@ -13,11 +13,10 @@
#if defined(GEKKO) #if defined(GEKKO)
#include <wiiuse/wpad.h> #include <wiiuse/wpad.h>
#define FONT_PATH "/apps/frodo/FreeMono.ttf" #define FONT_PATH "/apps/frodo/FreeMono.ttf"
#define MS_PER_FRAME 30
#else #else
#define FONT_PATH "FreeMono.ttf" #define FONT_PATH "FreeMono.ttf"
#define MS_PER_FRAME 20
#endif #endif
#define MS_PER_FRAME 40
static struct timeval tv_start; static struct timeval tv_start;
static int MENU_SIZE_X, MENU_SIZE_Y; static int MENU_SIZE_X, MENU_SIZE_Y;
@ -217,19 +216,17 @@ void C64::bind_key(Prefs *np)
menu_init(&bind_key_menu, this->menu_font, bind_key_messages, menu_init(&bind_key_menu, this->menu_font, bind_key_messages,
0, 0, MENU_SIZE_X, MENU_SIZE_Y); 0, 0, MENU_SIZE_X, MENU_SIZE_Y);
menu_init(&key_menu, this->menu_font, keys,
0, 0, MENU_SIZE_X, MENU_SIZE_Y);
int opt = menu_select(real_screen, &bind_key_menu, ~0, NULL); int opt = menu_select(real_screen, &bind_key_menu, ~0, NULL);
if (opt >= 0) if (opt >= 0)
{ {
menu_init(&key_menu, this->menu_font, keys,
0, 0, MENU_SIZE_X, MENU_SIZE_Y);
int key = menu_select(real_screen, &key_menu, ~0, NULL); int key = menu_select(real_screen, &key_menu, ~0, NULL);
#if defined(GEKKO)
np->JoystickKeyBinding[opt] = kcs[key]; np->JoystickKeyBinding[opt] = kcs[key];
#endif menu_fini(&key_menu);
} }
menu_fini(&bind_key_menu); menu_fini(&bind_key_menu);
menu_fini(&key_menu);
} }
void C64::display_options(Prefs *np) void C64::display_options(Prefs *np)
@ -343,12 +340,6 @@ void C64::VBlank(bool draw_frame)
// Poll joysticks // Poll joysticks
TheCIA1->Joystick1 = poll_joystick(0); TheCIA1->Joystick1 = poll_joystick(0);
TheCIA1->Joystick2 = poll_joystick(1); TheCIA1->Joystick2 = poll_joystick(1);
if (ThePrefs.JoystickSwap) {
uint8 tmp = TheCIA1->Joystick1;
TheCIA1->Joystick1 = TheCIA1->Joystick2;
TheCIA1->Joystick2 = tmp;
}
// Count TOD clocks // Count TOD clocks
TheCIA1->CountTOD(); TheCIA1->CountTOD();
@ -403,10 +394,6 @@ void C64::VBlank(bool draw_frame)
this->display_options(np); this->display_options(np);
break; break;
case 5: /* Swap joysticks */ case 5: /* Swap joysticks */
if (submenus[0] == 0)
np->JoystickSwap = false;
else
np->JoystickSwap = true;
break; break;
case 7: /* Save / load game */ case 7: /* Save / load game */
this->save_load_state(np); this->save_load_state(np);
@ -418,6 +405,10 @@ void C64::VBlank(bool draw_frame)
default: default:
break; break;
} }
if (submenus[0] == 0)
np->JoystickSwap = false;
else
np->JoystickSwap = true;
this->NewPrefs(np); this->NewPrefs(np);
ThePrefs = *np; ThePrefs = *np;
@ -480,12 +471,16 @@ void C64::open_close_joysticks(bool oldjoy1, bool oldjoy2, bool newjoy1, bool ne
uint8 C64::poll_joystick(int port) uint8 C64::poll_joystick(int port)
{ {
#ifdef GEKKO #ifdef GEKKO
int controller = port;
Uint32 held; Uint32 held;
uint8 j = 0xff; uint8 j = 0xff;
if (ThePrefs.JoystickSwap)
controller = !port;
WPAD_ScanPads(); WPAD_ScanPads();
held = WPAD_ButtonsHeld(port); held = WPAD_ButtonsHeld(controller);
if (held & WPAD_BUTTON_UP) if (held & WPAD_BUTTON_UP)
j &= 0xfb; // Left j &= 0xfb; // Left
if (held & WPAD_BUTTON_DOWN) if (held & WPAD_BUTTON_DOWN)

View File

@ -206,7 +206,7 @@ void C64Display::Update(void)
} }
else if (ThePrefs.DisplayOption == 1) { else if (ThePrefs.DisplayOption == 1) {
/* Center, double size */ /* Center, double size */
srcrect = (SDL_Rect){28, 14, FULL_DISPLAY_X / 2, FULL_DISPLAY_Y / 2}; srcrect = (SDL_Rect){32, 14, FULL_DISPLAY_X / 2, FULL_DISPLAY_Y / 2};
dstrect = (SDL_Rect){0, 0, FULL_DISPLAY_X, FULL_DISPLAY_Y}; dstrect = (SDL_Rect){0, 0, FULL_DISPLAY_X, FULL_DISPLAY_Y};
} }
else { else {

View File

@ -97,7 +97,7 @@ CIA_SC.o: CIA_SC.cpp CIA.h CPUC64.h CPU1541.h VIC.h Prefs.h
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.
main.o: sysdeps.h sysconfig.h main.h C64.h Display.h Prefs.h SAM.h main.o: sysdeps.h sysconfig.h main.h C64.h Display.h Prefs.h SAM.h main_x.i
Display.o: sysdeps.h sysconfig.h Display.h main.h Prefs.h Display_SDL.i Display.o: sysdeps.h sysconfig.h Display.h main.h Prefs.h Display_SDL.i
Prefs.o: sysdeps.h sysconfig.h Prefs.h Display.h C64.h main.h Prefs.o: sysdeps.h sysconfig.h Prefs.h Display.h C64.h main.h
SID.o: sysdeps.h sysconfig.h SID.h Prefs.h SID_SDL.i SID.o: sysdeps.h sysconfig.h SID.h Prefs.h SID_SDL.i

View File

@ -26,7 +26,7 @@ static uint8_t char_to_kc[] =
/* F1 */ /* F1 */
/* F7 */ /* F7 */
['\n'] = MATRIX(0, 1), ['\n'] = MATRIX(0, 1),
['\008'] = MATRIX(0, 0), [8] = MATRIX(0, 0),
['E'] = MATRIX(1, 6), ['E'] = MATRIX(1, 6),
['S'] = MATRIX(1, 5), ['S'] = MATRIX(1, 5),

View File

@ -31,7 +31,7 @@ int main(int argc, char **argv)
return 0; return 0;
fflush(stdout); fflush(stdout);
// Init SDL // Init SDL
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) < 0) {
fprintf(stderr, "Couldn't initialize SDL (%s)\n", SDL_GetError()); fprintf(stderr, "Couldn't initialize SDL (%s)\n", SDL_GetError());
return 0; return 0;
} }

View File

@ -263,7 +263,7 @@ static uint32_t wait_key_press(void)
Uint32 remote_keys; Uint32 remote_keys;
WPAD_ScanPads(); WPAD_ScanPads();
remote_keys = WPAD_ButtonsDown(WPAD_CHAN_0); remote_keys = WPAD_ButtonsDown(WPAD_CHAN_0) | WPAD_ButtonsDown(WPAD_CHAN_1);
if (remote_keys & WPAD_BUTTON_DOWN) if (remote_keys & WPAD_BUTTON_DOWN)
keys |= KEY_RIGHT; keys |= KEY_RIGHT;