1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
When inputs are stored in a TASD file, their values are formatted in a specific order. Data is stored as close to the console-native format as possible.
Most consoles use "active-low" signals for button presses. That means that if a button is pressed, it sends a logical LOW signal, represented as binary '0'. For example, a NES controller pressing 'A' and 'Left' can be represented as binary '01111101' or hex 0x7D. However, some consoles may include "active-high" signals, or have a more complex protocol.
Each controller map will include their spec-defined controller type that's used in PortController packets. All inputs that are active-low, will have a forward slash '/' infront of them. For example, all of the buttons on the NES standard controller are active-low, as seen below. Unless otherwise specified, button inputs without a '/' will be active-high, or have a custom protocol.
=== NES Standard ===
Spec Type: 01 01
Length: 1 byte
bit 7 = /A
bit 6 = /B
bit 5 = /Select
bit 4 = /Start
bit 3 = /Up
bit 2 = /Down
bit 1 = /Left
bit 0 = /Right
=== NES Multitap (Four Score) ===
Spec Type: 01 02
Length: ?
???
=== NES Zapper ===
Spec Type: 01 03
Length: ?
???
=== SNES Standard ===
Spec Type: 02 01
Length: 2 bytes
bit 15 = /B
bit 14 = /Y
bit 13 = /Select
bit 12 = /Start
bit 11 = /Up
bit 10 = /Down
bit 9 = /Left
bit 8 = /Right
bit 7 = /A
bit 6 = /X
bit 5 = /L
bit 4 = /R
bit 3 = 1
bit 2 = 1
bit 1 = 1
bit 0 = 1
=== SNES Multitap ===
Spec Type: 02 02
Length: ?
???
=== SNES Mouse ===
Spec Type: 02 03
Length: ?
???
=== SNES Superscope ===
Spec Type: 02 04
Length: ?
???
=== N64 Standard ===
Spec Type: 03 01
Length: 4 bytes
The N64 uses the Joybus Protocol. Pressed buttons are represented as a binary '1'.
Protocol details can be found here: https://n64brew.dev/wiki/Joybus_Protocol
bit 31 = A
bit 30 = B
bit 29 = Z
bit 28 = Start
bit 27 = D-Pad Up
bit 26 = D-Pad Down
bit 25 = D-Pad Left
bit 24 = D-Pad Right
bit 23 = RST (special controller reset bit)
bit 22 = 0
bit 21 = Left Trigger
bit 20 = Right Trigger
bit 19 = C-Up
bit 18 = C-Down
bit 17 = C-Left
bit 16 = C-Right
bits 15-8 = Analog Stick X-Axis (signed 8bit number, decimal -128 to +127)
bits 7-0 = Analog Stick Y-Axis (signed 8bit number, decimal -128 to +127)
=== N64 Standard with Rumble Pak ===
Spec Type: 03 02
Identical to N64 Standard (03 01)
=== N64 Standard with Controller Pak ===
Spec Type: 03 03
Identical to N64 Standard (03 01)
=== N64 Standard with Transfer Pak ===
Spec Type: 03 04
Identical to N64 Standard (03 01)
=== N64 Mouse ===
Spec Type: 03 05
Length: 4 bytes
The N64 uses the Joybus Protocol. Pressed buttons are represented as a binary '1'.
Protocol details can be found here: https://n64brew.dev/wiki/Joybus_Protocol
bit 31 = A
bit 30 = B
bits 29-24 = 0
bits 23-16 = 0
bits 15-8 = Relative X-Axis position (signed 8bit number, decimal -128 to +127)
bits 7-0 = Relative Y-Axis position (signed 8bit number, decimal -128 to +127)
=== N64 Voice Recognition Unit (VRU) ===
Spec Type: 03 06
Length: ?
Unknown at this time, more research is required to understand the VRU.
=== N64 RandNet Keyboard ===
Spec Type: 03 07
Length: 7 bytes
The N64 uses the Joybus Protocol. Protocol details can be found here: https://n64brew.dev/wiki/Joybus_Protocol
And Keyboard specific details here: https://sites.google.com/site/consoleprotocols/home/nintendo-joy-bus-documentation/n64-specific/randnet-keyboard
bits 55-40 = first key ID or all zeros
bits 39-24 = second key ID or all zeros
bits 23- 8 = third key ID or all zeros
bits 7- 0 = special keyboard flags
=== N64 Densha de Go ===
Spec Type: 03 08
Length: 4 bytes
The N64 uses the Joybus Protocol. Pressed buttons are represented as a binary '1'.
Protocol details can be found here: https://n64brew.dev/wiki/Joybus_Protocol
bit 31 = B
bit 30 = A
bit 29 = Accelerator
bit 28 = Start
bit 27 = Accelerator
bit 26 = 0
bit 25 = 0
bit 24 = Accelerator
bit 23 = 0
bit 22 = 0
bit 21 = C
bit 20 = Select
bits 19-16 = Brake
bits 15-8 = 0
bits 7-0 = 0
=== GC Standard ===
Spec Type: 04 01
Length: 8 bytes
The GC uses the Joybus Protocol. Pressed buttons are represented as a binary '1'.
Protocol details can be found here: https://n64brew.dev/wiki/Joybus_Protocol
TODO
=== GC Keyboard ===
Spec Type: 04 02
Length: ?
The GC uses the Joybus Protocol. Pressed buttons are represented as a binary '1'.
Protocol details can be found here: https://n64brew.dev/wiki/Joybus_Protocol
TODO
=== GB Gamepad ===
Spec Type: 05 01
Length: 1 byte
bit 7 = /Down
bit 6 = /Up
bit 5 = /Left
bit 4 = /Right
bit 3 = /Start
bit 2 = /Select
bit 1 = /B
bit 0 = /A
=== GBC Gamepad ===
Spec Type: 06 01
Length: 1 byte
Identical to GB Gamepad (05 01)
=== GBA(SP) Gamepad ===
Spec Type: 07 01
Length: 2 bytes
bits 15-10 = 1
bit 9 = /L
bit 8 = /R
bit 7 = /Down
bit 6 = /Up
bit 5 = /Left
bit 4 = /Right
bit 3 = /Start
bit 2 = /Select
bit 1 = /B
bit 0 = /A
=== Genesis 3-Button ===
Spec Type: 08 01
Length: 1 byte
bit 7 = /A
bit 6 = /Start
bit 5 = /Up
bit 4 = /Down
bit 3 = /Left
bit 2 = /Right
bit 1 = /B
bit 0 = /C
=== Genesis 6-Button ===
Spec Type: 08 02
Length: 2 bytes
bit 15 = /A
bit 14 = /Start
bit 13 = /Up
bit 12 = /Down
bit 11 = /Left
bit 10 = /Right
bit 9 = /B
bit 8 = /C
bit 7 = /Z
bit 6 = /Y
bit 5 = /X
bit 4 = /Mode
bit 3 = 1
bit 2 = 1
bit 1 = 1
bit 0 = 1
=== A2600 Joystick ===
Spec Type: 09 01
Length: 1 byte
bit 7 = /Up
bit 6 = /Down
bit 5 = /Left
bit 4 = /Right
bit 3 = 1
bit 2 = /Button
bit 1 = 1
bit 0 = 1
=== A2600 Paddle ===
Spec Type: 09 02
Length: 1 byte
bit 7 = 1
bit 6 = 1
bit 5 = /LeftButton
bit 4 = /RightButton
bit 3 = RightPot
bit 2 = LeftPot
bit 1 = 1
bit 0 = 1
=== A2600 Keypad ===
Spec Type: 09 03
Length: 1 byte
bit 7 = /Row1
bit 6 = /Row2
bit 5 = /Row3
bit 4 = /Row4
bit 3 = /Column1
bit 2 = /Column3
bit 1 = /Column2
bit 0 = 1
|