Rewrote unified Mode-X blitter in DOS port. [TRAC]

This commit is contained in:
stainless
2001-11-14 12:17:36 +00:00
parent c446309ddc
commit a0d8e5bca9
2 changed files with 88 additions and 107 deletions

View File

@@ -159,7 +159,7 @@ NEWSYM outofmemory
SECTION .data SECTION .data
NEWSYM mydebug, db '',13,10,0 NEWSYM mydebug, db '',13,10,0
NEWSYM outofmem, db 'You don',39,'t have enough memory to run this program!',13,10,0 NEWSYM outofmem, db 'You don',39,'t have enough memory to run this program!',13,10,0
%define ZVERSION '337 ' %define ZVERSION '337'
;%define ZBETA 0 ;%define ZBETA 0
; Line added by Peter Santing ; Line added by Peter Santing
@@ -176,27 +176,34 @@ NEWSYM welcome
; db 'PRIVATE BETA VERSION!!! PLEASE DO NOT DISTRIBUTE!!! Thank you!',13,10 ; db 'PRIVATE BETA VERSION!!! PLEASE DO NOT DISTRIBUTE!!! Thank you!',13,10
; db 'Private Beta is Registered to : ',USERNAMEN,13,10 ; db 'Private Beta is Registered to : ',USERNAMEN,13,10
;%else ;%else
db 'ZSNES v1.',ZVERSION,' beta (c) 1997-2001, ZSNES Team (zsKnight & _Demo_)',13,10
%ifdef __LINUX__ %ifdef __LINUX__
db 'ZSNES v1.',ZVERSION,' beta (c)1997-2001 ZSNES Team (zsKnight - _Demo_)',13,10 db 'Compiled under NASM and GCC. (Linux/FreeBSD)',13,10,13,10
db 'Linux version, please report crashes to zsnes-devel@lists.sourceforge.net.',13,10
db 'Compiled under NASM, GCC',13,10,13,10
%else %else
db 'ZSNES v1.',ZVERSION,' beta (c)1997-2001 ZSNES Team (zsKnight - _Demo_)',13,10 %ifdef __WIN32__
; ZSNES DOS doesn't use WDOSX anymore db 'Compiled under NASM and MSVC++. (Windows)',13,10,13,10
db 'Compiled under NASM, GCC (DOS+DPMI)',13,10,13,10 %else
db 'Compiled under NASM and DJGPP. (DOS w/ DPMI)',13,10,13,10
%endif
%endif %endif
;%endif ;%endif
db ' Programmers : zsKnight, _Demo_',13,10 db 'Be sure to check http://www.zsnes.com/ for the latest version.',13,10
db ' Assistant Coder : Pharos',13,10,13,10 db 'Please report crashes to zsnes-devel@lists.sourceforge.net.',13,10,13,10
db 'ZSNES comes with ABSOLUTELY NO WARRANTY. This is free software,',10,13 db ' Main Coders : zsKnight, _Demo_, and pagefault',13,10
db ' Assistant Coders : Pharos, teuf, theoddone33, and stainless',13,10,13,10
db 'ZSNES comes with ABSOLUTELY NO WARRANTY. This is free software,',10,13
db 'and you are welcome to redistribute it under certain conditions;',10,13 db 'and you are welcome to redistribute it under certain conditions;',10,13
db 'check license.txt.',10,13,10,13 %ifdef __LINUX__
db 'Use ZSNES -? for command line definitions',13,10,13,10,0 db 'please read ',39,'LICENSE',39,' thoroughly before using it.',10,13,10,13
%else
db 'please read ',39,'LICENSE.TXT',39,' thoroughly before using it.',10,13,10,13
%endif
db 'Use ZSNES -? for command line definitions.',13,10,13,10,0
;cpuidfname db 'nocpuzid.dat',0 ;cpuidfname db 'nocpuzid.dat',0
;cpuidtext db 'NOTE: If ZSNES crashes here, then please re-run. ',0 ;cpuidtext db 'NOTE: If ZSNES crashes here, then please re-run. ',0
;cpuidtext2 db 13,' ',13,0 ;cpuidtext2 db 13,' ',13,0
YesMMX db 'MMX support enabled.',13,10,13,10,0 YesMMX db 'MMX support found and enabled.',13,10,13,10,0
; global variables ; global variables

View File

