# C_PAD_RINGBUF output record -- the tail of sub_8220D500, read from
# /image/sylpheed.pe. r3 = the ringbuf; r9 = the XINPUT_GAMEPAD source.
# This is where a menu gets edge-vs-level, and it is one struct, not two paths.

8220D7C0  7D0A582E  
8220D7C4  9103000C  +12 <- cur                     : HELD (level)
8220D7C8  7D0A582E  
8220D7CC  80E3000C  
8220D7D0  7D083278  r8 = cur XOR prev              : CHANGED
8220D7D4  91030010  +16 <- changed                 : (overwritten below)
8220D7D8  5508003E  
8220D7DC  7CCA582E  
8220D7E0  7D063078  r6 = changed ANDC cur          : RELEASED this frame
8220D7E4  90C30014  +20 <- released                : FALLING EDGE
8220D7E8  7D6A582E  
8220D7EC  90E30018  +24 <- cur                     : HELD (second copy)
8220D7F0  7D0B5838  r11 = changed AND cur          : PRESSED this frame
8220D7F4  91630010  +16 <- pressed                 : RISING EDGE (final value)
8220D7F8  8969002A  
8220D7FC  9163001C  +28 <- bLeftTrigger            : RAW ANALOG byte
8220D800  8969002B  
8220D804  91630020  +32 <- bRightTrigger           : RAW ANALOG byte
8220D808  A169002C  
8220D80C  7D6B0734  

# So the ring record is:
#   +12  buttons HELD      (level)   -- a menu that repeats on hold reads this
#   +16  buttons PRESSED   (rising)  -- a menu that fires once per press reads this
#   +20  buttons RELEASED  (falling)
#   +24  buttons HELD      (copy)
#   +28  bLeftTrigger      raw 0..255, analog value preserved alongside the bit
#   +32  bRightTrigger     raw 0..255
