Skip to content

Commit 709ffca

Browse files
authored
Merge pull request #121 from chore/ci-and-quality-improvements
chore: CI hygiene + GitFlow + perf tooling (umbrella) 28 commits of CI hygiene, code-quality gates, GitFlow branching, and the toolchain we'll lean on for the upcoming perf work. Headline: - GitFlow: develop integration branch + warn-on-master workflow - 6 strict CI gates + 4 advisory ones (sanitizers / clang-tidy / clang-format / coverage) - Mach-O symbol gating (production .dylib: 46 retro_* exports, 0 leaks) - Single source-of-truth version (CORE_BASE_VERSION in Makefile, generated version.h, .info validated on every build) - macos-x86_64 cross-compiles from arm64 (no more rare-runner stuck releases) - make benchmark target + docs/profiling.md for the perf phase - 4 spike issues opened: #122 (JIT), #123 (OP), #124 (blitter), #125 (ASAN leak triage) All 12 Copilot review threads addressed and resolved. Diff: 50 files, +1905 / -469.
2 parents 4fcf958 + ba042e4 commit 709ffca

50 files changed

Lines changed: 1905 additions & 469 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# clang-format config for virtualjaguar-libretro.
2+
#
3+
# DELIBERATELY MINIMAL. The upstream codebase has mixed brace style
4+
# AND mixed indent (tabs in src/tom/*, spaces in libretro.c, Allman
5+
# braces in src/jerry/jerry.h, K&R elsewhere) per-file. No single
6+
# style works. This config only enforces things that are universally
7+
# consistent across the tree: don't sort includes, don't reflow long
8+
# lines, don't touch preprocessor indent. Brace placement, spacing,
9+
# and indent style are NOT enforced.
10+
#
11+
# The CI check (`clang-format.yml`) runs clang-format-diff on changed
12+
# lines and posts suggestions to the job summary -- it does NOT fail
13+
# the build. Use it as a "consider this" prompt, not a gate.
14+
15+
BasedOnStyle: LLVM
16+
Language: Cpp
17+
18+
# Don't reflow long lines -- author makes wrapping decisions.
19+
ColumnLimit: 0
20+
21+
# libretro / UAE include order is hand-tuned; don't reorder.
22+
SortIncludes: false
23+
IncludeBlocks: Preserve
24+
25+
# Don't touch preprocessor indent -- breaks ifdef-guarded code.
26+
IndentPPDirectives: None
27+
28+
# Tolerate both tab and space indent without rewriting.
29+
UseTab: ForIndentation
30+
TabWidth: 4
31+
IndentWidth: 4
32+
33+
# Don't reformat comments (preserves the upstream's ASCII art).
34+
ReflowComments: false

.clang-tidy

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# clang-tidy config for virtualjaguar-libretro.
2+
#
3+
# Curated check list aimed at catching real bugs in emulator C code
4+
# without flooding the diff with style-preference noise. See the
5+
# CI workflow `clang-tidy` job for how this is invoked (only on
6+
# PR-changed files).
7+
#
8+
# Disabled checks rationale below each `-` entry.
9+
10+
Checks: >
11+
bugprone-*,
12+
clang-analyzer-*,
13+
readability-inconsistent-declaration-parameter-name,
14+
readability-misleading-indentation,
15+
readability-redundant-control-flow,
16+
misc-redundant-expression,
17+
-bugprone-easily-swappable-parameters,
18+
-bugprone-narrowing-conversions,
19+
-bugprone-implicit-widening-of-multiplication-result,
20+
-bugprone-reserved-identifier,
21+
-bugprone-assignment-in-if-condition,
22+
-bugprone-macro-parentheses,
23+
-bugprone-signed-char-misuse,
24+
-bugprone-suspicious-include,
25+
-bugprone-switch-missing-default-case,
26+
-bugprone-branch-clone,
27+
-clang-analyzer-deadcode.DeadStores,
28+
-clang-analyzer-optin.portability.UnixAPI,
29+
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
30+
-clang-analyzer-valist.Uninitialized
31+
32+
# Don't promote to errors yet -- the workflow itself decides via
33+
# --warnings-as-errors / continue-on-error.
34+
WarningsAsErrors: ''
35+
36+
# Apply checks to in-tree headers but skip vendored / generated.
37+
HeaderFilterRegex: '^(src/(core|tom|jerry|cd)|libretro\.c).*'
38+
39+
# Don't run clang-format inline (we have a separate clang-format job).
40+
FormatStyle: none
41+
42+
# Disabled-check rationale:
43+
# - easily-swappable-parameters: emulator hot paths take many same-typed args.
44+
# - narrowing-conversions / implicit-widening: register byte ops trip these constantly.
45+
# - reserved-identifier: __LIBRETRO__ and UAE __regs/__pads use reserved names by design.
46+
# - assignment-in-if-condition: idiomatic in dispatch loops.
47+
# - macro-parentheses: misfires on GET16/SET32 byte-swap macros.
48+
# - signed-char-misuse: ROM byte buffers commonly use signed char.
49+
# - suspicious-include: project includes .c files in a couple of dispatch headers.
50+
# - switch-missing-default-case: cosmetic; switches on bit-field decode patterns
51+
# commonly omit default because all valid bit values are handled.
52+
# - branch-clone: register-decode if-chains in src/cd/cdrom.c and src/tom/tom.c
53+
# intentionally write the same value for several adjacent register addresses
54+
# to make the address->effect mapping legible. Real bug clones are caught
55+
# by code review, not this check.
56+
# - deadcode.DeadStores: blitter / OP / register-decode functions self-doc-init
57+
# locals that are read via macros (BCOMPEN, DSTA2, ...) clang-tidy can't see
58+
# the linkage for. Removing these inits would introduce real bugs.
59+
# - DeprecatedOrUnsafeBufferHandling: MSVC-flavored noise about strcpy/sprintf.
60+
# - optin.portability.UnixAPI: false positive on libretro_core_options.h calloc.
61+
# - valist.Uninitialized: false-positive prone on our log macros.

.ecrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"Exclude": [
3+
"test/roms/.*",
4+
"test/baselines/.*",
5+
"test/tools/build/.*",
6+
"build/.*",
7+
"src/m68000/.*",
8+
"src/bios/jag.*\\.c$",
9+
"src/core/version.h",
10+
"libretro-common/.*",
11+
"docs/atari-jaguar-1999/.*",
12+
".*\\.(png|jpg|jpeg|gif|bmp|ico|pdf|j64|jag|rom|cof|abs|bin|chd|cue|iso|cdi|so|dll|dylib|a|o|bc|exe|dat|gz|tar|zip|tgz|7z)$"
13+
],
14+
"Disable": {
15+
"MaxLineLength": true
16+
}
17+
}

.editorconfig

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# EditorConfig: https://editorconfig.org
2+
#
3+
# Project-wide consistency for line endings / charset / final newline.
4+
# Indentation style is intentionally NOT enforced for C sources here:
5+
# the upstream Virtual Jaguar tree mixes tabs (src/tom, src/jerry) with
6+
# 4-space (libretro.c, src/core/cheat.c) and a sweeping reformat is out
7+
# of scope. Makefiles (tabs required) and YAML (2-space) are pinned.
8+
9+
root = true
10+
11+
[*]
12+
charset = utf-8
13+
end_of_line = lf
14+
insert_final_newline = true
15+
trim_trailing_whitespace = true
16+
17+
# Makefiles: recipe lines must be tabs (make will fail loudly if not),
18+
# but ifeq/else if blocks in this tree mix tab/space indentation for
19+
# readability; we don't enforce a single style here.
20+
21+
# GitHub Actions / generic YAML.
22+
[*.{yml,yaml}]
23+
indent_style = space
24+
indent_size = 2
25+
26+
# Shell scripts: only enforce no-tabs; the existing tree uses 3-space
27+
# in some files and 2-space in others, both fine.
28+
[*.sh]
29+
indent_style = space
30+
31+
# Markdown: trailing two spaces are a hard line-break — don't strip.
32+
[*.md]
33+
trim_trailing_whitespace = false
34+
35+
# Machine-generated UAE 68K core: do not touch.
36+
[src/m68000/**]
37+
charset = unset
38+
end_of_line = unset
39+
insert_final_newline = unset
40+
trim_trailing_whitespace = unset
41+
indent_style = unset
42+
indent_size = unset
43+
44+
# Embedded BIOS / boot stubs are bin2c-generated hex arrays;
45+
# every line ends in trailing whitespace by design.
46+
[src/bios/jag*.c]
47+
trim_trailing_whitespace = unset
48+
49+
# libretro-common is a vendored subtree.
50+
[libretro-common/**]
51+
charset = unset
52+
end_of_line = unset
53+
insert_final_newline = unset
54+
trim_trailing_whitespace = unset
55+
indent_style = unset
56+
indent_size = unset

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @JoeMatt @twinaphex
1+
* @JoeMatt @twinaphex
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Bug report
2+
description: A reproducible behavior bug (crash, wrong output, hang, freeze) in a specific game or scenario.
3+
title: "[bug] "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for filing. The more reproducible this is, the faster it gets fixed. For perf regressions, use the `Performance issue` template instead.
10+
11+
- type: input
12+
id: game
13+
attributes:
14+
label: Game / ROM
15+
description: Title, region, dump notes (homebrew vs commercial, .jag vs .j64, CD vs cart).
16+
placeholder: "e.g. Atari Karts (1995, USA, .jag)"
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: repro
22+
attributes:
23+
label: Steps to reproduce
24+
description: What you did, in order, including which menu screens / inputs.
25+
placeholder: |
26+
1. Boot ROM
27+
2. Press Start at title
28+
3. Select Single Race
29+
4. Crash on track-select screen
30+
validations:
31+
required: true
32+
33+
- type: textarea
34+
id: expected
35+
attributes:
36+
label: Expected vs actual
37+
placeholder: |
38+
Expected: track-select renders normally.
39+
Actual: black screen, audio loops 0.5s buffer, RetroArch logs "GPU stalled".
40+
validations:
41+
required: true
42+
43+
- type: dropdown
44+
id: bios
45+
attributes:
46+
label: BIOS mode
47+
description: Set in RetroArch core options as `virtualjaguar_bios`.
48+
options:
49+
- "HLE BIOS (default; no real BIOS file)"
50+
- "Real BIOS (jagboot.rom in system/)"
51+
- "Not sure"
52+
validations:
53+
required: true
54+
55+
- type: dropdown
56+
id: blitter
57+
attributes:
58+
label: Blitter mode
59+
description: Set in RetroArch core options as `virtualjaguar_usefastblitter`.
60+
options:
61+
- "Fast (default)"
62+
- "Accurate (Midsummer2)"
63+
- "Both (issue is independent of blitter)"
64+
validations:
65+
required: true
66+
67+
- type: input
68+
id: core_version
69+
attributes:
70+
label: Core version
71+
description: RetroArch -> Information -> Core Information -> "Core Version", or strings on the binary. (e.g. v2.2.0 abc1234)
72+
validations:
73+
required: true
74+
75+
- type: input
76+
id: frontend
77+
attributes:
78+
label: Frontend + platform
79+
placeholder: "e.g. RetroArch 1.21.0, macOS 14.5 (arm64); or Provenance 3.x iOS"
80+
validations:
81+
required: true
82+
83+
- type: textarea
84+
id: logs
85+
attributes:
86+
label: Logs
87+
description: Paste relevant lines from the RetroArch log (Settings -> Logging -> Logging Verbosity = Debug, then check `~/Library/Application Support/RetroArch/logs/` on macOS or platform equivalent). Use `<details><summary>Log</summary>...</details>` for long pastes.
88+
render: shell
89+
90+
- type: checkboxes
91+
id: pre
92+
attributes:
93+
label: Pre-flight
94+
options:
95+
- label: Verified the issue is in this libretro core (not standalone Virtual Jaguar or another emulator).
96+
required: true
97+
- label: Searched [existing issues](https://github.com/libretro/virtualjaguar-libretro/issues?q=is%3Aissue) for duplicates.
98+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: libretro Discord
4+
url: https://discord.com/invite/27Xxm2h
5+
about: General libretro / RetroArch questions are best in the Discord; this tracker is for Virtual Jaguar core bugs and feature work.
6+
- name: Upstream Virtual Jaguar
7+
url: http://shamusworld.gotdns.org/git/virtualjaguar
8+
about: Issues that are reproducible in standalone Virtual Jaguar (not specific to the libretro core) belong upstream.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Feature request
2+
description: A new capability you'd like the core to expose.
3+
title: "[feat] "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Before filing: this is a libretro fork of upstream Virtual Jaguar. Hardware-emulation requests should usually go upstream; this tracker is for libretro-specific surface (core options, save state shape, RetroAchievements, input remapping, etc.).
10+
11+
- type: textarea
12+
id: what
13+
attributes:
14+
label: What
15+
description: One sentence on what you want.
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: why
21+
attributes:
22+
label: Why / use case
23+
description: Concrete scenario. "I want X so I can do Y" beats "X would be nice".
24+
validations:
25+
required: true
26+
27+
- type: textarea
28+
id: how
29+
attributes:
30+
label: How (if you have ideas)
31+
description: Optional. Pointers to where you think it'd hook in (`libretro_core_options.h`, a specific subsystem) help if you have them.
32+
33+
- type: checkboxes
34+
id: pre
35+
attributes:
36+
label: Pre-flight
37+
options:
38+
- label: This is libretro-fork-specific, not a general Virtual Jaguar emulation feature (those go upstream).
39+
required: true

0 commit comments

Comments
 (0)