So there I was doing some copper(-ish) bars using the tried and true method of 'draw lines and rotate the palette.' How to I preserve the background color? Pic should be attached. It rotates along with everything else

; tasm [blah]
; tlink [blah]
MODEL SMALL
.STACK 200H
.386
.DATA
palindex db 0
upperstop dw 320*50
lowerstart dw 320*150
endscreen dw 320*200
Palette LABEL BYTE
i=0
REPT 42
db i/2,i,i/3
i=i+1
ENDM
i=42
REPT 42
db i/2,i,i/3
i=i-1
ENDM
REPT 52 ; make the reds a little more coppery
db i,i/2,i/3
i=i+1
ENDM
i=52
REPT 52
db i,i/2,i/3
i=i-1
ENDM
i=0
REPT 32 ; less avail for blue but that's okay
db i/2,i/3,i
i=i+1
ENDM
i=32
REPT 32
db i/2,i/3,i
i=i-1
ENDM
.CODE
Set_Palette PROC
mov ax,SEG Palette
mov ds,ax
mov si,OFFSET Palette
mov dx,3C8h
xor al,al
out dx,al
inc dx
mov cx,(256*3)
rep outsb
ret
ENDP
start:
mov ax,13h ; set mode 13
int 10h
push 0a000h ; stick video segment in es
pop es
;------- set palette ---------
call Set_Palette
; ------ main loop ----------
main:
mov di,lowerstart ; draw some lines along the bottom of the screen
lower:
mov ax,di
sub ax,lowerstart
shr ax,1
shl ax,3
stosb
cmp di,endscreen
jb lower
xor di,di
upper: ; xor the colors and draw along the top
mov ax,di
shr ax,1
shl ax,3
xor al, 11111000b
stosb
cmp di,upperstop
jb upper
; ------ rotate ----------
; michael abrash this isn't
inc palindex
mov si,OFFSET Palette
mov dx, 3C8h
mov al, palindex
out dx, al
inc dx
mov cx, (256*3)
rep outsb
in al, 60h
cmp al, 01h
jnz main
;------- exit stuff ---------
mov ax,3
int 10h
mov ah,4CH
mov al,00H
int 21H
END Start