majorpkr.c: cleanup/modernize, reduce tag lookups, fix flipscreen, fix generic_paletteram regression (nw)