(cherry picked from commit 2bf3715e95, adapted)
The original cabinet duplicates Trigger and Event for the rider's other
hand. Keep the primary pair on the first mouse and take the mirror pair
from the left/right buttons of a second mouse, which frees the first
mouse's X1/X2 buttons for Start and Coin in Star Wars Trilogy.
Adapted on dev:
- The second mouse's buttons are used only once dev has unlocked port 2
as a separate mouse. On X11 and Wayland RetroArch reports the same
pointer on every port, and every left click would also press Trigger 2.
- Start/Coin on X1/X2 are mapped in ApplyGunLayout, only for games with
the analog joystick (Star Wars Trilogy), next to the gun games' own
light-gun Start/Coin mapping.
- The input descriptor labels are left out (per-game descriptors are
not on dev).
Tested: Linux: Star Wars Trilogy with a mouse: X2 inserts a coin, X1
starts, left and right click fire Trigger and Event; gamepad unchanged.
Simulate the Model 3 network board in the Libretro core and carry its
frames over RetroArch Netplay's packet interface
(RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE), so linked cabinets can play
together without the standalone socket board.
Supported families: Daytona USA 2, Harley-Davidson, Scud Race, Sega
Rally 2, Ski Champ, Spikeout and Spikeout Final Edition (Type 1); Le
Mans 24, Virtual On 2 and Dirt Devils (Type 2). Two to sixteen cabinets,
with a handshake, a common roster, role checks and a per-frame exchange
with a timeout. New options: Network Board (connected by default) and
Linked Cabinets (2-16).
Squashed from these commits, whose intermediate steps (Daytona 2 only,
then Scud Race, then all Type 1, then Type 2) have no value on their own:
e7ea7d48b0 Add experimental Daytona 2 cabinet networking
437256ddbb Add experimental Scud Race cabinet networking
c4f012958a Recognize linked-cabinet network hardware
d43eda03ec Enable Sega Rally 2 network transport
55b59bbcb3 Support multi-cabinet linked play
bc3788aea7 Enable netpacket transport for all Type 1 games
f7029c25f6 Add Type 2 linked-cabinet transport
03ee7631c0 Connect the network board by default
ad99627b37 Document all supported linked-cabinet families
74da0c469b Document linked-cabinet role requirements (option text)
Adapted on dev:
- The game-aware NVRAM settings options are not on dev, so each
cabinet's link role (Master/Slave/Satellite) and car or machine number
are set in the game's Service Menu, as on real cabinets; the option
descriptions say so. Option visibility per game is left out.
- The NetBoard config defaults were only defined for Windows; they are
now defined on every platform, and NetworkCabinets uses unsigned
bounds so it compiles.
- Network, NetworkCabinets and SimulateNet are applied after the
Supermodel.ini merge, like the other core options.
- jni/Android.mk gets -DNET_BOARD and the new source file.
- The README part of 74da0c4 waits for the dev README.
Tested: Linux, two RetroArch 1.22.2 instances over localhost Netplay:
Daytona 2 (Type 1) and Le Mans 24 (Type 2) link as Master and Slave and
exchange frames; Daytona 2 races show the other cabinet's car at full
speed. Single player with the board connected and no Netplay: Daytona 2,
Scud Race, Sega Rally 2 and Le Mans 24 boot to attract mode as before,
same speed and log. Windows, macOS, RPi5 and Android arm64 (ndk-build)
builds pass.
Force Feedback never rumbled: the core option only gated the rumble
output, but the drive board generates force effects only when
Supermodel's ForceFeedback setting is set, which defaults to false and
is not in the bundled Supermodel.ini. Set it from the core option after
the INI merge. Switching the option off still stops rumble immediately;
switching it on mid-game shows a restart message, as the drive board
reads the setting when it is reset.
With the drive board running, self-centre and friction were sent
straight to the rumble motors. Both are steady wheel resistance held for
the whole race, so the controller vibrated nonstop from the coin insert.
Follow standalone Supermodel's XInput gamepad mapping instead: ignore
self-centre and friction, rumble on a constant force only above 30%,
and add the vibrate effect, on both motors.
Tested: Linux, Xbox 360 controller, Scud Race. Before: no rumble at all;
with only the drive board enabled, constant rumble from the coin insert
that did not stop. After: rumble in hard corners and collisions only
(log of a one-minute race: 250 constant-force commands, 91 above 30%,
30 self-centre commands ignored).
(cherry picked from commit 7fa0473dc3, adapted)
Expose standalone Supermodel's NoWhiteFlash setting as a core option and
enable Force Feedback by default.
Adapted on dev:
- Only "Disable White Flash" (video, default off, requires restarting
the content) and the Force Feedback default are taken. It is applied
after the Supermodel.ini merge and reuses the existing restart message.
- The Model 3 Timing Mode option is left out: dev already runs native
57.524 Hz timing, and a 60 Hz mode was rejected earlier.
- Force Feedback defaults to on: games without a drive board do not
rumble, games with one do.
Tested: Linux: Virtua Fighter 3 boot shows a white screen at frame 240
by default and a black one with Disable White Flash on; later frames are
identical. Force Feedback shows on by default.
(cherry picked from commit 3d2296f00f, adapted)
The Upright Star Wars Trilogy cabinet reverses the yoke's horizontal
electrical range relative to Deluxe. When the game's NVRAM says Upright,
mirror the virtual yoke X axis so right still steers right in mouse,
analog stick and hybrid modes.
Adapted on dev:
- The cabinet is read directly from the 93C46 EEPROM (Genibus header
"M3 SEGA SWTA", word 12 bit 0x400 clear = Upright) instead of through
the game-aware NVRAM settings framework, which is not on dev.
- It is checked on the first frame, after the .srm, native .nv or
first-boot template has been loaded; a cabinet change made in the
service menu applies after reloading the content.
- The flag is cleared on content load and unload.
Tested: Linux: Star Wars Trilogy. On dev before, switching the cabinet
to Upright in the service menu reversed left and right (up and down
unchanged). After: Upright logs "analog X inverted" and stick and mouse
steer correctly; Deluxe logs "analog X normal" and is unchanged.
(cherry picked from commit 7ac58a0e60)
Pad the 61-frame average labels to one width so the colons and values
line up in a single column in the monospaced ImGui font.
Applied on dev with the file's CRLF line endings kept.
Tested: Linux: Virtua Fighter 3 with the Timing Overlay enabled shows
all labels aligned and the longest line fits in the overlay window.
(cherry picked from commit 3fc1f09071, adapted)
Both 3D renderers sanitize NaN/Inf fog values used by Star Wars Trilogy
(New3D fogDensity, Legacy3D fogParams). -ffast-math assumes such values
cannot exist and the compiler removes std::isnan/std::isinf checks, so
the fix was dead code in every build.
Adapted on dev:
- Instead of dropping -ffast-math and -funsafe-math-optimizations for
New3D.o and Legacy3D.o, only -fno-finite-math-only is added. That is
enough to keep the checks and leaves the rest of fast-math for the
renderers' matrix and vertex math.
Tested: gcc and clang with -ffast-math fold isnan/isinf to false; with
-fno-finite-math-only they are kept. New3D.o/Legacy3D.o had no unordered
compares before and have them now. Linux: Virtua Fighter 3 and Star Wars
Trilogy render normally. Windows (both renderers), macOS and RPi5
(New3D) builds pass with the flag applied.
(cherry picked from commit 800e6dfe11, adapted)
Render the 3D scene at an integer multiple of the output resolution and
let SuperAA downsample it into the libretro framebuffer. SuperAA's output
now always reaches the frontend, which also makes CRT Colour take effect.
Adapted on dev:
- SuperAA keeps its own target handling; it gains SetOutputTarget() so
Draw() writes into the libretro resolved FBO, which is now always
created at the output size and returned by getSuperModelFBO().
- The option is shown on desktop OpenGL builds only (HAVE_SUPERSAMPLING
in CoreOptionsTypes.h, from the GLES defines) instead of a Makefile
platform list. No LibretroConfigProvider change was needed.
- The value is applied after the Supermodel.ini merge, like the other
core options, and changes reuse the existing "apply after restarting
the content" message.
- The 3D scissor is scaled by the supersampling factor.
- CRLF line endings kept in SuperAA.cpp/.h.
Tested: Linux: default output unchanged; CRT Colour now visibly changes
the colours (Japan D93 strongly, USA D65 subtly); Supersampling 2x and
4x give the full picture with anti-aliased edges in Virtua Fighter 3 and
Scud Race; 2x Resolution + 2x Supersampling and Wide Background + 2x
Supersampling fill the frame; Supersampling + CRT Colour both apply.
Windows build has 3D Renderer, CRT Colour and Supersampling, macOS CRT
Colour and Supersampling, RPi5 none.
(cherry picked from commit 971139dc61, adapted)
Offer runtime New3D or Legacy3D selection only when both renderers are
compiled, negotiate the required GL profile, and expose the native CRT
Colour control behind a build capability flag.
Adapted on dev:
- Quad Rendering is left out: with it enabled New3D draws no 3D geometry,
on master as well as here (issue #21). It can come back once fixed.
- CRT Colour is shown on desktop OpenGL builds only, decided by the GLES
defines rather than a list of platform names, which missed
linux-aarch64, ios-arm64 and tvos-arm64. HAVE_LEGACY3D is still set by
the Makefile, after all platform source filtering.
- The values are applied after the Supermodel.ini merge, like the other
core options, so the core option wins over the INI.
- The capability flags live in CoreOptionsTypes.h, which
libretro_core_options.h now includes before option_defs.
- Changes reuse the existing "apply after restarting the content"
message.
CRT Colour has no visible effect yet: SuperAA's colour-corrected output
is not routed to the libretro framebuffer. Commit 800e6df (supersampling)
in the same series addresses that.
Tested: Linux: Virtua Fighter 3 and Scud Race render normally with
New3D (OpenGL 4.1 core context) and with Legacy3D (compatibility
context); switching the option shows the restart message and a reload
applies it. Windows build has 3D Renderer and CRT Colour, macOS CRT
Colour only, RPi5 neither.
(cherry picked from commit 68c5fa0a4e, adapted)
Keep the canonical option name and enabled default while retaining the
added Apple Silicon MAP_JIT implementation behind it.
Adapted on dev: the option stays behind HAVE_PPC_JIT rather than
__aarch64__, so it only appears when the JIT is built in (the arm64
slice of the osxcross universal build has no JIT). The description no
longer claims a large speed-up or that a restart is needed, since the
option is applied on every option update.
Tested: the Linux x86-64 core has no JIT option and runs Virtua Fighter
3 as before; the RPi5 aarch64 core builds and contains the option,
"JIT Recompiler (ARM64)", enabled by default.
(cherry picked from commit b2d003cbd2, adapted)
Expose a Gun mode that combines relative RetroMouse movement with the
RetroPad cursor while excluding absolute Lightgun coordinates.
Adapted on dev: only the new mode is taken. The option labels keep
dev's names ("Hybrid", "Lightgun", ...), since "Lightgun Only" would be
wrong on dev, where Lightgun mode still falls back to the raw mouse. The
gun device names and input descriptors are left out: they belong to the
#15 input profile system, which dev does not have.
Tested: The Lost World: in the new mode the mouse moves the cursor
relatively (grabbed) and the left stick moves it too; mouse buttons and
B/A fire and reload. Hybrid, Lightgun, Mouse and Analog Stick Cursor
behave as before.
The layout's gear and pedal mappings were only written into the
runtime config when content was loaded. RetroArch's Restart
(retro_reset) only resets the board, so after changing the option the
old mappings stayed active until the content was closed and reloaded.
Worse, the H-pattern decoder reads the option live, so switching away
from it left the right stick with no gears at all.
When the option changes, rewrite the mappings and have Supermodel
re-parse its input mappings, as it does at load, with the emulation
threads paused around it.
Tested: Scud Race, switching all four layouts mid-race without a
restart: each one takes effect at once, and L/R and the pedals keep
working in every layout.
(cherry picked from commit a713d06a95, adapted)
Let the right stick work as a four-position H-pattern gearbox: the
diagonals select gears 1-4 like a real 4-speed lever (up-left 1,
down-left 2, up-right 3, down-right 4). A diagonal needs both axes past
about half travel.
Adapted on dev: the H-pattern is a fourth value of the existing Driving
Controls Layout option ("Standard + H-pattern gearbox on right stick")
rather than a separate option. The decoder drives virtual buttons
JOY1_BUTTON17-20, which are mapped to InputGearShift1-4 only in that
layout, so the other layouts and user mappings are unaffected. The
hysteresis was dropped: Supermodel latches the last gear selected, so
releasing the stick already keeps the gear engaged.
Tested: Scud Race with manual transmission: each diagonal selects its
gear, releasing the stick keeps it, L/R and the analog pedals still
work.
(cherry picked from commit 3daefc806e, adapted)
Map the standalone MultiThreaded and GPUMultiThreaded settings to a
single restart-required Libretro option. Keep the setting independent
from RetroArch threaded video.
- Single Thread: everything runs on the frontend's thread.
- Multi-threaded: the sound and drive boards run on worker threads.
- Multi-threaded + GPU (default): PowerPC emulation also overlaps with
graphics processing. This is what the core has always used.
Adapted on dev: the original applied the option through
ApplyCoreOptions(), which dev does not have; here it is set after the
Supermodel.ini merge, like the other core options, so it overrides the
INI. The active mode is logged when content starts, and changing the
option shows a restart message as dev's other restart-only options do.
Tested: Virtua Fighter 3 and Scud Race in each mode: the log shows the
expected MultiThreaded/GPUMultiThreaded values, the process has one
worker thread less per step down, and the default matches the previous
build (15/16 threads). On a desktop PC Scud Race holds 60 FPS in every
mode; Virtua Fighter 3 needs the GPU thread for 60 FPS (engine 11 ms,
against 17-18 ms without it). Changing the option in game shows the
restart message and restarting applies it.
Remove the lightgunPositionMoved array, which is set but never read
since the gun cursor rework, and give the input descriptor terminator
all of its fields. With this, the files under Src/OSD/libretro build
without warnings.
Tested: Linux build, The Lost World runs with the timing overlay.
(cherry picked from commit d918d05c52)
Remove dead Libretro code and unused declarations, fix initializer and
option terminator warnings, and keep warning suppressions scoped to
vendored/generated sources. Preserve the official engine by excluding
the unrelated historical Z80 CTC behavior change.
Adapted on dev: the conflicts in LibretroWrapper.cpp were resolved
keeping dev's save state version 6 and its audio pacing (one 57.53 Hz
frame of audio per retro_run); the unused NVRAM_FILE_VERSION is
dropped with the old .nv functions that used it. GetKeyName() keeps
dev's real implementation from the keyboard fix. CRLF line endings of
LibretroWrapper.cpp are preserved.
Tested: full clean Linux build goes from 636 to 209 warnings; Windows
(MinGW) and macOS (osxcross) builds succeed. Virtua Fighter 3, Scud
Race, The Lost World and Star Wars Trilogy run with the timing overlay.
No keyboard mapping has ever worked in this core. CInputSystem strips
the KEY_ prefix before calling GetKeyIndex(), so the core received
"D" while its table compared "KEY_D", and every KEY_* entry in
Supermodel.ini was ignored. The keyboard only worked through
RetroArch's keyboard-to-RetroPad binds.
GetKeyIndex() now covers every key name Supermodel accepts (as in the
SDL build, the generic SHIFT, CTRL and ALT have no single libretro key
and stay unmapped). It returns the key's position in the table rather
than a RETROK code, because CInputSystem uses the value to index its
key source arrays; IsKeyPressed() and GetKeyName() translate it back.
The default mappings keep the keys that cannot clash with RetroArch's
default binds: 1-8 (start, coin, service, test) and the arrow keys,
which only repeat what the D-pad already does. The letter keys and
Space are dropped. With RetroArch's default binds they would have fired
together with the pad buttons the same keys are bound to (in Virtua
Fighter 3, A would press Punch and Guard together), and F is
RetroArch's fullscreen hotkey. Players keep today's behaviour, and
KEY_* entries added to Supermodel.ini now work. The bundled
Supermodel.ini is regenerated to match.
Tested: Virtua Fighter 3 with RetroArch's default keyboard binds: 3
inserts a coin and 1 starts, arrows move, z/x/a/s each trigger one
action through the pad binds, d does nothing and f only toggles
fullscreen, 6 enters and leaves the test menu. Star Wars Trilogy, Scud
Race and The Lost World load and run.
(cherry picked from commit 5ed82d6baa, renderer presentation part only)
With the widescreen hack on, the core still rendered a 496x384 frame
and only told the frontend a 16:9 aspect ratio, so RetroArch stretched
it: 2D layers were always stretched, 3D was stretched unless the
viewport covered the whole screen, and Wide Background had no visible
effect.
The core now renders a real 16:9 frame (683x384 times the resolution
multiplier) with the 4:3 game area centred in it. New3D widens
full-screen viewports into the side areas, the 2D layers stay 4:3
unless Wide Background is selected, and gun input is mapped through the
same offset so the aim matches the picture. With widescreen off the
output is pixel-identical to before.
Adapted on dev: dev applies the Widescreen option without a restart,
so the frame size is recomputed in retro_run() and sent with
RETRO_ENVIRONMENT_SET_GEOMETRY; the maximum size reported in the AV
info is the 16:9 width at the current resolution multiplier. The
original's change to hide the crosshair when the gun is off-screen is
left out, because the crosshair code already handles that.
Tested: Virtua Fighter 3 and The Lost World, windowed and fullscreen
at 2560x1440: Widescreen keeps correct proportions with the 4:3 area
centred, 3D gameplay fills the width, Widescreen + Wide Background
fills the screen, live switching works both ways, gun shots land on
the crosshair at the edges and corners, and 4:3 output is unchanged.
(cherry picked from commit 5ed82d6baa, light-gun modes part only)
Gun and yoke axes were mapped to mixed sources such as
"MOUSE_XAXIS,JOY1_XAXIS". Supermodel answers such a mapping with the
first source that is not centred, and an accumulated relative mouse is
almost never exactly centred, so:
- in the analog-gun games (The Lost World, Ocean Hunter, L.A.
Machineguns) the mouse shadowed the stick once it had moved;
- in Star Wars Trilogy the stick returned to wherever the mouse had
been left instead of its centre (5DH/A0H instead of 80H/80H);
- player 2 had no gun at all (all P2 analog-gun inputs were NONE);
- a real light gun's position was never used: MOUSE_XAXIS read only
the RetroMouse.
The input system now exposes separate devices: RetroMouse ports 1/2
(MOUSE, MOUSE2), RetroLightgun ports 1/2 (MOUSE3, MOUSE4), virtual
per-player gun cursors (MOUSE5, MOUSE6) and a virtual yoke (MOUSE7).
Two new options choose their sources and apply immediately:
- Gun Input Mode: Hybrid (default; light gun, mouse or left stick, the
last one moved wins), Lightgun, Mouse, Analog Stick Cursor. The stick
moves the cursor at a set speed and it stays where it is left.
- Star Wars Trilogy Input Mode: Hybrid (default; mouse or absolute
stick, the last one moved wins), Mouse, Analog Stick.
Light gun Reload or AUX_A is the second trigger; IS_OFFSCREEN is no
longer read as a button, which left Shot 2 stuck. Mouse buttons and
wheel are read from all devices.
Adapted on dev: the original put the MOUSE5/6/7 mappings in its control
profiles. Here they are the defaults and, like the driving layout, are
re-applied after the Supermodel.ini merge so an older ini cannot bring
back the mixed sources; the bundled Supermodel.ini is updated to match.
Light gun Start/Select (mouse X1/X2) act as Start/Coin only in the
analog-gun games. KEY_F is not used for the yoke's Event 2, because F
is RetroArch's fullscreen hotkey. Many frontend drivers (RetroArch on
Wayland or X11) report one system pointer on every port, which made
player 2 mirror player 1's aim and shots; port 2's mouse and light gun
are now ignored until they report something port 1 did not, so udev
or raw-input setups with two real devices still work.
Tested: The Lost World gun test: mouse aims and fires as before and
right-click reloads; pad 1 and pad 2 sticks move the P1 and P2 cursors
and B fires; the mouse moves only P1 and a click no longer fires for
P2. Star Wars Trilogy input test: rest at 80H/80H, stick returns to
centre after the mouse was moved, mouse holds its position, fire and
event buttons respond to mouse and pad.
(cherry picked from commit 5ed82d6baa, frame timing diagnostics part only)
The timing overlay was drawn into the frontend framebuffer after the
blit. That is not portable: a hardware frontend may replace or resolve
that target inside video_cb(). It is now drawn into Supermodel's own
FBO before the blit, so it is part of the submitted frame.
The overlay and the [Timing] log gain 61-frame averages for the parts
CModel3's own timings do not see: engine (RunFrame), audio hand-off,
overlay, blit, other, frontend present (shader chain and vsync wait),
the worst frame, the actual frame rate, and the engine and callback
frame-rate caps. Everything is only drawn and logged when the overlay is
enabled.
Partially applied on dev: the original also moved the overlay clock to
60 fps as part of its 60 Hz timing; dev keeps 57.53.
Tested: Sega Rally 2 with glcore, overlay renders correctly with the new
section; game rendering unchanged.
(cherry picked from commit 5ed82d6baa, driving response part only)
"Analog Sensitivity" was parsed but never applied: at 50% the steering
still reached full lock (01H-FFH in Sega Rally 2's input test). It is
replaced by options that act on driving games (Games.xml vehicle input):
- Driving Steering Response: Linear or Progressive (fine center).
- Driving Steering Output Range: 50-150% around the center.
- Driving Accelerator / Brake Output Range: 50-150%, including 75.3%
for games whose pedals read 00-C0.
Defaults (Linear, 100%) leave behavior unchanged.
Adapted on dev: the scaled values are written back into the inputs the
game reads, but Supermodel's digital (keyboard/D-pad) sources are
incremental and start each poll from the previous value. The unscaled
values are now kept and restored before every poll, so the scaling does
not compound from frame to frame. Driving games are detected from the
Games.xml vehicle input instead of the original's control profiles. The
FBNeo Logarithmic curve is left out until the provenance of its table
is checked.
Tested: Sega Rally 2 input test. Range 50%: stick and keyboard reach
41H/BFH and hold there. Progressive: finer center, full lock kept.
Accelerator 75.3%: tops out at C0H.
(cherry picked from commit 5ed82d6baa, renderer/audio option part only)
Expose three settings standalone Supermodel already has, which Libretro
users could only change by editing Supermodel.ini:
- SCSP DSP Engine: New (MAME, default) or Legacy (ElSemi), for games
whose DSP effects sound wrong under the new engine.
- 2D Layer Upscaling Filter: Nearest, Biquintic, Bilinear (default) or
Bicubic. This also fixes the setting being ignored: upscaleMode was
never read from the config nor initialized, so the 2D layers were
always upscaled with Nearest instead of standalone's Bilinear.
- Widescreen Hack gains "Widescreen + Wide Background", which also
stretches the lower 2D layer (applies live).
DSP and upscaling changes need a content restart; the core shows a
message when they change.
Partially applied on dev: the original replaces the widescreen boolean
with a mode enum and drops the renderer re-init on widescreen changes.
Dev keeps its widescreen handling and only adds the background setting.
Tested: Scud Race at 3x, Nearest vs Bilinear screenshots show the 2D
text filtered as selected. Wide Background had no visible effect in the
attract modes tried (no lower 2D layer there).
(cherry picked from commit 5ed82d6baa, crosshair and VSync parts only)
"Show Crosshairs" was parsed but never applied, so the crosshair setting
came only from Supermodel.ini (off). Even when enabled, the crosshair was
drawn into framebuffer 0: the renderers restore it after drawing into
Supermodel's off-screen target, and in Libretro that is not the image
blitted to the frontend. EndFrameVideo() now rebinds Supermodel's FBO
before drawing the crosshair.
The option now selects the native Supermodel mask (Disabled, Player 1,
Player 2, Players 1 & 2), applied at load and live when changed. Old
"enabled"/"disabled" values are still accepted. Analog gun games (Lost
World, Ocean Hunter, L.A. Machineguns) are now detected as gun games
instead of special-casing Lost World by name.
The VSync option did nothing: vsync is owned by the frontend in a
Libretro core. It is removed.
Partially applied on dev: the rest of the original commit (input
profiles, gun input modes, 60 Hz timing, renderer controls) is not
taken here.
Tested: The Lost World. Before: no crosshair with the option enabled.
After: Player 1 / Players 1 & 2 / Disabled all work live.
(cherry picked from commit 5ed82d6baa, input order fixes only)
CInputSystem expects mouse buttons as Left, Middle, Right, X1, X2, but
the RetroMouse buttons were stored as Left, Right, Middle. Every
MOUSE_RIGHT_BUTTON mapping (gun off-screen/reload, Ocean Hunter's
second trigger, the Star Wars event button) answered to middle-click.
IsJoyPOVInDir() indexes the POV array with POV_UP/DOWN/LEFT/RIGHT
(0..3), but it was filled as Up, Right, Down, Left, so a POV_DOWN
mapping read Right. The default mappings use D-pad buttons, so this
only affected custom POV bindings.
Partially applied on dev: the original commit is a large rewrite of the
input layer (per-game control profiles, multiple mouse/lightgun ports,
virtual gun cursors). Only these two ordering fixes are taken here; the
RetroLightgun button layout is left unchanged.
Tested: The Lost World with a mouse. Before: right-click did nothing,
middle-click reloaded. After: right-click reloads.
(cherry picked from commit 5ed82d6baa, audio part only)
Remove AdjustAudioForCPUFrequency(). It scaled the per-frame audio size
by PowerPC frequency / 66 MHz, but the CPU clock changes neither the
frame rate nor the 735 samples the sound board produces per frame. It
ran on every core option update, so with a fixed PowerPC frequency
(e.g. 100 MHz) changing any option in-game cut each sound frame to ~505
samples: the sound sped up and then stopped.
Also seed the ring buffer with two silent packets so the first frontend
callback has valid data while the SoundBoard thread wakes up.
Partially applied on dev: the original also moved the core to a fixed
60 Hz / 735-sample timing. Dev keeps the true 57.524 Hz arcade rate,
so only the audio buffer fixes are taken here.
Tested: Sega Rally 2, PowerPC 100 MHz, toggling Widescreen and the
PowerPC frequency in-game. Before: audio sped up, then went silent.
After: audio stays correct.
Touch overlays and some pads press L2/R2 only digitally and report 0 on the
analog channel, so the trigger pedals in the driving layouts never moved.
Fall back to full travel when the digital button is pressed and the analog
value is 0. Real analog triggers are unaffected.
(cherry picked from commit c58560531e, driving part only)
L/R shift sequentially and L2/R2 are the analog pedals in every driving
layout; the optional layouts only add a gate or a lever on the right stick.
Keyboard bindings stay identical to standalone Supermodel.
Partially applied on dev: the original also removed the Service/Test button
option and hard-wired L3/R3 through direct writes to the input lines. Dev
keeps the option (default L3/R3, routed through the configurable joystick
buttons), so only the driving layout and the matching input descriptor
labels are taken here.
(cherry picked from commit 7c7984f2e2)
Partially applied on dev: the joystick Service/Test mapping (virtual
buttons 21-24) was already here. What this adds is the L3/R3 default,
which keeps Service/Test off the shoulder buttons that the default
driving layout uses for gears, and refreshing the input descriptors
when the option changes.
Request the renderer's required core profile, track context readiness, and avoid entering the emulator when renderer initialization fails.
(cherry picked from commit c5139e94e6)
Adapted for dev: a desktop build with RENDERER=legacy still requests a
compatibility context, since Legacy3D uses fixed-function entry points
that a core profile removes. New3D builds request the 4.1 core profile
as in the original. Tested on Linux/NVIDIA with RetroArch's gl and glcore
drivers (Sega Rally 2, VF3, Scud Race, Daytona 2, Lost World).
Both are arm64 and both are the GLES build with Apple's SDK in front of
it. The renderer already resolves every entry point through glsym on the
other GLES platforms, so nothing here links against a GL framework -
OpenGLES is deprecated on these systems in any case - and Legacy3D is
dropped the way it is for macOS and Android, with an explicit
RENDERER=legacy rejected rather than silently accepted.
No PPC JIT. Writing and then executing the same page needs an entitlement
a libretro core cannot ask for on stock iOS or tvOS, so Model 3 runs on
the interpreter. That is worth saying plainly, and it is still better than
leaving the platform unbuilt.
The dylib names are the ones the ios-arm64 and tvos-arm64 templates look
for, and their after_script checks the platform recorded in the Mach-O,
which is what -isysroot and the version-min flag put there. A missing SDK
is an error at that point rather than an empty -isysroot and a confusing
failure later - the same lesson as the bundled headers in the commit
before this one.
Checked here with make -n and a stub xcrun: glsym_es3.c is compiled and
glsym_gl.c is not, no Legacy3D object reaches the link line, the Unix
FileSystemPath is the one selected, the targets come out as
supermodel_libretro_ios.dylib and supermodel_libretro_tvos.dylib, and
HAVE_PPC_JIT is absent from both. Neither SDK exists outside the Apple
runner, so both jobs are allow_failure until a pipeline has had them.
(cherry picked from commit 3421244b30)
Adapted for dev: dropped the two hunks that extend the RENDERER=legacy
rejection and the HAVE_LEGACY3D/QUAD/CRT/SUPERSAMPLING capability lists,
since those come from PR #13 changes that are not on this branch. The
iOS/tvOS platform section, GLES source filtering and CI jobs are unchanged.
NVRAM_FILE_VERSION was defined as static in libretro.cpp and not
visible to LibretroWrapper.cpp, causing a compile error in debug
builds. Add the constant alongside STATE_FILE_VERSION.
path_mkdir() was replaced with g_vfs_interface->mkdir() in a recent
refactor, but VFS mkdir is single-level only and silently fails when
the parent directory does not exist on fresh installs. Restore the
two-step creation: mkdir [system]/supermodel first, then
[system]/supermodel/Config.
Z80CTC.cpp was added in commit f75f90e but never added to the Android
build, which would cause a link failure. SUPERMODEL_OSD_LIBRETRO aligns
Android.mk with the main Makefile where it was already defined.
Partial application of 66770ce — networking parts omitted (LibretroNetBoard
not present on this branch).
The libretro buildbot invokes the MinGW cross build with platform=win64
(set by the ci-templates windows-x64-mingw.yml), but the Makefile only had
an ifeq ($(platform),win) branch and no catch-all else. With platform=win64
no branch matched at all: TARGET stayed empty, PLATFORM_DEFINES was empty
and "make" reported "Nothing to be done for 'all'". make exited 0, so the
job went green in ~11s while producing no DLL:
PLATFORM_DEFINES ARE:
make: Nothing to be done for 'all'.
...
mv: cannot stat './supermodel_libretro.dll': No such file or directory
WARNING: supermodel_libretro.dll: no matching files
ERROR: No files to upload
Job succeeded
That is why supermodel_libretro.dll has never appeared in the Windows
nightlies while every other platform is published.
- normalize win/win32/win64/windows/wincross64 to "win" right after platform
auto-detection, so every Windows branch (including the FileSystemPath
selection) matches
- stop force-overriding CC/CXX/AR in the cross-compile path. The MXE
container exports x86_64-w64-mingw32.static-gcc; "override CC :=
x86_64-w64-mingw32-gcc" pointed the build at compilers that do not exist
there. Fall back to the plain mingw-w64 names only when no toolchain was
given (origin default), and pick the i686 prefix for win32
- guard the CI job with "test -f ${CORENAME}_libretro.dll" so a no-op build
fails loudly instead of silently uploading nothing
Carry the custom DSB music mapping template forward from the previous Supermodel modernization branch. The wrapper, documentation, and CI artifact already expect this optional system asset.
Keep the active sound-board state tied to the content configuration,
document the restart requirement, and notify the user when the option
changes. This avoids partially applying a live change across the SCSP
and DSB paths.
Ported from PR #13 commit e225710 (applied manually — libretro.cpp
context conflicted with commit-15 variables not present on this branch).
Keep CPU model, bus multiplier, and PCI bridge tied to Model 3 stepping. Manual frequency choices now affect only the emulated per-frame cycle budget, so 25 and 70 MHz no longer silently initialize 66 MHz internal timing.
Retain the additional 25 MHz underclock from the previous supermodel-modern branch. Standalone Supermodel accepts the same value through PowerPCFrequency, while the remaining option labels and presets continue to follow the official Libretro implementation.
Bump both Libretro save-state paths and the shared standalone path to format version 6. The Drive Board Z80 CTC adds serialized state that is not compatible with version 5 files.
Port standalone Supermodel commit fda18d3 and its initializer-order correction while retaining the current BlockFile API. Run the drive-board Z80 at 8 MHz, derive NMIs from its programmed CTC, and preserve the prior zero-time-constant fix where a raw value of zero represents 256.
Port upstream standalone commit fef2b38 so Step 1.x exposes only MPC105 and Step 2.x only MPC106. Keep bridge selection tied to hardware stepping even when the Libretro CPU-frequency override is active, and remove obsolete per-game PCI overrides.
Native FP translation (op63/op59) is not yet fully equivalent to the
interpreter. Harley-Davidson's attract-mode AI visibly diverges with it
enabled; keeping the integer/control/memory JIT and interpreting FP
restores reference behaviour with ample performance headroom.
Cherry-picked from 50a7455 (PR #13).
Declare the GLU dependency explicitly because the Libretro frontend does not guarantee exporting the fixed-function helper used by the compiled Legacy3D renderer.
When no frontend save RAM or valid native NVRAM exists, optionally seed known games with service-menu generated 93C46 settings while leaving backup RAM fresh. Existing saves remain untouched.
Validate the complete block layout and ROM metadata before restoring state, detect truncation or corruption with a checksum, preserve legacy core compatibility, and keep the state format at version 5 for the official engine revision.