Fixed RE:CV to play properly on cloned GDEMU

Technical help for Dreamcast console, accessories and games only. Ask questions and find answers here. For Online help see the Online Forum

Moderator: pcwzrd13

User avatar
yzb
Developer
Posts: 130

Fixed RE:CV to play properly on cloned GDEMU

Post#1 » Fri Mar 04, 2022 11:38 am

Hello everyone, my name is YZB

My native language is not English, and I don't know English either. In order not to be misunderstood by Google's translation software, I decided to post this post in Chinese. ;)

If you don't understand, you can use translation software

发这个帖子可能会影响到某些人的利益,但是我的目的并不是如此

本贴的目的只是想进行技术上的讨论和交流,如果本贴对某些人的利益照成了影响,本人深表歉意




GDEMU是由波兰人Deunan开发的一款在DREAMCAST主机上使用的硬件设备,其作用是代替主机上的整个光驱板,使其可以在主机上直接使用sd卡来玩游戏

论坛下面这个贴有比较详细的介绍,我就不多介绍了
http://bbs.chinaemu.org/read-htm-tid-96589.html
Image



安装方法和使用说明官网都有非常详细的介绍
以下是GDEMU作者官网链接:
https://gdemu.wordpress.com/ordering/ordering-gdemu/

这个项目官网介绍说是从2008年开始,期间固件更新了很多次。详细的更新说明官网也有介绍:
https://gdemu.wordpress.com/firmware/updating-gdemu/


想买的话可以在官网订购,但是官网是不定期开放预售,而且每次只放出有很少部分,这使得很多人捏着钱包望眼欲穿,想买也买不到


直到2018年的时候,GDEMU的硬件固件被克隆了下来,市面上开始出现大量的克隆版本

对于克隆版的是非对错,本人不予评论,只是拜克隆版所赐(量大便宜管够),本人也凑热闹买了一块,所以做了一点研究(不过有条件的话还是提倡去官网买,可以支持原作者,毕竟有钱了才能有动力继续更新固件或者开发其他设备)


那么原版和克隆版有什么区别呢?

这里做个简单的介绍

原版固件可以更新,目前最新版的固件已经到5.20.3了,不排除以后还会有更新的可能


克隆固件停留在当时的最后版本,5.15.0,而且克隆固件是不能更新的


那么排除价格和使用材料因素的话,原版和克隆版就是固件版本的区别了

看固件版本的更新说明,因为克隆版使用的是5.15.0版本,那么从这个版本往上就是和原版的差别

5.20.3→→→→→→→原版最新固件
稳定性提升#2


5.20.2(未发布)
稳定性提升#1


5.20.1
CD-XA 媒体的游戏检测修复→→→→→→→(可以看成是bleem模拟器对ps游戏碟片格式的支持)


5.20.0
系统代码更新SoA 和 RE:CV 自动时序配置文件→→→→(维罗妮卡和阿卡迪亚的bug修复)
用于手动限制 GDEMU 速度的新 INI 选项

5.15.0→→→→→→→→→→→→→克隆固件的最后版本
内部变化使用较新的编译器



看起来没有什么大的更新,只有5.20.0版有针对生化维罗妮卡和阿卡迪亚的bug修复更新


这2个游戏比较特别,在5.15.0或以下版本运行时会出现一些bug(以下会做详细的介绍)


现在是2022年,算下来GDEMU到现在已经有十几年了,克隆版本的出现也快有四年了


那么现在为这2个游戏在克隆版本上能正常游玩做一个修复应该不会对原版的销售照成什么影响吧


本贴的目的只是想进行技术上的讨论和交流,如果本贴对你的销售照成了影响,本人深表歉意



这次我们先说RE:CV,也就是生化危机,代号维罗妮卡,另外一个游戏等这个游戏测试没有问题再更新

大多数人只知道生化危机 维罗妮卡这个游戏在5.15.0版的GDEMU上会在CD2遇到老虎头无限拿宝石的bug,

只有少数人知道在这个游戏其实还有另外一个bug,就是在游戏菜单界面,查看文档的时候出现的bug
只是这个bug不怎么明显,也不是特别影响游戏,所以很多人都没怎么注意到


有bug的情况:中间的文档被缩小了,并且书签不会显示

Image

Image



正常情况是下面这样的:中间的文档显示正常,书签页面也显示正常

Image
Image


那么是什么照成这些bug的呢?这么明显的bug当年负责测试游戏的都没测试出来吗?

