aboutsummaryrefslogtreecommitdiff
path: root/plugins/dfxvideo/i386.asm
diff options
context:
space:
mode:
authorPCSX* teams2010-11-16 14:15:22 +0200
committerGrazvydas Ignotas2010-11-16 14:15:22 +0200
commitef79bbde537d6b9c745a7d86cb9df1d04c35590d (patch)
treeef8d2520dbb9e1e345b41b12c9959f300ca8fd10 /plugins/dfxvideo/i386.asm
downloadpcsx_rearmed-ef79bbde537d6b9c745a7d86cb9df1d04c35590d.tar.gz
pcsx_rearmed-ef79bbde537d6b9c745a7d86cb9df1d04c35590d.tar.bz2
pcsx_rearmed-ef79bbde537d6b9c745a7d86cb9df1d04c35590d.zip
pcsxr-1.9.92
Diffstat (limited to 'plugins/dfxvideo/i386.asm')
-rw-r--r--plugins/dfxvideo/i386.asm67
1 files changed, 67 insertions, 0 deletions
diff --git a/plugins/dfxvideo/i386.asm b/plugins/dfxvideo/i386.asm
new file mode 100644
index 0000000..86d6e23
--- /dev/null
+++ b/plugins/dfxvideo/i386.asm
@@ -0,0 +1,67 @@
+; i386.asm - description
+; -------------------
+; begin : Sun Nov 08 2001
+; copyright : (C) 2001 by Pete Bernert
+; email : BlackDove@addcom.de
+
+; ported from inline gcc to nasm by linuzappz
+
+
+; This program is free software; you can redistribute it and/or modify *
+; it under the terms of the GNU General Public License as published by *
+; the Free Software Foundation; either version 2 of the License, or *
+; (at your option) any later version. See also the license.txt file for *
+; additional informations. *
+
+
+bits 32
+
+section .text
+
+%include "macros.inc"
+
+NEWSYM i386_BGR24to16
+ push ebp
+ mov ebp, esp
+ push ebx
+ push edx
+
+ mov eax, [ebp+8] ; this can hold the G value
+ mov ebx, eax ; this can hold the R value
+ mov edx, eax ; this can hold the B value
+ shr ebx, 3 ; move the R value
+ and edx, 00f80000h ; mask the B value
+ shr edx, 9 ; move the B value
+ and eax, 00f800h ; mask the G value
+ shr eax, 6 ; move the G value
+ and ebx, 0000001fh ; mask the R value
+ or eax, ebx ; add R to G value
+ or eax, edx ; add B to RG value
+ pop edx
+ pop ebx
+ mov esp, ebp
+ pop ebp
+ ret
+
+NEWSYM i386_shl10idiv
+ push ebp
+ mov ebp, esp
+ push ebx
+ push edx
+
+ mov eax, [ebp+8]
+ mov ebx, [ebp+12]
+ mov edx, eax
+ shl eax, 10
+ sar edx, 22
+ idiv ebx
+
+ pop edx
+ pop ebx
+ mov esp, ebp
+ pop ebp
+ ret
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
+