Well Im not sure that you can page flip in those modes. They take up a lot of memory in themselves so there may not be any extra room in the VRAM for page flipping. You can use double buffering, but don't use memcpy. It only uses bytes on most compilers and this is slow in hi-res hi-color modes.
Here is a 32-bit memcpy written in MASM source:
size is specified in bytes not DWORDS. I could write another one that is specified in DWORDs but converting from bytes to DWORDS is trivial and it makes the function easier to use to specify the length in bytes.
This uses the ARG directive which might be slower - you don't have to use the ARG directive just make sure you know where on the stack each parameter is.
mov bp,sp ;must do this
push ds ;preserve ds
push edi ;preserve edi
push esi ;preserve esi
cld ;set direction flag
lds esi,[source] ;load full pointer source into DS:ESI
les edi,[dest] ;load full pointer dest into ES:EDI
mov ecx,[size] ;load size in ecx
shr ecx,2 ;convert to DWORDs
rep movsd ;do the copy operation
pop esi ;restore esi
pop edi ;restore edi
pop ds ;restore ds
pop bp ;restore bp
ret ;return to caller
If this does not work, PM me on the board because I have one that does. I just wrote this off the top of my head here so I'm not guaranteeing there are no errors. But I don't want to frustrate you so if there are problems simply PM me and I will get you a copy that works.
This will copy extremely fast since the default data fetch for modern CPUs is 32-bits. I've used this and it works very well for full screen 16 and 32-bit memory copies and double buffering or back buffering. It's not as fast as page flipping but it's the next best thing to it.