Dolphin, the GameCube and Wii emulator - Forums

Full Version: Eternal Darkness
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
(03-25-2010, 07:22 PM)wiliamjoan Wrote: [ -> ]I have problem regarding playing Eternal darkness.I have a wiikey 2 fitted and been playing GCOS multi disks no problems.The problem I have is I just cannot get Eternal darkness to work..It just gives me an error on the first title screen something about restart console and read the manual.

This is an emulation forum. Playing backups on hardmodded consoles is natively playing games. The two don't really have much in common.
Hey all, I was just curious if there had been any movement on this game in the last few weeks. I'm really looking forward to being able to play it in dolphin! If anyone can get it working, it's skidau! Smile
As we know it is the FIFO timing that causes Eternal Darkness to break, the strategy I am using is to use Dolphin's scheduler to manage the emulation of the GameCube's CPU and GPU speeds. This requires a reworking of the FIFO code. Similar to reconditioning the engine of a car, I am going to the take code apart, clean and fit it back piece by piece until it is working again. Finally, I will tune the code.

Using the scheduler for the GameCube's GPU is different from how Dolphin works now. Currently, in Single Core mode, Dolphin executes graphics commands as soon as the CPU sends any. In Dual Core mode, there are two threads which run as fast as they can. The CPU sends the graphics commands and continues to execute the game code. The GPU reads the commands and draws the graphics on the screen until there are no commands left.

By using the scheduler to manage the timing, the Dolphin will be able to control the synchronisation between the two processors. The code works by noting that the Wii GPU is a ~243Mhz processor, so it can execute roughly 243 million cycles per second. The code throttles the GPU to execute at that speed relative to the CPU which runs at 729Mhz.

To do this, I stripped the FIFO code back to a most basic level, removing the speed hacks and game hacks. This included disabling the dual core mode (it is a speed hack). This way, I can debug what each processor is doing at every step without having the results clouded by the hacks. The downside is that the code is slow.

I filled in the GPU code that was missing. Various GPU registers and features have been omitted so that Dolphin can emulate the games at a decent clip. I added the code as I wanted to work with a complete (as far as what has been documented/known) implementation of the GPU.

The next thing I did was to align the FIFO code in the DX9/OGL plugins to the video software FIFO code as closely as I could. The two types of plugins have been developed independently and the code differ in their style and features. By aligning the code, this beings the compatibility of the video sw plugin to the DX9/OGL plugin while maintaining the speed benefit of using hardware accelerated graphics of the PC. It also lets me debug the FIFO by comparing the results between the HW plugin and the SW plugin.

The encouraging thing at this point was that game compatibility had not been lost even though the FIFO code had been restructured.

Unfortunately, this was not enough to get Eternal Darkness running reliably. It would often freeze at random times.

Random occurrences are usually due to multi-threading code. I removed the multi-threading code from the DSP HLE plugin to stop the random freezes happening. Now it would freeze at the same place every time.

As the code does not contain accurate timing information, I decided to add this in to see if that will improve things. I wrote homebrew code for the Wii which measured the time taken to execute each instruction of the GPU. I put this information into Dolphin and it did help Eternal Darkness to execute the intro movies with less stuttering.

I hit a roadblock at this point because the homebrew code revealed that the Vertex Loader timing depends on what is being drawn on the screen. If the vertex loader draws a triangle that is far away (a small triangle), the GPU executes quicker than if the triangle is up close (filling the whole screen). This is problematic for Dolphin as we cannot accurately measure the timing when there are so many dependent variables.

At this stage, I will have to look deeper into the Eternal Darkness game code and try to determine the timing it expects from the Vertex Loader. If this can be reliably detected by Dolphin, further progress can be made.


Here's a graphical timeline of the progress for those lazy to read:

* = done
O = to-do

* Remove speed hacks
* Remove game hacks
* Add in scheduler to manage timing
* Complete GPU feature: watermarks
* Complete GPU feature: interrupts
* Complete GPU feature: idle flags
* Complete GPU feature: status flags
* Align video HW plugin to video SW plugin
* Measure and add NOP timing
* Measure and add BP reg timing
* Measure and add CP reg timing
* Measure and add XF reg timing
* Measure and add Display List timing
* Measure and add Vertex Loader timing
* Remove DSP HLE thread randomness
O Synchronise CPU video memory reads to GPU writes
O Test that the changes fix other games with FIFO problems
O Add cycle counting for Dual Core mode
O Re-enable Dual Core mode
O Re-add GPU speed hacks
O Test games on tuned code
O Make synchronised FIFO an optional feature

aaronaugusts

I loved to play Horror games. Eternal Darkness is also a psychological horror video game which is released for the Nintendo GameCube. This game utilises the unique sanity effects to enhance the gameplay. This game revolves around Alexandra Roivas who is investigating the mysterious murder of her grandfather.
@skidau: wow, that was an impressive amount of progress!! Smile After seeing how you got F-zero working, I'm sure that you'll wrestle this one to the ground in due time. Just don't give up! And thank you for all your work getting this excellent game to finally work! Cool
wow, nice read. I didn't understand a word, but still...interesting read ^^
Go for it, big boy!
It's all greek to me, but seriously, you guys are Gods to me. Big Grin
(04-14-2010, 05:59 AM)StripTheSoul Wrote: [ -> ]wow, nice read. I didn't understand a word, but still...interesting read ^^
Go for it, big boy!

That's funny. " I really enjoyed what you typed, skid, whatever the hell you were saying there".

Skid, I guess what he liked was your good grammar skills since he didn't understand a word of what you actually meant. Smile
Despite me not knowing a lick about coding I was able to understand what Skid was referring to. That's quite impressive so far, perhaps it might help games that suffer drastic performance losses due to the Fifo code such as Zelda: Twilight Princess in addition to games such as Eternal Darkeness.
looks like you are going to end with your own dolphin branch, amazing work!
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26