06-14-2016, 03:50 PM
Luzie Wrote:I put the Fastcall / MCode out and get the "5 Out of screen" ErrorThis behaviour is expected.
while only running this BASIC lines:
This wraps around (e.g. AT 24,0 is printed on line 0). But these wrapped lines don“t print from column 15,Code:FOR A=0 TO 40
PRINT AT A,15; INK 6; PAPER 0;A;"###"
NEXT A
END
they are printed from column 0. And at program end, this rises the "5 Out of screen" error.
The ZX Spectrum screen has only 24 physical rows (from 0 to 23). Printing beyond 23 just wraps around and resets the X coordinate (back to 0).
It also puts an "Out Of Screen" signal in the ROM Variable, hence when you exit back to Sinclair BASIC you get the 5 Out of Screen Error.
This is done this way because you can check if your latest print has been out of screen or not.
Also, if you enable ZX BASIC check error flag, printing or plotting out of screen will trigger an Out of Screen error and exit to BASIC.