;vector_handler_40142
;--------------------
;Allows sound to be forced to left or right audio channel

;R11 - pointer to VARS

.vector_handler_40142
 ADD     R12, R11, #stereo_position - VARS
 SUB     R14, R0, #1
 AND     R14, R14, #7			;ensure its within limits
 TEQ     R1, #128			;read request?
 LDREQB  R1, [R12, R14]			;YES,
 EXITSWIEQ ""				; |+  return old value

 STRB    R1, [R12, R14]			;store position
 LDRB    R12, [R11, #force_mono - VARS]
 TEQ     R12, #0			;are we forcing mono?
 MOVNE   R1, R12			;YES
B     vector_handler_forward