Skip to content

Commit 6002f57

Browse files
Merge pull request #11 from NathanNeurotic/copilot/improve-mmce-art-performance
Remove MMCE one-at-a-time blocking throttle in art loader
2 parents 71efb35 + 647de32 commit 6002f57

2 files changed

Lines changed: 13 additions & 18 deletions

File tree

src/menusys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static s32 menuSemaId;
8181
static s32 menuListSemaId = -1;
8282
static ee_sema_t menuSema;
8383

84-
#define MENU_MMCE_CONFIG_IDLE_FRAMES 20
84+
#define MENU_MMCE_CONFIG_IDLE_FRAMES 20
8585

8686
static void menuInvalidateArtSelection(void)
8787
{

src/texcache.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ enum {
4646
CACHE_REQ_PRIORITY_PREFETCH
4747
};
4848

49-
#define CACHE_SLOW_MODE_INTERACTIVE_DELAY 4
50-
#define CACHE_MMCE_INTERACTIVE_MAX_DELAY 12
51-
#define CACHE_APP_INTERACTIVE_MAX_DELAY 4
52-
#define CACHE_APP_PREFETCH_DELAY 10
53-
#define CACHE_PRIME_IDLE_DELAY 12
54-
#define CACHE_THREAD_PRIORITY 0x40
55-
#define CACHE_MMCE_LOAD_THREAD_PRIORITY 90
56-
#define CACHE_END_WAIT_TICKS_FORCE 120
57-
#define CACHE_END_WAIT_TICKS_SOFT 15
49+
#define CACHE_SLOW_MODE_INTERACTIVE_DELAY 4
50+
#define CACHE_MMCE_INTERACTIVE_MAX_DELAY 12
51+
#define CACHE_APP_INTERACTIVE_MAX_DELAY 4
52+
#define CACHE_APP_PREFETCH_DELAY 10
53+
#define CACHE_PRIME_IDLE_DELAY 12
54+
#define CACHE_THREAD_PRIORITY 0x40
55+
#define CACHE_MMCE_LOAD_THREAD_PRIORITY 90
56+
#define CACHE_END_WAIT_TICKS_FORCE 120
57+
#define CACHE_END_WAIT_TICKS_SOFT 15
5858

5959
extern void *_gp;
6060

@@ -1417,18 +1417,13 @@ static GSTEXTURE *cacheGetTextureInternal(image_cache_t *cache, item_list_t *lis
14171417
}
14181418

14191419
if (priority == CACHE_REQ_PRIORITY_INTERACTIVE && list != NULL && list->mode == MMCE_MODE && effectiveMode == MMCE_MODE) {
1420+
/* Safety net: if a queued request for a different game somehow survived a
1421+
* generation advance, drop it now so the new game's art can queue cleanly.
1422+
* cacheAdvanceGeneration() normally handles this on every navigation event. */
14201423
load_image_request_t *queuedMmceReq = cacheFindQueuedInteractiveModeLocked(MMCE_MODE);
14211424

14221425
if (queuedMmceReq != NULL && strcmp(queuedMmceReq->value, value) != 0)
14231426
cacheDropQueuedRequestLocked(queuedMmceReq);
1424-
1425-
/* cacheHasActiveInteractiveModeLocked() checks gArtCurrentReq != NULL, so
1426-
* dereferencing abortRequested is safe here while the cache lock is held. */
1427-
if ((cacheHasActiveInteractiveModeLocked(MMCE_MODE) && !gArtCurrentReq->abortRequested) ||
1428-
cacheHasQueuedInteractiveModeLocked(MMCE_MODE)) {
1429-
cacheUnlock();
1430-
return NULL;
1431-
}
14321427
}
14331428

14341429
if (priority == CACHE_REQ_PRIORITY_PREFETCH && cache->queuedPrefetchRequests >= cacheGetPrefetchLimit(cache)) {

0 commit comments

Comments
 (0)