The reason why SCREEN works the way it does is rather simple:
SCREEN 0 is a TEXT-only screen, and is kept in memory in 2 byte chunks. 1 byte contains color information, the 2nd byte contains the character information. It’s easy to recover character and text information as they’re stored in memory for every position on the screen.
ALL other text modes are graphic modes and information is stored in a pixel-by-pixel method. PRINT “A” to the screen, and there’s *NO* information stored anywhere that calls that an “A” character. All that is stored is an 8x16 segment of pixels colored in the foreground, background color of that character.
In text mode (SCREEN 0), the SCREEN command can *always* retrieve the character and color information for you.
In graphic mode, it simply *GUESSES* at the character which most closely matches that 8x16 pattern of pixels.
Let’s say I have a program which does:
PRINT “F”
Then I draw a line at the bottom of that “F”...
Comparing the graphics, which do you think would be more likely to be returned from the function — “E” or “F”?
You printed F, but then drew a line... Since it *almost* matches an “E” in the 8x16 pixel comparison, it’d probably report itself as an “E”....
Which is why you’ll *NEVER* have a reliable way to use SCREEN, in graphic modes, to tell the difference in CHR$(32) and CHR$(255). You printed 2 different characters, but they’re both spaces on the screen, with the same blank pattern.
The only truly reliable way to know what characters are on the screen is to print them to SCREEN 0 so that character information is saved. (Or store the character value in an array, if you want to go that way.)
I can provide samples of both storage methods, if anyone wants.