我在 DosBox 0.74 上用 TASM 3.0 编写,我正在尝试在模式 x(调整 13h,未链接模式 13)中编写,但在这里您可以在图像中看到,它不太正确。似乎平面 1(第二个平面)根本没有打印,所有其他平面的顺序都不正确。我知道这里的代码效率低下,但我想让它工作然后清理它。
proc showBMP
push cx
mov ax, 0A000h
mov es, ax
mov cx, [BMPHeight]
mov ax, [BMPWidth]
xor dx, dx
mov si, 4
div si
mov bp, dx
mov dx, [BMPX]
showBMP_nextLine:
call VGAPlaneStartBMP
push cx
push dx
mov di, cx
add di, [BMPY]
mov cx, di
shl cx, 6
shl di, 8
add di, cx
add di, dx
mov ah, 3fh
mov cx, [BMPWidth]
add …Run Code Online (Sandbox Code Playgroud) 1我在 DosBox 0.74 上用 TASM 3.0 写,我想用模式 x(调整 13h,非链接模式 13)写,我遇到了一个问题,你如何在图像中看到,每一行都被打印出来,但是在每行,每组四个像素只打印第一个像素的颜色,这是在VRAM中的不同空间打印图像进行双缓冲后,因此所有四个平面都有第一个平面的数据。
这是图像的打印方式(这是没有双缓冲区的直接打印,是的,计时器有问题,但没关系)

这是使用双缓冲打印图像的方式
我确实认为问题在于模式x时VGA端口中的数据与读写不同,这里是选择VGA平面的代码
proc VGAPlaneSelect
push ax
push dx
push cx
mov al, 02h
mov dx, 03C4h
out dx, al
VGAPlaneSelect_start:
mov ax, 1
mov cl, [VGAPlane]
shl ax, cl
cmp [VGAPlane], 4
jne VGAPlaneSelect_end
mov [VGAPlane], 0
jmp VGAPlaneSelect_start
VGAPlaneSelect_end:
mov dx, 03C5h
out dx, al
pop cx
pop dx
pop ax
ret
endp VGAPlaneSelect
Run Code Online (Sandbox Code Playgroud)
如果输出不是问题,这里是内存传输的代码:
proc DoubleBuffer
mov ax, 0A000h
mov es, ax …Run Code Online (Sandbox Code Playgroud) 我知道人们会讨厌我什至不显示任何代码,但是从理论上讲,例如,汇编程序如何才能显示功能菜单并同时播放歌曲?还是喜欢玩游戏并同时设置计时器,这怎么可能?
我看不到该怎么办,因为处理器只有一个代码段,也许我可以制作2个汇编文件,并且处理器可以以某种方式工作?