Help in resizing the screen height display ( Y-axis )

General area for talk about ZSNES. The best place to ask for related questions as well as troubleshooting.

Moderator: ZSNES Mods

Post Reply
Marcelo_20XX
New Member
Posts: 9
Joined: Mon Mar 25, 2013 9:11 pm

Help in resizing the screen height display ( Y-axis )

Post by Marcelo_20XX »

I am trying to lower the Y-axis resolution to compensate the stretching it makes when you play on a 16:9 monitor ( I don't mind if I lose some lines at the top and bottom of the screen ), I used to do this with the Height size adjustment on old monitors, but since the LCD era I can no longer manually adjust the size of the screen's height display.

So far I haven't been successful in narrowing where Zsnes calculates the display output in the source, can someone help me, thanks!
odditude
Official tech support dood
Posts: 2120
Joined: Wed Jan 25, 2006 7:57 am

Re: Help in resizing the screen height display ( Y-axis )

Post by odditude »

so you're trying to use the correct aspect ratio with the top and bottom clipped?
Why yes, my shift key *IS* broken.
Marcelo_20XX
New Member
Posts: 9
Joined: Mon Mar 25, 2013 9:11 pm

Re: Help in resizing the screen height display ( Y-axis )

Post by Marcelo_20XX »

Kind of, though its impossible to reach 4:3 because then you will clip the image too much, so I only want to fine tune the Y-axis a little, I know there is an option that let you play at the 4:3 Aspect ratio on a widescreen monitor by having letterboxes at the right and left sides of the screen, so I prefer the earlier approach. Also there are some games that benefits from this, namely Final Fight 2 where you get black stripes at the top and bottom already. I have been doing this on other emus with good results (ePSXe and Magic Engine). I am just having a hard time replicating this on Zsnes, so any help is appreciated.
Marcelo_20XX
New Member
Posts: 9
Joined: Mon Mar 25, 2013 9:11 pm

Re: Help in resizing the screen height display ( Y-axis )

Post by Marcelo_20XX »

Here is some update of what I am trying to do:

Image

Original Image Display

Image

Resized Image Display

I did this in Snes9x 1.53 by changing some code in the render.cpp source:

inline void SetRect(RECT* rect, int width, int height, int scale)
{
rect->left = 0;
rect->right = width * scale;
rect->top = -48;
rect->bottom = ((height - (GUI.HeightExtend?0:15)) * scale)-64;
}

But I have no idea how can I do this in Zsnes
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: Help in resizing the screen height display ( Y-axis )

Post by grinvader »

Marcelo_20XX wrote:But I have no idea how can I do this in Zsnes
Probably because all the render stuff is in assembly. Have fun storming the castle !
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Marcelo_20XX
New Member
Posts: 9
Joined: Mon Mar 25, 2013 9:11 pm

Re: Help in resizing the screen height display ( Y-axis )

Post by Marcelo_20XX »

I have some knowledge of assembly, its much harder to do this that in C++ and I agree with you, but, just give me a hint where should I look and I will have fun storming the castle. I actually changed some code but the image just got moved not resized like in Snes9x. Thanks for any advice
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: Help in resizing the screen height display ( Y-axis )

Post by grinvader »

I couldn't point it out even if I wanted, it's all over the place. Oh, also don't forget that overscan modifies vertical stuff too.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Gil_Hamilton
Buzzkill Gil
Posts: 4294
Joined: Wed Jan 12, 2005 7:14 pm

Re: Help in resizing the screen height display ( Y-axis )

Post by Gil_Hamilton »

What Grinvader is trying to say is... ZSNES is not even clean, well-documented assembly. It's a Lovecraftian nightmare of spaghetti code and ad-hoc design.
Squall_Leonhart wrote:
You have your 2s, 4s, 8s, 16s, 32s, 64s, and 128s(crash course in binary counting!). But no 1s.
DirectInput represents all bits, not just powers of 2 in an axis.
KHDownloads
Marcelo_20XX
New Member
Posts: 9
Joined: Mon Mar 25, 2013 9:11 pm

Re: Help in resizing the screen height display ( Y-axis )

Post by Marcelo_20XX »

Hmmm...I see, thanks both of you for the replies, closest I got was at looking this part in copyvwin:

Process2xSaIwin:
mov ebx,hirestiledat+1
cmp byte[GUIOn],1
je .loopabi
cmp byte[newengen],0
je .loopabi
mov ebx,SpecialLine+1
.loopabi
mov [InterPtr],ebx

; add edi,[VESAAddr]
%ifdef __UNIXSDL__
mov dl,223
%else
mov dl,[resolutn]
sub dl,1 ; Compensate for top/bottom line + 2 lines in 2xSaI
%endif
mov [lineleft],dl
mov dword[esi+512],0
mov dword[esi+512+576*2],0
mov ebx,[vidbufferofsb]
add ebx,288*2

I changed this value in the hope of reducing the top and bottom, but I didn't get the desired effect, it just cropped the display of the bottom part of the image
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: Help in resizing the screen height display ( Y-axis )

Post by grinvader »

Marcelo_20XX wrote:Hmmm...I see, thanks both of you for the replies, closest I got was at looking this part in copyvwin:

Code: Select all

Process2xSaIwin:
    mov ebx,hirestiledat+1
    cmp byte[GUIOn],1
    je .loopabi
    cmp byte[newengen],0
    je .loopabi
    mov ebx,SpecialLine+1
.loopabi
    mov [InterPtr],ebx

;    add edi,[VESAAddr]
%ifdef __UNIXSDL__
    mov dl,223
%else
    mov dl,[resolutn]
    sub dl,1    ; Compensate for top/bottom line + 2 lines in 2xSaI      <<<<
%endif
    mov [lineleft],dl
    mov dword[esi+512],0
    mov dword[esi+512+576*2],0
    mov ebx,[vidbufferofsb]
    add ebx,288*2
I changed this value in the hope of reducing the top and bottom, but I didn't get the desired effect, it just cropped the display of the bottom part of the image

Code: Select all

 tags for your visual comfort.

I forgot to mention that pretty much every filter has its own code like that. This is the part that handles 2xSaI. As you can see, there's port-dependant hardcoded shit in there. Fun times !
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Post Reply