aboutsummaryrefslogtreecommitdiff
path: root/graphics/scaler/hq2x_i386.asm
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/scaler/hq2x_i386.asm')
-rw-r--r--graphics/scaler/hq2x_i386.asm69
1 files changed, 29 insertions, 40 deletions
diff --git a/graphics/scaler/hq2x_i386.asm b/graphics/scaler/hq2x_i386.asm
index a4bc50c979..085df82ce5 100644
--- a/graphics/scaler/hq2x_i386.asm
+++ b/graphics/scaler/hq2x_i386.asm
@@ -22,6 +22,8 @@ GLOBAL _hq2x_16
EXTERN _LUT16to32
EXTERN _RGBtoYUV
+EXTERN _hqx_highbits
+EXTERN _hqx_lowbits
SECTION .bss
linesleft resd 1
@@ -47,10 +49,6 @@ const5 dd 0x00050005,0x00000005
const6 dd 0x00060006,0x00000006
const14 dd 0x000E000E,0x0000000E
threshold dd 0x00300706,0x00000000
-; FIXME: zerlowbits assumes 565 mode.
-; Also, in the code, the constant 0x0821 is used which also assumes 565 mode
-highbits dd 0xF7DEF7DE
-lowbits dd 0x0821
moduloSrc dd 0
moduloDst dd 0
@@ -135,17 +133,14 @@ SECTION .text
%macro Interp1 3
mov edx,%2
mov ecx,%3
- cmp edx,ecx
- je %%fin
- and edx,[highbits]
- and ecx,[highbits]
+ and edx,[_hqx_highbits]
+ and ecx,[_hqx_highbits]
add ecx,edx
shr ecx,1
- add ecx,[lowbits]
- and ecx,[highbits]
+ add ecx,[_hqx_lowbits]
+ and ecx,[_hqx_highbits]
add edx,ecx
shr edx,1
-%%fin:
mov %1,dx
%endmacro
@@ -154,19 +149,15 @@ SECTION .text
%macro Interp2 4
mov edx,%3
mov ecx,%4
- cmp edx,ecx
- je %%fin1
- and edx,[highbits]
- and ecx,[highbits]
+ and edx,[_hqx_highbits]
+ and ecx,[_hqx_highbits]
add ecx,edx
shr ecx,1
- add ecx,[lowbits]
+ add ecx,[_hqx_lowbits]
%%fin1:
mov edx,%2
- cmp edx,ecx
- je %%fin2
- and ecx,[highbits]
- and edx,[highbits]
+ and ecx,[_hqx_highbits]
+ and edx,[_hqx_highbits]
add edx,ecx
shr edx,1
%%fin2:
@@ -178,10 +169,8 @@ SECTION .text
%macro Interp5 3
mov edx,%2
mov ecx,%3
- cmp edx,ecx
- je %%fin
- and edx,[highbits]
- and ecx,[highbits]
+ and edx,[_hqx_highbits]
+ and ecx,[_hqx_highbits]
add edx,ecx
shr edx,1
%%fin:
@@ -1729,12 +1718,12 @@ _hq2x_16:
shl eax,16
or eax,edx
mov ecx,[w2]
- and edx,[highbits]
- and ecx,[highbits]
+ and edx,[_hqx_highbits]
+ and ecx,[_hqx_highbits]
add ecx,edx
shr ecx,1
- add ecx,[lowbits]
- and ecx,[highbits]
+ add ecx,[_hqx_lowbits]
+ and ecx,[_hqx_highbits]
add edx,ecx
shr edx,1
mov ecx,edx
@@ -1746,12 +1735,12 @@ _hq2x_16:
..@cross2:
shl eax,16
mov ecx,[w4]
- and edx,[highbits]
- and ecx,[highbits]
+ and edx,[_hqx_highbits]
+ and ecx,[_hqx_highbits]
add ecx,edx
shr ecx,1
- add ecx,[lowbits]
- and ecx,[highbits]
+ add ecx,[_hqx_lowbits]
+ and ecx,[_hqx_highbits]
add edx,ecx
shr edx,1
or eax,edx
@@ -1760,12 +1749,12 @@ _hq2x_16:
jmp .loopx_end
..@cross4:
mov ecx,[w6]
- and edx,[highbits]
- and ecx,[highbits]
+ and edx,[_hqx_highbits]
+ and ecx,[_hqx_highbits]
add ecx,edx
shr ecx,1
- add ecx,[lowbits]
- and ecx,[highbits]
+ add ecx,[_hqx_lowbits]
+ and ecx,[_hqx_highbits]
add edx,ecx
shr edx,1
shl edx,16
@@ -1778,12 +1767,12 @@ _hq2x_16:
shl eax,16
or eax,edx
mov ecx,[w8]
- and edx,[highbits]
- and ecx,[highbits]
+ and edx,[_hqx_highbits]
+ and ecx,[_hqx_highbits]
add ecx,edx
shr ecx,1
- add ecx,[lowbits]
- and ecx,[highbits]
+ add ecx,[_hqx_lowbits]
+ and ecx,[_hqx_highbits]
add edx,ecx
shr edx,1
mov ecx,edx