我正在尝试在DOSBox上使用汇编语言设置VGA(640x480x16)的调色板,但是特定的颜色6、8-F没有改变。我已经尝试过使用中断和直接通过端口进行改变,其他颜色都可以工作,但这些不行。我正在使用默认配置下的DOSBox 0.74-3。以下是我的代码:
setpalete MACRO index,r,g,b
mov ax, 1010h
mov bx, index
mov ch, r
mov cl, g
mov dh, b
int 10h
ENDM
Start:
mov ax, 0A000h
mov es, ax
;set video mode to 640x480 16 color ah=0 al=12h int 10h
mov ax, 12h
int 10h
setpalete 06h,030h,030h,030h
mov dx, 03C4h ;dx = indexregister
mov ah, 06h ;Color
mov al, 02h ;register select - map mask
out dx, ax ;select the bitplanes.
mov al, 0FFh
mov di, 0
mov cx,38400
rep stosb
这里是使用端口设置调色板
setpalete MACRO index,r,g,b
mov dx, 3c8h
mov al, index
out dx, al
mov dx, 3c9h
mov al, r
out dx, al ; set R
mov al, g
out dx, al ; set G
mov al, b
out dx, al ; set B
ENDM
感谢您提前的支持。