A9VG电玩部落论坛

 找回密码
 注册
搜索
12
返回列表 发新帖
楼主: shenqifx

[资料]OPL、PS2ESDL不兼容及不完美支持(含需特殊设置的游戏)的游戏统计

[复制链接]

精华
0
帖子
679
威望
0 点
积分
721 点
种子
12 点
注册时间
2007-1-8
最后登录
2024-3-21
发表于 2012-11-30 15:45  ·  辽宁 | 显示全部楼层
本帖最后由 tq03q9i 于 2012-11-30 15:46 编辑

关于机战impact,我把此问题提交给了psxscene的sliver bull,他说有两个问题导致死机,其中一个是难解决的逻辑错误,正在尝试对第二个问题进行补丁

精华
0
帖子
679
威望
0 点
积分
721 点
种子
12 点
注册时间
2007-1-8
最后登录
2024-3-21
发表于 2012-11-30 15:48  ·  辽宁 | 显示全部楼层
I have found two timing-related problems in the game's main ELF, but I cannot say whether that list is complete or just the tip of the iceberg. Both problems can be triggered by a CDVD command completing at the wrong time, and if triggered will definitely result in the game freezing instantly. The problems are:



1.Access to the global variable cntrl_** from within cdvCallback and cdvMain.
2.Usage of sceCdGetError in cdvCallback.


Both are programming errors, and a program containing them is not even guaranteed to run without issues on real hardware. In my opinion, it is pure luck that SRW does not hang when run from optical media. The first problem can be masked if the hardware is slow enough, but the second one cannot (but fortunately, that one is even more rare to occur)...

Now for the details. The global variable cntrl_** is used to keep track of whether a command has been sent to the CDVD mechanism. For that, it starts at zero and is incremented on two occasions: once from cdvMain when starting the command (e.g., via sceCdRead), and another time from cdvCallback if a command completed successfully. The problem is that cdvMain increments the variable after the command has been started successfully, using a three-instruction sequence (e.g., lw, addiu, sw). cdvCallback does the same after calling sceCdGetError to check for an error. It reminds me of Shadow Hearts Covenant, its the same kind of problem.

Now suppose the callback comes in after cdvMain's lw/addiu, but before sw. The temporary register will contain the value 1, which is going to be written to cntrl_** no matter what. However, the callback thread has a higher priority, so it interrupts this sequence and manipulates cntrl_** itself, setting it to 1. When cdvMain runs again, it writes a value of 1 again, but waits for the value 2 to appear. This will never happen (the callback has already run, but its update to the variable was lost), and the game hangs .

This problem exists at a few locations within cdvMain, as there is no single point where it increments cntrl_**. The code is duplicated a few times, basically for every call to an asynchronous CDVD routine (sceCdRead, sceCdStandby and so on). A fix would need to patch all these increments to prevent cdvCallback from interrupting them; I recommend to patch cdvCallback itself as well. I will try a DIntr/EIntr around the increment and see whether that helps.

The first issue is rare, and unfortunately does not seem to occur as often on my test setup as it does on your machine. I can actually leave my TOOL with ODEM running for half an hour before the game freezes. However, when single-stepping across the problematic regions in the debugger, the hang is reproducible. I can also get the game to continue after such a hang by manually setting cntrl_** to 2.

Second problem. Remember I said that cdvCallback invokes sceCdGetError to check whether the command completed successfully? Well, its not that simple. The routine actually does this: "while ((err = sceCdGetError()) != -1);". That is, it invokes sceCdGetError repeatedly until it succeeds, denoted by a return value other than -1. But for this routine to work, the EE-side CDVD client library must be able to acquire the SCMD semaphore; that is, no other SCMD must be outstanding when sceCdGetError runs, or the routine fails and returns -1. The second problem now is exactly this case: the main thread (cdvMain) does an SCMD, that call acquires the SCMD sema, performs an RPC and waits for it to complete. Then the callback runs and control switches to cdvCallback, which tries to invoke sceCdGetError. That routine sees the SCMD sema being held by another thread and fails, prompting cdvCallback to invoke it again immediately. Of course, cdvMain has to means to run in the meantime (cdvCallback does never sleep and runs at a higher priority), so the program is stuck indefinitely .

