RE: Reason for illegal function call in VORTEX.BAS

by (no login)

Nice debugging Dave, you were right.

This is an anomaly!
In QB in all other screen modes you get an Illegal Function Call if you try to access an out of range palette index.
QBASIC Example:
SCREEN 9
PALETTE 16,1 'Illegal Function Call

But this works!
SCREEN 9
PALETTE 256,1

It seems when the palette statement is passed an index it does the following:
index=index AND 255
if index>largestpossibleindex then ERROR
OUT &H3C8,index

Of course, in SCREEN 13, this never causes an error, even for negative indexes!!!

I don't like this QBASIC "behaviour", but I will change QB64 to be compatible with this. It's very easy to change.

Funnily enough older demos of QB64 compiled and ran VORTEX.BAS perfectly. This is because older versions didn't correctly round floating point numbers being passed as integral arguments to subs.

Another little mystery solved,
Galleon

Posted on Mar 11, 2008, 11:50 PM
from IP address 58.110.128.68

Respond to this message   

Return to Index