iplounge.net Forum Index iplounge.net
NFS PU & HS Online Racing Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

On NFSPU @ widescreen aspect ratios and Normandie crashes

 
Post new topic   Reply to topic    iplounge.net Forum Index -> IPL PU Support
View previous topic :: View next topic  
Author Message
fk



Joined: 12 Jul 2014
Posts: 6

PostPosted: Sat Jul 12, 2014 9:24 pm    Post subject: On NFSPU @ widescreen aspect ratios and Normandie crashes Reply with quote

(I don't think I'm telling anyone anything new here, but finding a reasonably active NFSPU community is bloody hard these days.)

Having dug out NFSPU recently again, I was somewhat bothered by its not playing nice with widescreen displays. While you can set it to widescreen resolutions (and with the Voodoo renderer + nGlide, you can even get the menu at a nice resolution), but everything's horizontally stretched and icky. So I looked into solving that and a few false starts and various related and unrelated distractions later, I now have something reasonably presentable.



Download
https://bitbucket.org/fk/porsche-graphics-hacks/downloads/nfspu-widescreen-1.0.1.zip

The source can be found at https://bitbucket.org/fk/porsche-graphics-hacks.

Installation

  • extract the contents of this archive into the "Drivers" subdirectory of your NFSPU installation directory
  • install the Microsoft Visual C++ 2013 x86 Redistributable using the included "vcredist_x86.exe" installer
  • enable the widescreen patch by double-clicking the "Enable Widescreen Renderer.reg" file (and confirming all prompts)
  • (optionally) if you prefer to use the Glide renderer, remove the initial ";" from the ";driver=voodoo2" line in "porsche-widescreen.ini"


On a certain set of crashes
I think I've fixed the notorious Normandie/lens flare crashes. However, I'm not totally confident that I've fixed it totally or that I caught every related crash and as such, I'd appreciate to get feedback on stability. So, it'd be great if everyone could reset the usual work-arounds, i.e. turn on lens flare and the rear view mirror and change the sky files for all tracks back to their defaults. And if you do get a crash, see further below for how you can help me debug it.

Other notes

  • Both the Direct3D 7 renderer and the Glide renderer are supported (I only tested the Glide renderer with nGlide); the D3D renderer is the default because it needs no external dependencies but I highly recommend the Glide renderer with nGlide for anyone.
  • Zooming into the car interiors in the menu shows some visual glitches.
  • Don't set the in-game resolution to 640x480, that'll also cause slight visual issues. Again, somewhat obscure technical reasons, just use a resolution that wasn't around 20 years ago.
  • This patch corrects the horizontal stretching by basically counter-stretching the image vertically, i.e. the image will be cut off at the top and bottom (HUD and interface elements are fine and on-screen). As a result, compared to the game running at a 4:3 aspect ratio, a widescreen aspect ratio will give you the same horizontal field of view, but less vertical field of view. It's not a big deal, but the wider your screen, the less you'll strictly see, compared to 4:3.


