Coder Social home page Coder Social logo

decaf-emu / decaf-emu Goto Github PK

View Code? Open in Web Editor NEW
1.2K 1.2K 139.0 27.01 MB

Researching Wii U emulation.

License: GNU General Public License v3.0

C++ 95.51% C 3.22% CMake 0.86% Assembly 0.03% GLSL 0.27% Python 0.11%
cpp decaf-emu emulator wii-u

decaf-emu's Introduction

Build status

decaf-emu

Researching Wii U emulation. Licensed under the terms of the GNU General Public License, version 3 or later (GPLv3+).

You can find us for developer discussion:

Support

None, this is an in-development project and user support is not provided.

Building from Source

See BUILDING.md

Binaries

The latest Windows and Linux binaries are available via Actions artifacts. You must be logged into GitHub in order to download the artifacts.

MacOS builds are currently not provided due to complications with Vulkan.

Running

Run the decaf-qt executable, it is recommended to run the emulator from the root git directory so that it is able to access resources/fonts/*. Alternatively, set resources_path in the configuration file to point to the resources directory.

Configuration files can be found at:

  • Windows - %APPDATA%\decaf
  • Linux - ~/.config/decaf

On Linux, a "Bus error" crash usually indicates an out-of-space error in the temporary directory. Set the TMPDIR environment variable to a directory on a filesystem with at least 2GB free.

Additionally there is an SDL command line application which can be used by ./decaf-sdl play <path to game>

decaf-emu's People

Contributors

achurch avatar adubbz avatar aliaspider avatar archshift avatar ashquarky avatar baryluk avatar bleizo avatar brett19 avatar carlkenner avatar codingkoopa avatar comex avatar cornytrace avatar creepermario avatar curtisy1 avatar exjam avatar garyodernichts avatar jlachniet avatar kinnay avatar linkmauve avatar lioncash avatar petmac avatar qurious-pixel avatar rozelette avatar sepalani avatar snickerbockers avatar steveleafo avatar tatsh avatar tilka avatar velocityra avatar zhuowei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

decaf-emu's Issues

Allow full cleanup of system state.

So we can close a game and run it again without restarting the emulator.

This will require making sure all game and kernel allocated objects are cleaned up.

Fix Code Cache race when two threads hit the same function.

NOTE: this is for lockless cache branch.

This is gonna act silly. Proposed change:

  1. Use method .findOrInsert rather than .find followed by .insert using a null value at first then putting the real value at end of gen
  2. Use tail insertion than head insertion
  3. When cmpxchg fails check that the new tail item does not have same key
  4. When findOrInsert returns a found value rather than inserted value then we if the value is null we must wait until the other thread has finished code gen

Alarms & Interrupts

Add support for alarms and interrupts.

Easy for interpreter, will require some serious thinking about a good way to do it for the JIT.

File system function don't return file not found

A fix to this error makes NSMBU run a lot further. The lines in FSGetStat and FSOpenFile that return the file not found error don't work, because file is always a pointer to something and it compares: if(!file). I'm not sure what's the correct fix for this, but personally, I fixed this by changing it to: if(file->size() == -1).

Thread safe kernel

Evaluate which kernel functions are required to be thread safe, and go add some locks!

Verify OSGetMemBound

Check that MEM2 is meant to return the whole memory range, when testing it via browser exploit it doesn't...

Implement MP task queue

Basically a queue of function pointers to execute, execution is handled when explicitly requested by the game (it is not run in the background by kernel or interrupts or any black magic). Must be careful to ensure there is no race conditions as I believe it is a thread safe API.

Add building instructions

Opening the VS solution file (and the .vcxproj files located in the /build/ directory) is like opening a blank project, nothing is displayed. All the libraries are where they need to be.
Am I doing something wrong?
Edit: Not sure if it matters, but I'm on Win7 64bit so no DX12 support, I don't need to compile the project, just to open it in VS.

Decompile fetch shaders

Apparently it is possible to load fetch shaders from disk rather than init them at run time. This means we need to decompile them, ahhhhhhhhhhhhhh.

Game: Mii Maker

Really Windows 10?

What kind of bullshit are you trying to pull? Why would 10 be any different from Windows 7 or 8? They're the same fucking thing, an x86-64 based OS, so how dare you alienate people?

Cleanup heap managers

Move implementations to coreinit_x.cpp.
Get rid of the silly heaphandle management in gSystem.
Use the game memory for heap management rather than host.

Make JIT thread-safe.

Currently will definitely shit the bed if called from multiple threads at the same time.

Find alternatives for the fonts used by OSGetSharedData

Many applications (such as Mii Maker) use the four shared TTF fonts (CafeCn.ttf, CafeKr.ttf, CafeStd.ttf, CafeTw.ttf) obtained from OSGetSharedData, and crash if no font is present. I don't think these fonts can be redistributed with the emulator.

Do we ship alternative fonts with the emu, or could we fall back to any TTF font (e.g. Arial on Windows)?

Hardware/Emulator CPU test suite

Make some fancy tool that generates test cases for all instructions to run on hardware over TCP with a dumb thin client running on Wii U. These test cases should then be able to be run against the emulators interpreter and compare results. Would be nice if the test cases could be generated into a portable format so that other projects may share it ;)

Implement PPC code unit tests

Create a unit test infrastructure which can run tests and verify results within the emulator for interpreter and jit.
Create an app to run these tests on a real WiiU to ensure our expected output meets the reality of the hardware.
Add lots of unit tests!

Research texture dumping and un-tiling

All the Wii U textures I've seen are passed to GX2SetPixelTexture already swizzled; it would be nice to have a feature to unswizzle them and dump them to disk for inspection.

(If it's too early to consider texture related stuff, feel free to close this)

The tiling/untiling algorithm is implemented in a few libraries:

  • AddrLib (in Mesa) - official AMD code; complex, only supports r800 (but close enough to r600 that it might work), complex API
  • Mesa's old R600 driver - simple, no out-of-the box support for untiling compressed textures
  • EveryFileExplorer's texture support - decompresses dxt5 textures before untiling; only supports one type of tiling; also has a copy of a decompiled R600 AddrLib

Should we look into these libraries to see whether we can integrate one of them to process textures?

Cleanup memory page allocation.

As we currently allocate the whole memory range in base heaps, decide if the page allocation in Memory really necessary?

Orrr mark pages as allocated as they are used from the memory heap? Maybe this is pointless though because games probably will make their own large heaps inside the default heap?

AmiboSettings blows up

We've been doing graphical testing using AmiiboSettings and we've noticed that after a while the graphics start to blow up and eventually the game crashes. I've narrowed it down to a function (sub_20EA924) running on another thread which is looping, starting at around 0x15F698C0, and decrementing by 0x800 on each iteration. It's doing a memset(addr, 0, 0xc) (loc_20EAD08) which slowly corrupts game memory until it reaches the game code memory which is when the app blows up.

cc: @exjam @zhuowei @kinnay

SleepAlarmHandler wakes up wrong thread?

Splatoon crashes at startup since a thread's startup function is called with an OSAlarm (?!) and an OSContext (?!). It seems that SleepAlarmHandler is the cause of the issue.

The log is here: thread 103 creates a new thread (107), then it OSSleepTicks(0) to allow the new thread to execute; however, the SleepAlarmHandler is called on the new thread 107 according to the log.

Since the new thread hasn't executed yet, it got woken up at its entry point, but with argc set to the OSAlarm and argv set to its own OSContext (?!). It then tries to use an OSMessageQueue in its argument, but since its argument isn't what it's expecting, an assert in wiiu-emu fires on the invalid message queue.

Fix Processor::fiberEntryPoint

Nede to loop here allowing more functions to be run.

Example case:
OSGetDefaultThread(0)
OSRunThread(thread, func1)
...
<func1 exits, thread exits>
...
OSGetDefaultThread(0)
OSRunThread(thread, func2)

func2 will not run because fiberEntryPoint does not loop!

Implement block heap

This is a heap where you have two separate memory regions, one which is reserved only for the actual allocated memory, and one for the heap management data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.