02-11-2022, 08:49 PM
a bit of asm in your c code ?
Personally, I use asm for hblank code, sometimes using also bank register switch (incf, decf or ldf)
Do you know ldir(w) and lddr(w) ? (check asm doc: e_900h_chap3_cpu_4.pdf)
something like:
void moveRam(void*dst,void*src,u32 count)
{
__ASM(" ld xbc,(xsp+12) ");
__ASM(" ld xhl,(xsp+8) ");
__ASM(" ld xde,(xsp+4) ");
__ASM(" ldirw (xde+),(xhl+) ");
}
can be improved without using a function and direct access to global var to init dst & src (maybe you can use DMA for async mem transfert)
Most of the time, -O3 is better than my own asm "optimizations", that's why I often add a -S to check how it's compiled.
Personally, I use asm for hblank code, sometimes using also bank register switch (incf, decf or ldf)
Do you know ldir(w) and lddr(w) ? (check asm doc: e_900h_chap3_cpu_4.pdf)
something like:
void moveRam(void*dst,void*src,u32 count)
{
__ASM(" ld xbc,(xsp+12) ");
__ASM(" ld xhl,(xsp+8) ");
__ASM(" ld xde,(xsp+4) ");
__ASM(" ldirw (xde+),(xhl+) ");
}
can be improved without using a function and direct access to global var to init dst & src (maybe you can use DMA for async mem transfert)
Most of the time, -O3 is better than my own asm "optimizations", that's why I often add a -S to check how it's compiled.

