# Drift mode in free roam (runtime/drift.c), one instance (--page app): new career -> prologue free roam, onto the
# straight south of the start, X on the page: the drift-event switch and the drift camera (view 4).  A handbrake
# flick at the bend banks a drift (the log: "[drift] ... a drift of N"; the page's DRIFT counter counting, log SHOT
# counting, and the panel, log SHOT drift), the pause
# menu switches the handling off and back on, and X off gives the view back.  The trace: the switch, the view,
# STYLE_DRIFT (state, pending, total), the DriftCar (multiplier, its next level's points, rate) and the car's slip.
#   node web/tools/roam-pair.mjs --solo --page app --a Drv:roam_drift.txt
0     tapuntil RETURN MC_Background.fng 120 4000
+120  tap LEFT
+30   tap RETURN
+240  tap BACK
+8    tap BACK
+8    tap BACK
+8    tap BACK
+20   type ${ROAM_PROFILE}
+60   tap RETURN
+240  tap RETURN
+0    waitfng GarageMain.fng 3000
+300  tap LEFT
+60   tap RETURN                      # Career
+300  tap RETURN                      # Start New Career
+0    waitfng UI_EngageMessageDialog.fng 8000
+120  tap RETURN                      # SMS: Continue
+0    roam waitroam 3000
+0    roam smsauto on
+300  teleport 1695.0 -845.0 24.6 0xb82e
+120  expect i:0x890104 == 0
+0    expect i:0x83aa74 == 3
+0    log KEY KeyX
+30   expect i:0x890104 == 1
+0    expect i:0x83aa74 == 4
+0    trace 5 sw=i:0x890104 view=i:0x83aa74 st=i:[[[[0x890118]+0xbd0]+0x1d4]]+0x14 pend=[[[[0x890118]+0xbd0]+0x1d4]]+0x24 tot=[[[[0x890118]+0xbd0]+0x1d4]]+0x2c lvl=i:[[[0x890118]+0xbd0]+0x1d8]+0x1c gain=i:[[[0x890118]+0xbd0]+0x1d8]+0x20 rate=[[[0x890118]+0xbd0]+0x1d8]+0x34 wt=i:0x86518c spd=[[0x8900ac]+4]+0x42c vx=[[0x8900ac]+4]+0x70 vy=[[0x8900ac]+4]+0x74 fx=[[0x8900ac]+4]+0x90 fy=[[0x8900ac]+4]+0x94
+0    down UP
+0    waitexpr [[0x8900ac]+4]+0x42c > 3 1200
+150  log flick
+0    down LEFT
+100wms tap SPACE 8
+300wms up LEFT
+0    down RIGHT
+300wms up RIGHT
+0    down LEFT
+150wms up LEFT
+0    log SHOT drifting
+12   log SHOT counting
+600wms log SHOT drift
+0    expect [[[[0x8900ac]+4]+0x34]+0x40]+0x188 != 1  # the drift assist sets the rear grip (drift.c physics_out)
+0    expect i:0x861e74 == 0             # the career's bank: drift points are not money
+0    expect i:0x7ed344 == 0             # the music's attenuation: free roam's song plays on (a drift race: 0x7FFF)
+60   up UP
+0    down DOWN
+180  up DOWN
+60   tap ESCAPE                      # the pause menu: the handling off, the camera stays
+60   expect i:0x890104 == 0
+0    expect i:0x83aa74 == 4
+0    tap ESCAPE
+60   expect i:0x890104 == 1
+0    log SHOT back
+0    log KEY KeyX
+30   expect i:0x890104 == 0
+0    expect i:0x83aa74 == 3
+0    expect [[[[0x8900ac]+4]+0x34]+0x40]+0x188 == 1  # the rear wheels' grip as before drift mode
+0    expect [[[[0x8900ac]+4]+0x34]+0x44]+0x188 == 1
+0    log SHOT off
+0    untrace
+60   quit
