(Wii) Some work on Wii port - included szlib.c - moved input-related

function over to input_luts.c
This commit is contained in:
TwinAphex51224 2012-03-12 22:39:29 +01:00
parent 36885e35d7
commit dd9f4be2aa
7 changed files with 38 additions and 35 deletions

View File

@ -541,6 +541,9 @@ int main(int argc, char *argv[])
xdk360_video_init();
xdk360_input_init();
ssnes_input_set_default_keybind_names_for_emulator();
menu_init();
begin_loop:

View File

@ -7,9 +7,9 @@
DEBUG = 0
CC = powerpc-eabi-gcc
CXX = powerpc-eabi-g++
LD = powerpc-eabi-ld
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld
DOL_TARGET := ssnes.dol
ELF_TARGET := ssnes.elf
@ -23,7 +23,7 @@ CXXFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
LDFLAGS := $(MACHDEP)
LIBS := -lfat -lsnes -lwiiuse -logc -lbte -lfreetype
OBJ = wii/main.o fifo_buffer.o ssnes.o driver.o gfx/fonts.o file.o settings.o message.o rewind.o movie.o ups.o bps.o strl.o screenshot.o audio/hermite.o dynamic.o audio/utils.o conf/config_file.o wii/audio.o wii/input.o wii/video.o console/sgui.o console/list.o console/font.bmpobj
OBJ = wii/main.o fifo_buffer.o ssnes.o driver.o gfx/fonts.o file.o settings.o message.o rewind.o movie.o ups.o bps.o strl.o screenshot.o audio/hermite.o dynamic.o audio/utils.o conf/config_file.o wii/audio.o wii/input.o wii/video.o console/sgui.o console/list.o console/font.bmpobj console/main_wrap.o console/console_ext.o console/szlib/szlib.o
CFLAGS += -std=gnu99 -DSSNES_CONSOLE -DHAVE_CONFIGFILE=1 -DHAVE_GETOPT_LONG -DHAVE_FREETYPE -DPACKAGE_VERSION=\"0.9.5\" -Dmain=ssnes_main -Wno-char-subscripts
@ -38,7 +38,7 @@ endif
all: $(DOL_TARGET)
%.dol: %.elf
elf2dol $< $@
$(DEVKITPPC)/bin/elf2dol $< $@
$(ELF_TARGET): $(OBJ)
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)

View File

@ -20,7 +20,6 @@
#include "../boolean.h"
#include "../strl.h"
#include "../libsnes.hpp"
#include "../input/input_luts.h"
#include "../general.h"
#include <string.h>
#include <ctype.h>
@ -77,30 +76,6 @@ void ssnes_console_name_from_id(char *name, size_t size)
}
}
void ssnes_console_set_default_keybind_names_for_emulator(void)
{
const char *id = snes_library_id();
// Genesis Plus GX/Next
if (strstr(id, "Genesis Plus GX"))
{
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_B],
"B button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_B]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_A],
"C button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_A]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_X],
"Y button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_X]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_Y],
"A button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_Y]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_L],
"X button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_L]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_R],
"Z button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_R]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_SELECT],
"Mode button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_SELECT]));
}
}
#ifdef HAVE_ZLIB
static int ssnes_extract_currentfile_in_zip(unzFile uf)
{

View File

@ -29,10 +29,6 @@ const char *ssnes_console_get_rom_ext(void);
// Transforms a library id to a name suitable as a pathname.
void ssnes_console_name_from_id(char *name, size_t size);
// Sets custom default keybind names (some systems emulated by the emulator
// will need different keybind names for buttons, etc.)
void ssnes_console_set_default_keybind_names_for_emulator(void);
#ifdef HAVE_ZLIB
int ssnes_extract_zipfile(const char *zip_path);
#endif

View File

@ -23,7 +23,9 @@
#endif
#include <stddef.h>
#include <string.h>
#include "input_luts.h"
#include "../strl.h"
uint64_t ssnes_default_keybind_lut[SSNES_FIRST_META_KEY];
@ -238,3 +240,26 @@ const char *ssnes_input_find_platform_key_label(uint64_t joykey)
return "Unknown";
}
void ssnes_input_set_default_keybind_names_for_emulator(void)
{
const char *id = snes_library_id();
// Genesis Plus GX/Next
if (strstr(id, "Genesis Plus GX"))
{
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_B],
"B button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_B]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_A],
"C button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_A]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_X],
"Y button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_X]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_Y],
"A button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_Y]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_L],
"X button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_L]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_R],
"Z button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_R]));
strlcpy(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_SELECT],
"Mode button", sizeof(ssnes_default_libsnes_keybind_name_lut[SNES_DEVICE_ID_JOYPAD_SELECT]));
}
}

View File

@ -114,5 +114,9 @@ const char *ssnes_input_find_platform_key_label(uint64_t joykey);
uint64_t ssnes_input_find_previous_platform_key(uint64_t joykey);
uint64_t ssnes_input_find_next_platform_key(uint64_t joykey);
// Sets custom default keybind names (some systems emulated by the emulator
// will need different keybind names for buttons, etc.)
void ssnes_input_set_default_keybind_names_for_emulator(void);
#endif

View File

@ -596,7 +596,7 @@ int main(int argc, char *argv[])
ps3_input_init();
oskutil_init(&g_console.oskutil_handle, 0);
ssnes_console_set_default_keybind_names_for_emulator();
ssnes_input_set_default_keybind_names_for_emulator();
menu_init();