Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base_tsa: Fix crash after Ctrl-Alt-Del in all games since th11 #1

Closed
nmlgc opened this issue May 3, 2014 · 8 comments
Closed

base_tsa: Fix crash after Ctrl-Alt-Del in all games since th11 #1

nmlgc opened this issue May 3, 2014 · 8 comments
Assignees
Labels

Comments

@nmlgc
Copy link
Contributor

nmlgc commented May 3, 2014

No description provided.

@nmlgc nmlgc added bug and removed bug labels May 3, 2014
@nmlgc
Copy link
Contributor Author

nmlgc commented Jul 14, 2014

This seems to be a rather common issue among Windows applications in general, as I've also encountered it with DOSBox and Neko Project II. Maybe these are just GPU hardware or driver issues on my end?

@nmlgc nmlgc added ZUN bug and removed enhancement labels Dec 10, 2016
@DankRank
Copy link
Member

DankRank commented Feb 6, 2017

A while ago I've tried to fix this bug, but I didn't succeed. My guess was that the game doesn't handle lost devices the right way. It seems like the game indeed doesn't do it properly, but it isn't a problem most of the time, because modern versions of d3d9 don't lose device when you alt-tab or alt-enter, etc. It still happens, however, when you do win+L or ctrl+alt+del. That's not the actual reason though, after applying my fix, the game still crashes somewhere around texture (re)initialization.

One thing I haven't got around to test is wether or not the game will crash under XP (with original d3d9 installed) when alt-tabbing from full screen.

Here's the aforementioned fix: DankRank/thcrap@42e7b152
The BP_devicelost is supposed to replace a call to IDirect3DDevice9::Reset.

p.s. Everything I mention applies to LoLK, as I haven't looked at the other games (except DDC), but I'd assume that the problem is same.
p.p.s. I will post relevant memory locations for LoLK (and maybe DDC, if I still have those saved) later.

@DankRank
Copy link
Member

Found my old stuff for LoLK v1.00b

stack trace:

0044F349 - crash happens here (inside sub_44F300)
called at 00472981 (inside sub_472940)
called at 00472913 (inside sub_472790)
called at 00471AB7 (inside sub_471340, looks like WinMain)

Patch for the BP_devicelost, mentioned in previous post.
th15.js

{
	"breakpoints": {
		"devicelost": {
			"cavesize": "5"
		}
	}
}

th15.v1.00b.js

{
	"breakpoints":{
		"devicelost":{
			"addr": "Rx72972"
		}
	}
}

@DankRank DankRank changed the title base_tsa: Fix crash after Ctrl-Alt-Del in all games since th125 base_tsa: Fix crash after Ctrl-Alt-Del in all games since th11 Jul 1, 2017
@DankRank
Copy link
Member

DankRank commented Jul 4, 2017

2edbcc1 fixes this for all latest versions

@DankRank
Copy link
Member

DankRank commented Jul 5, 2017

Reopening, since the fix doesn't work on all machines apparently.

@DankRank DankRank reopened this Jul 5, 2017
@DankRank DankRank self-assigned this Jul 5, 2017
@DankRank
Copy link
Member

DankRank commented Jul 17, 2017

Should be fixed as of thpatch/thcrap@cb3404cdd

UPD: that fix breaks switching between fullscreen and windowed for some reason.

@DankRank
Copy link
Member

DankRank commented Sep 26, 2017

Fixed the fullscreen switching in thpatch/thcrap@c807a61ba0

Works on my machine, stops working on @nmlgc 's machine after switching fullscreen to window. (UPD2: because his drivers are trash)

UPD: [11:13 PM] Nmlgc: Next problem: F10 to cycle between the modes doesn't work anymore in TH11-TH13. Simply continues rendering in 640×480 fullscreen on the first monitor and shows a black window in the active window on the second monitor.

UPD2: disregard that.

@nmlgc
Copy link
Contributor Author

nmlgc commented Sep 26, 2017

Turned out to be a graphics driver issue on my end, and no remaining bugs in here after all.

In case anyone else has a similar issue with a AMD Radeon GPU (R7 260X in my case): TH14 and later used to not be displayed correctly in fullscreen mode. On startup, the screen flashed for a few seconds as Direct3D tried to change the display mode and failed. After that, the game was rendered at its native resolution in the top-left corner of my first monitor, with the rest of the screen filled with black, like this:

th14_046

The fix: Catalyst Control Center → My Digital Flat-Planels → (the display Touhou appears on) → Image Scaling Prefences → Disable GPU up-scaling.
th14 amd fullscreen bug culprit

@nmlgc nmlgc closed this as completed Sep 26, 2017
nmlgc added a commit that referenced this issue Oct 10, 2017
…images.

We'll probably end up rearranging all those sprites anyway though, to
make sure that translators can make them as large as they can possibly
appear in-game, despite breaking compatibility to the retexture patch
and other existing translations…

Sprites enlarged
----------------

front.png:
• #19 – MAX
• #20 – 点

replay00.png:
• #9 – 処理落ち率

result01.png:
• #4 – Extra

title01.png / title01s.png:
• #11 – Extra Start

title04.png / title04s.png:
• #00 – Shot (決定)
• #1 – Bomb (キャンセル)
• #11 – Off
• #16 – Midi
• #18 – Skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants