VOGONS


Psycho pinball vertical tilt

Topic actions

First post, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

Hi,

Psycho Pinball works almost perfectly in Dosbox, but I have this very annoying problem with the vertical tilt. Whenever I press space (to tilt), the screen currupts a bit, and most importantly, it releases all my pressed keys, including the tilt itself, meaning you can't tilt very high.

This takes away the ability to perform one of my most important strategies, which is to throw the ball back into the table when it is about to roll off via the sides. To to this, I hold up the flipper on the respective side, and press vertical and the proper horizontal tilt keys simultaniously. But, because the vertical tilt causes my keys to be reset, the ball is slammed right down again by the falling flipper.

Is there a way to fix this?

Reply 1 of 48, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Vertical tilt is rather strange. It changes the screen resolution to get the effect. This makes dosbox reset the window and video mode so it probably also looses the pressed keys...

http://www.si-gamer.net/gulikoza

Reply 2 of 48, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

Hmm, that probably means there is no fix for it, is there?

BTW, when I still had win98, I could play psycho pinball on this monitor, including the vertical tilt. It didn't modeswitch or whatever (which is notable by a blackout), and if I remember correctly, even a change in screen position would result in the monitor having to resync to the changed frequencies. Add to this that the tilt effect is animated, meaning it would require about 10-25 (or so) changes in video timings, it seems somewhat unlikely. Are you sure this is what happens?

Reply 3 of 48, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

I'm not sure what happens, but this is what I observed. I did a lot of testing with Psycho pinball when debugging my D3D patch and one of the strange things was that vertical tilt was extremely slow. Then I noticed that the resolution is changing and the textures are being recreated. But I don't know the details of VGA hardware to know what exactly the game is doing...

http://www.si-gamer.net/gulikoza

Reply 4 of 48, by Miki Maus

User metadata
Rank Member
Rank
Member

Yep, the game is changing resolution (I tested only High resolution setting) from 320x367 to 320x355 I think in steps of 1 e.g. 320x366 320x365 or something like that, anyway the way to fix it is to keep the height at 367 if resolution changes to anything between 320x367 and 320x355 I have done this by changing vga_draw.cpp of DOSBox 0.65 by adding this piece of code:

if (height <= 367 && height > 354) {
height = 367;
scalew = 1;
scaleh = 1;
}

at line 650 before vga.draw.lines_total=height;

Also note that this can potentially mess up any other game that uses that resolution. There is one thing, I tried this only with DOSBox 0.60 because I can't get any later version to compile with MSVC 6 and I'm to lazy to download and install MinGW and MSYS, but it should work with newer versions. And some part of the credit should go to felipe.sanches who posted resolution patch for Pinball Fantasies from which I got the idea for Psycho Pinball.

Reply 5 of 48, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

In 0.65, it's line 645.

The variables scalew and scaleh are not defined anymore. I commented them out, and the patch still works. I also wouldn't know why you'd wanna override the scaling.

When tilting now, you can see the top of the table at the bottom 😀

Perhaps this patch can be extended so that it checks for the presence of psycho pinball in memory. A dirty hack would be to check if the executable name is _P_.EXE. This was (and perhaps is) a trick done by a lot of graphics drivers, which employ game specific cheats to improve framerates. Changing the name of some game to unrealtournament.exe radicly changed speed 😀

BTW, in-game screenshots of psycho pinball are in 640x367. Where does that 320 come from?

Reply 6 of 48, by Miki Maus

User metadata
Rank Member
Rank
Member

The pixels are streched so without horizontal scaling you get 320x367. 😎
I looked in 0.65 sources, it's doublewidth=true; for some resolutions.

Last edited by Miki Maus on 2006-07-26, 19:58. Edited 1 time in total.

Reply 7 of 48, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

Perhaps that's why my ball looks like an american football. Also, in DOS, the screen was much more narrow; it wasn't filled horizontally.

How does one accomplish correct geometry in Dosbox with psycho pinball?

Reply 9 of 48, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

Haha, the table looks very weird like this, but I guess it's correct 😀. It does however, also decrease in vertical size now.

Is there is no way to do it by tweaking the config file? And, shouldn't this doublewidth issue be solved in general? I mean, would dosbox be able to detect that it shouldn't be stretched? If psycho asks for 320x367, why does it set it to 640x376?

Reply 10 of 48, by Miki Maus

User metadata
Rank Member
Rank
Member

