For more modern setup, you can use context.transform(1, 0, 0, -1, 0, canvas.height)
. This flips y axis and moves the whole canvas one screenful.
More on available transformations:
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/transform