# Pad-only: the PS2 layout on Options > Controls > Joypad Configuration, in
# the first column: Throttle Cross, Back / Reverse Square, Shift Up R2, Shift
# Down L2.  A button bound to the throttle or the brake there turns the
# trigger's axis off (dinput_pad.c bind_takes_axis), and a trigger that is no
# axis presses its button half way.  Then in a Quick Race: R2 and L2 shift
# and neither accelerates nor brakes, Cross accelerates, Square brakes.
# Channel 1 (0x874fb0) is the pad's: +0x8 the action mask (active low, bit =
# action id: 1 throttle, 2 brake, 7 shift up, 8 shift down; bit 0 goes low
# with any of them, and the Cross also sends its front-end action, bit 31),
# +0x10/+0x11 the analog throttle/brake (0..254), +0x18 the in-game button
# table, +0x365/+0x366 the throttle/brake axis on.  "@in+OFF" the player's
# input controller: +0x2d4 throttle, +0x2dc brake (0..1).
0     pad connect
+0    tappaduntil START MC_Background.fng 120 4000
+200  tappad A                                       # no profile
+0    waitfng GarageMain.fng 3000
+700  tappad DRIGHT
+60   tappad DRIGHT
+60   tappad DRIGHT
+60   tappad DRIGHT
+60   tappad DRIGHT
+60   tappad DRIGHT        # (Split Screen, after Quick Race)
+120  tappad A                                       # Options
+0    waitfng UI_OptionsMain.fng 600
+300  tappad DRIGHT
+120  tappad DRIGHT
+120  tappad DRIGHT
+120  tappad DRIGHT
+120  tappad A                                       # Controls
+0    waitfng UI_Options_PC_Controller.fng 600
+300  tappad DUP                                     # header
+120  tappad DRIGHT                                  # Joypad Configuration
+200  dump defaults
+0    expect b:0x875315 == 1
+0    expect b:0x875316 == 1
+0    tappad DDOWN                                   # Steering (Left)
+60   tappad DDOWN                                   # Steering (Right)
+60   tappad DDOWN                                   # Throttle
+90   tappad A                                       # "press a button"
+120  tappad A                                       # Cross
+120  expect b:0x875315 == 0
+0    expect b:0x875316 == 1
+0    tappad DDOWN                                   # Back / Reverse
+90   tappad A
+120  tappad X                                       # Square
+120  expect b:0x875316 == 0
+0    tappad DDOWN                                   # Shift Up
+90   tappad A
+120  trigger RT 0.6
+20   trigger RT 0
+120  tappad DDOWN                                   # Shift Down
+90   tappad A
+120  trigger LT 0.6
+20   trigger LT 0
+120  dump ps2_layout
+0    peek 0x874fc8 12
+0    expect x:0x874fc8 == 1
+0    expect x:0x874fd0 == 2
+0    expect x:0x874ff0 == 8
+0    expect x:0x874ff4 == 7
+0    tappad B                                       # leave Controls
+300  tappad B                                       # leave Options: "save the profile?"
+300  tappad A                                       # No
+0    waitfng UI_Main.fng 1500
+300  tappad DLEFT                                   # back to Quick Race
+60   tappad DLEFT
+60   tappad DLEFT
+60   tappad DLEFT
+60   tappad DLEFT
+60   tappad DLEFT        # (Split Screen, after Quick Race)
+120  tappaduntil A UI_QRModeSelect.fng 150 3000
+200  tappaduntil A UI_QRTrackSelect.fng 150 1500
+200  tappaduntil A UI_QRModeOptions.fng 150 1500
+200  tappaduntil A UI_QRCarSelect.fng 150 1500
+200  tappaduntil A PC_Loading.fng 150 1500
+0    waitmem 0x8654a4 6 3000
+600  log --- at rest ---
+0    peek 0x874fb8 2
+0    peek @in+0x2d4
+0    peek @in+0x2dc
+0    log --- R2 half way: shift up, no throttle ---
+0    trigger RT 0.6
+10   peek 0x874fb8 4
+0    peek @in+0x2d4
+0    expect b:0x874fb8 == 126
+0    expect b:0x874fc0 == 0
+0    trigger RT 0
+30   log --- L2 half way: shift down, no brake ---
+0    trigger LT 0.6
+10   peek 0x874fb8 4
+0    peek @in+0x2dc
+0    expect b:0x874fb9 == 254
+0    expect b:0x874fc1 == 0
+0    trigger LT 0
+30   log --- R2 a little: nothing ---
+0    trigger RT 0.3
+10   expect b:0x874fb8 == 255
+0    trigger RT 0
+30   log --- Cross: throttle ---
+0    pad A down
+30   peek 0x874fb8 2
+0    peek @in+0x2d4
+0    expect x:0x874fb8 == 2147483644
+0    pad A up
+30   log --- Square: brake ---
+0    pad X down
+30   peek 0x874fb8 2
+0    peek @in+0x2dc
+0    expect b:0x874fb8 == 250
+0    pad X up
+30   dump race
+0    quit
