
One more hint: any call to an external BASIC program part could use FAST or SLOW rom calls (e. g. within MEFISDOS to allow access to MMC without being interrupted by NMI), so this rom calls hook off the C internal display routine. So you should call zx_fast() and zx_slow(), when the C program is running again to reenable the C display routine.
And I had a lot of trouble when calling external routines (in EPROM), which write things onto screen. Then often the print positons of C and BASIC/ROM did not match, resulting in a corrupt display file

So i call
"zx_cls()" and "putchar(12)"
after being back in C to clear the screen and reset the BASIC print system vars as well as the C console print position ...
Siggi