其实答案也很简单,因为GDEMU不是使用光盘作为媒介,所以读取速度和时间都加快了很多,照成原来本因需要运行的一部分程序没有运行到,结果bug就出现了。

至于为什么当年负责测试的没测试出来,可能是因为当年都是使用光盘作为测试的吧。

程序员为了能加快游戏的运行速度,尽可能的让游戏运行速度更流畅一点,减少读取的时间,不惜一切代价对程序做了最大的优化。


所以在这个游戏中,当遇到需要从光盘读取数据的时候,程序员优化的程序流程大概是这样的:

按帧进行判断(注意,按帧进行判断是指在一个完整的游戏流程里面进行判断,并不是特指在读取数据这里做单独的一个循环判断,而是指这个游戏每帧运行到这里,判断完毕以后,都会返回游戏跑完完整的一圈流程,然后再次重新进入到这里来继续进行判断,直到读取完毕以后程序才会切到其他地方)

第1帧:给定一些参数,程序按照参数开始从光盘读取数据到内存

第2帧:判断数据是否读取完毕,如果读取完毕,则退出数据读取判断,下次程序不会再来这里。如果未读取完毕,则对游戏一些内存做初始化操作

第3帧:判断数据是否读取完毕,如果读取完毕,则退出数据读取判断,下次程序不会再来这里。如果未读取完毕,则继续对游戏进行一些内存操作

第4帧:判断数据是否读取完毕,如果读取完毕,则退出数据读取判断,下次程序不会再来这里。如果未读取完毕,则继续对游戏进行一些内存操作

...................................................................

第N帧:判断数据是否读取完毕,如果读取完毕,则退出数据读取判断,下次程序不会再来这里。如果未读取完毕,返回,下一次继续来这里的循环点判断



从上面的流程我们就不难看出,程序为了保持流畅性,在读取数据的时候是实时的,在读取中不会影响流畅性,当数据读取完毕以后程序也可以在第一时间做出相应的反应

这里多嘴说一句,大部分的游戏数据读取机制是直接在读取程序里面做个小循环,直到数据全部读取完毕才退出这个小循环


所以根据上面的流程,不难推断出为什么在5.15.0版的GDEMU上会出现这个bug了

因为从第1帧到第2帧期间,时间上只有一帧,在光盘上是不可能一帧读取完数据的,所以当程序循环判断的时候,数据未读取完毕,那么则会开始对游戏一些内存做初始化操作

但是在5.15.0版固件的GDEMU上就不一样了,因为当时的固件没有对数据读取做出一些速度限制,都是用最快的速度读取的,所以在它上面是可以出现1帧或者2帧把数据读取完毕的情况,所以后面对游戏一些内存做初始化操作的那些步骤就都被省略了,那么bug自然就出现了。

所以GDEMU的新固件针对这2个游戏专门做了限制,限制什么呢,当然是限制读取速度了,限制了读取速度,bug自然就解决了。

但是这个速度限制了也有个坏处,因为它限制的应该是全局的读取速度,那就是这个游戏的数据读取速度整体被降下来了,流畅性自然没有原来不限制速度的时候高了

因为我没有原版的GDEMU,所以针对上面这个结论也只是猜测,希望有原版升级到最新版固件的GDEMU朋友能配合做一个测试


因为我没有原版的GDEMU,克隆的固件又不能升级,要修复这个游戏我只能从游戏程序里面下手了

所以针对上面那个读取流程,我自己改写了一下程序,添加了一些指令进去,用来判断是否是触发bug的那几个数据

程序流程大致是这样的:

在第1帧程序开始按照参数从光盘读取数据到内存以后,对接下来的判断读取程序进行了扩充。

第N(N>1)帧:判断数据是否读取完毕,如果读取完毕,则跳到下面分支①,如果未读取完毕,则对游戏一些内存做初始化操作,然后返回,下一次继续来这里的循环点判断

分支① 数据读取完毕以后,判断是否是触发bug的那几个数据,如果不是,则退出数据读取判断,下次程序不会再来这里。如果是那几个触发bug的数据则跳到下面的分支②

分支② 从固定内存地址读取一个数值X(这个X的值最开始为00,并且在每一帧的读取数据判断那里这个值都会递增+1)
判断X的值是否大于Y(Y为读取数据完毕以后需要的最少帧数值,只有大于等于这个值,内存才真正初始化完毕)

