Using a cushion folded in half as a pillow, I lay down on the hard floor — just carpet over floorboards.
Literal
Two-fold did cushion [object-を] pillow-substitute [to-に], I [topic-は] flooring [possessive-の] above [to-に] carpet [object-を] spread only [possessive-の] hard floor [toward-へと] sideways-became.
二つ折りにした ('folded in half') modifies クッション. 枕代わりに ('as a substitute for a pillow') uses ~代わり ('substitute, replacement'). フローリングの上にカーペットを敷いただけの ('just carpet laid on top of floorboards') is a long relative clause modifying 床. 横になる ('to lie down') is the standard phrase. The sentence is detailed first-person narration describing uncomfortable sleeping conditions.