Skip to content

Commit c7c1a61

Browse files
committed
Simplify no$gba debug output functions
1 parent b7dc51a commit c7c1a61

2 files changed

Lines changed: 22 additions & 85 deletions

File tree

include/nds/debug.h

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,30 @@ On the ARM 9 this functionality is best accessed via the console studio integrat
3838
#ifndef NDS_DEBUG_INCLUDE
3939
#define NDS_DEBUG_INCLUDE
4040

41-
void nocashWrite(const char *message, int len);
42-
/*! \brief Send a message to the no$gba debug window
41+
#include <stddef.h>
42+
#include "ndstypes.h"
43+
44+
#define REG_NOCASH_OUT_STRZ (*(vu32*)0x4fffa10)
45+
#define REG_NOCASH_OUT_CHAR (*(vu8*) 0x4fffa1c)
46+
47+
/*! \brief Send a message to the no$gba debug window
4348
\param message The message to send
49+
\param len Length in characters of the message to send
50+
*/
51+
static inline void nocashWrite(const char *message, size_t len)
52+
{
53+
for (size_t i = 0; i < len; i ++) {
54+
REG_NOCASH_OUT_CHAR = message[i];
55+
}
56+
}
57+
58+
/*! \brief Send a message to the no$gba debug window
59+
\param message The message to send (zero-terminated string)
4460
*/
45-
void nocashMessage(const char *message);
61+
static inline void nocashMessage(const char *message)
62+
{
63+
REG_NOCASH_OUT_STRZ = (u32)message;
64+
}
4665

4766
#endif // NDS_DEBUG_INCLUDE
4867

source/common/debugprint.s

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)