如果X值小于Y,返回,下一次继续来这里的循环点判断

如果X值大于等于Y则退出数据读取判断,下次程序不会再来这里(内存初始化完毕,可以正常继续进行下一步的程序)



这段程序的优点就是只针对那几个触发bug的数据才会有延迟操作,对读取其他的数据是不会照成影响的


缺点是需要在原版的镜像上面修改,对原版爱好者不太友好(当然如果你自己做成金手指格式也可以)




以上程序经过短时间的测试,结果是正常的

特此发上来,有需要的可以自行选择附件下载测试


以上发言都只是个人看法,如果有不对或者不同意见或者不同方法能达成目的的也可以提出,欢迎讨论

最后附件放上已经修改好的日版 美版 欧版的1st主程序文件,会自己替换的可以自行替换进去

不会替换的也不要紧,在我们汉化组的官网也放上修改好的日版 美版 欧版GDI镜像,嫌自己替换麻烦的也可以自行去我们官网下载修改好的GDI文件地址是:
gdi download:

Code: Select all

https://game.sgcn.games/web/list.html?ver=1.037&path=SGGG%u6C49%u5316%u7EC4%5CRE_Veronica_FIX_for_GDEMU_BY_YZB&scode=570961


这个游戏测试正常结束以后,我会继续放上永恒的阿卡迪亚的bug修正版本(虽然汉化版里面已经修复了那个bug,但是估计还有些人喜欢日版 美版吧)


最后的最后,如果你觉得本贴对你有帮助,欢迎对我们SGGG小祖进行捐助,以便我们小祖能够走得更远更久,用爱发电不知能维持多久。

地址为
https://sgcn.games/QandA.html?v=4.14
Attachments
PAL_GB_T-36806D-05 (Disc 1) [6443] [E] [0799A00] [T36806D 05] [20000423] [V1.000].zip
(1.05 MiB) Downloaded 362 times
PAL_DE_T-36806D-18 (Disc 1) [C99A] [E] [0799A00] [T36806D 18] [20000421] [V1.000].zip
(1.05 MiB) Downloaded 341 times
USA_T-1204N (Disc 1) [5EE7] [U] [0799A10] [T1204N] [20000223] [V1.000].zip
(1.05 MiB) Downloaded 666 times
JAP_T-1240M (Disc 1) [1E07] [J] [0799A10] [T1240M] [20010109] [V1.003].zip
(1.07 MiB) Downloaded 336 times
Last edited by yzb on Fri Mar 04, 2022 12:12 pm, edited 9 times in total.

User avatar
Londinium
dirty sailor
Posts: 183

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#2 » Fri Mar 04, 2022 11:51 am

>'I don't know English either'
>Posted in perfect English, better than some native speakers I've heard


Also, cool post mate
ImageImageImageImageImageImageImageImageImage

Motoracer5
blackout!
Posts: 130

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#3 » Fri Mar 04, 2022 12:09 pm

Good job yzb! Nice to see that fixed for so many GDEMU users

Impacto
dark night
Posts: 63

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#4 » Fri Mar 04, 2022 1:19 pm

Thank you so much man

User avatar
mistamontiel
Shark Patrol
Posts: 1946
Contact:

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#5 » Fri Mar 04, 2022 1:56 pm

yzb some previous post showed me https://www.deepl.com

A translator, and a real one

Cheers yzb!!!

jse
noob
Posts: 2

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#6 » Fri Mar 04, 2022 9:24 pm

Thank you very much for your work YZB

User avatar
MoeFoh
Uber
Posts: 1036

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#7 » Sat Mar 05, 2022 5:35 am

Finally, an answer! Thanks, yzb. ;)
Gentleman, start your engines and get testing.

TRANSLATION:

In order to speed up the running speed of the game, the programmers try to make the game run more smoothly, reduce the reading time, and optimize the program at all costs.

So in this game, when it is necessary to read data from the disc, the program flow optimized by the programmer is probably like this:

Judging by frame (note that judging by frame refers to a complete game process. Judgment does not specifically refer to a separate loop judgment in reading data, but refers to the game running here every frame. After the judgment is completed, it will return to the game to complete a complete lap process, and then re-enter here again. to continue the judgment, and the program will not switch to other places until the reading is completed).

Frame 1: Given some parameters, the program starts to read data from the disc to the memory according to the parameters.

Frame 2: Determine whether the data is read, if After the reading is completed, exit the data reading judgment, and the next program will not come here again. If it is not read, initialize some memory of the game.

