- Implement RETRO_ENVIRONMENT_GET_USERNAME callback as a no-op. - Explicitly execute core in libc application context. - Pause audio only when audio is connected. - Fix keys in tyrquake run scenario, use depot packages, disable audio. Fix #76
198 lines
5.0 KiB
Plaintext
198 lines
5.0 KiB
Plaintext
# setting environment variable FORCE_QEMU permits running netperf in qemu
|
|
set force_qemu [info exists ::env(FORCE_QEMU)]
|
|
|
|
if {[expr [have_include "power_on/qemu"] && !$force_qemu]} {
|
|
puts "\Game emulation inside Qemu is not recommended.\n"
|
|
exit
|
|
}
|
|
|
|
#
|
|
# Check used commands
|
|
#
|
|
set wget [check_installed wget]
|
|
set unzip [check_installed unzip]
|
|
|
|
create_boot_directory
|
|
|
|
import_from_depot \
|
|
genodelabs/src/[base_src] \
|
|
genodelabs/pkg/[drivers_interactive_pkg] \
|
|
genodelabs/src/init \
|
|
genodelabs/src/report_rom \
|
|
|
|
build {
|
|
app/retro_frontend
|
|
libretro/tyrquake
|
|
server/fb_upscale
|
|
server/input_remap
|
|
}
|
|
|
|
#
|
|
# Generate config
|
|
#
|
|
|
|
append config {
|
|
<config verbose="yes">
|
|
<default caps="128"/>
|
|
<parent-provides>
|
|
<service name="CPU"/>
|
|
<service name="IO_MEM"/>
|
|
<service name="IO_PORT"/>
|
|
<service name="IRQ"/>
|
|
<service name="LOG"/>
|
|
<service name="PD"/>
|
|
<service name="RM"/>
|
|
<service name="ROM"/>
|
|
</parent-provides>
|
|
<default-route>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</default-route>
|
|
|
|
<start name="timer">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides><service name="Timer"/></provides>
|
|
</start>
|
|
|
|
<start name="drivers" caps="1000">
|
|
<resource name="RAM" quantum="32M"/>
|
|
<binary name="init"/>
|
|
<route>
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
<any-service> <parent/> </any-service>
|
|
</route>
|
|
<provides>
|
|
<service name="Input"/>
|
|
<service name="Framebuffer"/>
|
|
</provides>
|
|
</start>
|
|
|
|
<start name="fb_upscale">
|
|
<resource name="RAM" quantum="4M"/>
|
|
<provides> <service name="Framebuffer"/> </provides>
|
|
<route>
|
|
<service name="Framebuffer">
|
|
<child name="drivers"/> </service>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>
|
|
<start name="input_remap">
|
|
<resource name="RAM" quantum="2M"/>
|
|
<provides> <service name="Input"/> </provides>
|
|
<config>
|
|
<!-- Map Genode keys to libretro keys.
|
|
This is really awkward, keycodes from the 'retro_frontend -> input'
|
|
report must be cross-referenced from libretro.h to the retro_frontend
|
|
translation table. In the future the frontend may use logical
|
|
names in the 'input' report or feature a built-in remapper.
|
|
-->
|
|
<map from="KEY_A" to="BTN_LEFT"/>
|
|
<map from="KEY_W" to="BTN_FORWARD"/>
|
|
<map from="KEY_S" to="BTN_BACK"/>
|
|
<map from="KEY_D" to="BTN_RIGHT"/>
|
|
|
|
<map from="KEY_RIGHT" to="BTN_B"/>
|
|
<map from="KEY_DOWN" to="BTN_A"/>
|
|
<map from="KEY_LEFT" to="BTN_X"/>
|
|
<map from="KEY_UP" to="BTN_Y"/>
|
|
|
|
<map from="KEY_Q" to="BTN_TL"/>
|
|
<map from="KEY_E" to="BTN_TR"/>
|
|
|
|
<map from="KEY_LEFTSHIFT" to="BTN_THUMBL"/>
|
|
|
|
<map from="KEY_LEFTCTRL" to="BTN_TR2"/>
|
|
<map from="KEY_SPACE" to="BTN_TL2"/>
|
|
|
|
|
|
<map from="KEY_GRAVE" to="BTN_SELECT"/>
|
|
<map from="KEY_ESC" to="BTN_START"/>
|
|
<map from="KEY_ENTER" to="BTN_A"/>
|
|
</config>
|
|
<route>
|
|
<service name="Input">
|
|
<child name="drivers"/> </service>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>
|
|
<start name="report_rom">
|
|
<resource name="RAM" quantum="4M"/>
|
|
<provides> <service name="Report"/> </provides>
|
|
<config verbose="yes"/>
|
|
</start>
|
|
<start name="retro_frontend">
|
|
<resource name="RAM" quantum="64M"/>
|
|
<config core="tyrquake_libretro.lib.so">
|
|
<libc stdout="/dev/log" stderr="/dev/log"/>
|
|
<vfs>
|
|
<tar name="quake.tar"/>
|
|
<dir name="dev"> <log/> </dir>
|
|
<dir name="id1"> <tar name="quake.tar"/> </dir>
|
|
<ram/>
|
|
</vfs>
|
|
</config>
|
|
<route>
|
|
<service name="Framebuffer">
|
|
<child name="fb_upscale"/> </service>
|
|
<service name="Input">
|
|
<child name="input_remap"/> </service>
|
|
<service name="Report">
|
|
<child name="report_rom"/> </service>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>
|
|
</config>}
|
|
|
|
install_config $config
|
|
|
|
#
|
|
# Download and extract shareware Quake
|
|
#
|
|
if {![file exist "bin/quake.tar"]} {
|
|
if {![file exist bin/quake_sw.zip]} {
|
|
puts "Downloading shareware Quake..."
|
|
set zip_url "https://archive.org/download/quakeshareware/QUAKE_SW.zip"
|
|
catch { exec $wget $zip_url -O bin/quake_sw.zip }
|
|
}
|
|
|
|
puts "Extracting Quake data..."
|
|
exec mkdir -p bin/tmp/quake
|
|
exec $unzip -o bin/quake_sw.zip -d bin/tmp
|
|
exec mv "bin/tmp/QUAKE_SW/ID1/CONFIG.CFG" "bin/tmp/quake/config.cfg"
|
|
exec mv "bin/tmp/QUAKE_SW/ID1/PAK0.PAK" "bin/tmp/quake/pak0.pak"
|
|
exec tar cf bin/quake.tar -C bin/tmp/quake .
|
|
exec rm -rf bin/tmp
|
|
}
|
|
|
|
#
|
|
# This core requires that some variables be set by the frontend
|
|
#
|
|
set variables_fd [open "bin/variables" w]
|
|
puts $variables_fd {
|
|
<variables>
|
|
<variable key="tyrquake_colored_lighting" value="disabled"/>
|
|
<variable key="tyrquake_resolution" value="640x400"/>
|
|
<variable key="tyrquake_retropad_layout" value="1: New layout"/>
|
|
</variables>
|
|
}
|
|
close $variables_fd
|
|
|
|
# generic modules
|
|
build_boot_image {
|
|
fb_upscale
|
|
input_remap
|
|
libc.lib.so
|
|
libm.lib.so
|
|
quake.tar
|
|
retro_frontend
|
|
stdcxx.lib.so
|
|
tyrquake_libretro.lib.so
|
|
variables
|
|
}
|
|
|
|
append qemu_args " -soundhw es1370 "
|
|
|
|
run_genode_until forever
|
|
|
|
rm bin/variables
|