So to break it down a bit and make it as clear as possible: As for the second argument of the OUT 985 statement: The first four bits set the background color. 1st bit (value: 1) = Toggle blue 2nd bit (value: 2) = Toggle green 3rd bit (value: 4) = Toggle red 4th bit (value: 8) = Toggle high intensity The next two bits set the foreground palette. 5th bit (value: 16) = Toggle high intensity 6th bit (value: 32) = Toggle warm/cold palette What your 'OUT 984, 46' seems to do is turn on the monochrome bit which gives you red instead of magenta in your palette when using a color display. Doesn't seem to work on the warm (brownish) palette. SCREEN 1, 1 has the same effect. With the COLOR statement you can alter between the warm and the cold palette, but you can only get the high intensity foreground palette by setting a high intensity background color, which is weird since it's clearly possible to have black as background and a high intensity foreground palette using your hack.
Great video - this has helped me on a little retro project I am working on :) After some experimenting I found performing a routine of SCREEN 2:SCREEN 1 or SCREEN 0:SCREEN 1 (to reset intensity bit) then putting in a range of OUT 985,0 through to OUT 985,65 produced standard 4 x MODE4 palettes with each of the 16 BG Colors. To get the MODE 5 Palette (5&6) I added OUT 984,46 to the routine and used ranges OUT 985,32 - OUT985,16. I can simply call my custom subs CGAPAL (1-6) and then CGACOL (0-15) and switch between any of the palette and BG colors.
I barely remember one of the screen-related statements (screen, color, print...) had an optional extra parameter for selecting the cga palette in screen mode 1. I always used the one you can see at 4:00, because I hate the colors cyan and pink^^. No need to use OUT here ;).