The assembly code for the 640-mode and 320-mode routines is moved to a macro so it can be shared between them.