Initial pass on some logging that would be helpful for debugging crashes/problems (#1457)

This commit is contained in:
Garrett Cox
2023-09-14 21:31:05 -05:00
committed by GitHub
parent 0a1e70ebaa
commit 7dffd63c39
6 changed files with 11 additions and 0 deletions

View File

@@ -662,6 +662,7 @@ s32 Flags_GetSwitch(PlayState* play, s32 flag) {
* Sets current scene switch flag.
*/
void Flags_SetSwitch(PlayState* play, s32 flag) {
lusprintf(__FILE__, __LINE__, 2, "Switch Flag Set - %#x", flag);
if (flag < 0x20) {
play->actorCtx.flags.swch |= (1 << flag);
} else {
@@ -673,6 +674,7 @@ void Flags_SetSwitch(PlayState* play, s32 flag) {
* Unsets current scene switch flag.
*/
void Flags_UnsetSwitch(PlayState* play, s32 flag) {
lusprintf(__FILE__, __LINE__, 2, "Switch Flag Unset - %#x", flag);
if (flag < 0x20) {
play->actorCtx.flags.swch &= ~(1 << flag);
} else {
@@ -724,6 +726,7 @@ s32 Flags_GetTreasure(PlayState* play, s32 flag) {
* Sets current scene chest flag.
*/
void Flags_SetTreasure(PlayState* play, s32 flag) {
lusprintf(__FILE__, __LINE__, 2, "Treasure Flag Set - %#x", flag);
play->actorCtx.flags.chest |= (1 << flag);
}
@@ -784,6 +787,7 @@ s32 Flags_GetCollectible(PlayState* play, s32 flag) {
* Sets current scene collectible flag.
*/
void Flags_SetCollectible(PlayState* play, s32 flag) {
lusprintf(__FILE__, __LINE__, 2, "Collectible Flag Set - %#x", flag);
if (flag != 0) {
if (flag < 0x20) {
play->actorCtx.flags.collect |= (1 << flag);

View File

@@ -1576,6 +1576,7 @@ void Message_Decode(PlayState* play) {
extern const char* msgStaticTbl[];
void Message_OpenText(PlayState* play, u16 textId) {
lusprintf(__FILE__, __LINE__, 2, "Display Text - textId: %#x", textId);
static s16 messageStaticIndices[] = { 0, 1, 3, 2 };
MessageContext* msgCtx = &play->msgCtx;
Font* font = &msgCtx->font;

View File

@@ -1759,6 +1759,7 @@ u8 Return_Item(u8 itemID, ModIndex modId, ItemID returnItem) {
* @return u8
*/
u8 Item_Give(PlayState* play, u8 item) {
lusprintf(__FILE__, __LINE__, 2, "Item Give - item: %#x", item);
static s16 sAmmoRefillCounts[] = { 5, 10, 20, 30, 5, 10, 30, 0, 5, 20, 1, 5, 20, 50, 200, 10 };
s16 i;
s16 slot;