From 107dd8aa8081e90cc91c88af9cf9bba3cd351bd7 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Thu, 13 Jun 2002 22:45:47 +0000 Subject: [PATCH] Rewrote mode 4 fix --- zsnes/src/video/newgfx.mac | 42 ++++++------------------------------ zsnes/src/video/newgfx16.mac | 15 +++++++------ 2 files changed, 15 insertions(+), 42 deletions(-) diff --git a/zsnes/src/video/newgfx.mac b/zsnes/src/video/newgfx.mac index 98199332..673c58dd 100644 --- a/zsnes/src/video/newgfx.mac +++ b/zsnes/src/video/newgfx.mac @@ -2887,11 +2887,11 @@ EXTSYM drawmode7ngextbg,drawmode7ngextbg2 shr edx,3 shl edx,6 xor eax,eax - cmp byte[BGMA+ebx],4 - je .offsetmode4 mov ax,[BGPT3+ebx*2] -.offsetmode4 + cmp dx,0 + jl .isneg add ax,dx +.isneg xor edx,edx mov dx,[BG3SXl+ebx*2] and dx,0F8h @@ -2955,21 +2955,6 @@ EXTSYM drawmode7ngextbg,drawmode7ngextbg2 add eax,ecx add [ofsmtptr],ecx mov [ofsmmptr],eax - - mov word[bgtxadd2],0 - cmp word[BGPT3X+ebx*2],0 - je .yesoverfl - mov cx,word[BG3SXl+ebx*2] - add cx,16 - test cx,100h - jz .notoverfl - add dword[ofsmcptr],800h - sub word[bgtxadd2],800h - jmp .yesoverfl -.notoverfl - add word[bgtxadd2],800h -.yesoverfl - mov dword[ofshvaladd],0 mov ecx,[BGOPT1+ebx*2+%1*512] mov edx,[BGMA+ebx] @@ -3254,11 +3239,11 @@ EXTSYM drawmode7ngextbg,drawmode7ngextbg2 shr edx,3 shl edx,6 xor eax,eax - cmp byte[BGMA+ebx],4 - je .offsetmode4 mov ax,[BGPT3+ebx*2] -.offsetmode4 + cmp dx,0 + jl .isneg add ax,dx +.isneg xor edx,edx mov dx,[BG3SXl+ebx*2] and dx,0F8h @@ -3290,21 +3275,6 @@ EXTSYM drawmode7ngextbg,drawmode7ngextbg2 mov eax,[BGPT1+ebx*2+%1*512] mov [ofsmtptr],eax mov [ofsmtptrs],eax - - mov word[bgtxadd2],0 - cmp word[BGPT3X+ebx*2],0 - je .yesoverfl - mov cx,word[BG3SXl+ebx*2] - add cx,16 - test cx,100h - jz .notoverfl - add dword[ofsmcptr],800h - sub word[bgtxadd2],800h - jmp .yesoverfl -.notoverfl - add word[bgtxadd2],800h -.yesoverfl - mov ecx,[BG1SXl+ebx*2+%1*512] mov edx,[BGPT1X+ebx*2+%1*512] test ecx,100h diff --git a/zsnes/src/video/newgfx16.mac b/zsnes/src/video/newgfx16.mac index 26d49169..a6c62527 100644 --- a/zsnes/src/video/newgfx16.mac +++ b/zsnes/src/video/newgfx16.mac @@ -3131,7 +3131,10 @@ EXTSYM osm2dis shl edx,6 xor eax,eax mov ax,[BGPT3+ebx*2] + cmp dx,0 + jl .isneg1 add ax,dx +.isneg1 xor edx,edx mov dx,[BG3SXl+ebx*2] and dx,0F8h @@ -3299,11 +3302,11 @@ EXTSYM osm2dis shr edx,3 shl edx,6 xor eax,eax - cmp byte[BGMA+ebx],4 - je .offsetmode4 mov ax,[BGPT3+ebx*2] -.offsetmode4 + cmp dx,0 + jl .isneg2 add ax,dx +.isneg2 xor edx,edx mov dx,[BG3SXl+ebx*2] and dx,0F8h @@ -3705,11 +3708,11 @@ EXTSYM osm2dis shr edx,3 shl edx,6 xor eax,eax - cmp byte[BGMA+ebx],4 - je .offsetmode4 mov ax,[BGPT3+ebx*2] -.offsetmode4 + cmp dx,0 + jl .isneg3 add ax,dx +.isneg3 xor edx,edx mov dx,[BG3SXl+ebx*2] and dx,0F8h