I don't have a solution to the second problem yet. In my opinion, the program logic is completely flawed, because sceCdGetError simply is not safe to be called from the callback. The developers seem to have known of such a problem (if not, why would they have put that crazy loop around sceCdGetError?), but unfortunately that doesn't help us. I will try to patch in a call to DelayThread here and see if that helps; the routine does not exist in the file yet, but should be easy to implement manually...

I'm going to test some patches to the game, but I cannot say when these'll be finished. I will be very busy with university for at least the coming month, but I will try to find some time for hacking SRW.

这个是他给的回复

精华
0
帖子
194
威望
0 点
积分
211 点
种子
7 点
注册时间
2006-2-9
最后登录
2021-9-25
发表于 2013-2-14 12:43  ·  上海 | 显示全部楼层
本帖最后由 changdaojun 于 2013-2-14 16:40 编辑

打击者1945 1+2 [jp] SLPM_62515(PS2ESDL/usb模式)
进入游戏后丢手柄。三角+方块 均无效

重新下载欧版
打击者1945 1+2 [EU] SLES-51741
游戏可玩,低概率丢手柄。

精华
0
帖子
679
威望
0 点
积分
721 点
种子
12 点
注册时间
2007-1-8
最后登录
2024-3-21
发表于 2015-7-20 16:07  ·  辽宁 来自手机 | 显示全部楼层
本帖最后由 tq03q9i 于 2015-7-20 16:09 编辑

OPL超级机器人大战Impact被修复了,毛利大大更新下本贴

精华
0
帖子
729
威望
0 点
积分
778 点
种子
25 点
注册时间
2013-2-12
最后登录
2024-3-13
发表于 2015-11-18 19:45  ·  北京 来自手机 | 显示全部楼层
好帖!学习学习!

精华
0
帖子
13
威望
0 点
积分
14 点
种子
5 点
注册时间
2015-11-3
最后登录
2019-8-22
发表于 2015-11-20 00:06  ·  四川 | 显示全部楼层
请问圣斗士支持吗?

精华
0
帖子
1876
威望
0 点
积分
2251 点
种子
10 点
注册时间
2009-4-12
最后登录
2024-3-27
发表于 2015-11-21 14:45  ·  内蒙古 | 显示全部楼层
SLPM_659.99.龙背上的骑兵2.iso除了HDL查不到兼容性!
https://bbs.luryl.com/thread-4777057-1-1.html

1394和USB均不支持。

精华
0
帖子
53
威望
0 点
积分
78 点
种子
31 点
注册时间
2015-4-25
最后登录
2024-5-15
发表于 2015-12-13 14:00  ·  广西 | 显示全部楼层
gerrand22 发表于 2012-11-29 08:49
OPL-USB玩《北欧女神2(美版)》,必须从游戏最初开始就开启Mode6,否则进行到第五章会出现死机情况。
如果 ...

那啥,我下载了个存档用在中文版上面,不清楚是不是刚开始就开了Mode6。游戏存档已经过了50周目,为了保险一点,我把存档拷贝到2号卡槽,俺上述方法开一个存档,再把下载的存档复制1号卡槽覆盖可以嘛。

精华
0
帖子
151
威望
0 点
积分
193 点
种子
5 点
注册时间
2010-5-29
最后登录
2020-2-7
发表于 2015-12-23 23:30  ·  浙江 | 显示全部楼层
本帖最后由 lacher11 于 2015-12-23 23:31 编辑

两个人的烟火中文版刚进游戏就死机了,有办法解决吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|A9VG电玩部落 川公网安备 51019002005286号

GMT+8, 2024-5-16 18:08 , Processed in 0.222433 second(s), 19 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部