@@ -396,7 +396,7 @@ NEWSYM copymodex224
mov eax,(320*225)/4 mov eax,(320*225)/4
.pageb .pageb
mov dl,222 mov bl,222
jmp copymodexloop jmp copymodexloop
;******************************************************* ;*******************************************************
@@ -438,8 +438,8 @@ NEWSYM copymodex240
mov eax,(320*240)/4 mov eax,(320*240)/4
.pageb .pageb
mov dl,[resolutn] mov bl,[resolutn]
sub dl,2 sub bl,2
jmp copymodexloop jmp copymodexloop
;******************************************************* ;*******************************************************
@@ -481,110 +481,84 @@ NEWSYM copymodex256
mov eax,(320*256)/4 mov eax,(320*256)/4
.pageb .pageb
mov dl,[resolutn] mov bl,[resolutn]
sub dl,2 sub bl,2
jmp copymodexloop jmp copymodexloop
;eax = VGA address of output page ;eax = VGA address of output page
;edi = offset in current page of first line ;edi = offset in current page of first line
;esi = address of first line to be copied ;esi = address of first line to be copied
;dl = number of lines to copy ;bl = number of lines to copy
NEWSYM copymodexloop NEWSYM copymodexloop
add edi,eax add edi,eax
mov [.pageaddress],eax mov [.pageaddress],eax
mov [.linecount],dl mov [.linecount],bl
mov [.startesi],esi mov [.startesi],esi
mov [.startedi],edi mov [.startedi],edi
.loopa1 ; register allocation
mov ecx,16 ; bl = line counter (0-total lines)
.loopb1 ; bh = other line counter (descriptive, eh?) (0-8)
mov ah,[esi+12] ; ebp = plane counter
mov al,[esi+8] ; ch = plane enable bit
shl eax,16 ; cl = 4-pixel copy counter
mov ah,[esi+4] ; edx= pixel processing & I/O address
mov al,[esi+0] ; eax = pixel processing & I/O data
mov [es:edi],eax
add esi,16
add edi,4
dec ecx
jnz .loopb1
add esi,32
add edi,16
dec dl
jnz .loopa1
mov dx,03C4h mov dx,03C4h
mov ax,0202h
.loopa
mov ebp,4
mov ch,1
cmp bl,8
mov bh,bl
jb .loopb
mov bh,8
.loopb
; set write plane
mov ah,ch
add ch,ch
mov al,02h
out dx,ax out dx,ax
mov esi,[.startesi]
push ebx
push edi
push esi
.loopc
; loop count
mov cl,16
.loopd
mov al,[esi+8]
mov ah,[esi+12]
shl eax,16
mov al,[esi+0]
mov ah,[esi+4]
add esi,16
mov [es:edi],eax
add edi,4
dec cl
jnz .loopd
add esi,16+16
add edi,(320-256)/4
dec bh
jnz .loopc
pop esi
pop edi
pop ebx
inc esi inc esi
mov edi,[.startedi] dec ebp
mov dl,[.linecount] jnz .loopb
.loopa2
mov ecx,16 ; next line
.loopb2 add esi,(16+256+16)*8-4
mov ah,[esi+12] add edi,320*8/4
mov al,[esi+8] sub bl,bh
shl eax,16 jnz .loopa
mov ah,[esi+4]
mov al,[esi+0]
mov [es:edi],eax
add esi,16
add edi,4
dec ecx
jnz .loopb2
add esi,32
add edi,16
dec dl
jnz .loopa2
mov dx,03C4h
mov ax,0402h
out dx,ax
mov esi,[.startesi]
add esi,2
mov edi,[.startedi]
mov dl,[.linecount]
.loopa3
mov ecx,16
.loopb3
mov ah,[esi+12]
mov al,[esi+8]
shl eax,16
mov ah,[esi+4]
mov al,[esi+0]
mov [es:edi],eax
add esi,16
add edi,4
dec ecx
jnz .loopb3
add esi,32
add edi,16
dec dl
jnz .loopa3
mov dx,03C4h
mov ax,0802h
out dx,ax
mov esi,[.startesi]
add esi,3
mov edi,[.startedi]
mov dl,[.linecount]
.loopa4
mov ecx,16
.loopb4
mov ah,[esi+12]
mov al,[esi+8]
shl eax,16
mov ah,[esi+4]
mov al,[esi+0]
mov [es:edi],eax
add esi,16
add edi,4
dec ecx
jnz .loopb4
add esi,32
add edi,16
dec dl
jnz .loopa4
pop es pop es
@@ -610,6 +584,7 @@ NEWSYM copymodexloop
.setpageb .setpageb
mov [whichpage],al mov [whichpage],al
ret ret
SECTION .bss SECTION .bss
.startesi resd 1 .startesi resd 1
.startedi resd 1 .startedi resd 1
@@ -619,7 +594,6 @@ SECTION .bss
NEWSYM whichpage, resb 1 ; active page and visual page locations NEWSYM whichpage, resb 1 ; active page and visual page locations
SECTION .text SECTION .text
;******************************************************* ;*******************************************************
; CopyModeQ 224 Copies buffer into chained 256x224 ; CopyModeQ 224 Copies buffer into chained 256x224
;******************************************************* ;*******************************************************