]> 4ch.mooo.com Git - 16.git/blobdiff - 16/WOLFSRC/ID_VH_A.ASM
got 8086 port of wolf3d to work and sod to work
[16.git] / 16 / WOLFSRC / ID_VH_A.ASM
diff --git a/16/WOLFSRC/ID_VH_A.ASM b/16/WOLFSRC/ID_VH_A.ASM
new file mode 100755 (executable)
index 0000000..7e59995
--- /dev/null
@@ -0,0 +1,110 @@
+; ID_VL.ASM\r
+\r
+       IDEAL\r
+       MODEL   MEDIUM,C\r
+\r
+       INCLUDE 'ID_VL.EQU'\r
+\r
+SCREENSEG      =       0a000h\r
+\r
+UPDATEWIDE     =       20\r
+UPDATEHIGH     =       13\r
+\r
+       DATASEG\r
+\r
+\r
+EXTRN  bufferofs                       :WORD\r
+EXTRN  displayofs                      :WORD\r
+EXTRN  ylookup                         :WORD\r
+EXTRN  linewidth                       :WORD\r
+EXTRN  blockstarts                     :WORD   ;offsets from drawofs for each update block\r
+\r
+EXTRN  update                          :BYTE\r
+\r
+       CODESEG\r
+\r
+\r
+;=================\r
+;\r
+; VH_UpdateScreen\r
+;\r
+;=================\r
+\r
+PROC   VH_UpdateScreen\r
+PUBLIC VH_UpdateScreen\r
+USES   si,di\r
+\r
+       mov     dx,SC_INDEX\r
+       mov     ax,SC_MAPMASK+15*256\r
+       out     dx,ax\r
+\r
+       mov dx,GC_INDEX\r
+       mov al,GC_MODE\r
+       out dx,al\r
+\r
+       inc dx\r
+       in      al,dx\r
+       and al,252\r
+       or      al,1\r
+       out dx,al\r
+\r
+       mov     bx,UPDATEWIDE*UPDATEHIGH-1              ; bx is the tile number\r
+       mov     dx,[linewidth]\r
+\r
+;\r
+; see if the tile needs to be copied\r
+;\r
+@@checktile:\r
+       test    [update+bx],1\r
+       jnz     @@copytile\r
+@@next:\r
+       dec     bx\r
+       jns     @@checktile\r
+\r
+;\r
+; done\r
+;\r
+       mov dx,GC_INDEX+1\r
+       in      al,dx\r
+       and al,NOT 3\r
+       or      al,0\r
+       out dx,al\r
+       ret\r
+\r
+;\r
+; copy a tile\r
+;\r
+@@copytile:\r
+       mov     [update+bx],0\r
+       shl     bx,1\r
+       mov     si,[blockstarts+bx]\r
+       shr     bx,1\r
+       mov     di,si\r
+       add     si,[bufferofs]\r
+       add     di,[displayofs]\r
+\r
+       mov     ax,SCREENSEG\r
+       mov     ds,ax\r
+\r
+REPT   16\r
+       mov     al,[si]\r
+       mov     [di],al\r
+       mov     al,[si+1]\r
+       mov     [di+1],al\r
+       mov     al,[si+2]\r
+       mov     [di+2],al\r
+       mov     al,[si+3]\r
+       mov     [di+3],al\r
+       add     si,dx\r
+       add     di,dx\r
+ENDM\r
+\r
+       mov     ax,ss\r
+       mov     ds,ax\r
+       jmp     @@next\r
+\r
+ENDP\r
+\r
+\r
+       END\r
+\r