mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-22 22:44:14 -04:00
String macros (#1871)
* PRINTF * T * fault * yaz0 * __osMalloc * audio_thread_manager * graph * padmgr * sched * z_play * z_arrow_ice * z_arrow_light * z_elf_msg * z_elf_msg3 * z_elf_msg4 * z_elf_msg5 * z_mir_ray * stackcheck * Include versions in macros.h * Fix workaround for permuter
This commit is contained in:
@@ -231,7 +231,7 @@ ifeq ($(COMPILER),gcc)
|
||||
else
|
||||
CFLAGS += -G 0 -non_shared -Xcpluscomm -nostdinc -Wab,-r4300_mul
|
||||
|
||||
WARNINGS := -fullwarn -verbose -woff 624,649,838,712,516,513,596,564,594,807
|
||||
WARNINGS := -fullwarn -verbose -woff 624,649,838,712,516,513,596,564,594,807,609
|
||||
ASFLAGS := -march=vr4300 -32 -G0 -no-pad-sections
|
||||
CCASFLAGS := $(GBI_DEFINES) -G 0 -non_shared -Xcpluscomm -nostdinc -Wab,-r4300_mul $(WARNINGS) -o32
|
||||
COMMON_DEFINES := -D_MIPS_SZLONG=32 $(GBI_DEFINES) $(GAME_VERSION)
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ void CIC6105_AddRomInfoFaultPage(void);
|
||||
void CIC6105_Destroy(void);
|
||||
void CIC6105_Init(void);
|
||||
|
||||
#if MM_VERSION <= N64_JP_1_1
|
||||
#if MM_VERSION < N64_US
|
||||
void CIC6105_ScheduleCICTask(void);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ typedef struct ArenaNode {
|
||||
/* 0x4 */ size_t size;
|
||||
/* 0x8 */ struct ArenaNode* next;
|
||||
/* 0xC */ struct ArenaNode* prev;
|
||||
#if MM_VERSION <= N64_JP_1_1
|
||||
#if MM_VERSION < N64_US
|
||||
/* 0x10 */ const char* filename;
|
||||
/* 0x14 */ int line;
|
||||
/* 0x18 */ OSId threadId;
|
||||
@@ -44,7 +44,7 @@ void* __osRealloc(Arena* arena, void* ptr, size_t newSize);
|
||||
void __osGetSizes(Arena* arena, size_t* outMaxFree, size_t* outFree, size_t* outAlloc);
|
||||
s32 __osCheckArena(Arena* arena);
|
||||
|
||||
#if MM_VERSION <= N64_JP_1_1
|
||||
#if MM_VERSION < N64_US
|
||||
void *__osMallocDebug(Arena *arena, size_t size, const char* file, int line);
|
||||
void *__osMallocRDebug(Arena *arena, size_t size, const char* file, int line);
|
||||
void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MACROS_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "versions.h"
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
@@ -71,4 +72,35 @@
|
||||
} \
|
||||
(void)0
|
||||
|
||||
/**
|
||||
* The T macro holds translations in English for original debug strings written in Japanese.
|
||||
* The translated strings match the original debug strings, they are only direct translations.
|
||||
* For example, any original name is left as is rather than being replaced with the name in the codebase.
|
||||
*/
|
||||
#define T(jp, en) jp
|
||||
|
||||
// IDO doesn't support variadic macros, but it merely throws a warning for the
|
||||
// number of arguments not matching the definition (warning 609) instead of
|
||||
// throwing an error. We suppress this warning and rely on GCC to catch macro
|
||||
// argument errors instead.
|
||||
// Note some tools define __sgi but preprocess with a modern cpp implementation,
|
||||
// ensure that these do not use the IDO workaround to avoid errors.
|
||||
#define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX && !PERMUTER)
|
||||
|
||||
#if DEBUG_FEATURES
|
||||
#define PRINTF osSyncPrintf
|
||||
#elif IDO_PRINTF_WORKAROUND
|
||||
#if MM_VERSION >= N64_US
|
||||
#define PRINTF(args) (void)0
|
||||
#else
|
||||
#define PRINTF(args) (void)(args)
|
||||
#endif
|
||||
#else
|
||||
#if MM_VERSION >= N64_US
|
||||
#define PRINTF(format, ...) (void)0
|
||||
#else
|
||||
#define PRINTF(format, ...) (void)(format)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // MACROS_H
|
||||
|
||||
+17
-10
@@ -122,7 +122,9 @@ end:
|
||||
osSetIntMask(mask);
|
||||
|
||||
if (alreadyExists) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddClient: %08x は既にリスト中にある\n" VT_RST, client);
|
||||
osSyncPrintf(VT_COL(RED, WHITE) T("fault_AddClient: %08x は既にリスト中にある\n",
|
||||
"fault_AddClient: %08x is already in the list\n") VT_RST,
|
||||
client);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +161,9 @@ void Fault_RemoveClient(FaultClient* client) {
|
||||
osSetIntMask(mask);
|
||||
|
||||
if (listIsEmpty) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_RemoveClient: %08x リスト不整合です\n" VT_RST, client);
|
||||
osSyncPrintf(VT_COL(RED, WHITE) T("fault_RemoveClient: %08x リスト不整合です\n",
|
||||
"fault_RemoveClient: %08x list inconsistency\n") VT_RST,
|
||||
client);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +204,9 @@ end:
|
||||
osSetIntMask(mask);
|
||||
|
||||
if (alreadyExists) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterAddClient: %08x は既にリスト中にある\n" VT_RST, client);
|
||||
osSyncPrintf(VT_COL(RED, WHITE) T("fault_AddressConverterAddClient: %08x は既にリスト中にある\n",
|
||||
"fault_AddressConverterAddClient: %08x is already in the list\n") VT_RST,
|
||||
client);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,7 +240,8 @@ void Fault_RemoveAddrConvClient(FaultAddrConvClient* client) {
|
||||
osSetIntMask(mask);
|
||||
|
||||
if (listIsEmpty) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST,
|
||||
osSyncPrintf(VT_COL(RED, WHITE) T("fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n",
|
||||
"fault_AddressConverterRemoveClient: %08x is already in the list\n") VT_RST,
|
||||
client);
|
||||
}
|
||||
}
|
||||
@@ -982,20 +989,20 @@ void Fault_ThreadEntry(void* arg) {
|
||||
|
||||
if (msg == FAULT_MSG_CPU_BREAK) {
|
||||
sFaultInstance->msgId = (u32)FAULT_MSG_CPU_BREAK;
|
||||
// "Fault manager: OS_EVENT_CPU_BREAK received"
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n");
|
||||
osSyncPrintf(T("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n",
|
||||
"Fault manager: OS_EVENT_CPU_BREAK received\n"));
|
||||
} else if (msg == FAULT_MSG_FAULT) {
|
||||
sFaultInstance->msgId = (u32)FAULT_MSG_FAULT;
|
||||
// "Fault manager: OS_EVENT_FAULT received"
|
||||
osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n");
|
||||
osSyncPrintf(
|
||||
T("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n", "Fault manager: OS_EVENT_FAULT received\n"));
|
||||
} else if (msg == FAULT_MSG_UNK) {
|
||||
Fault_UpdatePad();
|
||||
faultedThread = NULL;
|
||||
continue;
|
||||
} else {
|
||||
sFaultInstance->msgId = (u32)FAULT_MSG_UNK;
|
||||
// "Fault manager: received an unknown message"
|
||||
osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n");
|
||||
osSyncPrintf(T("フォルトマネージャ:不明なメッセージを受信しました\n",
|
||||
"Fault manager: received an unknown message\n"));
|
||||
}
|
||||
|
||||
faultedThread = __osGetCurrFaultedThread();
|
||||
|
||||
@@ -425,26 +425,18 @@ void __osFree(Arena* arena, void* ptr) {
|
||||
node = (ArenaNode*)((uintptr_t)ptr - sizeof(ArenaNode));
|
||||
|
||||
if (!NODE_IS_VALID(node)) {
|
||||
#if MM_VERSION < N64_US
|
||||
// __osFree:Unauthorized release(%08x)\n
|
||||
(void)"__osFree:不正解放(%08x)\n";
|
||||
#endif
|
||||
PRINTF(T("__osFree:不正解放(%08x)\n", "__osFree:Unauthorized release(%08x)\n"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (node->isFree) {
|
||||
#if MM_VERSION < N64_US
|
||||
// __osFree:Double release(%08x)\n
|
||||
(void)"__osFree:二重解放(%08x)\n";
|
||||
#endif
|
||||
PRINTF(T("__osFree:二重解放(%08x)\n", "__osFree:Double release(%08x)\n"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!CHECK_CORRECT_ARENA(node, arena)) {
|
||||
#if MM_VERSION < N64_US
|
||||
// __osFree:arena(%08x) and __osMallocのarena(%08x) do not match\n
|
||||
(void)"__osFree:arena(%08x)が__osMallocのarena(%08x)と一致しない\n";
|
||||
#endif
|
||||
PRINTF(T("__osFree:arena(%08x)が__osMallocのarena(%08x)と一致しない\n",
|
||||
"__osFree:arena(%08x) and __osMallocのarena(%08x) do not match\n"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -499,20 +491,18 @@ void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line) {
|
||||
node = (ArenaNode*)((uintptr_t)ptr - sizeof(ArenaNode));
|
||||
|
||||
if (!NODE_IS_VALID(node)) {
|
||||
// __osFree:Unauthorized release(%08x)\n
|
||||
(void)"__osFree:不正解放(%08x)\n";
|
||||
PRINTF(T("__osFree:不正解放(%08x)\n", "__osFree:Unauthorized release(%08x)\n"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (node->isFree) {
|
||||
// __osFree:Double release(%08x)\n
|
||||
(void)"__osFree:二重解放(%08x)\n";
|
||||
PRINTF(T("__osFree:二重解放(%08x)\n", "__osFree:Double release(%08x)\n"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!CHECK_CORRECT_ARENA(node, arena)) {
|
||||
// __osFree:arena(%08x) and __osMallocのarena(%08x) do not match\n
|
||||
(void)"__osFree:arena(%08x)が__osMallocのarena(%08x)と一致しない\n";
|
||||
PRINTF(T("__osFree:arena(%08x)が__osMallocのarena(%08x)と一致しない\n",
|
||||
"__osFree:arena(%08x) and __osMallocのarena(%08x) do not match\n"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -689,21 +679,18 @@ s32 __osCheckArena(Arena* arena) {
|
||||
|
||||
ArenaImpl_Lock(arena);
|
||||
|
||||
// "Checking the contents of the arena..."
|
||||
(void)"アリーナの内容をチェックしています... (%08x)\n";
|
||||
(void)T("アリーナの内容をチェックしています... (%08x)\n", "Checking the contents of the arena... (%08x)\n");
|
||||
|
||||
for (iter = arena->head; iter != NULL; iter = iter->next) {
|
||||
if (!NODE_IS_VALID(iter)) {
|
||||
// "Oops!!"
|
||||
(void)"おおっと!! (%08x %08x)\n";
|
||||
(void)T("おおっと!! (%08x %08x)\n", "Oops!! (%08x %08x)\n");
|
||||
|
||||
err = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// "The arena still looks good"
|
||||
(void)"アリーナはまだ、いけそうです\n";
|
||||
(void)T("アリーナはまだ、いけそうです\n", "The arena still looks good\n");
|
||||
|
||||
ArenaImpl_Unlock(arena);
|
||||
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
#include "libu64/stackcheck.h"
|
||||
|
||||
#include "macros.h"
|
||||
#include "stdbool.h"
|
||||
#include "stdint.h"
|
||||
|
||||
#include "versions.h"
|
||||
|
||||
#if MM_VERSION < N64_US || DEBUG_FEATURES
|
||||
#define STACKCHECK_PRINTF osSyncPrintf
|
||||
#elif IDO_PRINTF_WORKAROUND
|
||||
#define STACKCHECK_PRINTF(args) (void)0
|
||||
#else
|
||||
#define STACKCHECK_PRINTF(format, ...) (void)0
|
||||
#endif
|
||||
|
||||
StackEntry* sStackInfoListStart = NULL;
|
||||
StackEntry* sStackInfoListEnd = NULL;
|
||||
|
||||
@@ -22,10 +32,9 @@ void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 i
|
||||
|
||||
for (iter = sStackInfoListStart; iter != NULL; iter = iter->next) {
|
||||
if (iter == entry) {
|
||||
#if MM_VERSION < N64_US
|
||||
// is already in the list
|
||||
osSyncPrintf("stackcheck_init: %08x は既にリスト中にある\n", entry);
|
||||
#endif
|
||||
STACKCHECK_PRINTF(
|
||||
T("stackcheck_init: %08x は既にリスト中にある\n", "stackcheck_init: %08x is already in the list\n"),
|
||||
entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -74,10 +83,8 @@ void StackCheck_Cleanup(StackEntry* entry) {
|
||||
}
|
||||
|
||||
if (inconsistency) {
|
||||
#if MM_VERSION < N64_US
|
||||
// List is inconsistent
|
||||
osSyncPrintf("stackcheck_cleanup: %08x リスト不整合です\n", entry);
|
||||
#endif
|
||||
STACKCHECK_PRINTF(
|
||||
T("stackcheck_cleanup: %08x リスト不整合です\n", "stackcheck_cleanup: %08x list inconsistency\n"), entry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,10 +111,10 @@ StackStatus StackCheck_GetState(StackEntry* entry) {
|
||||
status = STACK_STATUS_OK;
|
||||
}
|
||||
|
||||
#if MM_VERSION < N64_US
|
||||
osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free,
|
||||
(entry->name != NULL) ? entry->name : "(null)");
|
||||
#else
|
||||
STACKCHECK_PRINTF("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used,
|
||||
free, (entry->name != NULL) ? entry->name : "(null)");
|
||||
|
||||
#if MM_VERSION >= N64_US
|
||||
(void)"(null)";
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -1,3 +1,4 @@
|
||||
#include "macros.h"
|
||||
#include "fault.h"
|
||||
#include "libc64/sprintf.h"
|
||||
#include "libc64/sleep.h"
|
||||
@@ -55,8 +56,7 @@ void* Yaz0_NextDMA(u8* curSrcPos) {
|
||||
} else {
|
||||
oldPri = osGetThreadPri(NULL);
|
||||
osSetThreadPri(NULL, OS_PRIORITY_APPMAX);
|
||||
// Compression/decompression error
|
||||
osSyncPrintf("圧縮展開異常\n");
|
||||
osSyncPrintf(T("圧縮展開異常\n", "compression/decompression error\n"));
|
||||
osSetThreadPri(NULL, oldPri);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) {
|
||||
sRetryCount--;
|
||||
Sched_SendAudioCancelMsg(audioMgr->sched);
|
||||
} else {
|
||||
osSyncPrintf("audioMgr.c:もうダメ!死ぬ!\n");
|
||||
osSyncPrintf(T("audioMgr.c:もうダメ!死ぬ!\n", "audioMgr.c: I can't go on! I'm dying!\n"));
|
||||
osDestroyThread(NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
#include "gamealloc.h"
|
||||
|
||||
#include "libc64/malloc.h"
|
||||
#include "macros.h"
|
||||
|
||||
void GameAlloc_Log(GameAlloc* this) {
|
||||
GameAllocEntry* iter = this->base.next;
|
||||
|
||||
#if MM_VERSION <= N64_JP_1_1
|
||||
(void)"this = %08x\n";
|
||||
#endif
|
||||
PRINTF("this = %08x\n");
|
||||
|
||||
while (iter != &this->base) {
|
||||
#if MM_VERSION <= N64_JP_1_1
|
||||
(void)"ptr = %08x size = %d\n";
|
||||
#endif
|
||||
PRINTF("ptr = %08x size = %d\n");
|
||||
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
+1
-2
@@ -161,8 +161,7 @@ retry:
|
||||
Sched_SendGfxCancelMsg(&gScheduler);
|
||||
goto retry;
|
||||
} else {
|
||||
// graph.c: No more! die!
|
||||
osSyncPrintf("graph.c:もうダメ!死ぬ!\n");
|
||||
osSyncPrintf(T("graph.c:もうダメ!死ぬ!\n", "graph.c: I can't go on! I'm dying!\n"));
|
||||
Fault_AddHungupAndCrashImpl("RCP is HUNG UP!!", "Oh! MY GOD!!");
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -583,8 +583,9 @@ void PadMgr_UpdateConnections(void) {
|
||||
// Other/Unrecognized
|
||||
if (sPadMgrInstance->ctrlrType[i] == PADMGR_CONT_NONE) {
|
||||
sPadMgrInstance->ctrlrType[i] = PADMGR_CONT_UNK;
|
||||
// "Recognized an unknown type of controller (%04x)"
|
||||
sprintf(msg, "知らない種類のコントローラ(%04x)を認識しました",
|
||||
sprintf(msg,
|
||||
T("知らない種類のコントローラ(%04x)を認識しました",
|
||||
"Recognized an unknown type of controller (%04x)"),
|
||||
sPadMgrInstance->padStatus[i].type);
|
||||
}
|
||||
// Missing break required for matching
|
||||
|
||||
+20
-30
@@ -87,30 +87,26 @@ void Sched_HandleNMI(Scheduler* sched) {
|
||||
void Sched_HandleAudioCancel(Scheduler* sched) {
|
||||
s32 i;
|
||||
|
||||
// AUDIO SP Cancel
|
||||
osSyncPrintf("AUDIO SP キャンセルします\n");
|
||||
osSyncPrintf(T("AUDIO SP キャンセルします\n", "I am canceling the AUDIO SP\n"));
|
||||
|
||||
if ((sched->curRSPTask != NULL) && (sched->curRSPTask->list.t.type == M_AUDTASK)) {
|
||||
if (!(IO_READ(SP_STATUS_REG) & SP_STATUS_HALT)) {
|
||||
// Attempts to stop AUDIO SP
|
||||
osSyncPrintf("AUDIO SP止めようとします\n");
|
||||
osSyncPrintf(T("AUDIO SP止めようとします\n", "Attempting to stop AUDIO SP\n"));
|
||||
|
||||
IO_WRITE(SP_STATUS_REG, SP_SET_HALT);
|
||||
|
||||
i = 0;
|
||||
while (!(IO_READ(SP_STATUS_REG) & SP_STATUS_HALT)) {
|
||||
if (i++ > 100) {
|
||||
// AUDIO SP did not stop (10ms timeout)
|
||||
osSyncPrintf("AUDIO SP止まりませんでした(10msタイムアウト)\n");
|
||||
osSyncPrintf(
|
||||
T("AUDIO SP止まりませんでした(10msタイムアウト)\n", "AUDIO SP did not stop (10ms timeout)\n"));
|
||||
goto send_mesg;
|
||||
}
|
||||
usleep(100);
|
||||
}
|
||||
// AUDIO SP stopped (% d * 100us)
|
||||
osSyncPrintf("AUDIO SP止まりました(%d * 100us)\n", i);
|
||||
osSyncPrintf(T("AUDIO SP止まりました(%d * 100us)\n", "AUDIO SP stopped (%d * 100us)\n"), i);
|
||||
} else {
|
||||
// AUDIO SP seems to be stopped
|
||||
osSyncPrintf("AUDIO SP止まっているようです\n");
|
||||
osSyncPrintf(T("AUDIO SP止まっているようです\n", "AUDIO SP seems to be stopped\n"));
|
||||
}
|
||||
|
||||
send_mesg:
|
||||
@@ -129,13 +125,12 @@ void Sched_HandleAudioCancel(Scheduler* sched) {
|
||||
if (cur->msgQ != NULL) {
|
||||
osSendMesg(cur->msgQ, cur->msg, OS_MESG_BLOCK);
|
||||
}
|
||||
// Removed AUDIO SP task from pending list
|
||||
osSyncPrintf("AUDIO SP タスクを実行待ちリストから削除しました\n");
|
||||
osSyncPrintf(T("AUDIO SP タスクを実行待ちリストから削除しました\n",
|
||||
"The AUDIO SP task has been removed from the pending list\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
// There are no AUDIO SP tasks to cancel
|
||||
osSyncPrintf("キャンセルすべき AUDIO SP タスクがありません\n");
|
||||
osSyncPrintf(T("キャンセルすべき AUDIO SP タスクがありません\n", "There are no AUDIO SP tasks to cancel\n"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,30 +145,26 @@ void Sched_HandleAudioCancel(Scheduler* sched) {
|
||||
void Sched_HandleGfxCancel(Scheduler* sched) {
|
||||
s32 i;
|
||||
|
||||
// GRAPH SP Cancel
|
||||
osSyncPrintf("GRAPH SP キャンセルします\n");
|
||||
osSyncPrintf(T("GRAPH SP キャンセルします\n", "I am canceling the GRAPH SP\n"));
|
||||
|
||||
if ((sched->curRSPTask != NULL) && (sched->curRSPTask->list.t.type == M_GFXTASK)) {
|
||||
if (!(IO_READ(SP_STATUS_REG) & SP_STATUS_HALT)) {
|
||||
// GRAPH SP tries to stop
|
||||
osSyncPrintf("GRAPH SP止めようとします\n");
|
||||
osSyncPrintf(T("GRAPH SP止めようとします\n", "Attempting to stop GRAPH SP\n"));
|
||||
|
||||
IO_WRITE(SP_STATUS_REG, SP_SET_HALT);
|
||||
|
||||
i = 0;
|
||||
while (!(IO_READ(SP_STATUS_REG) & SP_STATUS_HALT)) {
|
||||
if (i++ > 100) {
|
||||
// GRAPH SP did not stop (10ms timeout)
|
||||
osSyncPrintf("GRAPH SP止まりませんでした(10msタイムアウト)\n");
|
||||
osSyncPrintf(
|
||||
T("GRAPH SP止まりませんでした(10msタイムアウト)\n", "GRAPH SP did not stop (10ms timeout)\n"));
|
||||
goto send_mesg;
|
||||
}
|
||||
usleep(100);
|
||||
}
|
||||
// GRAPH SP stopped (%d * 100us)
|
||||
osSyncPrintf("GRAPH SP止まりました(%d * 100us)\n", i);
|
||||
osSyncPrintf(T("GRAPH SP止まりました(%d * 100us)\n", "GRAPH SP stopped (%d * 100us)\n"), i);
|
||||
} else {
|
||||
// GRAPH SP seems to be stopped
|
||||
osSyncPrintf("GRAPH SP止まっているようです\n");
|
||||
osSyncPrintf(T("GRAPH SP止まっているようです\n", "GRAPH SP seems to be stopped\n"));
|
||||
}
|
||||
|
||||
send_mesg:
|
||||
@@ -195,16 +186,14 @@ void Sched_HandleGfxCancel(Scheduler* sched) {
|
||||
goto halt_rdp;
|
||||
}
|
||||
|
||||
// There are no GRAPH SP tasks to cancel
|
||||
osSyncPrintf("キャンセルすべき GRAPH SP タスクがありません\n");
|
||||
osSyncPrintf(T("キャンセルすべき GRAPH SP タスクがありません\n", "There are no GRAPH SP tasks to cancel\n"));
|
||||
|
||||
halt_rdp:
|
||||
if (sched->curRDPTask != NULL) {
|
||||
OSTask_t* dpTask = &sched->curRDPTask->list.t;
|
||||
|
||||
if (dpTask->type == M_GFXTASK) {
|
||||
// Try to stop DP
|
||||
osSyncPrintf("DP止めようとします\n");
|
||||
osSyncPrintf(T("DP止めようとします\n", "Attempting to stop DP\n"));
|
||||
bzero(dpTask->output_buff, (uintptr_t)dpTask->output_buff_size - (uintptr_t)dpTask->output_buff);
|
||||
osSendMesg(&sched->interruptQueue, (OSMesg)RDP_DONE_MSG, OS_MESG_NOBLOCK);
|
||||
}
|
||||
@@ -239,8 +228,9 @@ void Sched_QueueTask(Scheduler* sched, OSScTask* task) {
|
||||
void Sched_Yield(Scheduler* sched) {
|
||||
// Don't yield audio tasks
|
||||
if (sched->curRSPTask->list.t.type == M_AUDTASK) {
|
||||
// A new audio task has been entered even though the previous audio task has not been completed yet
|
||||
osSyncPrintf("まだ前回のオーディオタスクが完了していないのに新たなオーディオタスクがエントリされた\n");
|
||||
osSyncPrintf(
|
||||
T("まだ前回のオーディオタスクが完了していないのに新たなオーディオタスクがエントリされた\n",
|
||||
"A new audio task has been entered, even though the previous audio task has not yet been completed\n"));
|
||||
} else if (!(sched->curRSPTask->state & OS_SC_YIELD)) {
|
||||
sched->curRSPTask->state |= OS_SC_YIELD;
|
||||
osSpTaskYield();
|
||||
|
||||
+1
-2
@@ -864,8 +864,7 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
this->envCtx.sandstormPrimA = 255;
|
||||
this->envCtx.sandstormEnvA = 255;
|
||||
|
||||
// "It's here!!!!!!!!!"
|
||||
(void)"来た!!!!!!!!!!!!!!!!!!!!!";
|
||||
(void)T("来た!!!!!!!!!!!!!!!!!!!!!", "It's here!!!!!!!!!!!!!!!!!!!!!");
|
||||
|
||||
this->transitionMode = TRANS_MODE_SANDSTORM_END;
|
||||
} else {
|
||||
|
||||
@@ -56,7 +56,7 @@ void ArrowIce_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
void ArrowIce_Destroy(Actor* thisx, PlayState* play) {
|
||||
Magic_Reset(play);
|
||||
(void)"消滅"; // Unreferenced in retail, means "Disappearance"
|
||||
(void)T("消滅", "Disappearance");
|
||||
}
|
||||
|
||||
void ArrowIce_Charge(ArrowIce* this, PlayState* play) {
|
||||
|
||||
@@ -55,7 +55,7 @@ void ArrowLight_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
void ArrowLight_Destroy(Actor* thisx, PlayState* play) {
|
||||
Magic_Reset(play);
|
||||
(void)"消滅"; // Unreferenced in retail, means "Disappearance"
|
||||
(void)T("消滅", "Disappearance");
|
||||
}
|
||||
|
||||
void ArrowLight_Charge(ArrowLight* this, PlayState* play) {
|
||||
|
||||
@@ -40,7 +40,7 @@ void ElfMsg_SetupAction(ElfMsg* this, ElfMsgActionFunc actionFunc) {
|
||||
s32 func_8092DF9C(ElfMsg* this, PlayState* play) {
|
||||
if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) &&
|
||||
Flags_GetSwitch(play, this->actor.home.rot.y - 1)) {
|
||||
(void)"共倒れ"; // "Collapse together"
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
if (ELFMSG_GET_SWITCH_FLAG(&this->actor) != 0x7F) {
|
||||
Flags_SetSwitch(play, ELFMSG_GET_SWITCH_FLAG(&this->actor));
|
||||
}
|
||||
@@ -60,7 +60,7 @@ s32 func_8092DF9C(ElfMsg* this, PlayState* play) {
|
||||
return false;
|
||||
}
|
||||
if (Flags_GetSwitch(play, ELFMSG_GET_SWITCH_FLAG(&this->actor))) {
|
||||
(void)"共倒れ"; // "Collapse together"
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
Actor_Kill(&this->actor);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void ElfMsg2_SetupAction(ElfMsg2* this, ElfMsg2ActionFunc actionFunc) {
|
||||
s32 func_8096EC4C(ElfMsg2* this, PlayState* play) {
|
||||
if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) &&
|
||||
Flags_GetSwitch(play, this->actor.home.rot.y - 1)) {
|
||||
(void)"共倒れ"; // "Collapse together"
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
if (ELFMSG2_GET_SWITCH_FLAG(&this->actor) != 0x7F) {
|
||||
Flags_SetSwitch(play, ELFMSG2_GET_SWITCH_FLAG(&this->actor));
|
||||
}
|
||||
@@ -50,7 +50,7 @@ s32 func_8096EC4C(ElfMsg2* this, PlayState* play) {
|
||||
if (this->actor.home.rot.y == 129) {
|
||||
|
||||
if (Flags_GetClear(play, this->actor.room)) {
|
||||
(void)"共倒れ2"; // "Collapse 2"
|
||||
(void)T("共倒れ2", "Mutual destruction 2");
|
||||
if (ELFMSG2_GET_SWITCH_FLAG(&this->actor) != 0x7F) {
|
||||
Flags_SetSwitch(play, ELFMSG2_GET_SWITCH_FLAG(&this->actor));
|
||||
}
|
||||
@@ -62,7 +62,7 @@ s32 func_8096EC4C(ElfMsg2* this, PlayState* play) {
|
||||
return false;
|
||||
}
|
||||
if (Flags_GetSwitch(play, ELFMSG2_GET_SWITCH_FLAG(&this->actor))) {
|
||||
(void)"共倒れ"; // "Collapse together"
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
Actor_Kill(&this->actor);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ void ElfMsg3_SetupAction(ElfMsg3* this, ElfMsg3ActionFunc actionFunc) {
|
||||
s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) {
|
||||
if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) &&
|
||||
Flags_GetSwitch(play, this->actor.home.rot.y - 1)) {
|
||||
(void)"共倒れ"; // "Collapse together"
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
if (ELFMSG3_GET_SWITCH_FLAG(&this->actor) != 0x7F) {
|
||||
Flags_SetSwitch(play, ELFMSG3_GET_SWITCH_FLAG(&this->actor));
|
||||
}
|
||||
@@ -59,7 +59,7 @@ s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) {
|
||||
return false;
|
||||
}
|
||||
if (Flags_GetSwitch(play, ELFMSG3_GET_SWITCH_FLAG(&this->actor))) {
|
||||
(void)"共倒れ"; // "Collapse together"
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
Actor_Kill(&this->actor);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ static InitChainEntry sInitChain[] = {
|
||||
s32 func_80AFD380(ElfMsg4* this, PlayState* play) {
|
||||
if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) &&
|
||||
Flags_GetSwitch(play, this->actor.home.rot.y - 1)) {
|
||||
(void)"共倒れ"; // "Collapse together"
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
if (ELFMSG4_GET_SWITCH_FLAG(&this->actor) != 0x7F) {
|
||||
Flags_SetSwitch(play, ELFMSG4_GET_SWITCH_FLAG(&this->actor));
|
||||
}
|
||||
@@ -59,7 +59,7 @@ s32 func_80AFD380(ElfMsg4* this, PlayState* play) {
|
||||
return false;
|
||||
}
|
||||
if (Flags_GetSwitch(play, ELFMSG4_GET_SWITCH_FLAG(&this->actor))) {
|
||||
(void)"共倒れ"; // "Collapse together"
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
Actor_Kill(&this->actor);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ static InitChainEntry sInitChainsInitChain[] = {
|
||||
s32 func_80AFD990(ElfMsg5* this, PlayState* play) {
|
||||
if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) &&
|
||||
Flags_GetSwitch(play, this->actor.home.rot.y - 1)) {
|
||||
(void)"共倒れ"; // Collapse together
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
if (ELFMSG5_GET_SWITCH_FLAG(&this->actor) != 0x7F) {
|
||||
Flags_SetSwitch(play, ELFMSG5_GET_SWITCH_FLAG(&this->actor));
|
||||
}
|
||||
@@ -44,7 +44,7 @@ s32 func_80AFD990(ElfMsg5* this, PlayState* play) {
|
||||
}
|
||||
if (this->actor.home.rot.y == 0x81) {
|
||||
if (Flags_GetClear(play, this->actor.room)) {
|
||||
(void)"共倒れ2"; // Collapse 2
|
||||
(void)T("共倒れ2", "Mutual destruction 2");
|
||||
if (ELFMSG5_GET_SWITCH_FLAG(&this->actor) != 0x7F) {
|
||||
Flags_SetSwitch(play, ELFMSG5_GET_SWITCH_FLAG(&this->actor));
|
||||
}
|
||||
@@ -56,7 +56,7 @@ s32 func_80AFD990(ElfMsg5* this, PlayState* play) {
|
||||
return false;
|
||||
}
|
||||
if (Flags_GetSwitch(play, ELFMSG5_GET_SWITCH_FLAG(&this->actor))) {
|
||||
(void)"共倒れ"; // Collapse together
|
||||
(void)T("共倒れ", "Mutual destruction");
|
||||
Actor_Kill(&this->actor);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -237,8 +237,6 @@ static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_F32(cullingVolumeDownward, 1000, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
const char D_808E3DD0[] = "反射光 発生失敗";
|
||||
|
||||
void MirRay_SetupCollider(MirRay* this) {
|
||||
MirRayDataEntry* dataEntry = &sMirRayData[MIRRAY_LOCATION(&this->actor)];
|
||||
f32 x = (this->poolPt.x - this->sourcePt.x) * dataEntry->unk_10;
|
||||
@@ -294,6 +292,7 @@ void MirRay_Init(Actor* thisx, PlayState* play) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
|
||||
|
||||
if (MIRRAY_LOCATION(&this->actor) >= MIRRAY_MAX) {
|
||||
(void)T("反射光 発生失敗", "Reflected light failed to spawn");
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user