From: kub Date: Thu, 16 Nov 2023 20:53:05 +0000 (+0200) Subject: build, revisions and fixes for opendingux based platforms X-Git-Tag: v2.00~163 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=250c8ffbc0d8796ecaa0aeb6a43b15ec58ca9b97;p=picodrive.git build, revisions and fixes for opendingux based platforms --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0beb46b..61fc10ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,7 +172,7 @@ jobs: ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD) ./configure --platform=miyoo make -j2 - mv PicoDrive.zip PicoDrive-miyoo-$ver.zip + mv PicoDrive-miyoo.zip PicoDrive-miyoo-$ver.zip - name: artifacts uses: actions/upload-artifact@v3 with: diff --git a/Makefile b/Makefile index e39cd8e7..1120f8bb 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ endif chkCCflag = $(shell n=/dev/null; echo $(1) | tr " " "\n" | while read f; do \ $(CC) $$f -x c -c $$n -o $$n 2>$$n && echo "_$$f" | tr -d _; done) -ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","gp2x" "opendingux" "miyoo" "rpi1")) +ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","gp2x" "opendingux" "rpi1")) # very small caches, avoid optimization options making the binary much bigger CFLAGS += -fno-common -finline-limit=42 -fno-unroll-loops -ffast-math CFLAGS += $(call chkCCflag, -fno-stack-protector) @@ -136,11 +136,18 @@ $(TARGET)-dge.zip: .od_data all: $(TARGET)-dge.zip CFLAGS += -DSDL_SURFACE_SW # some legacy dinguces had bugs in HWSURFACE else +ifneq (,$(filter %__MIYOO__, $(CFLAGS))) +$(TARGET)-miyoo.zip: .od_data + rm -f .od_data/default.*.desktop .od_data/PicoDrive.dge + cd .od_data && zip -9 -r ../$@ * +all: $(TARGET)-miyoo.zip +else $(TARGET).opk: .od_data rm -f .od_data/PicoDrive.dge mksquashfs .od_data $@ -all-root -noappend -no-exports -no-xattrs all: $(TARGET).opk endif +endif ifneq (,$(filter %mips32r2, $(CFLAGS))) CFLAGS += -DMIPS_USE_SYNCI # mips32r2 clear_cache uses SYNCI instead of a syscall @@ -152,22 +159,6 @@ use_inputmap ?= 1 # OpenDingux is a generic platform, really. PLATFORM := generic endif -ifeq "$(PLATFORM)" "miyoo" -$(TARGET).zip: $(TARGET) - $(RM) -rf .od_data - mkdir .od_data - cp -r platform/opendingux/data/. .od_data - cp platform/game_def.cfg .od_data - cp $< .od_data/PicoDrive - $(STRIP) .od_data/PicoDrive - rm -f .od_data/default.*.desktop .od_data/PicoDrive.dge - cd .od_data && zip -9 -r ../$@ * -all: $(TARGET).zip - -OBJS += platform/opendingux/inputmap.o -use_inputmap ?= 1 -PLATFORM := generic -endif ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","rpi1" "rpi2")) CFLAGS += -DHAVE_GLES -DRASPBERRY CFLAGS += -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads/ -I/opt/vc/include/interface/vmcs_host/linux/ diff --git a/configure b/configure index 12b5a46e..aede7215 100755 --- a/configure +++ b/configure @@ -105,29 +105,29 @@ set_platform() opendingux | gcw0 | rg350) # more modern devices using opendingux, with Ingenic MIPS JZ4770 or newer sound_drivers="sdl" - # mostly based on opendingux for gcw0, save device type as C define. + # mostly based on opendingux for gcw0 CFLAGS="$CFLAGS -D__OPENDINGUX__" MFLAGS="-march=mips32r2" platform="opendingux" ;; - odbeta) - # various devices with opendingux beta, arch flags from toolchain default - MFLAGS="" - platform="opendingux" - ;; rg99) # RG99 using opendingux, with Ingenic MIPS JZ4725B sound_drivers="sdl" - # mostly based on opendingux for gcw0, save device type as C define. - MFLAGS="-march=mips32" CFLAGS="$CFLAGS -D__OPENDINGUX__" + MFLAGS="-march=mips32" platform="opendingux" ;; miyoo) # Miyoo BittBoy, PocketGO 1, PowKiddy V90/Q90 with Allwinner F1C100s sound_drivers="sdl" + CFLAGS="$CFLAGS -D__OPENDINGUX__" MFLAGS="-mcpu=arm926ej-s -marm" - platform="miyoo" + platform="opendingux" + ;; + odbeta) + # various devices with opendingux beta, arch flags from toolchain default + MFLAGS="" + platform="opendingux" ;; pandora) sound_drivers="oss alsa" @@ -279,7 +279,7 @@ arm*) esac case "$platform" in -rpi1 | rpi2 | generic | opendingux | odbeta | miyoo) +rpi1 | rpi2 | generic | opendingux) need_sdl="yes" ;; esac @@ -363,6 +363,7 @@ test -n "$SDL_CONFIG" || SDL_CONFIG="$(ls $SYSROOT/*/*bin*/sdl-config 2>/dev/nul #test -n "$SDL_CONFIG" || SDL_CONFIG="$(ls $SYSROOT/*bin*/sdl2-config 2>/dev/null | grep /bin/sdl2-config | head -n 1)" #test -n "$SDL_CONFIG" || SDL_CONFIG="$(ls $SYSROOT/*/*bin*/sdl2-config 2>/dev/null | grep /bin/sdl2-config | head -n 1)" SDLVERSION=sdl && echo $SDL_CONFIG | grep -q sdl2 && SDLVERSION=sdl2 +test -n "$SDL_CONFIG" || SDL_CONFIG=false MAIN_LDLIBS="$LDLIBS -lm" diff --git a/platform/opendingux/data/default.lepus.desktop b/platform/opendingux/data/default.lepus.desktop new file mode 100644 index 00000000..857f932f --- /dev/null +++ b/platform/opendingux/data/default.lepus.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Picodrive +Comment=A mega drive/genesis emulator +Exec=PicoDrive %f +Icon=megadrive +Terminal=false +Categories=emulators; +MimeType=.md;.smd;.gen;.bin;.sms;.gg;.sg;.cue;.chd;.cso;.iso;.32x;.pco;.zip diff --git a/platform/opendingux/inputmap.c b/platform/opendingux/inputmap.c index c6382f30..a8af36b2 100644 --- a/platform/opendingux/inputmap.c +++ b/platform/opendingux/inputmap.c @@ -78,26 +78,25 @@ const char * const _in_sdl_key_names[SDLK_LAST] = { [SDLK_RETURN] = "START", [SDLK_ESCAPE] = "SELECT", -#if defined(__OPENDINGUX__) - [SDLK_HOME] = "POWER", - - [SDLK_TAB] = "L1", - [SDLK_BACKSPACE] = "R1", - [SDLK_PAGEUP] = "L2", - [SDLK_PAGEDOWN] = "R2", - [SDLK_KP_DIVIDE] = "L3", - [SDLK_KP_PERIOD] = "R3", -#elif defined(__MIYOO__) +#if defined(__MIYOO__) [SDLK_TAB] = "L1", [SDLK_BACKSPACE] = "R1", [SDLK_RALT] = "L2", [SDLK_RSHIFT] = "R2", - [SDLK_RCTRL] = "R", -#else + [SDLK_RCTRL] = "RESET", +#elif defined(__GCW0__) || defined(__DINGUX__) || defined(__RETROFW__) [SDLK_TAB] = "L", [SDLK_BACKSPACE] = "R", [SDLK_POWER] = "POWER", [SDLK_PAUSE] = "LOCK", +#else + [SDLK_TAB] = "L1", + [SDLK_BACKSPACE] = "R1", + [SDLK_PAGEUP] = "L2", + [SDLK_PAGEDOWN] = "R2", + [SDLK_KP_DIVIDE] = "L3", + [SDLK_KP_PERIOD] = "R3", + [SDLK_HOME] = "POWER", #endif }; const char * const (*in_sdl_key_names)[SDLK_LAST] = &_in_sdl_key_names; diff --git a/platform/psp/plat.c b/platform/psp/plat.c index d15b1b5e..0232b1d0 100644 --- a/platform/psp/plat.c +++ b/platform/psp/plat.c @@ -272,4 +272,4 @@ int posix_memalign(void **p, size_t align, size_t size) if (p) *p = memalign(align, size); return (p ? *p ? 0 : ENOMEM : EINVAL); -} \ No newline at end of file +} diff --git a/tools/release.sh b/tools/release.sh index 97814a82..eb093096 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -72,7 +72,7 @@ mv PicoDrive.opk release-$rel/PicoDrive-gcw0_$rel.opk # rg350, gkd350h etc: JZ4770 or newer docker pull ghcr.io/irixxxx/toolchain-opendingux echo " git config --global --add safe.directory /home/picodrive &&\ - ./configure --platform=opendingux &&\ + ./configure --platform=rg350 &&\ make clean && make -j2 all "\ | docker run -i -v$PWD:/home/picodrive -w/home/picodrive --rm ghcr.io/irixxxx/toolchain-opendingux sh && mv PicoDrive.opk release-$rel/PicoDrive-opendingux_$rel.opk @@ -85,7 +85,7 @@ echo " git config --global --add safe.directory /home/picodrive &&\ ./configure --platform=miyoo &&\ make clean && make -j2 all "\ | docker run -i -v$PWD:/home/picodrive -w/home/picodrive --rm ghcr.io/irixxxx/toolchain-miyoo sh && -mv PicoDrive.zip release-$rel/PicoDrive-miyoo_$rel.zip +mv PicoDrive-miyoo.zip release-$rel/PicoDrive-miyoo_$rel.zip } [ -z "${plat##* psp *}" ] && { @@ -122,7 +122,7 @@ mv PicoDrive.opk release-$rel/PicoDrive-odbeta-gcw0_$rel.opk } [ -z "${plat##* odbeta-lepus *}" ] && { -# lepus (untested): JZ4760 (mips32r1 with fpu) +# rg300 and other ingenic lepus based (untested): JZ4760 (mips32r1 with fpu) docker pull ghcr.io/irixxxx/toolchain-odbeta-lepus echo " git config --global --add safe.directory /home/picodrive &&\ ./configure --platform=opendingux --platform=odbeta &&\