mkst / sm64-port

My mirror of the sm64-port. You probably want to look at the 3DS port branch: https://github.com/mkst/sm64-port/tree/3ds-port
https://discord.gg/7bcNTPK
251 stars 34 forks source link

FEATURE - Move audio to CPU1 #26

Closed mkst closed 4 years ago

mkst commented 4 years ago

The (O)3DS has a dual core CPU. Core 0 is used for userland, Core 1 is for the OS. However 1 thread can be spawned on Core 1 and used for ~30% of the time.

It ought to be as simple as:

    s32 prio = 0;
    svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);

    APT_SetAppCpuTimeLimit(30);
    threadId = threadCreate(audio_3ds_loop, 0, 32 * 1024, prio - 1, 1, true);

... but it isn't. as this crashes when transitioning to the FILE SELECT screen, if it hasn't already crashed before this point.

Note: there is no point using Core 2 or 3 on the N3DS as performance is fine when running at 804mhz.

mkst commented 4 years ago

Closing due to https://github.com/mkst/sm64-port/commit/d9d0b7d59bf303b21745bdb756248205da300a65