Erasing sprites trails all a story !
The easiest solution is your sprite have large border with the color of the background it will overwrite the trails when moving.
Or you have to delete the trail at the previous position of your sprite, with something like that :
if (move == TOP)
{
u8* pvideomemTrail = cpct_getScreenPtr(CPCT_VMEM_START, x, y + SP_H + 1);
cpct_drawSolidBox(pvideomemTrail, cpct_px2byteM0(1,1), SP_W, 1);
}
else
if (move == LEFT)
{
u8* pvideomemTrail = cpct_getScreenPtr(CPCT_VMEM_START, x + SP_W + 1, y);
cpct_drawSolidBox(pvideomemTrail, cpct_px2byteM0(1,1), 1, SP_H);
}
else
...