I can't tell when I'm going up a half note or a whole note during these measures. For example, in measure 22 (the first bar in the picture), it looks like I'm supposed to play E natural twice on the two quarter notes because D# in E major is E♮. Similarly on measure 23, the first two quarters notes look the same since E## in F# and the second quarter note is F#. When I've listened to recordings it sounds like each note is going up a half step and not repeating so I know my reading is incorrect. My apologies if my wording is convoluted, I'm not sure the best way to write this out clearly. Basically I'm trying to understand this passage if it was transposed to C major.
The big roadblock here is that you're reading the right hand in bass clef; it's actually in treble clef!
As such, the opening two measures are a mostly chromatic line of
If you wanted to transpose this to C major, I recommend thinking in terms of scale degrees; move chromatically from scale-degree 5 to scale-degree 1, then move up a whole step to scale-degree 2:
(Also note that, when you say "D♯ in E major is E♮," this is actually incorrect, because accidentals are not additive.)