mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
Add support for the OpenDingux platform
This commit is contained in:
parent
4e3551a5f6
commit
d4bea61c8f
12 changed files with 105 additions and 5 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -16,3 +16,6 @@ mds/
|
||||||
cfg/
|
cfg/
|
||||||
libs/
|
libs/
|
||||||
obj/
|
obj/
|
||||||
|
.opk_data
|
||||||
|
PicoDrive
|
||||||
|
PicoDrive.opk
|
||||||
|
|
17
Makefile
17
Makefile
|
@ -55,7 +55,21 @@ asm_cdpico = 0
|
||||||
asm_cdmemory = 0
|
asm_cdmemory = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# frontend
|
ifeq "$(PLATFORM)" "opendingux"
|
||||||
|
opk: $(TARGET).opk
|
||||||
|
|
||||||
|
$(TARGET).opk: $(TARGET)
|
||||||
|
$(RM) -rf .opk_data
|
||||||
|
cp -r platform/opendingux/data .opk_data
|
||||||
|
cp $< .opk_data/PicoDrive
|
||||||
|
$(STRIP) .opk_data/PicoDrive
|
||||||
|
mksquashfs .opk_data $@ -all-root -noappend -no-exports -no-xattrs
|
||||||
|
|
||||||
|
OBJS += platform/opendingux/inputmap.o
|
||||||
|
|
||||||
|
# OpenDingux is a generic platform, really.
|
||||||
|
PLATFORM := generic
|
||||||
|
endif
|
||||||
ifeq "$(PLATFORM)" "generic"
|
ifeq "$(PLATFORM)" "generic"
|
||||||
OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME
|
OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME
|
||||||
OBJS += platform/common/plat_sdl.o
|
OBJS += platform/common/plat_sdl.o
|
||||||
|
@ -156,6 +170,7 @@ target_: $(TARGET)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(TARGET) $(OBJS)
|
$(RM) $(TARGET) $(OBJS)
|
||||||
|
$(RM) -r .opk_data
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
$(TARGET): $(OBJS)
|
||||||
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS)
|
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS)
|
||||||
|
|
11
configure
vendored
11
configure
vendored
|
@ -31,7 +31,7 @@ check_define()
|
||||||
# setting options to "yes" or "no" will make that choice default,
|
# setting options to "yes" or "no" will make that choice default,
|
||||||
# "" means "autodetect".
|
# "" means "autodetect".
|
||||||
|
|
||||||
platform_list="generic pandora gp2x"
|
platform_list="generic pandora gp2x opendingux"
|
||||||
platform="generic"
|
platform="generic"
|
||||||
sound_driver_list="oss alsa sdl"
|
sound_driver_list="oss alsa sdl"
|
||||||
sound_drivers=""
|
sound_drivers=""
|
||||||
|
@ -51,6 +51,7 @@ optimize_arm920="no"
|
||||||
CC="${CC-${CROSS_COMPILE}gcc}"
|
CC="${CC-${CROSS_COMPILE}gcc}"
|
||||||
CXX="${CXX-${CROSS_COMPILE}g++}"
|
CXX="${CXX-${CROSS_COMPILE}g++}"
|
||||||
AS="${AS-${CROSS_COMPILE}as}"
|
AS="${AS-${CROSS_COMPILE}as}"
|
||||||
|
STRIP="${STRIP-${CROSS_COMPILE}strip}"
|
||||||
SDL_CONFIG="`$CC --print-sysroot`/usr/bin/sdl-config"
|
SDL_CONFIG="`$CC --print-sysroot`/usr/bin/sdl-config"
|
||||||
MAIN_LDLIBS="$LDLIBS -lm"
|
MAIN_LDLIBS="$LDLIBS -lm"
|
||||||
config_mak="config.mak"
|
config_mak="config.mak"
|
||||||
|
@ -68,6 +69,9 @@ set_platform()
|
||||||
case "$platform" in
|
case "$platform" in
|
||||||
generic)
|
generic)
|
||||||
;;
|
;;
|
||||||
|
opendingux)
|
||||||
|
sound_drivers="sdl"
|
||||||
|
;;
|
||||||
pandora)
|
pandora)
|
||||||
sound_drivers="oss alsa"
|
sound_drivers="oss alsa"
|
||||||
optimize_cortexa8="yes"
|
optimize_cortexa8="yes"
|
||||||
|
@ -111,7 +115,7 @@ if [ "$show_help" = "yes" ]; then
|
||||||
echo " --sound-drivers=LIST sound output drivers [guessed]"
|
echo " --sound-drivers=LIST sound output drivers [guessed]"
|
||||||
echo " available: $sound_driver_list"
|
echo " available: $sound_driver_list"
|
||||||
echo "influential environment variables:"
|
echo "influential environment variables:"
|
||||||
echo " CROSS_COMPILE CC CXX AS CFLAGS ASFLAGS LDFLAGS LDLIBS"
|
echo " CROSS_COMPILE CC CXX AS STRIP CFLAGS ASFLAGS LDFLAGS LDLIBS"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -225,7 +229,7 @@ arm*)
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$platform" in
|
case "$platform" in
|
||||||
generic)
|
generic | opendingux)
|
||||||
need_sdl="yes"
|
need_sdl="yes"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -361,6 +365,7 @@ echo >> $config_mak
|
||||||
echo "CC = $CC" >> $config_mak
|
echo "CC = $CC" >> $config_mak
|
||||||
echo "CXX = $CXX" >> $config_mak
|
echo "CXX = $CXX" >> $config_mak
|
||||||
echo "AS = $AS" >> $config_mak
|
echo "AS = $AS" >> $config_mak
|
||||||
|
echo "STRIP = $STRIP" >> $config_mak
|
||||||
echo "CFLAGS += $CFLAGS" >> $config_mak
|
echo "CFLAGS += $CFLAGS" >> $config_mak
|
||||||
echo "ASFLAGS += $ASFLAGS" >> $config_mak
|
echo "ASFLAGS += $ASFLAGS" >> $config_mak
|
||||||
echo "LDFLAGS += $LDFLAGS" >> $config_mak
|
echo "LDFLAGS += $LDFLAGS" >> $config_mak
|
||||||
|
|
|
@ -72,12 +72,15 @@ const struct menu_keymap in_sdl_joy_map[] __attribute__((weak)) =
|
||||||
{ SDLK_WORLD_3, PBTN_MA3 },
|
{ SDLK_WORLD_3, PBTN_MA3 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern const char * const in_sdl_key_names[] __attribute__((weak));
|
||||||
|
|
||||||
static const struct in_pdata in_sdl_platform_data = {
|
static const struct in_pdata in_sdl_platform_data = {
|
||||||
.defbinds = in_sdl_defbinds,
|
.defbinds = in_sdl_defbinds,
|
||||||
.key_map = in_sdl_key_map,
|
.key_map = in_sdl_key_map,
|
||||||
.kmap_size = sizeof(in_sdl_key_map) / sizeof(in_sdl_key_map[0]),
|
.kmap_size = sizeof(in_sdl_key_map) / sizeof(in_sdl_key_map[0]),
|
||||||
.joy_map = in_sdl_joy_map,
|
.joy_map = in_sdl_joy_map,
|
||||||
.jmap_size = sizeof(in_sdl_joy_map) / sizeof(in_sdl_joy_map[0]),
|
.jmap_size = sizeof(in_sdl_joy_map) / sizeof(in_sdl_joy_map[0]),
|
||||||
|
.key_names = in_sdl_key_names,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YUV stuff */
|
/* YUV stuff */
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit c19e28f62660cdaed26698234cff9c084517b34c
|
Subproject commit d685ce4625e9f3b25b0852d31960cb429da06a9d
|
9
platform/opendingux/data/default.gcw0.desktop
Normal file
9
platform/opendingux/data/default.gcw0.desktop
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=Picodrive
|
||||||
|
Comment=A megadrive/genesis emulator
|
||||||
|
Exec=PicoDrive
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
StartupNotify=true
|
||||||
|
Icon=megadrive
|
||||||
|
Categories=emulators;
|
BIN
platform/opendingux/data/megadrive.png
Normal file
BIN
platform/opendingux/data/megadrive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
platform/opendingux/data/skin/background.png
Normal file
BIN
platform/opendingux/data/skin/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
platform/opendingux/data/skin/font.png
Normal file
BIN
platform/opendingux/data/skin/font.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
7
platform/opendingux/data/skin/readme.txt
Normal file
7
platform/opendingux/data/skin/readme.txt
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
The skin images can be customized, but there are several limitations:
|
||||||
|
|
||||||
|
background.png - must be 320x240 image with 24bit RGB colors.
|
||||||
|
font.png - must be 128x160 8bit grayscale image.
|
||||||
|
selector.png - must be 8x10 8bit grayscale image.
|
||||||
|
|
||||||
|
Font and selector colors can be changed by editing skin.txt.
|
3
platform/opendingux/data/skin/skin.txt
Normal file
3
platform/opendingux/data/skin/skin.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
// html-style hex color codes, ex. ff0000 is red, 0000ff is blue, etc.
|
||||||
|
text_color=ffffff
|
||||||
|
selection_color=0000c0
|
55
platform/opendingux/inputmap.c
Normal file
55
platform/opendingux/inputmap.c
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <SDL_keysym.h>
|
||||||
|
|
||||||
|
#include "../libpicofe/input.h"
|
||||||
|
#include "../libpicofe/in_sdl.h"
|
||||||
|
#include "../common/input_pico.h"
|
||||||
|
|
||||||
|
const struct in_default_bind in_sdl_defbinds[] = {
|
||||||
|
{ SDLK_UP, IN_BINDTYPE_PLAYER12, GBTN_UP },
|
||||||
|
{ SDLK_DOWN, IN_BINDTYPE_PLAYER12, GBTN_DOWN },
|
||||||
|
{ SDLK_LEFT, IN_BINDTYPE_PLAYER12, GBTN_LEFT },
|
||||||
|
{ SDLK_RIGHT, IN_BINDTYPE_PLAYER12, GBTN_RIGHT },
|
||||||
|
{ SDLK_LSHIFT, IN_BINDTYPE_PLAYER12, GBTN_A },
|
||||||
|
{ SDLK_LALT, IN_BINDTYPE_PLAYER12, GBTN_B },
|
||||||
|
{ SDLK_LCTRL, IN_BINDTYPE_PLAYER12, GBTN_C },
|
||||||
|
{ SDLK_RETURN, IN_BINDTYPE_PLAYER12, GBTN_START },
|
||||||
|
{ SDLK_ESCAPE, IN_BINDTYPE_EMU, PEVB_MENU },
|
||||||
|
{ SDLK_TAB, IN_BINDTYPE_EMU, PEVB_PICO_PPREV },
|
||||||
|
{ SDLK_BACKSPACE, IN_BINDTYPE_EMU, PEVB_PICO_PNEXT },
|
||||||
|
{ SDLK_BACKSPACE, IN_BINDTYPE_EMU, PEVB_STATE_SAVE },
|
||||||
|
{ SDLK_TAB, IN_BINDTYPE_EMU, PEVB_STATE_LOAD },
|
||||||
|
{ SDLK_SPACE, IN_BINDTYPE_EMU, PEVB_FF },
|
||||||
|
{ 0, 0, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
const struct menu_keymap in_sdl_key_map[] =
|
||||||
|
{
|
||||||
|
{ SDLK_UP, PBTN_UP },
|
||||||
|
{ SDLK_DOWN, PBTN_DOWN },
|
||||||
|
{ SDLK_LEFT, PBTN_LEFT },
|
||||||
|
{ SDLK_RIGHT, PBTN_RIGHT },
|
||||||
|
{ SDLK_LCTRL, PBTN_MOK },
|
||||||
|
{ SDLK_LALT, PBTN_MBACK },
|
||||||
|
{ SDLK_SPACE, PBTN_MA2 },
|
||||||
|
{ SDLK_LSHIFT, PBTN_MA3 },
|
||||||
|
{ SDLK_TAB, PBTN_L },
|
||||||
|
{ SDLK_BACKSPACE, PBTN_R },
|
||||||
|
};
|
||||||
|
|
||||||
|
const char * const in_sdl_key_names[SDLK_LAST] = {
|
||||||
|
[SDLK_UP] = "UP",
|
||||||
|
[SDLK_DOWN] = "DOWN",
|
||||||
|
[SDLK_LEFT] = "LEFT",
|
||||||
|
[SDLK_RIGHT] = "RIGHT",
|
||||||
|
[SDLK_LCTRL] = "A",
|
||||||
|
[SDLK_LALT] = "B",
|
||||||
|
[SDLK_LSHIFT] = "X",
|
||||||
|
[SDLK_SPACE] = "Y",
|
||||||
|
[SDLK_TAB] = "L",
|
||||||
|
[SDLK_BACKSPACE] = "R",
|
||||||
|
[SDLK_RETURN] = "START",
|
||||||
|
[SDLK_ESCAPE] = "SELECT",
|
||||||
|
[SDLK_POWER] = "POWER",
|
||||||
|
[SDLK_PAUSE] = "LOCK",
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue