freemint / tos.hyp

The tos.hyp tries to document all functions from TOS. It also has information about MagiC, N.AES, MyAES, Geneva, XaAES, oAESis and some emulators.
https://freemint.github.io/tos.hyp
GNU General Public License v2.0
13 stars 10 forks source link

vq_color test wrong? #94

Open DavidGZ opened 5 years ago

DavidGZ commented 5 years ago

Some colour printer drivers do not allow modifying the colour of each register. There is a simple test for checking if the driver permits you to change index colours: Call vq_color with set_flag value of 0 and save the return Call vs_color to modify that colour index by a significant value Call vq_color with set_flag value of 0 and then compare it with what you set Restore old value If equivalent values are returned, you can modify each colour index

If I understand this correctly the test described above for vq_color is wrong, the second call to vq_color should have the set flag set to 1 instead of 0 for this test to make sense.

The Compendium has the same test described in its vq_color page with the same error. If somebody confirms that I'm not missing anything I'll correct this.

th-otto commented 5 years ago

I think it does not matter much whether you use 0 or 1 in the 2nd call. The example states you should change it by a "significant value". The difference between 0 and 1 is only whether you get the exact value or not, but the test is only to check whether you can change the value at all.

DavidGZ commented 5 years ago

If I use set_flag 0 in the second vq_color call I'm going to get always what I requested with vs_color, I really don't understand how this is useful. Note that the vq_color description says that with a set_flag 0 I'll get the last requested value:

"set_flag 0 = Return colour values last requested by user at vs_color 1 = Return realized colour values"

th-otto commented 5 years ago

Hm, maybe it depends how it is implemented in the driver. Then of course feel free to update it.