How to create a memory dump when the game crashes
Crashes are wonderful! They teach us stuff! If you want to help me learn stuff from your crashes (and you have a decent upload speed), read on! By sending me a memory dump of the game process when it crashes, you can help me debug and hopefully fix that crash. A memory dump is basically all the contents of the game's working memory squashed into a handy file. To create one in case of a game crash:

  • Before starting the game, launch the Windows Task Manager (free tip: Control+Shift+Escape directly opens it) and, in the "Options" menu, switch on the "Always on top" setting (on Windows 8 and up, you might have to switch into advanced mode first by clicking the "More details" down-arrow in the lower left corner). Frozen fullscreen games have the annoying tendency to stick over and hide other windows; with this setting, we make sure we can properly use Task Manager later.
  • Now comes the fun part, where you get to play the game!
  • When you encounter a game crash (of the "Porsche.exe has stopped working" kind), don't close the game yet. Instead, launch Task Manager again and find the "Porsche" entry (on Windows 7 and older, you'll probably have to switch to the "Details" tab and look for it there). Once you've found it, right-click it and select "Create dump file". Once it's done, Windows should indicate where it's stored the memory dump file. You can close the game process now.
  • Find the dump file that got created in the last step, upload it somewhere and send me a link. The file is going to be several hundred MB so you probably want to compress it with 7-Zip or similar (but even then it'll be somewhat big).


Also: these dump files contain the game's memory contents. The most sensitive information one could extract from these is probably details about your profile and some information about your system, but you'll still not want to advertise them publicly. I promise that I'll only use these files to debug crashes, if you trust me that far. Wink


Last edited by fk on Wed Dec 10, 2014 3:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
fk



Joined: 12 Jul 2014
Posts: 6

PostPosted: Mon Jul 14, 2014 7:39 pm    Post subject: Reply with quote

Oh dear. I forgot to check this iteration with the in-game "widescreen" setting (which, by the way, only adds black bars at the top and bottom of the screen. Not very useful when your screen is *actually* wide). And as I feared, switching that setting on breaks aspect ratio correction Razz

I've compiled a quick hotfix that corrects that (only the DLL, just drop it over the 1.0 one), for anyone who wants their black bars:
Update: this is now in the 1.0.1 release, linked in the first post; no more DLL hotfix necessary.
--

Quote:
Can you select wide screen resolutions in Voodoo2/Glide? I can not as PU only shows the following screen resolutions


Yeah, voodoo2+nGlide only gives you certain resolution options (they seem hardcoded somewhere, I could select 1600x1200 on a system that didn't have 1200 vertical pixels on any monitor). Not sure if that's a limitation of voodoo2z.dll, the Glide API or nGlide. Note that the 3D stuff (track, cars etc.) is actually rendered at the resolution you set in nGlide; but yes, the HUD stuff'll get stretched. That's basically the tradeoff at this time: with voodoo2+nGlide, you get a stretched HUD, with D3D7 you get a stuttery mess. Wink To be fair, I think the stuttering might actually be OS-dependent or something. But I know what I'll pick.

--
I've been unsure if I should mention this, since I hate making promises (even the vaguest ones) that I'm not sure I can keep, but I've been reverse-engineering the interface between Porsche.exe and the renderer DLLs (this patch making good use of that work); and I'm cautiously optimistic that I might know enough about it to write an entirely new renderer DLL, from scratch, without having to bother with ever calling dx7z.dll or voodoo2z.dll. Basically, a native D3D9 (probably) renderer for this game. Just throwing that out there.


Last edited by fk on Wed Dec 10, 2014 3:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
[SK]Nath
Site Admin


Joined: 03 Dec 2010
Posts: 579

PostPosted: Mon Jul 14, 2014 11:36 pm    Post subject: Reply with quote

Hi fk,

Firstly I write on behalf of the IPL community to thank you for putting your time and dedication into your attempts to fix PU's crashing to desktop problems. We will support you as much as possible in hope that we can get to a point where PU runs as smoothly as possible for everyone without crashes.

For memory dumps after PU crashes - which would be the start and end addresses your looking for? Unfortunately my game has crashed twice today using the D3D registry fix you provided whilst racing Normandie Forward driving the '56 550 A Spyder with all settings enabled. I'd like to be able to get you a memory dump when this happens again next using the addresses that your looking for.

Thank you.

[SK]Nath
Back to top
View user's profile Send private message
[XR]TriG



Joined: 19 Sep 2010
Posts: 355
Location: Retired :)

PostPosted: Tue Jul 15, 2014 9:20 pm    Post subject: Reply with quote

[RS]JMac wrote:
I have moved this post to the links forum because of the number of links.


So now the problem is "the number" of links?!? It's so confusing too me trying keep up with your ever changing forum rules John Smile. Phew! So how many links is too many? 2? 3? 4? 5? 6? 10?

I would suggest you write down these ever changing rules for your forum, but I think we both know that links/advertising/too many screens/too many links, or whatever the new problem you find tomorrow, isn't the problem Smile.

So here is what I'll do for you John. I delete all my posts from this thread and never post here again. Then you should no longer have any reason to hide this great patch from the greater PU community.

Or are you still trying to get people to register to this forum by hiding things from unregistered users? Either why I'll delete my posts, np Smile

Have good day John and enjoy your day Smile


Last edited by [XR]TriG on Thu Jul 17, 2014 12:00 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
[RS]JMac
Site Admin


Joined: 11 Sep 2006
Posts: 864
Location: Ipswich UK

PostPosted: Wed Jul 16, 2014 3:11 pm    Post subject: Reply with quote

I have moved this post to the links forum because of the number of links.

Edit by IPL Administrator: This topic has been returned to IPL PU Support following the Admin Meeting on Monday 21st July.
_________________
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
[RS]JMac
Site Admin


Joined: 11 Sep 2006
Posts: 864
Location: Ipswich UK

PostPosted: Thu Jul 17, 2014 11:51 am    Post subject: Reply with quote

Hi Garrett

I'm sorry you feel disgruntled and maybe my post was a little short and not explanetory enough, the move of the post has nothing to do with the actual number of links.

When originally posted I thought the post was good and until such times as we make a formal download of the patch, or even add it to ipl's fix menu I considered that the PU Support Forum was indeed the best place for it.

This constitutes the first conflict of the new rules where all links,pictures and video's are posted only in the new forum's, I decided to let it stay there until the posting of other unrelated links, which I believe you posted knowing its against our rules and then replaced them after they were removed by admins.

I have no option, I must support our admin's so I decided to move the post with the intention of discussing it at the next monday admin meeting.

Also in support of admins I must ask you to remove your signature - admin [RS]SJak is unhappy about you quoting him in this way.

I understand that your a little unhappy about the new rules regarding links etc and seemingly a little misunderstanding as I personally thought you were on board with it but being disruptive is not the way to change anything.

you are partly responsible for bringing about the new rules and I dont have an issue with you trying to change it further, to this end we have tried to get you more involved by asking you to stand as moderator.

Finally in my own defence I have been too busy trying to implement HP2 to our family to be paying attention to forum or making long posts etc, but you are also a valued member of our community.

John
_________________
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
fk



Joined: 12 Jul 2014
Posts: 6

PostPosted: Sat Jul 19, 2014 2:20 pm    Post subject: Reply with quote

Well this thread got fun Smile

[SK]Nath wrote:
Hi fk,

For memory dumps after PU crashes - which would be the start and end addresses your looking for? Unfortunately my game has crashed twice today using the D3D registry fix you provided whilst racing Normandie Forward driving the '56 550 A Spyder with all settings enabled. I'd like to be able to get you a memory dump when this happens again next using the addresses that your looking for.

Thank you.

[SK]Nath


Uh... I have no idea what memory addresses I'm looking for Wink Unless this is an entirely new crash, I'd need the arguments of the 'readrect' function, which are somewhere on the stack, which I'm pretty sure doesn't have a fixed base address. A full memory dump is basically the most useful info I can get short of debugging the crash live on your machine.

If you're worried about file sizes, you can use Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) to create a so-called "mini dump" -- basically the call stack including arguments -- which is just a few hundred KB and should still be very helpful. The steps are essentially the same, just use Process Explorer instead of Task Manager and select "Create minidump".

Of course, if you have some basic knowledge of source-level debugging, you can just get Visual Studio ("Express 2013 for Windows Desktop", if in doubt) and the code (if you use the hotfix binary, you also need matching debugging symbols) and look into it yourself Smile The crash I've fixed was bad argument values in the 'readrect' function; maybe there's other values that cause a crash that my rather conservative filtering in that function doesn't catch.

--

I'm on a machine with NFSHS installed for a bit now so I had a quick look into its directory. As I suspected, it seems to use the same interface as NFSPU for talking to its exchangeable renderer DLLs; meaning that I can probably also do interesting things to that game...
Back to top
View user's profile Send private message
Andrej



Joined: 13 Oct 2012
Posts: 9

PostPosted: Mon Oct 20, 2014 8:14 pm    Post subject: Reply with quote

Oh my GOD FINALLYT! I have waited for a true widescreen fix for this game for an eternity since I switched from 17' CRT to widescreeners.

Thank you!!!!!
Back to top
View user's profile Send private message
fk



Joined: 12 Jul 2014
Posts: 6

PostPosted: Wed Dec 10, 2014 3:45 pm    Post subject: Reply with quote

Quick note: I basically ported this patch to High Stakes (really, it's 99% shared code) and, in the process of that, did a bunch of refactoring. Of course, none of that had any user-visible impact on the PU portion Wink Still, I rolled release 1.0.1 which now includes the fix for the widescreen setting.

Also, re: that from-the-ground-up D3D9 renderer: it's a cute idea, but I don't have any concrete plans to finish that any more. It was a bit of a bother to work on and it's not terrifically necessary anyway, what with nGlide around; plus, I got distracted by other (shiny and non-shiny) stuff. If anyone else wants to try their hand at it though, be my guest, all the code's linked in the first post.
Back to top
View user's profile Send private message
Felixeur



Joined: 17 Mar 2015
Posts: 6

PostPosted: Fri Mar 20, 2015 6:27 pm    Post subject: How to disable this patch Reply with quote

How do you disable it, I dont like it no offence
Back to top
View user's profile Send private message Send e-mail
fk



Joined: 12 Jul 2014
Posts: 6

PostPosted: Sat Mar 21, 2015 11:51 am    Post subject: Re: How to disable this patch Reply with quote

Felixeur wrote:
How do you disable it, I dont like it no offence


Well, assuming you installed it according to the instructions, you can just use one of the included .reg files ("Enable Direct3D 7 Renderer.reg" or "Enable Glide Renderer.reg", depending on which you want) to switch back to a default renderer. You can also delete the extracted files afterwards if you want to, but that's not strictly necessary.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iplounge.net Forum Index -> IPL PU Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group