Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| coding_rules [2021/12/27 17:00] – [On Buildroot] nadenislamarre | coding_rules [2022/07/21 02:43] (current) – add some bullet point coding rules atari | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| In other words, don't try to handle all cases if it makes the software complicated and unmaintainable. | In other words, don't try to handle all cases if it makes the software complicated and unmaintainable. | ||
| + | |||
| + | * Don't add new systems that are simply variations of other systems, aim to have one folder per system. An exception to this rule would be if a system required different configuration to launch, as asking the user to create two sets of custom emulator settings should be avoided. | ||
| + | * Don't put in [[: | ||
| + | * Build emulators from their source where possible. | ||
| + | * Don't add emulators that duplicate the function of other emulators. We must avoid redundancy as there is an upper limit as to how much data can be packed into the '' | ||
| + | * Avoid making patches if possible, encourage the source developer of the software to fix issues upstream. | ||
| + | * Avoid adding files to the '' | ||
| + | |||
| + | <WRAP center round info> | ||
| + | A timeline of when certain changes are allowed to be merged upstream can be found here: https:// | ||
| + | </ | ||
| ===== Project files ===== | ===== Project files ===== | ||
| - | The [[https:// | + | The [[https:// |
| + | |||
| + | The following directories are owned by Batocera: | ||
| ==== defconfig build files ==== | ==== defconfig build files ==== | ||
| Line 41: | Line 54: | ||
| Windows Vista and above support symlinks, but this is not built-in by default. Here's an unofficial extension to explorer.exe that adds such functionality: | Windows Vista and above support symlinks, but this is not built-in by default. Here's an unofficial extension to explorer.exe that adds such functionality: | ||
| </ | </ | ||
| - | |||
| - | ===== How to add an emulator ===== | ||
| - | |||
| - | - Install (its initial configuration script in its package at https:// | ||
| - | - Add your system/ | ||
| - | * You can check a list of system shortnames that can be automatically scraped for here: https:// | ||
| - | - Add your system/ | ||
| - | - Create and test its config generator at https:// | ||
| - | - Define the generator (syntax: '' | ||
| - | - Include it in the packages list (syntax: '' | ||
| - | - Create the " | ||
| - | - If appropriate, | ||
| - | - Call the files if required here: https:// | ||
| - | - Configure the default emulator (if you've added a whole new system) with https:// | ||
| - | - Configure the default settings for particular architectures (such as if your emulator requires certain settings to function on a particular architecture) at https:// | ||
| - | - Limit your emulator to particular platforms (typically, complex standalone emulators are x86/x86_64 only) with https:// | ||
| - | - If BIOS files are required, set them in https:// | ||
| - | |||
| - | If you'd like an example of a recent pull request that adds a whole new emulator: https:// | ||
| ===== Global features/ | ===== Global features/ | ||
| Line 69: | Line 63: | ||
| <code yaml> | <code yaml> | ||
| < | < | ||
| + | group: <group name> # An optional group to sort this feature under. This is mostly used to categorize " | ||
| features: [<common feature 1>, <common feature 2>, < | features: [<common feature 1>, <common feature 2>, < | ||
| cfeatures: # Custom features, found in the advanced settings. | cfeatures: # Custom features, found in the advanced settings. | ||
| Line 105: | Line 100: | ||
| " | " | ||
| perf_hacks: | perf_hacks: | ||
| + | group: ADVANCED OPTIONS | ||
| prompt: | prompt: | ||
| description: | description: | ||
| Line 114: | Line 110: | ||
| cfeatures: | cfeatures: | ||
| emulatedwiimotes: | emulatedwiimotes: | ||
| + | group: ADVANCED OPTIONS | ||
| prompt: | prompt: | ||
| description: | description: | ||
| Line 122: | Line 119: | ||
| Spacing is everything here. Triple-check that you have used the correct amount of indentation. If your build fails to compile because of errors related to '' | Spacing is everything here. Triple-check that you have used the correct amount of indentation. If your build fails to compile because of errors related to '' | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | A new way to use options is available as presets, read more about it on [[https:// | ||
| + | |||
| + | (FIXME how is this done in Batocera, though?) | ||
| + | </ | ||
| General practice isn't to be a one-for-one representation of the settings available to the emulator, that would defy the point of Batocera. Important settings that may need to be changed frequently/ | General practice isn't to be a one-for-one representation of the settings available to the emulator, that would defy the point of Batocera. Important settings that may need to be changed frequently/ | ||
| Line 153: | Line 156: | ||
| dolphinGFXSettings.remove_option(" | dolphinGFXSettings.remove_option(" | ||
| dolphinGFXSettings.remove_option(" | dolphinGFXSettings.remove_option(" | ||
| + | </ | ||
| + | |||
| + | ==== Multi-line descriptions ==== | ||
| + | |||
| + | Use of multi-line descriptions is discouraged, | ||
| + | |||
| + | A multi-line description can be enabled by prepending '' | ||
| + | |||
| + | <code yaml> | ||
| + | [...] | ||
| + | prompt: | ||
| + | description: | ||
| + | Show context-sensitive info | ||
| + | over the game | ||
| + | and a 3rd line | ||
| + | and a 4th line. | ||
| + | submenu: DECORATIONS | ||
| + | [...] | ||
| </ | </ | ||
| Line 162: | Line 183: | ||
| * Only update values controlled by Batocera | * Only update values controlled by Batocera | ||
| - | Configuration handled by Batocera comes from three places: | + | Configuration handled by Batocera comes from: |
| * the configgen plugin. hardcoded or dependant on non user values (the number of plugged pads for example) | * the configgen plugin. hardcoded or dependant on non user values (the number of plugged pads for example) | ||
| * **configgen-defaults.yml** the default configuration | * **configgen-defaults.yml** the default configuration | ||
| Line 199: | Line 220: | ||
| * rpi kernels (to be up to date) | * rpi kernels (to be up to date) | ||
| * rust (because ruffle uses the last versions) | * rust (because ruffle uses the last versions) | ||
| + | * linux LTS kernels | ||
- coding_rules.1640624438.txt.gz
- Last modified: 5 years ago
- by nadenislamarre