Frame 3: Judge whether the data has been read. If the reading is complete, exit the data read judgment, and the program will not come here again next time. If the reading is not completed, continue to perform some memory operations on the game.

Frame 4: Determine whether the data has been read. If the reading is completed, exit the data reading judgment, and the program will not come here again next time. If the reading is not complete, continue to do some memory operations on the game

Nth frame: judge whether the data has been read, if it is finished, exit the data Read judgment, the next program will not come here again. If the reading is not completed, return, and judge the loop point to continue here next time.

From the above process, it is not difficult to see that in order to maintain fluency, the program is real-time when reading data, and it will not affect the reading. Fluency, when the data is read, the program can also respond accordingly at the first time. Let me say something.

GDEMU

because from the first frame to the second frame, there is only one frame in time. It is impossible to read the data in one frame, so when the program loops and judges, the data is not read, then it will start to initialize some memory of the game,

but because the firmware at that time did not impose some speed restrictions on data reading, it was all read at the fastest speed, so it was possible to read the data in 1 or 2 frames. The steps for initializing some memory in the game are omitted, so bugs naturally appear.

Therefore, the new firmware of GDEMU has specially made restrictions on these two games. What are the restrictions? Of course, the reading speed is limited, and the reading speed is limited, and the bug is naturally solved.

But this speed limit also has a disadvantage, because it should limit the global reading speed, that is, the overall data reading speed of this game has been reduced, and the fluency is naturally not as high as when the speed was not limited.

because there is no original version of GDEMU, so the above conclusion is only a guess. I hope that GDEMU friends who have upgraded the original version to the latest firmware can do a test.

Because I don't have the original version of GDEMU, the cloned firmware cannot be upgraded. To fix this game, I only have to do it. I can start from the game program.

So for the reading process above, I rewrote the program and added some instructions to judge whether it is the data that triggered the bug. The

program flow is roughly as follows:

In the first After the frame program starts to read data from the CD to the memory according to the parameters, the next judgment reading program is expanded.

The Nth (N>1) frame: judge whether the data has been read. If the data is read, jump to the following branch ①. If it is not read, initialize some memory of the game, then return, and continue next time. The loop point judgment.

branch here ① After the data is read, judge whether it is the data that triggers the bug. If not, exit the data reading judgment, and the program will not come here next time. If it is the data that triggers the bug, jump to the following branch ②.

branch ② read a value X from the fixed memory address (the value of this X is 00 at the beginning, and the read data of each frame judges where this value is It will increase +1)
to judge whether the value of X is greater than Y (Y is the minimum frame value required after reading the data, only if it is greater than or equal to this value, the memory is really initialized).

If the value of X is less than Y, return, and continue next time The loop point judgment here.

If the value of X is greater than or equal to Y, the data reading judgment will be exited, and the program will not come here next time (the memory initialization is completed, and the next program can be continued normally).

The advantage of this program is that it is only for the data that triggers the bug. There will be a delay operation, which will not affect the reading of other data.
Last edited by MoeFoh on Wed Mar 23, 2022 1:36 pm, edited 1 time in total.
“The problem with the world is that the intelligent people are full of doubts, while the stupid ones are full of confidence.”
- Charles Bukowski

User avatar
Gromber
undertow
Posts: 30
Contact:

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#8 » Sat Mar 05, 2022 6:39 am

hi! can someone convert the patch for PAL-ES with japanese cake vga patch? https://blog.japanese-cake.io/index.php ... -the-dark/

Thanks yzb for your hard work and sharing for everyone.

User avatar
fafadou
Gold Lion
Posts: 1652

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#9 » Sun Mar 06, 2022 2:21 pm

Is there a save with ?
Someone has try it with his gdemu ?
And with a sdcard reader dreamshell ?
I'm sorry i can't Do it...
Thank you very much.

AgentMomo
Prince of Persia
Posts: 346

Re: Fixed RE:CV to play properly on cloned GDEMU

Post#10 » Sun Mar 06, 2022 7:43 pm

你可以为 GDI USB 修复生化危机 3 的 FMV 滞后吗?谢谢。
Nǐ kěyǐ wéi GDI USB xiūfù shēnghuà wéijī 3 de FMV zhìhòu ma? Xièxiè.

  • Similar Topics
    Replies
    Views
    Last post

Return to “Support”

Who is online

Users browsing this forum: No registered users