Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
RishiRecon
GitHub Repository: RishiRecon/exploits
Path: blob/main/misc/emulator/xnes/snes9x/docs/controls.txt
28798 views
1
This lists the available commands, excluding the ones you get back from
2
S9xGetAllSnes9xCommands(). The various meta-characters are:
3
# - A number. The range is detemined by the context
4
## - A two-digit number (i.e. with leading zeros)
5
[...] - Something optional
6
(...) - For grouping with |
7
| - "or", choose one of the options.
8
<...> - A named field
9
{...} - A list of possible values. Multiple values may be used, but they
10
must be in the order listed and joined with +-signs.
11
"" - 'ditto', used to indicate the same list as the above line.
12
13
Speeds are: Var, Slow, Med, and Fast. 'Var' starts slow and speeds up as the
14
button is held.
15
16
Axes are: Left/Right, Right/Left, Up/Down, Down/Up, Y/A, A/Y, X/B, B/X, L/R,
17
and R/L. Negative is listed first (i.e. "Y/A" means negative deflection is
18
towards Y, while "A/Y" means negative deflection is towards A).
19
20
AxisToPointer, ButtonToPointer, and AxisToButtons allow for translating
21
between different input types. There are 8 'pointers' with IDs
22
PseudoPointerBase+0 to PseudoPointerBase+7, and 256 'buttons' with IDs
23
PseudoButtonBase+0 to PseudoButtonBase+255. So for example,
24
"AxisToButtons 0/255 T=50%" would take the axis data, and do
25
S9xReportButton(PseudoButtonBase+0,1) when said axis goes past 50% in the
26
negative direction and S9xReportButton(PseudoButtonBase+255,1) when it goes
27
over 50% deflection in the positive direction. Similarly, it will do
28
S9xReportButton(...,0) when the deflection drops under 50% in either
29
direction. "ButtonToPointer 1u Slow" would move the pointer with ID
30
PseudoPointerBase+0 up one pixel per frame as long as the button is pressed
31
(reporting this change at the end of each frame).
32
33
---------------
34
Button Commands
35
---------------
36
37
Joypad# {Up, Down, Left, Right, A, B, X, Y, L, R, Start, Select}
38
Joypad# Turbo ""
39
Joypad# Sticky ""
40
Joypad# StickyTurbo ""
41
Joypad# ToggleTurbo ""
42
Joypad# ToggleSticky ""
43
Joypad# ToggleStickyTurbo ""
44
45
Mouse# (L|R|LR)
46
47
Superscope AimOffscreen
48
Superscope {Fire, Cursor, ToggleTurbo, Pause}
49
Superscope AimOffscreen ""
50
51
Justifier# AimOffscreen
52
Justifier# {Trigger, Start}
53
Justifier# AimOffscreen ""
54
55
ButtonToPointer #[u|d][l|r] <speed> ; NOTE: "# <speed>" is invalid
56
57
-------------
58
Axis Commands
59
-------------
60
61
Joypad# Axis <axis> T=#% ; T = 0.1 to 100 by tenths
62
AxisToButtons #/# T=#% ; neg then pos, range 0-255, T as above
63
AxisToPointer #(h|v) [-]<speed> ; NOTE: '-' inverts the axis
64
65
----------------
66
Pointer Commands
67
----------------
68
69
Pointer {Mouse1, Mouse2, Superscope, Justifier1, Justifier2}
70
71
------
72
Multis
73
------
74
75
Multis are a type of button command. The basic format of a multi is "{...}",
76
where the '...' consists of 1 or more valid non-multi button command
77
strings. The braces are literal, not metacharacters. Subcommands separated
78
by commas are executed one after the next. Semicolons skip one frame before
79
continuing subcommand execution. Semicolons may be repeated. When the multi
80
button is pressed, each subcommand is 'pressed', and when the multi button
81
is released each subcommand is 'released'.
82
83
There are also press-only multis, defined as "+{...}". These act just like
84
regular multis, with two differences: the multi is only run when you press
85
the button (release isignored), and each subcommand must be prefixed with
86
'+' or '-' to indicate whether the the subcommand should be pressed or
87
released.
88
89
For example: {Joypad1 A,Joypad2 A;Joypad3 A;;;;;QuickSave000}
90
This presses (or releases) A on pads 1 and 2, then waits one frame, then
91
presses A on pad 3, then waits 5 frames, then saves to snapshot 0 (on press
92
only).
93
94
You may access the multi number in the returned s9xcommand_t structure as
95
cmd.button.multi_idx. This may be used to assign the same multi to multiple
96
buttons:
97
MULTI#<num> ; NOTE: that's a literal octothorpe
98
99