1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
|
# Global definitions
platform ?= unix
core_platform ?= $(platform)
CC = $(CROSS_COMPILE)gcc
SYSROOT = $(shell $(CC) --print-sysroot)
PROCS = -j4
OBJS = libpicofe/input.o libpicofe/in_sdl.o libpicofe/linux/in_evdev.o libpicofe/linux/plat.o libpicofe/fonts.o libpicofe/readpng.o libpicofe/config_file.o cheat.o config.o content.o core.o menu.o main.o options.o overrides.o patch.o scale.o unzip.o util.o video.o
BIN = picoarch
CFLAGS += -Wall
CFLAGS += -fdata-sections -ffunction-sections -DPICO_HOME_DIR='"/.picoarch/"' -flto
CFLAGS += -I./ -I./libretro-common/include/ $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
LDFLAGS = -lc -ldl -lgcc -lm -lSDL -lasound -lpng -lz -Wl,--gc-sections -flto
# Unpolished or slow cores that build
# EXTRA_CORES += fbalpha2012 mame2003_plus prboom scummvm tyrquake
CORES = beetle-pce-fast bluemsx fceumm fmsx gambatte gme gpsp mame2000 pcsx_rearmed picodrive quicknes smsplus-gx snes9x2002 snes9x2005 $(EXTRA_CORES)
ifneq ($(platform), trimui)
CORES := $(CORES) dosbox-pure fake-08 snes9x2005_plus snes9x2010
endif
# CORES = dosbox-pure
beetle-pce-fast_REPO = https://github.com/libretro/beetle-pce-fast-libretro
beetle-pce-fast_CORE = mednafen_pce_fast_libretro.so
beetle-pce-fast_TYPES = pce,cue,ccd,chd,toc,m3u
bluemsx_REPO = https://github.com/libretro/blueMSX-libretro
bluemsx_TYPES = rom,ri,mx1,mx2,dsk,col,sg,sc,cas,m3u
dosbox-pure_REPO = https://github.com/schellingb/dosbox-pure
dosbox-pure_CORE = dosbox_pure_libretro.so
dosbox-pure_TYPES = zip,dosz,exe,com,bat,iso,cue,ins,img,ima,vhd,jrc,tc,m3u,m3u8,conf
fake-08_REPO = https://github.com/jtothebell/fake-08
fake-08_BUILD_PATH = fake-08/platform/libretro
fake-08_MAKEFILE = Makefile
fake-08_CORE = fake08_libretro.so
fake-08_TYPES = p8,png
fbalpha2012_BUILD_PATH = fbalpha2012/svn-current/trunk
fbalpha2012_MAKEFILE = makefile.libretro
fbalpha2012_TYPES = zip
fceumm_REPO = https://github.com/libretro/libretro-fceumm
fceumm_MAKEFILE = Makefile.libretro
fceumm_TYPES = fds,nes,unf,unif
fmsx_REPO = https://github.com/libretro/fmsx-libretro
fmsx_TYPES = rom,mx1,mx2,dsk,cas
gambatte_REPO = https://github.com/libretro/gambatte-libretro
gambatte_TYPES = gb,gbc,dmg,zip
gme_REPO = https://github.com/libretro/libretro-gme
gpsp_TYPES = gba,bin,zip
mame2000_REPO = https://github.com/libretro/mame2000-libretro
mame2000_TYPES = zip
mame2003_plus_REPO = https://github.com/libretro/mame2003-plus-libretro
mame2003_plus_TYPES = zip
pcsx_rearmed_MAKEFILE = Makefile.libretro
pcsx_rearmed_TYPES = bin,cue,img,mdf,pbp,toc,cbn,m3u,chd
picodrive_MAKEFILE = Makefile.libretro
picodrive_TYPES = bin,gen,smd,md,32x,cue,iso,chd,sms,gg,m3u,68k,sgd
prboom_REPO = https://github.com/libretro/libretro-prboom
prboom_TYPES = wad,iwad,pwad,lmp
quicknes_REPO = https://github.com/libretro/QuickNES_Core
quicknes_TYPES = nes
scummvm_TYPES = scummvm
smsplus-gx_MAKEFILE = Makefile.libretro
smsplus-gx_CORE = smsplus_libretro.so
smsplus-gx_TYPES = sms,bin,rom,col,gg,sg
snes9x2002_TYPES = smc,fig,sfc,gd3,gd7,dx2,bsx,swc,zip
snes9x2005_REPO = https://git.crowdedwood.com/snes9x2005
snes9x2005_REVISION = performance
snes9x2005_TYPES = smc,fig,sfc,gd3,gd7,dx2,bsx,swc,zip
snes9x2005_plus_REPO = https://git.crowdedwood.com/snes9x2005
snes9x2005_plus_REVISION = performance
snes9x2005_plus_FLAGS = USE_BLARGG_APU=1
snes9x2005_plus_TYPES = smc,fig,sfc,gd3,gd7,dx2,bsx,swc,zip
snes9x2010_TYPES = smc,fig,sfc,gd3,gd7,dx2,bsx,swc,zip
tyrquake_TYPES = pak
ifeq ($(platform), trimui)
OBJS += plat_trimui.o
CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s -fno-PIC -DCONTENT_DIR='"/mnt/SDCARD/Roms"'
LDFLAGS += -fno-PIC
else ifeq ($(platform), funkey-s)
OBJS += plat_funkey.o funkey/fk_menu.o funkey/fk_instant_play.o
CFLAGS += -DCONTENT_DIR='"/mnt"' -DFUNKEY_S
LDFLAGS += -fPIC
LDFLAGS += -lSDL_image -lSDL_ttf # For fk_menu
core_platform = classic_armv7_a7
else ifeq ($(platform), unix)
OBJS += plat_linux.o
LDFLAGS += -fPIE
endif
ifeq ($(DEBUG), 1)
CFLAGS += -Og -g
LDFLAGS += -g
else
CFLAGS += -Ofast -DNDEBUG
ifneq ($(PROFILE), 1)
LDFLAGS += -s
endif
endif
ifeq ($(PROFILE), 1)
CFLAGS += -fno-omit-frame-pointer -pg -g
LDFLAGS += -pg -g
else ifeq ($(PROFILE), GENERATE)
CFLAGS += -fprofile-generate=./profile/picoarch
LDFLAGS += -lgcov
else ifeq ($(PROFILE), APPLY)
CFLAGS += -fprofile-use -fprofile-dir=./profile/picoarch -fbranch-probabilities
endif
ifeq ($(MINUI), 1)
MMENU = 1
CFLAGS += -DMINUI
endif
ifeq ($(MMENU), 1)
CFLAGS += -DMMENU
LDFLAGS += -lSDL_image -lSDL_ttf -ldl
endif
CFLAGS += $(EXTRA_CFLAGS)
SOFILES = $(foreach core,$(CORES),$(core)_libretro.so)
print-%:
@echo '$*=$($*)'
all: $(BIN) cores
libpicofe/.patched:
cd libpicofe && ($(foreach patch, $(sort $(wildcard patches/libpicofe/*.patch)), git apply -p1 < ../$(patch) &&) touch .patched)
reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1))
clean-libpicofe:
test ! -f libpicofe/.patched || (cd libpicofe && ($(foreach patch, $(call reverse,$(sort $(wildcard patches/libpicofe/*.patch))), git apply -R -p1 < ../$(patch) &&) rm .patched))
plat_trimui.o: plat_sdl.c
plat_funkey.o: plat_sdl.c
plat_linux.o: plat_sdl.c
overrides.o: overrides.c overrides/*.h
$(BIN): libpicofe/.patched $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) -o $(BIN)
define CORE_template =
$1_REPO ?= https://github.com/libretro/$(1)/
$1_BUILD_PATH ?= $(1)
$1_MAKE = make $(and $($1_MAKEFILE),-f $($1_MAKEFILE)) platform=$(core_platform) $(and $(DEBUG),DEBUG=$(DEBUG)) $(and $(PROFILE),PROFILE=$(PROFILE)) $($(1)_FLAGS)
$(1):
git clone $(if $($1_REVISION),,--depth 1) --recursive $$($(1)_REPO) $(1)
$(if $1_REVISION,cd $(1) && git checkout $($1_REVISION),)
(test ! -d patches/$(1)) || (cd $(1) && $(foreach patch, $(sort $(wildcard patches/$(1)/*.patch)), git apply -p1 < ../$(patch) &&) true)
$(1)/$(1)_libretro.so: $(1)
cd $$($1_BUILD_PATH) && $$($1_MAKE) $(PROCS)
$(1)_libretro.so: $(1)/$(1)_libretro.so
cp $$($1_BUILD_PATH)/$(if $($(1)_CORE),$($(1)_CORE),$(1)_libretro.so) $(1)_libretro.so
clean-$(1):
test ! -d $(1) || cd $$($1_BUILD_PATH) && $$($1_MAKE) clean
rm -f $(1)_libretro.so
endef
$(foreach core,$(CORES),$(eval $(call CORE_template,$(core))))
cores: $(SOFILES)
clean-picoarch:
rm -f $(OBJS) $(BIN)
rm -rf pkg
rm -f *.opk
clean: clean-libpicofe clean-picoarch
rm -f $(SOFILES)
clean-all: $(foreach core,$(CORES),clean-$(core)) clean
force-clean: clean
rm -rf $(CORES)
ifeq ($(platform), trimui)
beetle-pce-fast_NAME = pce_fast
beetle-pce-fast_ROM_DIR = PCE
beetle-pce-fast_PAK_NAME = TurboGrafx-16
bluemsx_NAME = blueMSX
bluemsx_ROM_DIR = MSX
bluemsx_PAK_NAME = MSX (blueMSX)
fbalpha2012_NAME = fba2012
fbalpha2012_ROM_DIR = ARCADE
fbalpha2012_PAK_NAME = Arcade (FBA)
fceumm_ROM_DIR = FC
fceumm_PAK_NAME = Nintendo (fceumm)
fmsx_NAME = fMSX
fmsx_ROM_DIR = MSX
fmsx_PAK_NAME = MSX
gambatte_ROM_DIR = GB
gambatte_PAK_NAME = Game Boy
gpsp_ROM_DIR = GBA
gpsp_PAK_NAME = Game Boy Advance
define gpsp_PAK_EXTRA
needs-swap
endef
gme_ROM_DIR = MUSIC
gme_PAK_NAME = Game Music
mame2000_ROM_DIR = ARCADE
mame2000_PAK_NAME = Arcade
mame2003_plus_NAME = mame2003+
mame2003_plus_ROM_DIR = ARCADE
mame2003_plus_PAK_NAME = Arcade (MAME 2003-plus)
picodrive_ROM_DIR = MD
picodrive_PAK_NAME = Genesis
pcsx_rearmed_ROM_DIR = PS
pcsx_rearmed_PAK_NAME = PlayStation
define pcsx_rearmed_PAK_EXTRA
needs-swap
endef
quicknes_ROM_DIR = FC
quicknes_PAK_NAME = Nintendo
smsplus-gx_ROM_DIR = MS
smsplus-gx_PAK_NAME = Game Gear
snes9x2002_ROM_DIR = SFC
snes9x2002_PAK_NAME = Super Nintendo
snes9x2005_ROM_DIR = SFC
snes9x2005_PAK_NAME = Super Nintendo (2005)
# -- gmenunx
dist-gmenu-section:
mkdir -p pkg/gmenunx/Apps/picoarch
mkdir -p pkg/gmenunx/Apps/gmenunx/sections/emulators
mkdir -p pkg/gmenunx/Apps/gmenunx/sections/libretro
touch pkg/gmenunx/Apps/gmenunx/sections/libretro/.section
dist-gmenu-picoarch: $(BIN) dist-gmenu-section
cp $(BIN) pkg/gmenunx/Apps/picoarch
$(file >pkg/gmenunx/Apps/gmenunx/sections/emulators/picoarch,$(picoarch_SHORTCUT))
define CORE_gmenushortcut =
$1_NAME ?= $1
define $1_SHORTCUT
title=$$($1_NAME)
exec=/mnt/SDCARD/Apps/picoarch/picoarch
params=/mnt/SDCARD/Apps/picoarch/$1_libretro.so
selectordir=/mnt/SDCARD/Roms/$($1_ROM_DIR)
selectorfilter=$($1_TYPES)
endef
dist-gmenu-$(1): $(BIN) $(1)_libretro.so dist-gmenu-picoarch dist-gmenu-section
cp $1_libretro.so pkg/gmenunx/Apps/picoarch
$$(file >pkg/gmenunx/Apps/gmenunx/sections/libretro/$(1),$$($(1)_SHORTCUT))
endef
$(foreach core, $(CORES),$(eval $(call CORE_gmenushortcut,$(core))))
define picoarch_SHORTCUT
title=$(BIN)
exec=/mnt/SDCARD/Apps/picoarch/picoarch
endef
dist-gmenu: $(foreach core, $(CORES), dist-gmenu-$(core)) dist-gmenu-picoarch
cp README.trimui.md pkg/
# -- MinUI
ifeq ($(MINUI), 1)
define CORE_pak_template =
define $1_LAUNCH_SH
#!/bin/sh
# $($1_PAK_NAME).pak/launch.sh
EMU_EXE=picoarch
EMU_DIR=$$$$(dirname "$$$$0")
ROM_DIR=$$$${EMU_DIR/.pak/}
ROM_DIR=$$$${ROM_DIR/Emus/Roms}
EMU_NAME=$$$${ROM_DIR/\/mnt\/SDCARD\/Roms\//}
ROM=$$$${1}
$($1_PAK_EXTRA)
HOME="$$$$ROM_DIR"
cd "$$$$EMU_DIR"
"$$$$EMU_DIR/$$$$EMU_EXE" ./$1_libretro.so "$$$$ROM" &> "/mnt/SDCARD/.minui/logs/$$$$EMU_NAME.txt"
endef
dist-minui-$(1): $(BIN) $(1)_libretro.so
mkdir -p "pkg/MinUI/Emus/$($1_PAK_NAME).pak"
$$(file >$1_launch.sh,$$($1_LAUNCH_SH))
mv $1_launch.sh "pkg/MinUI/Emus/$($1_PAK_NAME).pak/launch.sh"
cp $(BIN) $1_libretro.so "pkg/MinUI/Emus/$($1_PAK_NAME).pak"
endef
define picoarch_LAUNCH_SH
#!/bin/sh
# picoarch.pak/launch.sh
EMU_EXE=picoarch
EMU_DIR=$$(dirname "$$0")
EMU_NAME=$$EMU_EXE
needs-swap
HOME="/mnt/SDCARD/Games/picoarch.pak/"
cd "$$EMU_DIR"
"$$EMU_DIR/$$EMU_EXE" &> "/mnt/SDCARD/.minui/logs/$$EMU_NAME.txt"
endef
dist-minui-picoarch: $(BIN) cores
mkdir -p "pkg/MinUI/Games/picoarch.pak"
$(file >picoarch_launch.sh,$(picoarch_LAUNCH_SH))
mv picoarch_launch.sh "pkg/MinUI/Games/picoarch.pak/launch.sh"
cp $(BIN) $(SOFILES) "pkg/MinUI/Games/picoarch.pak"
$(foreach core, $(CORES),$(eval $(call CORE_pak_template,$(core))))
dist-minui: $(foreach core, $(CORES), dist-minui-$(core)) dist-minui-picoarch
cp README.trimui.md pkg/
endif # MINUI=1
picoarch.zip:
make platform=trimui PROFILE=APPLY clean-all dist-gmenu
rm -f $(OBJS) $(BIN)
make platform=trimui PROFILE=APPLY EXTRA_CFLAGS=-Wno-error=coverage-mismatch MINUI=1 dist-minui
cd pkg && zip -r ../picoarch.zip *
endif # platform=trimui
ifeq ($(platform), funkey-s)
beetle-pce-fast_NAME = pce_fast
beetle-pce-fast_ROM_DIR = /mnt/PCE-TurboGrafx
beetle-pce-fast_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/mednafen/opk/pce/pce.png
beetle-pce-fast_ICON = pce
bluemsx_NAME = blueMSX
bluemsx_ROM_DIR = /mnt/MSX
bluemsx_ICON_URL = https://raw.githubusercontent.com/MiyooCFW/gmenunx/master/assets/miyoo/skins/PixUI/icons/dingux-msx.png
bluemsx_ICON = dingux-msx
dosbox-pure_ROM_DIR = /mnt/DOS
dosbox-pure_ICON_URL = https://raw.githubusercontent.com/MiyooCFW/gmenunx/master/assets/miyoo/skins/PixUI/icons/dosbox.png
dosbox-pure_ICON = dosbox
fake-08_NAME = fake-08
fake-08_ROM_DIR = /mnt/PICO-8
fake-08_ICON_URL = https://raw.githubusercontent.com/jtothebell/fake-08/master/platform/vita/sce_sys/icon0.png
fake-08_ICON = icon0
fbalpha2012_NAME = fba2012
fbalpha2012_ROM_DIR = /mnt/Arcade
fbalpha2012_ICON_URL = https://raw.githubusercontent.com/MiyooCFW/gmenunx/master/assets/miyoo/skins/PixUI/icons/fba.png
fbalpha2012_ICON = fba
fceumm_ROM_DIR = /mnt/NES
fceumm_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/FCEUX/opk/nes/nes.png
fceumm_ICON = nes
fmsx_NAME = fMSX
fmsx_ROM_DIR = /mnt/MSX
fmsx_ICON_URL = https://raw.githubusercontent.com/MiyooCFW/gmenunx/master/assets/miyoo/skins/PixUI/icons/dingux-msx.png
fmsx_ICON = dingux-msx
gambatte_ROM_DIR = /mnt/Game Boy
gambatte_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/gnuboy/opk/gb/gb.png
gambatte_ICON = gb
gme_ROM_DIR = /mnt/Music
gme_TYPES = ay,gbs,gym,hes,kss,nsf,nsfe,sap,spc,vgm,vgz,zip
gme_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/gmenu2x/FunKey/data/skins/240x240/Default/icons/gmu.png
gme_ICON = gmu
gpsp_ROM_DIR = /mnt/Game Boy Advance
gpsp_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/gpsp/opk/gba/gba.png
gpsp_ICON = gba
mame2000_ROM_DIR = /mnt/Arcade
mame2000_ICON_URL = https://raw.githubusercontent.com/MiyooCFW/gmenunx/master/assets/miyoo/skins/PixUI/icons/mame.png
mame2000_ICON = mame
mame2003_plus_NAME = mame2003+
mame2003_plus_ROM_DIR = /mnt/Arcade
mame2003_plus_ICON_URL = https://raw.githubusercontent.com/MiyooCFW/gmenunx/master/assets/miyoo/skins/PixUI/icons/mame.png
mame2003_plus_ICON = icon
pcsx_rearmed_ROM_DIR = /mnt/PS1
pcsx_rearmed_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/PCSX-ReARMed/opk/ps1/ps1.png
pcsx_rearmed_ICON = ps1
picodrive_ROM_DIR = /mnt/Sega Genesis
picodrive_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/picodrive/opk/megadrive/megadrive.png
picodrive_ICON = megadrive
quicknes_ROM_DIR = /mnt/NES
quicknes_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/FCEUX/opk/nes/nes.png
quicknes_ICON = nes
smsplus-gx_ROM_DIR = /mnt/Game Gear
smsplus-gx_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/mednafen/opk/gamegear/gamegear.png
smsplus-gx_ICON = gamegear
snes9x2002_ROM_DIR = /mnt/SNES
snes9x2002_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/PocketSNES/opk/snes/snes.png
snes9x2002_ICON = snes
snes9x2005_ROM_DIR = /mnt/SNES
snes9x2005_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/PocketSNES/opk/snes/snes.png
snes9x2005_ICON = snes
snes9x2005_plus_NAME = snes9x2005+
snes9x2005_plus_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/PocketSNES/opk/snes/snes.png
snes9x2005_plus_ICON = snes
snes9x2005_plus_ROM_DIR = /mnt/SNES
snes9x2010_NAME = snes9x2010
snes9x2010_ICON_URL = https://raw.githubusercontent.com/FunKey-Project/FunKey-OS/master/FunKey/package/PocketSNES/opk/snes/snes.png
snes9x2010_ICON = snes
snes9x2010_ROM_DIR = /mnt/SNES
define CORE_opk =
$1_NAME ?= $1
define $1_DESKTOP
[Desktop Entry]
Name=$$($1_NAME)
Comment=
Exec=picoarch ./$1_libretro.so %f
Icon=$$($1_ICON)
SelectorBrowser=true
SelectorDir=$($1_ROM_DIR)
SelectorFilter=$($1_TYPES)
Terminal=false
Type=Application
StartupNotify=true
Categories=emulators;
endef
picoarch-$(1).opk: $(BIN) $(1)_libretro.so
mkdir -p .opkdata
cp $1_libretro.so .opkdata
$$(file >$$($(1)_NAME).funkey-s.desktop,$$($(1)_DESKTOP))
mv $$($(1)_NAME).funkey-s.desktop .opkdata
cp $(BIN) $(1)_libretro.so .opkdata
$(if $($(1)_ICON_URL),cd .opkdata && curl -L $($(1)_ICON_URL) -O && mogrify -resize '32x32>' $($(1)_ICON).png,)
cd .opkdata && mksquashfs * ../picoarch-$(1).opk -all-root -no-xattrs -noappend -no-exports
rm -r .opkdata
endef
$(foreach core, $(CORES),$(eval $(call CORE_opk,$(core))))
define picoarch_DESKTOP
[Desktop Entry]
Name=picoarch
Comment=Small screen libretro frontend
Exec=picoarch
Icon=sdlretro_icon
Terminal=false
Type=Application
StartupNotify=true
Categories=emulators;
endef
picoarch.opk: $(BIN) cores
mkdir -p .opkdata
$(file >picoarch.funkey-s.desktop,$(picoarch_DESKTOP))
mv picoarch.funkey-s.desktop .opkdata
cp $(BIN) $(SOFILES) .opkdata
cd .opkdata && curl -L -O https://raw.githubusercontent.com/FunKey-Project/sdlretro/master/data/sdlretro_icon.png
cd .opkdata && mksquashfs * ../picoarch.opk -all-root -no-xattrs -noappend -no-exports
rm -r .opkdata
define picoarch_lite_DESKTOP
[Desktop Entry]
Name=picoarch-lite
Comment=Small screen libretro frontend
Exec=picoarch %f
Icon=sdlretro_icon
SelectorBrowser=true
SelectorDir=/mnt/Libretro/cores
SelectorFilter=so
Terminal=false
Type=Application
StartupNotify=true
Categories=emulators;
endef
picoarch-lite.opk: $(BIN)
mkdir -p .opkdata
$(file >picoarch.funkey-s.desktop,$(picoarch_lite_DESKTOP))
mv picoarch.funkey-s.desktop .opkdata
cp $(BIN) .opkdata
cd .opkdata && curl -L -O https://raw.githubusercontent.com/FunKey-Project/sdlretro/master/data/sdlretro_icon.png
cd .opkdata && mksquashfs * ../picoarch-lite.opk -all-root -no-xattrs -noappend -no-exports
rm -r .opkdata
picoarch-funkey-s.zip: picoarch.opk $(foreach core, $(CORES), picoarch-$(core).opk)
rm -f picoarch-funkey-s.zip
zip picoarch-funkey-s.zip README.funkey-s.md *.opk
endif # platform=funkey-s
|