OS_ScreenMode 2, mode enumeration format 1
André Timmermans (100) 655 posts |
Hi, while experimenting with screen mode enumeration, I have noticed some differences with the specs (IOMD build OS 5.22, PI3 build OS 5.23 from 07 Oct 2016). Here is some extract from a log I produce on OS 5.22: And this is from OS 5.23 on the PI: As you can see anything except for 4K & 64K modes has an incorrect ncolour value compared to the specs Valid Mode Variable Combinations |
Jeffrey Lee (213) 6048 posts |
I’m not seeing anything unusual here (5.22 on Iyonix + IOMD). Remember that there each mode could appear in one of two formats, the old format which doesn’t specify the mode flags/ncolour and the new format which does. So possibly it’s a bug in your code which is generating the missing values? SYS "OS_ScreenMode",2 TO ,,,,,,,size% size%=-size% DIM block% size% SYS "OS_ScreenMode",2,,,,,,block%,size% TO ,,count% count%=-count% PRINT count%;" modes in ";size%;" bytes" WHILE count%>0 count%-=1 CASE block%?4 OF WHEN 1: PRINT "X";block%!8;" Y";block%!12;" depth ";block%!16;" rate ";block%!20;" name ";FNname(block%+24) WHEN 3: PRINT "X";block%!8;" Y";block%!12;" ncolour ";block%!16;" flags ";STR$~(block%!20);" log2bpp ";block%!24;" rate ";block%!28;" name ";FNname(block%+32) OTHERWISE: PRINT "Unknown format ";block%?4 ENDCASE block% += block%!0 ENDWHILE END DEF FNname(a%) A$="" WHILE a%?0 > 0 A$ += CHR$(a%?0) a%+=1 ENDWHILE =A$ |
André Timmermans (100) 655 posts |
Correct, it’s a bug in the code for the parts of the list using the old format. ncolours = (1 << (2^log2bpp)) – 1, except of course in C “^” is EOR not exponent like in BASIC. Took me forever to notice it. |