change palette

When I’am try to change current palette with PgSetPalette() only small
changes have effect on the screen. When I try to make big changes ( more
then 36) of any color ( for example color index 3 in 256 Color mode) driver
switch ihdex to other color index. How I can lock this index ?

Eugeny Korolyov