mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-21 19:09:23 +01:00
Version 2.2
Solved issues # 20, 21,23, 25, 29. Added the possibility to show a smaller screen (so also the borders are shown), the preferences are saved manually and not automatically on exit, when a gameshot is saved also some preferences (key bindings, game name, 1541 emulation, screen dimension) related to the game are saved.
This commit is contained in:
parent
17d70cc3ef
commit
8085fee39c
324
Makefile.wii
324
Makefile.wii
@ -1,161 +1,163 @@
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# Clear the implicit built in rules
|
# Clear the implicit built in rules
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
ifeq ($(strip $(DEVKITPPC)),)
|
ifeq ($(strip $(DEVKITPPC)),)
|
||||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(DEVKITPPC)/wii_rules
|
include $(DEVKITPPC)/wii_rules
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# TARGET is the name of the output
|
# TARGET is the name of the output
|
||||||
# BUILD is the directory where object files & intermediate files will be placed
|
# BUILD is the directory where object files & intermediate files will be placed
|
||||||
# SOURCES is a list of directories containing source code
|
# SOURCES is a list of directories containing source code
|
||||||
# INCLUDES is a list of directories containing extra header files
|
# INCLUDES is a list of directories containing extra header files
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
TARGET := frodo
|
TARGET := frodo
|
||||||
BUILD := build
|
BUILD := build
|
||||||
SOURCES := Src
|
SOURCES := Src
|
||||||
DATA :=
|
DATA :=
|
||||||
INCLUDES :=
|
INCLUDES :=
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# options for code generation
|
# options for code generation
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|
||||||
PCFLAGS = -DPRECISE_CPU_CYCLES=1 -DPRECISE_CIA_CYCLES=1 -DPC_IS_POINTER=0
|
PCFLAGS = -DPRECISE_CPU_CYCLES=1 -DPRECISE_CIA_CYCLES=1 -DPC_IS_POINTER=0 -DWII_PORT
|
||||||
SCFLAGS = $(PCFLAGS) -DFRODO_SC
|
SCFLAGS = $(PCFLAGS) -DFRODO_SC
|
||||||
CFLAGS = -O3 -g -Wall $(MACHDEP) $(INCLUDE) -U__unix -DHAVE_SDL $(SCFLAGS) -I$(LIBOGC_INC)/SDL -I$(PWD)/Src/
|
CFLAGS = -O3 -g -Wall $(MACHDEP) $(INCLUDE) -DHAVE_SDL $(SCFLAGS) -I$(LIBOGC_INC)/SDL
|
||||||
CXXFLAGS = $(CFLAGS)
|
CXXFLAGS = $(CFLAGS)
|
||||||
|
|
||||||
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
|
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# any extra libraries we wish to link with the project
|
# any extra libraries we wish to link with the project
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
LIBS := -lSDL_ttf -lSDL_image -lpng -ljpeg -lz -lSDL -lfreetype -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard
|
LIBS := -lSDL_ttf -lSDL_image -lpng -ljpeg -lz -lSDL -lfreetype -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# list of directories containing libraries, this must be the top level containing
|
# list of directories containing libraries, this must be the top level containing
|
||||||
# include and lib
|
# include and lib
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
LIBDIRS :=
|
LIBDIRS := $(PORTLIBS)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# no real need to edit anything past this point unless you need to add additional
|
# no real need to edit anything past this point unless you need to add additional
|
||||||
# rules for different file extensions
|
# rules for different file extensions
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|
||||||
export OUTPUT := $(CURDIR)/$(TARGET)
|
export OUTPUT := $(CURDIR)/$(TARGET)
|
||||||
|
|
||||||
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
||||||
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
||||||
|
|
||||||
export DEPSDIR := $(CURDIR)/$(BUILD)
|
export DEPSDIR := $(CURDIR)/$(BUILD)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# automatically build a list of object files for our project
|
# automatically build a list of object files for our project
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
CFILES := gcaudio.c d64-read.c gui/menu_messages.c
|
CFILES := gcaudio.c d64-read.c gui/menu_messages.c
|
||||||
CPPFILES := Display.cpp main.cpp Prefs.cpp SID.cpp REU.cpp IEC.cpp 1541fs.cpp \
|
CPPFILES := Display.cpp main.cpp Prefs.cpp SID.cpp REU.cpp IEC.cpp 1541fs.cpp \
|
||||||
1541d64.cpp 1541t64.cpp 1541job.cpp C64_SC.cpp CPUC64_SC.cpp VIC_SC.cpp \
|
1541d64.cpp 1541t64.cpp 1541job.cpp C64_SC.cpp CPUC64_SC.cpp VIC_SC.cpp \
|
||||||
CIA_SC.cpp CPU1541_SC.cpp CPU_common.cpp \
|
CIA_SC.cpp CPU1541_SC.cpp CPU_common.cpp \
|
||||||
Network.cpp gui/dialogue_box.cpp gui/widget.cpp utils.cpp \
|
Network.cpp gui/dialogue_box.cpp gui/widget.cpp utils.cpp \
|
||||||
gui/game_info.cpp gui/status_bar.cpp gui/gui.cpp gui/listener.cpp \
|
gui/game_info.cpp gui/status_bar.cpp gui/gui.cpp gui/listener.cpp \
|
||||||
timer.cpp utils.cpp gui/virtual_keyboard.cpp gui/menu.cpp \
|
timer.cpp utils.cpp gui/virtual_keyboard.cpp gui/menu.cpp \
|
||||||
gui/file_browser.cpp data_store.cpp gui/network_server_messages.cpp
|
gui/file_browser.cpp data_store.cpp gui/network_server_messages.cpp
|
||||||
|
|
||||||
sFILES :=
|
sFILES :=
|
||||||
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
|
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
|
||||||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# use CXX for linking C++ projects, CC for standard C
|
# use CXX for linking C++ projects, CC for standard C
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
ifeq ($(strip $(CPPFILES)),)
|
ifeq ($(strip $(CPPFILES)),)
|
||||||
export LD := $(CC)
|
export LD := $(CC)
|
||||||
else
|
else
|
||||||
export LD := $(CXX)
|
export LD := $(CXX)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export OFILES := $(addsuffix .o,$(BINFILES)) \
|
export OFILES := $(addsuffix .o,$(BINFILES)) \
|
||||||
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
||||||
$(sFILES:.s=.o) $(SFILES:.S=.o)
|
$(sFILES:.s=.o) $(SFILES:.S=.o)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# build a list of include paths
|
# build a list of include paths
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
|
export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
|
||||||
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
|
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
|
||||||
-I$(CURDIR)/$(BUILD) \
|
-I$(CURDIR)/$(BUILD) \
|
||||||
-I$(LIBOGC_INC)
|
-I$(LIBOGC_INC) \
|
||||||
|
-I$(CURDIR)/Src \
|
||||||
#---------------------------------------------------------------------------------
|
-I$(PORTLIBS)/include
|
||||||
# build a list of library paths
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
|
# build a list of library paths
|
||||||
-L$(LIBOGC_LIB) -L/opt/devkitpro/libogc/lib
|
#---------------------------------------------------------------------------------
|
||||||
|
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
|
||||||
export OUTPUT := $(CURDIR)/$(TARGET)
|
-L$(LIBOGC_LIB) -L/opt/devkitpro/libogc/lib
|
||||||
.PHONY: $(BUILD) clean
|
|
||||||
|
export OUTPUT := $(CURDIR)/$(TARGET)
|
||||||
#---------------------------------------------------------------------------------
|
.PHONY: $(BUILD) clean
|
||||||
$(BUILD):
|
|
||||||
@[ -d $@ ] || mkdir -p $@ $@/gui
|
#---------------------------------------------------------------------------------
|
||||||
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.wii
|
$(BUILD):
|
||||||
|
@[ -d $@ ] || mkdir -p $@ $@/gui
|
||||||
#---------------------------------------------------------------------------------
|
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.wii
|
||||||
clean:
|
|
||||||
@echo clean ...
|
#---------------------------------------------------------------------------------
|
||||||
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol Src/*.o \
|
clean:
|
||||||
FrodoSC FrodoPC dist
|
@echo clean ...
|
||||||
|
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol Src/*.o \
|
||||||
dist: $(BUILD)
|
FrodoSC FrodoPC dist
|
||||||
rm -rf $@
|
|
||||||
install -d $@/apps/frodo
|
dist: $(BUILD)
|
||||||
install -d $@/frodo/images
|
rm -rf $@
|
||||||
install -d $@/frodo/saves
|
install -d $@/apps/frodo
|
||||||
install -d $@/frodo/metadata
|
install -d $@/frodo/images
|
||||||
install -d $@/frodo/tmp
|
install -d $@/frodo/saves
|
||||||
echo "a" > $@/frodo/tmp/dummy
|
install -d $@/frodo/metadata
|
||||||
touch $@/apps/frodo/frodorc
|
install -d $@/frodo/tmp
|
||||||
cp $(TARGET).dol $@/apps/frodo/boot.dol
|
echo "a" > $@/frodo/tmp/dummy
|
||||||
cp -rap themes $@/frodo/themes
|
touch $@/apps/frodo/frodorc
|
||||||
cp meta.xml $@/apps/frodo/
|
cp $(TARGET).dol $@/apps/frodo/boot.dol
|
||||||
cp icon.png $@/apps/frodo/
|
cp -rap themes $@/frodo/themes
|
||||||
find $@ -name ".svn" | xargs rm -rf
|
cp meta.xml $@/apps/frodo/
|
||||||
cd $@ && tar -czf ../c64-network.org-wii-bin.tar.gz *
|
cp icon.png $@/apps/frodo/
|
||||||
|
find $@ -name ".svn" | xargs rm -rf
|
||||||
#---------------------------------------------------------------------------------
|
cd $@ && tar -czf ../c64-network.org-wii-bin.tar.gz *
|
||||||
run:
|
|
||||||
wiiload $(TARGET).dol
|
#---------------------------------------------------------------------------------
|
||||||
|
run:
|
||||||
|
wiiload $(TARGET).dol
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
else
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
DEPENDS := $(OFILES:.o=.d)
|
else
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
DEPENDS := $(OFILES:.o=.d)
|
||||||
# main targets
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
$(OUTPUT).dol: $(OUTPUT).elf
|
# main targets
|
||||||
$(OUTPUT).elf: $(OFILES)
|
#---------------------------------------------------------------------------------
|
||||||
|
$(OUTPUT).dol: $(OUTPUT).elf
|
||||||
#---------------------------------------------------------------------------------
|
$(OUTPUT).elf: $(OFILES)
|
||||||
# This rule links in binary data with the .jpg extension
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
%.jpg.o : %.jpg
|
# This rule links in binary data with the .jpg extension
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
@echo $(notdir $<)
|
%.jpg.o : %.jpg
|
||||||
$(bin2o)
|
#---------------------------------------------------------------------------------
|
||||||
|
@echo $(notdir $<)
|
||||||
-include $(DEPENDS)
|
$(bin2o)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
-include $(DEPENDS)
|
||||||
endif
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
endif
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
1415
Src/C64.cpp
1415
Src/C64.cpp
File diff suppressed because it is too large
Load Diff
@ -303,8 +303,8 @@ void C64::VBlank(bool draw_frame)
|
|||||||
|
|
||||||
Gui::gui->runLogic();
|
Gui::gui->runLogic();
|
||||||
|
|
||||||
if (this->quit_thyself)
|
//if (this->quit_thyself)
|
||||||
ThePrefs.Save(ThePrefs.PrefsPath);
|
// ThePrefs.Save(ThePrefs.PrefsPath);
|
||||||
#if defined(GEKKO)
|
#if defined(GEKKO)
|
||||||
if (this->quit_thyself && Network::networking_started == true)
|
if (this->quit_thyself && Network::networking_started == true)
|
||||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||||
|
2132
Src/Display.cpp
2132
Src/Display.cpp
File diff suppressed because it is too large
Load Diff
1310
Src/Prefs.cpp
1310
Src/Prefs.cpp
File diff suppressed because it is too large
Load Diff
379
Src/Prefs.h
379
Src/Prefs.h
@ -1,189 +1,190 @@
|
|||||||
/*
|
/*
|
||||||
* Prefs.h - Global preferences
|
* Prefs.h - Global preferences
|
||||||
*
|
*
|
||||||
* Frodo (C) 1994-1997,2002-2005 Christian Bauer
|
* Frodo (C) 1994-1997,2002-2005 Christian Bauer
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PREFS_H
|
#ifndef _PREFS_H
|
||||||
#define _PREFS_H
|
#define _PREFS_H
|
||||||
|
|
||||||
#define SPEED_95 30
|
#define SPEED_95 30
|
||||||
#define SPEED_100 25
|
#define SPEED_100 25
|
||||||
#define SPEED_110 18
|
#define SPEED_110 18
|
||||||
|
|
||||||
#define MAX_JOYSTICK_AXES 16
|
#define MAX_JOYSTICK_AXES 16
|
||||||
#define MAX_JOYSTICK_BUTTONS 32
|
#define MAX_JOYSTICK_BUTTONS 32
|
||||||
#define MAX_JOYSTICK_HATS 8
|
#define MAX_JOYSTICK_HATS 8
|
||||||
|
|
||||||
// SID types
|
// SID types
|
||||||
enum {
|
enum {
|
||||||
SIDTYPE_NONE, // SID emulation off
|
SIDTYPE_NONE, // SID emulation off
|
||||||
SIDTYPE_DIGITAL, // Digital SID emulation
|
SIDTYPE_DIGITAL, // Digital SID emulation
|
||||||
SIDTYPE_SIDCARD // SID card
|
SIDTYPE_SIDCARD // SID card
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// REU sizes
|
// REU sizes
|
||||||
enum {
|
enum {
|
||||||
REU_NONE, // No REU
|
REU_NONE, // No REU
|
||||||
REU_128K, // 128K
|
REU_128K, // 128K
|
||||||
REU_256K, // 256K
|
REU_256K, // 256K
|
||||||
REU_512K // 512K
|
REU_512K // 512K
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Display types
|
// Display types
|
||||||
enum {
|
enum {
|
||||||
DISPTYPE_WINDOW, // Window
|
DISPTYPE_WINDOW, // Window
|
||||||
DISPTYPE_SCREEN // Fullscreen
|
DISPTYPE_SCREEN // Fullscreen
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
/* ASCII values before these */
|
/* ASCII values before these */
|
||||||
JOY_NONE = 0,
|
JOY_NONE = 0,
|
||||||
JOY_HORIZ = 256,
|
JOY_HORIZ = 256,
|
||||||
JOY_VERT = 258,
|
JOY_VERT = 258,
|
||||||
JOY_FIRE = 259,
|
JOY_FIRE = 259,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
HAT_PLAIN = 0,
|
HAT_PLAIN = 0,
|
||||||
HAT_ROTATED_90 = 1,
|
HAT_ROTATED_90 = 1,
|
||||||
HAT_ROTATED_180 = 2,
|
HAT_ROTATED_180 = 2,
|
||||||
HAT_ROTATED_270 = 2,
|
HAT_ROTATED_270 = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Key bindings (WII)
|
// Key bindings (WII)
|
||||||
enum {
|
enum {
|
||||||
WIIMOTE_UP,
|
WIIMOTE_UP,
|
||||||
WIIMOTE_DOWN,
|
WIIMOTE_DOWN,
|
||||||
WIIMOTE_LEFT,
|
WIIMOTE_LEFT,
|
||||||
WIIMOTE_RIGHT,
|
WIIMOTE_RIGHT,
|
||||||
WIIMOTE_2,
|
WIIMOTE_2,
|
||||||
WIIMOTE_1,
|
WIIMOTE_1,
|
||||||
WIIMOTE_A,
|
WIIMOTE_A,
|
||||||
WIIMOTE_B,
|
WIIMOTE_B,
|
||||||
WIIMOTE_PLUS,
|
WIIMOTE_PLUS,
|
||||||
WIIMOTE_MINUS,
|
WIIMOTE_MINUS,
|
||||||
CLASSIC_UP,
|
CLASSIC_UP,
|
||||||
CLASSIC_DOWN,
|
CLASSIC_DOWN,
|
||||||
CLASSIC_LEFT,
|
CLASSIC_LEFT,
|
||||||
CLASSIC_RIGHT,
|
CLASSIC_RIGHT,
|
||||||
CLASSIC_A,
|
CLASSIC_A,
|
||||||
CLASSIC_B,
|
CLASSIC_B,
|
||||||
CLASSIC_X,
|
CLASSIC_X,
|
||||||
CLASSIC_Y,
|
CLASSIC_Y,
|
||||||
CLASSIC_L,
|
CLASSIC_L,
|
||||||
CLASSIC_R,
|
CLASSIC_R,
|
||||||
CLASSIC_ZR,
|
CLASSIC_ZR,
|
||||||
CLASSIC_ZL,
|
CLASSIC_ZL,
|
||||||
N_WIIMOTE_BINDINGS
|
N_WIIMOTE_BINDINGS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Preferences data
|
// Preferences data
|
||||||
class Prefs {
|
class Prefs {
|
||||||
public:
|
public:
|
||||||
Prefs();
|
Prefs();
|
||||||
bool ShowEditor(bool startup, char *prefs_name);
|
bool ShowEditor(bool startup, char *prefs_name);
|
||||||
void Check(void);
|
void Check(void);
|
||||||
void Load(const char *filename);
|
void Load(const char *filename);
|
||||||
bool Save(const char *filename);
|
bool Save(const char *filename);
|
||||||
|
bool Save_game(const char *filename);
|
||||||
bool operator==(const Prefs &rhs) const;
|
|
||||||
bool operator!=(const Prefs &rhs) const;
|
bool operator==(const Prefs &rhs) const;
|
||||||
|
bool operator!=(const Prefs &rhs) const;
|
||||||
void SetupJoystickDefaults();
|
|
||||||
|
void SetupJoystickDefaults();
|
||||||
char BasePath[256]; // Where theme data etc are found
|
|
||||||
char PrefsPath[256]; // Where the prefs will be stored
|
char BasePath[256]; // Where theme data etc are found
|
||||||
int NormalCycles; // Available CPU cycles in normal raster lines
|
char PrefsPath[256]; // Where the prefs will be stored
|
||||||
int BadLineCycles; // Available CPU cycles in Bad Lines
|
int NormalCycles; // Available CPU cycles in normal raster lines
|
||||||
int CIACycles; // CIA timer ticks per raster line
|
int BadLineCycles; // Available CPU cycles in Bad Lines
|
||||||
int FloppyCycles; // Available 1541 CPU cycles per line
|
int CIACycles; // CIA timer ticks per raster line
|
||||||
int SkipFrames; // Draw every n-th frame
|
int FloppyCycles; // Available 1541 CPU cycles per line
|
||||||
|
int SkipFrames; // Draw every n-th frame
|
||||||
char DrivePath[4][256]; // Path for drive 8..11
|
|
||||||
|
char DrivePath[4][256]; // Path for drive 8..11
|
||||||
char ViewPort[256]; // Size of the C64 screen to display (Win32)
|
|
||||||
char DisplayMode[256]; // Video mode to use for full screen (Win32)
|
char ViewPort[256]; // Size of the C64 screen to display (Win32)
|
||||||
|
char DisplayMode[256]; // Video mode to use for full screen (Win32)
|
||||||
int SIDType; // SID emulation type
|
|
||||||
int REUSize; // Size of REU
|
int SIDType; // SID emulation type
|
||||||
int DisplayType; // Display type (BeOS)
|
int REUSize; // Size of REU
|
||||||
int Joystick1Port; // Port that joystick 1 is connected to (0 = no joystick, all other values are system dependant)
|
int DisplayType; // Display type (BeOS)
|
||||||
int Joystick2Port; // Port that joystick 2 is connected to
|
int Joystick1Port; // Port that joystick 1 is connected to (0 = no joystick, all other values are system dependant)
|
||||||
int LatencyMin; // Min msecs ahead of sound buffer (Win32)
|
int Joystick2Port; // Port that joystick 2 is connected to
|
||||||
int LatencyMax; // Max msecs ahead of sound buffer (Win32)
|
int LatencyMin; // Min msecs ahead of sound buffer (Win32)
|
||||||
int LatencyAvg; // Averaging interval in msecs (Win32)
|
int LatencyMax; // Max msecs ahead of sound buffer (Win32)
|
||||||
int ScalingNumerator; // Window scaling numerator (Win32)
|
int LatencyAvg; // Averaging interval in msecs (Win32)
|
||||||
int ScalingDenominator; // Window scaling denominator (Win32)
|
int ScalingNumerator; // Window scaling numerator (Win32)
|
||||||
|
int ScalingDenominator; // Window scaling denominator (Win32)
|
||||||
bool SpritesOn; // Sprite display is on
|
|
||||||
bool SpriteCollisions; // Sprite collision detection is on
|
bool SpritesOn; // Sprite display is on
|
||||||
bool JoystickSwap; // Swap joysticks 1<->2
|
bool SpriteCollisions; // Sprite collision detection is on
|
||||||
bool LimitSpeed; // Limit speed to 100%
|
bool JoystickSwap; // Swap joysticks 1<->2
|
||||||
bool FastReset; // Skip RAM test on reset
|
bool LimitSpeed; // Limit speed to 100%
|
||||||
bool CIAIRQHack; // Write to CIA ICR clears IRQ
|
bool FastReset; // Skip RAM test on reset
|
||||||
bool MapSlash; // Map '/' in C64 filenames
|
bool CIAIRQHack; // Write to CIA ICR clears IRQ
|
||||||
bool Emul1541Proc; // Enable processor-level 1541 emulation
|
bool MapSlash; // Map '/' in C64 filenames
|
||||||
bool SIDFilters; // Emulate SID filters
|
bool Emul1541Proc; // Enable processor-level 1541 emulation
|
||||||
bool DoubleScan; // Double scan lines (BeOS, if DisplayType == DISPTYPE_SCREEN)
|
bool SIDFilters; // Emulate SID filters
|
||||||
bool JoystickGeekPort; // Enable GeekPort joystick adapter
|
bool DoubleScan; // Double scan lines (BeOS, if DisplayType == DISPTYPE_SCREEN)
|
||||||
bool HideCursor; // Hide mouse cursor when visible (Win32)
|
bool JoystickGeekPort; // Enable GeekPort joystick adapter
|
||||||
bool DirectSound; // Use direct sound (instead of wav) (Win32)
|
bool HideCursor; // Hide mouse cursor when visible (Win32)
|
||||||
bool ExclusiveSound; // Use exclusive mode with direct sound (Win32)
|
bool DirectSound; // Use direct sound (instead of wav) (Win32)
|
||||||
bool AutoPause; // Auto pause when not foreground app (Win32)
|
bool ExclusiveSound; // Use exclusive mode with direct sound (Win32)
|
||||||
bool PrefsAtStartup; // Show prefs dialog at startup (Win32)
|
bool AutoPause; // Auto pause when not foreground app (Win32)
|
||||||
bool SystemMemory; // Put view work surface in system mem (Win32)
|
bool PrefsAtStartup; // Show prefs dialog at startup (Win32)
|
||||||
bool AlwaysCopy; // Always use a work surface (Win32)
|
bool SystemMemory; // Put view work surface in system mem (Win32)
|
||||||
bool SystemKeys; // Enable system keys and menu keys (Win32)
|
bool AlwaysCopy; // Always use a work surface (Win32)
|
||||||
bool ShowLEDs; // Show LEDs (Win32)
|
bool SystemKeys; // Enable system keys and menu keys (Win32)
|
||||||
|
bool ShowLEDs; // Show LEDs (Win32)
|
||||||
uint32 MsPerFrame;
|
|
||||||
|
uint32 MsPerFrame;
|
||||||
int JoystickAxes[MAX_JOYSTICK_AXES];
|
|
||||||
int JoystickHats[MAX_JOYSTICK_HATS];
|
int JoystickAxes[MAX_JOYSTICK_AXES];
|
||||||
int JoystickButtons[MAX_JOYSTICK_BUTTONS];
|
int JoystickHats[MAX_JOYSTICK_HATS];
|
||||||
|
int JoystickButtons[MAX_JOYSTICK_BUTTONS];
|
||||||
int MenuJoystickHats[MAX_JOYSTICK_HATS];
|
|
||||||
int MenuJoystickButtons[MAX_JOYSTICK_BUTTONS];
|
int MenuJoystickHats[MAX_JOYSTICK_HATS];
|
||||||
|
int MenuJoystickButtons[MAX_JOYSTICK_BUTTONS];
|
||||||
char NetworkName[32];
|
|
||||||
char NetworkServer[64];
|
char NetworkName[32];
|
||||||
int NetworkRegion;
|
char NetworkServer[64];
|
||||||
int NetworkPort;
|
int NetworkRegion;
|
||||||
|
int NetworkPort;
|
||||||
int NetworkKey;
|
|
||||||
uint16 NetworkAvatar;
|
int NetworkKey;
|
||||||
char Theme[128];
|
uint16 NetworkAvatar;
|
||||||
|
char Theme[128];
|
||||||
bool CursorKeysForJoystick;
|
|
||||||
};
|
bool CursorKeysForJoystick;
|
||||||
|
};
|
||||||
|
|
||||||
// These are the active preferences
|
|
||||||
extern Prefs ThePrefs;
|
// These are the active preferences
|
||||||
|
extern Prefs ThePrefs;
|
||||||
// Theses are the preferences on disk
|
|
||||||
extern Prefs ThePrefsOnDisk;
|
// Theses are the preferences on disk
|
||||||
|
extern Prefs ThePrefsOnDisk;
|
||||||
// Theses are the default preferences
|
|
||||||
extern Prefs TheDefaultPrefs;
|
// Theses are the default preferences
|
||||||
|
extern Prefs TheDefaultPrefs;
|
||||||
#endif
|
|
||||||
|
#endif
|
||||||
|
@ -1,429 +1,429 @@
|
|||||||
#include "gui.hh"
|
#include "gui.hh"
|
||||||
#include "menu.hh"
|
#include "menu.hh"
|
||||||
#include "help_box.hh"
|
#include "help_box.hh"
|
||||||
#include "dialogue_box.hh"
|
#include "dialogue_box.hh"
|
||||||
#include "virtual_keyboard.hh"
|
#include "virtual_keyboard.hh"
|
||||||
|
|
||||||
class BindKeysMenu;
|
class BindKeysMenu;
|
||||||
|
|
||||||
class AnalogueBindListener : public DialogueListener
|
class AnalogueBindListener : public DialogueListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AnalogueBindListener(BindKeysMenu *menu)
|
AnalogueBindListener(BindKeysMenu *menu)
|
||||||
{
|
{
|
||||||
this->menu = menu;
|
this->menu = menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
void escapeCallback(DialogueBox *which, int selected)
|
void escapeCallback(DialogueBox *which, int selected)
|
||||||
{
|
{
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void selectCallback(DialogueBox *which, int selected);
|
void selectCallback(DialogueBox *which, int selected);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BindKeysMenu *menu;
|
BindKeysMenu *menu;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BindKeysView;
|
class BindKeysView;
|
||||||
class BindKeysMenu : public Menu, public KeyboardListener
|
class BindKeysMenu : public Menu, public KeyboardListener
|
||||||
{
|
{
|
||||||
/* This is a very popular class with many friends */
|
/* This is a very popular class with many friends */
|
||||||
friend class BindKeysView;
|
friend class BindKeysView;
|
||||||
friend class AnalogueBindListener;
|
friend class AnalogueBindListener;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BindKeysMenu(Font *font, HelpBox *help) : Menu(font)
|
BindKeysMenu(Font *font, HelpBox *help) : Menu(font)
|
||||||
{
|
{
|
||||||
this->help = help;
|
this->help = help;
|
||||||
memset(this->hm, 0, sizeof(this->hm));
|
memset(this->hm, 0, sizeof(this->hm));
|
||||||
this->setText(bind_key_menu_messages);
|
this->setText(bind_key_menu_messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
~BindKeysMenu()
|
~BindKeysMenu()
|
||||||
{
|
{
|
||||||
this->freeHelpMessages();
|
this->freeHelpMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void selectCallback(int which)
|
virtual void selectCallback(int which)
|
||||||
{
|
{
|
||||||
int *ck = NULL;
|
int *ck = NULL;
|
||||||
/* Either the virtual keyboard or the analogue menu */
|
/* Either the virtual keyboard or the analogue menu */
|
||||||
bool use_virtkbd = true;
|
bool use_virtkbd = true;
|
||||||
|
|
||||||
switch(which)
|
switch(which)
|
||||||
{
|
{
|
||||||
case 0: /* Wiimote */
|
case 0: /* Wiimote */
|
||||||
switch (this->p_submenus[0].sel)
|
switch (this->p_submenus[0].sel)
|
||||||
{
|
{
|
||||||
case 0: ck = &Gui::gui->np->JoystickButtons[0]; break;
|
case 0: ck = &Gui::gui->np->JoystickButtons[0]; break;
|
||||||
case 1: ck = &Gui::gui->np->JoystickButtons[1]; break;
|
case 1: ck = &Gui::gui->np->JoystickButtons[1]; break;
|
||||||
case 2: ck = &Gui::gui->np->JoystickButtons[2]; break;
|
case 2: ck = &Gui::gui->np->JoystickButtons[2]; break;
|
||||||
case 3: ck = &Gui::gui->np->JoystickButtons[3]; break;
|
case 3: ck = &Gui::gui->np->JoystickButtons[3]; break;
|
||||||
case 4: ck = &Gui::gui->np->JoystickButtons[5]; break;
|
case 4: ck = &Gui::gui->np->JoystickButtons[5]; break;
|
||||||
case 5: ck = &Gui::gui->np->JoystickButtons[4]; break;
|
case 5: ck = &Gui::gui->np->JoystickButtons[4]; break;
|
||||||
default:
|
default:
|
||||||
panic("Wiimote: impossible selection %d", this->p_submenus[0].sel); break;
|
panic("Wiimote: impossible selection %d", this->p_submenus[0].sel); break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: /* Nunchuk */
|
case 2: /* Nunchuk */
|
||||||
switch (this->p_submenus[1].sel)
|
switch (this->p_submenus[1].sel)
|
||||||
{
|
{
|
||||||
case 0: ck = &Gui::gui->np->JoystickButtons[7]; break;
|
case 0: ck = &Gui::gui->np->JoystickButtons[7]; break;
|
||||||
case 1: ck = &Gui::gui->np->JoystickButtons[8]; break;
|
case 1: ck = &Gui::gui->np->JoystickButtons[8]; break;
|
||||||
default:
|
default:
|
||||||
panic("Nunchuk: impossible selection %d", this->p_submenus[1].sel); break;
|
panic("Nunchuk: impossible selection %d", this->p_submenus[1].sel); break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: /* Classic */
|
case 4: /* Classic */
|
||||||
switch (this->p_submenus[2].sel)
|
switch (this->p_submenus[2].sel)
|
||||||
{
|
{
|
||||||
case 0: ck = &Gui::gui->np->JoystickButtons[9]; break;
|
case 0: ck = &Gui::gui->np->JoystickButtons[9]; break;
|
||||||
case 1: ck = &Gui::gui->np->JoystickButtons[10]; break;
|
case 1: ck = &Gui::gui->np->JoystickButtons[10]; break;
|
||||||
case 2: ck = &Gui::gui->np->JoystickButtons[11]; break;
|
case 2: ck = &Gui::gui->np->JoystickButtons[11]; break;
|
||||||
case 3: ck = &Gui::gui->np->JoystickButtons[12]; break;
|
case 3: ck = &Gui::gui->np->JoystickButtons[12]; break;
|
||||||
case 4: ck = &Gui::gui->np->JoystickButtons[13]; break;
|
case 4: ck = &Gui::gui->np->JoystickButtons[13]; break;
|
||||||
case 5: ck = &Gui::gui->np->JoystickButtons[14]; break;
|
case 5: ck = &Gui::gui->np->JoystickButtons[14]; break;
|
||||||
case 6: ck = &Gui::gui->np->JoystickButtons[15]; break;
|
case 6: ck = &Gui::gui->np->JoystickButtons[15]; break;
|
||||||
case 7: ck = &Gui::gui->np->JoystickButtons[16]; break;
|
case 7: ck = &Gui::gui->np->JoystickButtons[16]; break;
|
||||||
case 8: ck = &Gui::gui->np->JoystickButtons[18]; break;
|
case 8: ck = &Gui::gui->np->JoystickButtons[18]; break;
|
||||||
case 9: ck = &Gui::gui->np->JoystickButtons[17]; break;
|
case 9: ck = &Gui::gui->np->JoystickButtons[17]; break;
|
||||||
default:
|
default:
|
||||||
panic("Classic: impossible selection %d", this->p_submenus[2].sel); break;
|
panic("Classic: impossible selection %d", this->p_submenus[2].sel); break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
Gui::gui->np->SetupJoystickDefaults();
|
Gui::gui->np->SetupJoystickDefaults();
|
||||||
this->updateHelpMessages();
|
this->updateHelpMessages();
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
panic("Impossible menu option\n");
|
panic("Impossible menu option\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this->cur_key = ck;
|
this->cur_key = ck;
|
||||||
|
|
||||||
if (use_virtkbd)
|
if (use_virtkbd)
|
||||||
{
|
{
|
||||||
VirtualKeyboard::kbd->activate(false);
|
VirtualKeyboard::kbd->activate(false);
|
||||||
VirtualKeyboard::kbd->registerListener(this);
|
VirtualKeyboard::kbd->registerListener(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AnalogueBindListener *bl = new AnalogueBindListener(this);
|
AnalogueBindListener *bl = new AnalogueBindListener(this);
|
||||||
DialogueBox *dlg = new DialogueBox(select_analogue_dlg);
|
DialogueBox *dlg = new DialogueBox(select_analogue_dlg);
|
||||||
|
|
||||||
dlg->registerListener(bl);
|
dlg->registerListener(bl);
|
||||||
Gui::gui->pushDialogueBox(dlg);
|
Gui::gui->pushDialogueBox(dlg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void hoverCallback(int which)
|
virtual void hoverCallback(int which)
|
||||||
{
|
{
|
||||||
this->help->updateHelpMessage(which);
|
this->help->updateHelpMessage(which);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void escapeCallback(int which)
|
virtual void escapeCallback(int which)
|
||||||
{
|
{
|
||||||
Gui::gui->popView();
|
Gui::gui->popView();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void keyCallback(bool shift, const char *str)
|
virtual void keyCallback(bool shift, const char *str)
|
||||||
{
|
{
|
||||||
panic_if(!this->cur_key, "No key selected but keyboard active???\n");
|
panic_if(!this->cur_key, "No key selected but keyboard active???\n");
|
||||||
|
|
||||||
*this->cur_key = this->stringToKeycode(str);
|
*this->cur_key = this->stringToKeycode(str);
|
||||||
this->updateHelpMessages();
|
this->updateHelpMessages();
|
||||||
this->help->updateHelpMessage(this->cur_sel);
|
this->help->updateHelpMessage(this->cur_sel);
|
||||||
VirtualKeyboard::kbd->deactivate();
|
VirtualKeyboard::kbd->deactivate();
|
||||||
this->cur_key = NULL;
|
this->cur_key = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateHelpMessages()
|
void updateHelpMessages()
|
||||||
{
|
{
|
||||||
this->freeHelpMessages();
|
this->freeHelpMessages();
|
||||||
|
|
||||||
this->hm[0] = this->addOne(this->hm[0], this->allocOne("1: %s", stringToPtr_Wiimote("1")));
|
this->hm[0] = this->addOne(this->hm[0], this->allocOne("1: %s", stringToPtr_Wiimote("1")));
|
||||||
this->hm[0] = this->addOne(this->hm[0], this->allocOne("2: %s", stringToPtr_Wiimote("2")));
|
this->hm[0] = this->addOne(this->hm[0], this->allocOne("2: %s", stringToPtr_Wiimote("2")));
|
||||||
this->hm[0] = this->addOne(this->hm[0], this->allocOne("A: %s", stringToPtr_Wiimote("A")));
|
this->hm[0] = this->addOne(this->hm[0], this->allocOne("A: %s", stringToPtr_Wiimote("A")));
|
||||||
this->hm[0] = this->addOne(this->hm[0], this->allocOne("B: %s", stringToPtr_Wiimote("B")));
|
this->hm[0] = this->addOne(this->hm[0], this->allocOne("B: %s", stringToPtr_Wiimote("B")));
|
||||||
this->hm[0] = this->addOne(this->hm[0], this->allocOne("+: %s", stringToPtr_Wiimote("+")));
|
this->hm[0] = this->addOne(this->hm[0], this->allocOne("+: %s", stringToPtr_Wiimote("+")));
|
||||||
this->hm[0] = this->addOne(this->hm[0], this->allocOne("-: %s", stringToPtr_Wiimote("-")));
|
this->hm[0] = this->addOne(this->hm[0], this->allocOne("-: %s", stringToPtr_Wiimote("-")));
|
||||||
|
|
||||||
/* Nunchuk */
|
/* Nunchuk */
|
||||||
this->hm[2] = this->addOne(this->hm[2], this->allocOne("Z: %s", stringToPtr_Nunchuk("Z")));
|
this->hm[2] = this->addOne(this->hm[2], this->allocOne("Z: %s", stringToPtr_Nunchuk("Z")));
|
||||||
this->hm[2] = this->addOne(this->hm[2], this->allocOne("C: %s", stringToPtr_Nunchuk("C")));
|
this->hm[2] = this->addOne(this->hm[2], this->allocOne("C: %s", stringToPtr_Nunchuk("C")));
|
||||||
|
|
||||||
/* Classic */
|
/* Classic */
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("a: %s", stringToPtr_Classic("a")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("a: %s", stringToPtr_Classic("a")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("b: %s", stringToPtr_Classic("b")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("b: %s", stringToPtr_Classic("b")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("x: %s", stringToPtr_Classic("x")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("x: %s", stringToPtr_Classic("x")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("y: %s", stringToPtr_Classic("y")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("y: %s", stringToPtr_Classic("y")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("L: %s", stringToPtr_Classic("L")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("L: %s", stringToPtr_Classic("L")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("R: %s", stringToPtr_Classic("R")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("R: %s", stringToPtr_Classic("R")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("Zl: %s", stringToPtr_Classic("Zl")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("Zl: %s", stringToPtr_Classic("Zl")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("Zr: %s", stringToPtr_Classic("Zr")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("Zr: %s", stringToPtr_Classic("Zr")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("+: %s", stringToPtr_Classic("+")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("+: %s", stringToPtr_Classic("+")));
|
||||||
this->hm[4] = this->addOne(this->hm[4], this->allocOne("-: %s", stringToPtr_Classic("-")));
|
this->hm[4] = this->addOne(this->hm[4], this->allocOne("-: %s", stringToPtr_Classic("-")));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this->hm[2] = this->addOne(this->hm[2], this->allocOne("l: %s", stringToPtr_Classic("l")));
|
this->hm[2] = this->addOne(this->hm[2], this->allocOne("l: %s", stringToPtr_Classic("l")));
|
||||||
this->hm[2] = this->addOne(this->hm[2], this->allocOne("r: %s", stringToPtr_Classic("r")));
|
this->hm[2] = this->addOne(this->hm[2], this->allocOne("r: %s", stringToPtr_Classic("r")));
|
||||||
this->hm[2] = this->addOne(this->hm[2], this->allocOne("R-toggle: %s", stringToPtr_Classic("RA")));
|
this->hm[2] = this->addOne(this->hm[2], this->allocOne("R-toggle: %s", stringToPtr_Classic("RA")));
|
||||||
this->hm[2] = this->addOne(this->hm[2], this->allocOne("L-toggle: %s", stringToPtr_Classic("LA")));
|
this->hm[2] = this->addOne(this->hm[2], this->allocOne("L-toggle: %s", stringToPtr_Classic("LA")));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
this->hm[7] = this->addOne(this->hm[11], xstrdup("Revert to defaults"));
|
this->hm[7] = this->addOne(this->hm[11], xstrdup("Revert to defaults"));
|
||||||
|
|
||||||
this->help->setHelpMessages(this->hm);
|
this->help->setHelpMessages(this->hm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void freeHelpMessages()
|
void freeHelpMessages()
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < ARRAY_SIZE(this->hm); i++)
|
for (unsigned i = 0; i < ARRAY_SIZE(this->hm); i++)
|
||||||
{
|
{
|
||||||
if (this->hm[i])
|
if (this->hm[i])
|
||||||
{
|
{
|
||||||
for (int j = 0; this->hm[i][j]; j++)
|
for (int j = 0; this->hm[i][j]; j++)
|
||||||
free((void*)this->hm[i][j]);
|
free((void*)this->hm[i][j]);
|
||||||
free(this->hm[i]);
|
free(this->hm[i]);
|
||||||
}
|
}
|
||||||
this->hm[i] = NULL;
|
this->hm[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EQ(b) (strcmp(str, b) == 0)
|
#define EQ(b) (strcmp(str, b) == 0)
|
||||||
int *stringToPtr_Classic(const char *str)
|
int *stringToPtr_Classic(const char *str)
|
||||||
{
|
{
|
||||||
if (EQ("Up"))
|
if (EQ("Up"))
|
||||||
return &Gui::gui->np->JoystickHats[0];
|
return &Gui::gui->np->JoystickHats[0];
|
||||||
if (EQ("Down"))
|
if (EQ("Down"))
|
||||||
return &Gui::gui->np->JoystickHats[1];
|
return &Gui::gui->np->JoystickHats[1];
|
||||||
if (EQ("Left"))
|
if (EQ("Left"))
|
||||||
return &Gui::gui->np->JoystickHats[2];
|
return &Gui::gui->np->JoystickHats[2];
|
||||||
if (EQ("Right"))
|
if (EQ("Right"))
|
||||||
return &Gui::gui->np->JoystickHats[3];
|
return &Gui::gui->np->JoystickHats[3];
|
||||||
if (EQ("LAH"))
|
if (EQ("LAH"))
|
||||||
return &Gui::gui->np->JoystickAxes[0];
|
return &Gui::gui->np->JoystickAxes[0];
|
||||||
if (EQ("LAV"))
|
if (EQ("LAV"))
|
||||||
return &Gui::gui->np->JoystickAxes[1];
|
return &Gui::gui->np->JoystickAxes[1];
|
||||||
if (EQ("RAH"))
|
if (EQ("RAH"))
|
||||||
return &Gui::gui->np->JoystickAxes[2];
|
return &Gui::gui->np->JoystickAxes[2];
|
||||||
if (EQ("RAV"))
|
if (EQ("RAV"))
|
||||||
return &Gui::gui->np->JoystickAxes[3];
|
return &Gui::gui->np->JoystickAxes[3];
|
||||||
if (EQ("RA"))
|
if (EQ("RA"))
|
||||||
return &Gui::gui->np->JoystickAxes[4];
|
return &Gui::gui->np->JoystickAxes[4];
|
||||||
if (EQ("LA"))
|
if (EQ("LA"))
|
||||||
return &Gui::gui->np->JoystickAxes[5];
|
return &Gui::gui->np->JoystickAxes[5];
|
||||||
if (EQ("a"))
|
if (EQ("a"))
|
||||||
return &Gui::gui->np->JoystickButtons[9];
|
return &Gui::gui->np->JoystickButtons[9];
|
||||||
if (EQ("b"))
|
if (EQ("b"))
|
||||||
return &Gui::gui->np->JoystickButtons[10];
|
return &Gui::gui->np->JoystickButtons[10];
|
||||||
if (EQ("x"))
|
if (EQ("x"))
|
||||||
return &Gui::gui->np->JoystickButtons[11];
|
return &Gui::gui->np->JoystickButtons[11];
|
||||||
if (EQ("y"))
|
if (EQ("y"))
|
||||||
return &Gui::gui->np->JoystickButtons[12];
|
return &Gui::gui->np->JoystickButtons[12];
|
||||||
if (EQ("L"))
|
if (EQ("L"))
|
||||||
return &Gui::gui->np->JoystickButtons[13];
|
return &Gui::gui->np->JoystickButtons[13];
|
||||||
if (EQ("R"))
|
if (EQ("R"))
|
||||||
return &Gui::gui->np->JoystickButtons[14];
|
return &Gui::gui->np->JoystickButtons[14];
|
||||||
if (EQ("Zl"))
|
if (EQ("Zl"))
|
||||||
return &Gui::gui->np->JoystickButtons[15];
|
return &Gui::gui->np->JoystickButtons[15];
|
||||||
if (EQ("Zr"))
|
if (EQ("Zr"))
|
||||||
return &Gui::gui->np->JoystickButtons[16];
|
return &Gui::gui->np->JoystickButtons[16];
|
||||||
if (EQ("-"))
|
if (EQ("-"))
|
||||||
return &Gui::gui->np->JoystickButtons[17];
|
return &Gui::gui->np->JoystickButtons[17];
|
||||||
if (EQ("+"))
|
if (EQ("+"))
|
||||||
return &Gui::gui->np->JoystickButtons[18];
|
return &Gui::gui->np->JoystickButtons[18];
|
||||||
if (EQ("Home"))
|
if (EQ("Home"))
|
||||||
return &Gui::gui->np->JoystickButtons[19];
|
return &Gui::gui->np->JoystickButtons[19];
|
||||||
|
|
||||||
/* Shound never happen! */
|
/* Shound never happen! */
|
||||||
panic("Illegal string %s\n", str);
|
panic("Illegal string %s\n", str);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int *stringToPtr_Nunchuk(const char *str)
|
int *stringToPtr_Nunchuk(const char *str)
|
||||||
{
|
{
|
||||||
if (EQ("Horiz"))
|
if (EQ("Horiz"))
|
||||||
return &Gui::gui->np->JoystickAxes[0];
|
return &Gui::gui->np->JoystickAxes[0];
|
||||||
if (EQ("Vert"))
|
if (EQ("Vert"))
|
||||||
return &Gui::gui->np->JoystickAxes[1];
|
return &Gui::gui->np->JoystickAxes[1];
|
||||||
if (EQ("Z"))
|
if (EQ("Z"))
|
||||||
return &Gui::gui->np->JoystickButtons[7];
|
return &Gui::gui->np->JoystickButtons[7];
|
||||||
if (EQ("C"))
|
if (EQ("C"))
|
||||||
return &Gui::gui->np->JoystickButtons[8];
|
return &Gui::gui->np->JoystickButtons[8];
|
||||||
|
|
||||||
/* Shound never happen! */
|
/* Shound never happen! */
|
||||||
panic("Illegal string %s\n", str);
|
panic("Illegal string %s\n", str);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int *stringToPtr_Wiimote(const char *str)
|
int *stringToPtr_Wiimote(const char *str)
|
||||||
{
|
{
|
||||||
if (EQ("Up"))
|
if (EQ("Up"))
|
||||||
return &Gui::gui->np->JoystickHats[0];
|
return &Gui::gui->np->JoystickHats[0];
|
||||||
if (EQ("Down"))
|
if (EQ("Down"))
|
||||||
return &Gui::gui->np->JoystickHats[1];
|
return &Gui::gui->np->JoystickHats[1];
|
||||||
if (EQ("Left"))
|
if (EQ("Left"))
|
||||||
return &Gui::gui->np->JoystickHats[2];
|
return &Gui::gui->np->JoystickHats[2];
|
||||||
if (EQ("Right"))
|
if (EQ("Right"))
|
||||||
return &Gui::gui->np->JoystickHats[3];
|
return &Gui::gui->np->JoystickHats[3];
|
||||||
if (EQ("A"))
|
if (EQ("A"))
|
||||||
return &Gui::gui->np->JoystickButtons[0];
|
return &Gui::gui->np->JoystickButtons[0];
|
||||||
if (EQ("B"))
|
if (EQ("B"))
|
||||||
return &Gui::gui->np->JoystickButtons[1];
|
return &Gui::gui->np->JoystickButtons[1];
|
||||||
if (EQ("1"))
|
if (EQ("1"))
|
||||||
return &Gui::gui->np->JoystickButtons[2];
|
return &Gui::gui->np->JoystickButtons[2];
|
||||||
if (EQ("2"))
|
if (EQ("2"))
|
||||||
return &Gui::gui->np->JoystickButtons[3];
|
return &Gui::gui->np->JoystickButtons[3];
|
||||||
if (EQ("-"))
|
if (EQ("-"))
|
||||||
return &Gui::gui->np->JoystickButtons[4];
|
return &Gui::gui->np->JoystickButtons[4];
|
||||||
if (EQ("+"))
|
if (EQ("+"))
|
||||||
return &Gui::gui->np->JoystickButtons[5];
|
return &Gui::gui->np->JoystickButtons[5];
|
||||||
if (EQ("Home"))
|
if (EQ("Home"))
|
||||||
return &Gui::gui->np->JoystickButtons[6];
|
return &Gui::gui->np->JoystickButtons[6];
|
||||||
|
|
||||||
/* Shound never happen! */
|
/* Shound never happen! */
|
||||||
panic("Illegal string %s\n", str);
|
panic("Illegal string %s\n", str);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#undef EQ
|
#undef EQ
|
||||||
|
|
||||||
const char **addOne(const char **dst, const char *what)
|
const char **addOne(const char **dst, const char *what)
|
||||||
{
|
{
|
||||||
int cur;
|
int cur;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
if (dst != NULL)
|
if (dst != NULL)
|
||||||
{
|
{
|
||||||
for (n = 0; dst[n]; n++)
|
for (n = 0; dst[n]; n++)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
cur = n;
|
cur = n;
|
||||||
n++;
|
n++;
|
||||||
dst = (const char **)xrealloc(dst, (n+1) * sizeof(const char*));
|
dst = (const char **)xrealloc(dst, (n+1) * sizeof(const char*));
|
||||||
dst[cur] = what;
|
dst[cur] = what;
|
||||||
dst[n] = NULL;
|
dst[n] = NULL;
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *allocOne(const char *fmt, int *what)
|
const char *allocOne(const char *fmt, int *what)
|
||||||
{
|
{
|
||||||
const char *str = this->bindingToString(*what);
|
const char *str = this->bindingToString(*what);
|
||||||
size_t len = strlen(str) + strlen(fmt) + 2;
|
size_t len = strlen(str) + strlen(fmt) + 2;
|
||||||
char *out = (char *)xmalloc(len);
|
char *out = (char *)xmalloc(len);
|
||||||
|
|
||||||
sprintf(out, fmt, str);
|
sprintf(out, fmt, str);
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
int stringToKeycode(const char *str)
|
int stringToKeycode(const char *str)
|
||||||
{
|
{
|
||||||
if (strcmp(str, "None") == 0)
|
if (strcmp(str, "None") == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* default: */
|
/* default: */
|
||||||
return VirtualKeyboard::kbd->stringToKeycode(str);
|
return VirtualKeyboard::kbd->stringToKeycode(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *bindingToString(int val)
|
const char *bindingToString(int val)
|
||||||
{
|
{
|
||||||
switch(val)
|
switch(val)
|
||||||
{
|
{
|
||||||
case JOY_NONE:
|
case JOY_NONE:
|
||||||
return "None";
|
return "None";
|
||||||
case JOY_HORIZ:
|
case JOY_HORIZ:
|
||||||
return "Horizontal";
|
return "Horizontal";
|
||||||
case JOY_VERT:
|
case JOY_VERT:
|
||||||
return "Vertical";
|
return "Vertical";
|
||||||
case JOY_FIRE:
|
case JOY_FIRE:
|
||||||
return "Fire";
|
return "Fire";
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* default: */
|
/* default: */
|
||||||
return VirtualKeyboard::kbd->keycodeToString(val);
|
return VirtualKeyboard::kbd->keycodeToString(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
HelpBox *help;
|
HelpBox *help;
|
||||||
int *cur_key;
|
int *cur_key;
|
||||||
const char **hm[14];
|
const char **hm[14];
|
||||||
};
|
};
|
||||||
|
|
||||||
void AnalogueBindListener::selectCallback(DialogueBox *which, int selected)
|
void AnalogueBindListener::selectCallback(DialogueBox *which, int selected)
|
||||||
{
|
{
|
||||||
switch(selected)
|
switch(selected)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
*menu->cur_key = JOY_HORIZ; break;
|
*menu->cur_key = JOY_HORIZ; break;
|
||||||
case 2:
|
case 2:
|
||||||
*menu->cur_key = JOY_VERT; break;
|
*menu->cur_key = JOY_VERT; break;
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
*menu->cur_key = JOY_NONE; break;
|
*menu->cur_key = JOY_NONE; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->menu->updateHelpMessages();
|
this->menu->updateHelpMessages();
|
||||||
this->menu->help->updateHelpMessage(this->menu->cur_sel);
|
this->menu->help->updateHelpMessage(this->menu->cur_sel);
|
||||||
|
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class BindKeysView : public GuiView
|
class BindKeysView : public GuiView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BindKeysView() : GuiView()
|
BindKeysView() : GuiView()
|
||||||
{
|
{
|
||||||
this->help = new HelpBox(Gui::gui->small_font, NULL);
|
this->help = new HelpBox(Gui::gui->small_font, NULL);
|
||||||
this->menu = new BindKeysMenu(Gui::gui->small_font, this->help);
|
this->menu = new BindKeysMenu(Gui::gui->small_font, this->help);
|
||||||
}
|
}
|
||||||
|
|
||||||
~BindKeysView()
|
~BindKeysView()
|
||||||
{
|
{
|
||||||
delete this->help;
|
delete this->help;
|
||||||
delete this->menu;
|
delete this->menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
void viewPushCallback()
|
void viewPushCallback()
|
||||||
{
|
{
|
||||||
this->menu->updateHelpMessages();
|
this->menu->updateHelpMessages();
|
||||||
this->help->updateHelpMessage(0);
|
this->help->updateHelpMessage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void runLogic()
|
void runLogic()
|
||||||
{
|
{
|
||||||
this->menu->runLogic();
|
this->menu->runLogic();
|
||||||
}
|
}
|
||||||
|
|
||||||
void pushEvent(event_t ev)
|
void pushEvent(event_t ev)
|
||||||
{
|
{
|
||||||
this->menu->pushEvent(ev);
|
this->menu->pushEvent(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw(SDL_Surface *where)
|
void draw(SDL_Surface *where)
|
||||||
{
|
{
|
||||||
SDL_Rect dst;
|
SDL_Rect dst;
|
||||||
|
|
||||||
/* Blit the backgrounds */
|
/* Blit the backgrounds */
|
||||||
dst = (SDL_Rect){20,45,300,400};
|
dst = (SDL_Rect){20,45,300,400};
|
||||||
SDL_BlitSurface(Gui::gui->main_menu_bg, NULL, where, &dst);
|
SDL_BlitSurface(Gui::gui->main_menu_bg, NULL, where, &dst);
|
||||||
|
|
||||||
dst = (SDL_Rect){350,13,0,0};
|
dst = (SDL_Rect){350,13,0,0};
|
||||||
SDL_BlitSurface(Gui::gui->bind_key_box, NULL, where, &dst);
|
SDL_BlitSurface(Gui::gui->bind_key_box, NULL, where, &dst);
|
||||||
|
|
||||||
this->menu->draw(where, 50, 70, 300, 400);
|
this->menu->draw(where, 50, 70, 300, 400);
|
||||||
this->help->draw(where, 358, 28, 264, 210);
|
this->help->draw(where, 358, 28, 264, 230);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BindKeysMenu *menu;
|
BindKeysMenu *menu;
|
||||||
HelpBox *help;
|
HelpBox *help;
|
||||||
};
|
};
|
||||||
|
@ -72,6 +72,7 @@ class StartGameListener : public TimeoutHandler
|
|||||||
public:
|
public:
|
||||||
StartGameListener()
|
StartGameListener()
|
||||||
{
|
{
|
||||||
|
|
||||||
Gui::gui->status_bar->queueMessage("Resetting the C64");
|
Gui::gui->status_bar->queueMessage("Resetting the C64");
|
||||||
TheC64->Reset();
|
TheC64->Reset();
|
||||||
TimerController::controller->arm(this, 4500);
|
TimerController::controller->arm(this, 4500);
|
||||||
|
@ -228,7 +228,8 @@ GameInfo::GameInfo(GameInfo *gi)
|
|||||||
this->genre = gi->genre;
|
this->genre = gi->genre;
|
||||||
|
|
||||||
if (gi->screenshot)
|
if (gi->screenshot)
|
||||||
this->screenshot = SDL_DisplayFormat(gi->screenshot);
|
// this->screenshot = SDL_DisplayFormat(gi->screenshot);
|
||||||
|
this->screenshot = sdl_surface_8bit_copy(gi->screenshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameInfo::~GameInfo()
|
GameInfo::~GameInfo()
|
||||||
|
@ -355,8 +355,8 @@ void Gui::exitMenu()
|
|||||||
prefs_changed = ThePrefs != *this->np;
|
prefs_changed = ThePrefs != *this->np;
|
||||||
ThePrefs = *this->np;
|
ThePrefs = *this->np;
|
||||||
|
|
||||||
if (prefs_changed)
|
//if (prefs_changed)
|
||||||
ThePrefs.Save(ThePrefs.PrefsPath);
|
// ThePrefs.Save(ThePrefs.PrefsPath);
|
||||||
|
|
||||||
this->saveGameInfo(this->metadata_base_path, this->cur_gameInfo->filename);
|
this->saveGameInfo(this->metadata_base_path, this->cur_gameInfo->filename);
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
case 0: /* Insert disc */
|
case 0: /* Insert disc */
|
||||||
Gui::gui->dv->setDirectory(Gui::gui->game_base_path);
|
Gui::gui->dv->setDirectory(Gui::gui->game_base_path);
|
||||||
Gui::gui->pushView(Gui::gui->dv);
|
Gui::gui->pushView(Gui::gui->dv);
|
||||||
|
|
||||||
Gui::gui->dv->runStartSequence(this->p_submenus[0].sel == 0);
|
Gui::gui->dv->runStartSequence(this->p_submenus[0].sel == 0);
|
||||||
break;
|
break;
|
||||||
case 2: /* Load/save states */
|
case 2: /* Load/save states */
|
||||||
@ -115,6 +115,11 @@ public:
|
|||||||
case 9: /* Options */
|
case 9: /* Options */
|
||||||
Gui::gui->pushView(Gui::gui->ov);
|
Gui::gui->pushView(Gui::gui->ov);
|
||||||
break;
|
break;
|
||||||
|
case 10: /* Save Prefs */
|
||||||
|
ThePrefs = *Gui::gui->np;
|
||||||
|
ThePrefs.Save(ThePrefs.PrefsPath);
|
||||||
|
Gui::gui->pushDialogueBox(new DialogueBox(save_prefs_done));
|
||||||
|
break;
|
||||||
case 11: /* Exit */
|
case 11: /* Exit */
|
||||||
DialogueBox *exit_dialogue = new DialogueBox(exit_dialogue_messages);
|
DialogueBox *exit_dialogue = new DialogueBox(exit_dialogue_messages);
|
||||||
exit_dialogue->registerListener(new ExitListener());
|
exit_dialogue->registerListener(new ExitListener());
|
||||||
|
@ -13,6 +13,17 @@ const char *exit_dialogue_messages[8] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char *save_prefs_done[8] = {
|
||||||
|
/*00*/ "Preferences saved!",
|
||||||
|
/*01*/ "#",
|
||||||
|
/*02*/ "#", /* Empty line */
|
||||||
|
/*03*/ "#",
|
||||||
|
/*04*/ "#",
|
||||||
|
/*05*/ "#",
|
||||||
|
/*06*/ "^|OK",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
const char *save_state_done[8] = {
|
const char *save_state_done[8] = {
|
||||||
/*00*/ "Game state saved!",
|
/*00*/ "Game state saved!",
|
||||||
/*01*/ "#",
|
/*01*/ "#",
|
||||||
@ -138,7 +149,7 @@ const char *main_menu_messages[14] = {
|
|||||||
/*07*/ "Game info",
|
/*07*/ "Game info",
|
||||||
/*08*/ "Networking",
|
/*08*/ "Networking",
|
||||||
/*09*/ "Options",
|
/*09*/ "Options",
|
||||||
/*10*/ " ",
|
/*10*/ "Save prefs",
|
||||||
/*11*/ "Quit",
|
/*11*/ "Quit",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@ -182,7 +193,10 @@ const char **main_menu_help[14] = {
|
|||||||
"Configure Frodo",
|
"Configure Frodo",
|
||||||
NULL,
|
NULL,
|
||||||
},
|
},
|
||||||
NULL,
|
(const char*[]){
|
||||||
|
"Save general preferences",
|
||||||
|
NULL,
|
||||||
|
},
|
||||||
(const char*[]){
|
(const char*[]){
|
||||||
"Quit Frodo",
|
"Quit Frodo",
|
||||||
NULL,
|
NULL,
|
||||||
@ -244,13 +258,9 @@ const char **options_menu_help[14] = {
|
|||||||
NULL,
|
NULL,
|
||||||
(const char*[]){
|
(const char*[]){
|
||||||
"Select display settings.",
|
"Select display settings.",
|
||||||
"Fullscreen attemts to run",
|
"Fullscreen runs in",
|
||||||
"in fullscreen mode, while.",
|
"double size mode, while",
|
||||||
"windowed uses a window.",
|
"window in streched mode.",
|
||||||
"Activated on next restart.",
|
|
||||||
" ",
|
|
||||||
"On the Wii, fullscreen is",
|
|
||||||
"always used",
|
|
||||||
NULL,
|
NULL,
|
||||||
},
|
},
|
||||||
NULL,
|
NULL,
|
||||||
@ -262,7 +272,10 @@ const char **options_menu_help[14] = {
|
|||||||
NULL,
|
NULL,
|
||||||
},
|
},
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
(const char*[]){
|
||||||
|
"Reset the c64.",
|
||||||
|
NULL,
|
||||||
|
},
|
||||||
NULL,
|
NULL,
|
||||||
(const char*[]){
|
(const char*[]){
|
||||||
"Setup theme for the Frodo",
|
"Setup theme for the Frodo",
|
||||||
@ -320,6 +333,7 @@ const char **network_menu_help[9] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char *game_info_menu_messages[11] = {
|
const char *game_info_menu_messages[11] = {
|
||||||
/*00*/ "Capture game screenshot",
|
/*00*/ "Capture game screenshot",
|
||||||
/*01*/ " ",
|
/*01*/ " ",
|
||||||
@ -334,6 +348,8 @@ const char *game_info_menu_messages[11] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char *genre_dlg[8] = {
|
const char *genre_dlg[8] = {
|
||||||
/*00*/ "Action",
|
/*00*/ "Action",
|
||||||
/*01*/ "Adventure",
|
/*01*/ "Adventure",
|
||||||
|
@ -26,5 +26,6 @@ extern const char *game_info_bad_number_dlg[];
|
|||||||
extern const char *genre_dlg[];
|
extern const char *genre_dlg[];
|
||||||
extern const char *players_dlg[];
|
extern const char *players_dlg[];
|
||||||
extern const char *save_state_done[];
|
extern const char *save_state_done[];
|
||||||
|
extern const char *save_prefs_done[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define NETWORK_USER_MENU_HH
|
#define NETWORK_USER_MENU_HH
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <Network.h>
|
#include "../Network.h"
|
||||||
|
|
||||||
class GuiView;
|
class GuiView;
|
||||||
class NetworkUserMenu;
|
class NetworkUserMenu;
|
||||||
|
@ -77,15 +77,16 @@ public:
|
|||||||
|
|
||||||
if (this->loadSnapshot)
|
if (this->loadSnapshot)
|
||||||
{
|
{
|
||||||
int display_type = Gui::gui->np->DisplayType;
|
//int display_type = Gui::gui->np->DisplayType;
|
||||||
|
|
||||||
|
TheC64->Reset();
|
||||||
TheC64->LoadSnapshot(new_path);
|
TheC64->LoadSnapshot(new_path);
|
||||||
|
|
||||||
this->updateGameInfo(fileName);
|
this->updateGameInfo(fileName);
|
||||||
Gui::gui->updateGameInfo(Gui::gui->sgv->gameInfo->gi);
|
Gui::gui->updateGameInfo(Gui::gui->sgv->gameInfo->gi);
|
||||||
Gui::gui->np->Load(prefs_path);
|
Gui::gui->np->Load(prefs_path);
|
||||||
/* Don't change display type */
|
/* Don't change display type */
|
||||||
Gui::gui->np->DisplayType = display_type;
|
//Gui::gui->np->DisplayType = display_type;
|
||||||
} else
|
} else
|
||||||
unlink(new_path);
|
unlink(new_path);
|
||||||
free(prefs_path);
|
free(prefs_path);
|
||||||
@ -162,6 +163,7 @@ void SaveGameView::saveSnapshot()
|
|||||||
char *prefs_name;
|
char *prefs_name;
|
||||||
char *save;
|
char *save;
|
||||||
|
|
||||||
|
/*
|
||||||
if (strlen(Gui::gui->np->DrivePath[0]) != 0)
|
if (strlen(Gui::gui->np->DrivePath[0]) != 0)
|
||||||
name = Gui::gui->np->DrivePath[0];
|
name = Gui::gui->np->DrivePath[0];
|
||||||
out_name = strrchr(name, '/');
|
out_name = strrchr(name, '/');
|
||||||
@ -169,6 +171,12 @@ void SaveGameView::saveSnapshot()
|
|||||||
out_name = name;
|
out_name = name;
|
||||||
else
|
else
|
||||||
out_name++;
|
out_name++;
|
||||||
|
*/
|
||||||
|
//take the filename from gameinfo instead from drivepath
|
||||||
|
out_name = Gui::gui->cur_gameInfo->filename;
|
||||||
|
if (!out_name)
|
||||||
|
out_name = name;
|
||||||
|
|
||||||
save = (char*)xmalloc( strlen(Gui::gui->save_game_path) + strlen(out_name) + 6 );
|
save = (char*)xmalloc( strlen(Gui::gui->save_game_path) + strlen(out_name) + 6 );
|
||||||
prefs_name = (char*)xmalloc( strlen(Gui::gui->save_game_path) + strlen(out_name) + 12 );
|
prefs_name = (char*)xmalloc( strlen(Gui::gui->save_game_path) + strlen(out_name) + 12 );
|
||||||
|
|
||||||
@ -182,9 +190,12 @@ void SaveGameView::saveSnapshot()
|
|||||||
if (!was_paused)
|
if (!was_paused)
|
||||||
TheC64->Resume();
|
TheC64->Resume();
|
||||||
|
|
||||||
|
//Take the screenshot from the one saved when the gui was activacted
|
||||||
Gui::gui->cur_gameInfo->setScreenshot(sdl_surface_8bit_copy(Gui::gui->screenshot));
|
Gui::gui->cur_gameInfo->setScreenshot(sdl_surface_8bit_copy(Gui::gui->screenshot));
|
||||||
Gui::gui->saveGameInfo(Gui::gui->save_game_path, out_name);
|
Gui::gui->saveGameInfo(Gui::gui->save_game_path, out_name);
|
||||||
ThePrefs.Save(prefs_name);
|
|
||||||
|
ThePrefs = *Gui::gui->np;
|
||||||
|
ThePrefs.Save_game(prefs_name);
|
||||||
|
|
||||||
Gui::gui->pushDialogueBox(new DialogueBox(save_state_done));
|
Gui::gui->pushDialogueBox(new DialogueBox(save_state_done));
|
||||||
|
|
||||||
|
581
Src/main.cpp
581
Src/main.cpp
@ -1,278 +1,303 @@
|
|||||||
/*
|
/*
|
||||||
* main.cpp - Main program
|
* main.cpp - Main program
|
||||||
*
|
*
|
||||||
* Frodo (C) 1994-1997,2002-2005 Christian Bauer
|
* Frodo (C) 1994-1997,2002-2005 Christian Bauer
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_ttf.h>
|
#include <SDL_ttf.h>
|
||||||
|
|
||||||
#include "sysdeps.h"
|
#include "sysdeps.h"
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "C64.h"
|
#include "C64.h"
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "Prefs.h"
|
#include "Prefs.h"
|
||||||
#include "SAM.h"
|
#include "SAM.h"
|
||||||
#include "gui/gui.hh"
|
#include "gui/gui.hh"
|
||||||
#include "data_store.hh"
|
#include "data_store.hh"
|
||||||
#include "utils.hh"
|
#include "utils.hh"
|
||||||
|
#include <fat.h>
|
||||||
#if defined(GEKKO)
|
|
||||||
#include "fat.h"
|
#if defined(GEKKO)
|
||||||
#endif
|
#include "fat.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Global variables
|
|
||||||
extern int init_graphics(void);
|
// Global variables
|
||||||
|
extern int init_graphics(void);
|
||||||
|
|
||||||
// Global variables
|
|
||||||
C64 *TheC64 = NULL; // Global C64 object
|
// Global variables
|
||||||
char AppDirPath[1024]; // Path of application directory
|
C64 *TheC64 = NULL; // Global C64 object
|
||||||
|
char AppDirPath[1024]; // Path of application directory
|
||||||
|
|
||||||
// ROM file names
|
|
||||||
#ifndef DATADIR
|
// ROM file names
|
||||||
#define DATADIR
|
#ifndef DATADIR
|
||||||
#endif
|
#define DATADIR
|
||||||
|
#endif
|
||||||
#ifdef __riscos__
|
|
||||||
#define BASIC_ROM_FILE "FrodoRsrc:Basic_ROM"
|
#ifdef __riscos__
|
||||||
#define KERNAL_ROM_FILE "FrodoRsrc:Kernal_ROM"
|
#define BASIC_ROM_FILE "FrodoRsrc:Basic_ROM"
|
||||||
#define CHAR_ROM_FILE "FrodoRsrc:Char_ROM"
|
#define KERNAL_ROM_FILE "FrodoRsrc:Kernal_ROM"
|
||||||
#define DRIVE_ROM_FILE "FrodoRsrc:1541_ROM"
|
#define CHAR_ROM_FILE "FrodoRsrc:Char_ROM"
|
||||||
#elif GEKKO
|
#define DRIVE_ROM_FILE "FrodoRsrc:1541_ROM"
|
||||||
#define WII_FRODO_BASE_PATH "/apps/frodo/"
|
#elif GEKKO
|
||||||
#define BASIC_ROM_FILE WII_FRODO_BASE_PATH"Basic_ROM"
|
#define WII_FRODO_BASE_PATH "/apps/frodo/"
|
||||||
#define KERNAL_ROM_FILE WII_FRODO_BASE_PATH"Kernal_ROM"
|
#define BASIC_ROM_FILE WII_FRODO_BASE_PATH"Basic_ROM"
|
||||||
#define CHAR_ROM_FILE WII_FRODO_BASE_PATH"Char_ROM"
|
#define KERNAL_ROM_FILE WII_FRODO_BASE_PATH"Kernal_ROM"
|
||||||
#define DRIVE_ROM_FILE WII_FRODO_BASE_PATH"1541_ROM"
|
#define CHAR_ROM_FILE WII_FRODO_BASE_PATH"Char_ROM"
|
||||||
#else
|
#define DRIVE_ROM_FILE WII_FRODO_BASE_PATH"1541_ROM"
|
||||||
#define BASIC_ROM_FILE DATADIR "Basic ROM"
|
#else
|
||||||
#define KERNAL_ROM_FILE DATADIR "Kernal ROM"
|
#define BASIC_ROM_FILE DATADIR "Basic ROM"
|
||||||
#define CHAR_ROM_FILE DATADIR "Char ROM"
|
#define KERNAL_ROM_FILE DATADIR "Kernal ROM"
|
||||||
#define DRIVE_ROM_FILE DATADIR "1541 ROM"
|
#define CHAR_ROM_FILE DATADIR "Char ROM"
|
||||||
#endif
|
#define DRIVE_ROM_FILE DATADIR "1541 ROM"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Builtin ROMs
|
|
||||||
#include "Basic_ROM.h"
|
// Builtin ROMs
|
||||||
#include "Kernal_ROM.h"
|
#include "Basic_ROM.h"
|
||||||
#include "Char_ROM.h"
|
#include "Kernal_ROM.h"
|
||||||
#include "1541_ROM.h"
|
#include "Char_ROM.h"
|
||||||
|
#include "1541_ROM.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* Load C64 ROM files
|
/*
|
||||||
*/
|
* Load C64 ROM files
|
||||||
|
*/
|
||||||
void Frodo::load_rom(const char *which, const char *path, uint8 *where, size_t size, const uint8 *builtin)
|
|
||||||
{
|
void Frodo::load_rom(const char *which, const char *path, uint8 *where, size_t size, const uint8 *builtin)
|
||||||
FILE *f = fopen(path, "rb");
|
{
|
||||||
if (f) {
|
FILE *f = fopen(path, "rb");
|
||||||
size_t actual = fread(where, 1, size, f);
|
if (f) {
|
||||||
fclose(f);
|
size_t actual = fread(where, 1, size, f);
|
||||||
if (actual == size)
|
fclose(f);
|
||||||
return;
|
if (actual == size)
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
// Use builtin ROM
|
|
||||||
printf("%s ROM file (%s) not readable, using builtin.\n", which, path);
|
// Use builtin ROM
|
||||||
memcpy(where, builtin, size);
|
printf("%s ROM file (%s) not readable, using builtin.\n", which, path);
|
||||||
}
|
memcpy(where, builtin, size);
|
||||||
|
}
|
||||||
void Frodo::load_rom_files()
|
|
||||||
{
|
void Frodo::load_rom_files()
|
||||||
load_rom("Basic", BASIC_ROM_FILE, TheC64->Basic, BASIC_ROM_SIZE, builtin_basic_rom);
|
{
|
||||||
load_rom("Kernal", KERNAL_ROM_FILE, TheC64->Kernal, KERNAL_ROM_SIZE, builtin_kernal_rom);
|
load_rom("Basic", BASIC_ROM_FILE, TheC64->Basic, BASIC_ROM_SIZE, builtin_basic_rom);
|
||||||
load_rom("Char", CHAR_ROM_FILE, TheC64->Char, CHAR_ROM_SIZE, builtin_char_rom);
|
load_rom("Kernal", KERNAL_ROM_FILE, TheC64->Kernal, KERNAL_ROM_SIZE, builtin_kernal_rom);
|
||||||
load_rom("1541", DRIVE_ROM_FILE, TheC64->ROM1541, DRIVE_ROM_SIZE, builtin_drive_rom);
|
load_rom("Char", CHAR_ROM_FILE, TheC64->Char, CHAR_ROM_SIZE, builtin_char_rom);
|
||||||
}
|
load_rom("1541", DRIVE_ROM_FILE, TheC64->ROM1541, DRIVE_ROM_SIZE, builtin_drive_rom);
|
||||||
|
}
|
||||||
/*
|
|
||||||
* Create application object and start it
|
/*
|
||||||
*/
|
* Create application object and start it
|
||||||
|
*/
|
||||||
extern "C" int main(int argc, char **argv)
|
|
||||||
{
|
extern "C" int main(int argc, char **argv)
|
||||||
timeval tv;
|
{
|
||||||
gettimeofday(&tv, NULL);
|
DIR_ITER *dir_tmp;
|
||||||
srand(tv.tv_usec);
|
timeval tv;
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
// Init SDL
|
srand(tv.tv_usec);
|
||||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) {
|
|
||||||
fprintf(stderr, "Couldn't initialize SDL (%s)\n", SDL_GetError());
|
// Init SDL
|
||||||
return 1;
|
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) {
|
||||||
}
|
fprintf(stderr, "Couldn't initialize SDL (%s)\n", SDL_GetError());
|
||||||
if (TTF_Init() < 0)
|
return 1;
|
||||||
{
|
}
|
||||||
fprintf(stderr, "Unable to init TTF: %s\n", TTF_GetError() );
|
if (TTF_Init() < 0)
|
||||||
return 1;
|
{
|
||||||
}
|
fprintf(stderr, "Unable to init TTF: %s\n", TTF_GetError() );
|
||||||
|
return 1;
|
||||||
fflush(stdout);
|
}
|
||||||
|
|
||||||
Frodo *the_app = new Frodo();
|
fflush(stdout);
|
||||||
the_app->ArgvReceived(argc, argv);
|
|
||||||
the_app->ReadyToRun();
|
#ifdef WII_PORT
|
||||||
delete the_app;
|
|
||||||
|
printf("\x1b[2;0H");
|
||||||
return 0;
|
|
||||||
}
|
//initialize libfat library
|
||||||
|
if (!fatInitDefault())
|
||||||
|
{
|
||||||
/*
|
printf("Couldn't initialize fat subsytem\n");
|
||||||
* Constructor: Initialize member variables
|
sleep(3);
|
||||||
*/
|
exit(0);
|
||||||
|
}
|
||||||
Frodo::Frodo()
|
|
||||||
{
|
//create tmp directory if it does not exist
|
||||||
Prefs p;
|
dir_tmp = diropen("/frodo/tmp");
|
||||||
|
if (!dir_tmp) {mkdir("/frodo/tmp",0777);printf("Making tmp directory\n");sleep(3);} else dirclose(dir_tmp);
|
||||||
TheC64 = NULL;
|
|
||||||
ThePrefs = p; /* Silly workaround to fix joystick bug */
|
|
||||||
TheDefaultPrefs = p;
|
#endif
|
||||||
}
|
|
||||||
|
Frodo *the_app = new Frodo();
|
||||||
|
the_app->ArgvReceived(argc, argv);
|
||||||
/*
|
the_app->ReadyToRun();
|
||||||
* Process command line arguments
|
delete the_app;
|
||||||
*/
|
|
||||||
char *network_server_connect = 0;
|
#ifdef WII_PORT
|
||||||
|
fatUnmount(0);
|
||||||
void Frodo::ArgvReceived(int argc, char **argv)
|
#endif
|
||||||
{
|
|
||||||
if (argc == 2)
|
return 0;
|
||||||
network_server_connect = argv[1];
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const char *try_path(const char *path, const char *file)
|
/*
|
||||||
{
|
* Constructor: Initialize member variables
|
||||||
if (path == NULL || file == NULL)
|
*/
|
||||||
return NULL;
|
|
||||||
|
Frodo::Frodo()
|
||||||
char *what = (char *)xmalloc(strlen(path) + strlen(file) + 3);
|
{
|
||||||
struct stat st;
|
Prefs p;
|
||||||
const char *out = NULL;
|
|
||||||
|
TheC64 = NULL;
|
||||||
sprintf(what, "%s/%s", path, file);
|
ThePrefs = p; /* Silly workaround to fix joystick bug */
|
||||||
if (stat(what, &st) == 0)
|
TheDefaultPrefs = p;
|
||||||
out = what;
|
}
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
/*
|
||||||
|
* Process command line arguments
|
||||||
void Frodo::LoadFrodorc()
|
*/
|
||||||
{
|
char *network_server_connect = 0;
|
||||||
const char *paths[] = {
|
|
||||||
"/frodo", // Wii
|
void Frodo::ArgvReceived(int argc, char **argv)
|
||||||
".",
|
{
|
||||||
"/apps/frodo", // Wii
|
if (argc == 2)
|
||||||
"frodo",
|
network_server_connect = argv[1];
|
||||||
NULL, // Filled in below
|
}
|
||||||
NULL, // also filled in below
|
|
||||||
"/usr/share/frodo",
|
const char *try_path(const char *path, const char *file)
|
||||||
NULL,
|
{
|
||||||
};
|
if (path == NULL || file == NULL)
|
||||||
const char *prefs_path = NULL;
|
return NULL;
|
||||||
const char *prefs_name = NULL;
|
|
||||||
const char *total_name = NULL;
|
char *what = (char *)xmalloc(strlen(path) + strlen(file) + 3);
|
||||||
char home_1[255];
|
struct stat st;
|
||||||
char home_2[255];
|
const char *out = NULL;
|
||||||
int i;
|
|
||||||
|
sprintf(what, "%s/%s", path, file);
|
||||||
if (getenv("HOME"))
|
if (stat(what, &st) == 0)
|
||||||
{
|
out = what;
|
||||||
snprintf(home_1, sizeof(home_1), "%s/.frodo", getenv("HOME"));
|
|
||||||
snprintf(home_2, sizeof(home_2), "%s/frodo", getenv("HOME"));
|
return out;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
void Frodo::LoadFrodorc()
|
||||||
strcpy(home_1, "");
|
{
|
||||||
strcpy(home_2, "");
|
const char *paths[] = {
|
||||||
}
|
"/frodo", // Wii
|
||||||
paths[4] = home_1;
|
".",
|
||||||
paths[5] = home_2;
|
"/apps/frodo", // Wii
|
||||||
|
"frodo",
|
||||||
for (i = 0; paths[i]; i++)
|
NULL, // Filled in below
|
||||||
{
|
NULL, // also filled in below
|
||||||
const char *p;
|
"/usr/share/frodo",
|
||||||
const char *name = "frodorc";
|
NULL,
|
||||||
|
};
|
||||||
p = try_path(paths[i], name);
|
const char *prefs_path = NULL;
|
||||||
|
const char *prefs_name = NULL;
|
||||||
if (p)
|
const char *total_name = NULL;
|
||||||
{
|
char home_1[255];
|
||||||
prefs_path = paths[i];
|
char home_2[255];
|
||||||
prefs_name = name;
|
int i;
|
||||||
total_name = p;
|
|
||||||
break;
|
if (getenv("HOME"))
|
||||||
}
|
{
|
||||||
free((void*)p);
|
snprintf(home_1, sizeof(home_1), "%s/.frodo", getenv("HOME"));
|
||||||
}
|
snprintf(home_2, sizeof(home_2), "%s/frodo", getenv("HOME"));
|
||||||
|
}
|
||||||
// Load preferences
|
else
|
||||||
if (total_name)
|
{
|
||||||
{
|
strcpy(home_1, "");
|
||||||
ThePrefs.Load(total_name);
|
strcpy(home_2, "");
|
||||||
strncpy(ThePrefs.PrefsPath, total_name, sizeof(ThePrefs.PrefsPath));
|
}
|
||||||
} else
|
paths[4] = home_1;
|
||||||
printf("No frodorc, using default\n");
|
paths[5] = home_2;
|
||||||
|
|
||||||
free((void*)total_name);
|
for (i = 0; paths[i]; i++)
|
||||||
}
|
{
|
||||||
|
const char *p;
|
||||||
/*
|
const char *name = "frodorc";
|
||||||
* Arguments processed, run emulation
|
|
||||||
*/
|
p = try_path(paths[i], name);
|
||||||
|
|
||||||
void Frodo::ReadyToRun(void)
|
if (p)
|
||||||
{
|
{
|
||||||
if (getcwd(AppDirPath, 256) == NULL)
|
prefs_path = paths[i];
|
||||||
strcpy(AppDirPath, "");
|
prefs_name = name;
|
||||||
|
total_name = p;
|
||||||
this->LoadFrodorc();
|
break;
|
||||||
if (network_server_connect)
|
}
|
||||||
strncpy(ThePrefs.NetworkServer, network_server_connect,
|
free((void*)p);
|
||||||
sizeof(ThePrefs.NetworkServer));
|
}
|
||||||
panic_if (!init_graphics(),
|
|
||||||
"Can't initialize graphics!\n");
|
// Load preferences
|
||||||
|
if (total_name)
|
||||||
// Create and start C64
|
{
|
||||||
TheC64 = new C64;
|
ThePrefs.Load(total_name);
|
||||||
DataStore::ds = new DataStore();
|
strncpy(ThePrefs.PrefsPath, total_name, sizeof(ThePrefs.PrefsPath));
|
||||||
TimerController::init();
|
} else
|
||||||
Gui::init();
|
printf("No frodorc, using default\n");
|
||||||
load_rom_files();
|
|
||||||
TheC64->Run();
|
free((void*)total_name);
|
||||||
|
}
|
||||||
delete TheC64;
|
|
||||||
|
/*
|
||||||
#if defined(GEKKO)
|
* Arguments processed, run emulation
|
||||||
fatUnmount("sd:");
|
*/
|
||||||
#endif
|
|
||||||
}
|
void Frodo::ReadyToRun(void)
|
||||||
|
{
|
||||||
/*
|
if (getcwd(AppDirPath, 256) == NULL)
|
||||||
* Determine whether path name refers to a directory
|
strcpy(AppDirPath, "");
|
||||||
*/
|
|
||||||
|
this->LoadFrodorc();
|
||||||
bool IsDirectory(const char *path)
|
if (network_server_connect)
|
||||||
{
|
strncpy(ThePrefs.NetworkServer, network_server_connect,
|
||||||
struct stat st;
|
sizeof(ThePrefs.NetworkServer));
|
||||||
return stat(path, &st) == 0 && S_ISDIR(st.st_mode);
|
panic_if (!init_graphics(),
|
||||||
}
|
"Can't initialize graphics!\n");
|
||||||
|
|
||||||
|
// Create and start C64
|
||||||
|
TheC64 = new C64;
|
||||||
|
DataStore::ds = new DataStore();
|
||||||
|
TimerController::init();
|
||||||
|
Gui::init();
|
||||||
|
load_rom_files();
|
||||||
|
TheC64->Run();
|
||||||
|
|
||||||
|
delete TheC64;
|
||||||
|
|
||||||
|
#if defined(GEKKO)
|
||||||
|
fatUnmount("sd:");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Determine whether path name refers to a directory
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool IsDirectory(const char *path)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
return stat(path, &st) == 0 && S_ISDIR(st.st_mode);
|
||||||
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 6.3 KiB |
Loading…
Reference in New Issue
Block a user