I wouldn't know. When I get and set MinGW up and runnig I will look into it. As for Psycho Pinball it could be that it is infact asking for 640x376 and stretches table horizontaly.

Reply 11 of 48, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

BTW, what I said about it not filling the screen vertically, I didn't remember correctly that normally, it doesn't do this either. So, there is no problem there.

Reply 12 of 48, by felipe.sanches

User metadata
Rank Newbie
Rank
Newbie

if we use the .exe filename as reference, the patch wont work for renamed files. Thats not a big problem, but its not elegant, either. So I tryied to figure out another solution.

We could try to search for signatures of the respective games in know emulated memory positions. Thats idea is similar to simple virus detection algorithms. Indeed, its not enough to rename a virus file because the antivirus continues to detect it 😀

About merging the patches, I dont see why we should do that. They provide separete effects: no-scroll patch gives us fulltable and the tilt patch corrects (in a hacky way) what seems to be a real bug. I think they should be kept separate for now.

Off course, in the future we can integrate various pinball related hacks such as these in a big pinball enhancement pack for dosbox 😁

Reply 13 of 48, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

We could try to search for signatures of the respective games in know emulated memory positions. Thats idea is similar to simple virus detection algorithms. Indeed, its not enough to rename a virus file because the antivirus continues to detect it

That would require making signatures/hashes of all known versions of the program. I don't know if dosbox would easily support detecting signatures, but it does sound like a good solution.

About merging the patches, I dont see why we should do that. They provide separete effects: no-scroll patch gives us fulltable and the tilt patch corrects (in a hacky way) what seems to be a real bug. I think they should be kept separate for now.

You're right, the tilt issue is actually a real bug. I didn't really see it as a dosbox bug because I'm not sure though if the developers apply such game specific fixes.

Both patches do have to be modified to be able to work along side eachother, though, because they are mutually exclusive now.

BTW, does this bugreport and patch have to be submitted to the tracker, or is the existence here enough?

Reply 14 of 48, by felipe.sanches

User metadata
Rank Newbie
Rank
Newbie

I suggest that you report the bug properly.

What else would you suggest for pinball enhancement?

I thought about faking multiball but it seems to be too hard to do. But not impossible. When we are playing between the software and the hardware that it expects to be running on, we can trick it with a lot of flexibility. We can build a middle layer on top of the original hardware.

Reply 15 of 48, by felipe.sanches

User metadata
Rank Newbie
Rank
Newbie

Let me tell you about some of the other tricks that i've been doing with pinball fantasies (maybe it works with other pinball games too)

I have successfully integrated dosbox with a set of LEDs on my parallel port. Then I sincronized the flashing of the LEDs with the flashing of some of the playfield lights. I got it sincronized with the P A R T Y lights for example.

Reply 16 of 48, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

game specific FIXES are allright. (If they are fixes and the real hardware acted that way as well)
Game specific HACKS won't go into the official code.

Water flows down the stream
How to ask questions the smart way!

Reply 17 of 48, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

OK, I'll make a bug report about the tilt issue.

The hacks issue we'd better suggest in the other thread. So, let me continue in the other thread.

Reply 18 of 48, by wcp

User metadata
Rank Newbie
Rank
Newbie
halfgaar wrote:
In 0.65, it's line 645. […]
Show full quote

In 0.65, it's line 645.

The variables scalew and scaleh are not defined anymore. I commented them out, and the patch still works. I also wouldn't know why you'd wanna override the scaling.

When tilting now, you can see the top of the table at the bottom 😀

Perhaps this patch can be extended so that it checks for the presence of psycho pinball in memory. A dirty hack would be to check if the executable name is _P_.EXE. This was (and perhaps is) a trick done by a lot of graphics drivers, which employ game specific cheats to improve framerates. Changing the name of some game to unrealtournament.exe radicly changed speed 😀

BTW, in-game screenshots of psycho pinball are in 640x367. Where does that 320 come from?

sorry for bumping this thread but im having the same issue here, when i press shift (the flipper) together with space (the tilt) the game shuts down... where is this vga_draw.cpp file where i can put those lines of code in? In folder options i enabled show invisible files but i cant find it anywhere.

Reply 19 of 48, by halfgaar

User metadata
Rank Newbie
Rank
Newbie

You need the source for this (you can download it). You will also need a C(++) compiler. But judging by your question, I think you will have trouble setting that up, it's kind of complicated.

You could also arrange someone to make a custom build for you. I don't have Windows, so I can't help you.

The bug about this issue has been filed BTW.