diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-09-19 13:17:14 +1200 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-09-19 13:32:32 +1200 |
commit | bb1aa5958d1b67707dcf0f6b08bfaf0b408bd46e (patch) | |
tree | b26d07ed58aaf7a5230fc3e28c103d616abfa9b8 /arm9/source/types/pathbuf.h | |
parent | 9612c307f00c4313d73fe0c3a86c05c8d8cd514e (diff) | |
download | bedrock-nds-bb1aa5958d1b67707dcf0f6b08bfaf0b408bd46e.zip |
Massive rewrite
This commit rewrites the emulator halfway from scratch to make it
easier to change and maintain in the future. The emulator core was
rewritten to adhere to the released Bedrock specification (earlier
versions implemented an older prototype specification, which is no
longer relevant).
This commit also adds proper support for running multiple concurrent
Bedrock instances. This was previously supported in a limited manner
for the on-screen keyboard, but now works for any regular program as
well, with switching being performed by pressing the L or R bumper
buttons. This is disabled by default, as programs will still need to
be baked into the emulator and hand-loaded.
Diffstat (limited to 'arm9/source/types/pathbuf.h')
-rw-r--r-- | arm9/source/types/pathbuf.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/arm9/source/types/pathbuf.h b/arm9/source/types/pathbuf.h index 7fd7251..a926262 100644 --- a/arm9/source/types/pathbuf.h +++ b/arm9/source/types/pathbuf.h @@ -1,18 +1,22 @@ -#include <nds.h> - #ifndef PATHBUF_H_ #define PATHBUF_H_ + #include "../bang.h" + + + // A 255-byte path buffer. typedef struct { - u8 mem[255]; + u8 mem[256]; u8 p; } PathBuf; - u8 pb_read(PathBuf *buf); - void pb_clear(PathBuf *buf); - void pb_reset(PathBuf *buf, bool to_name); - bool pb_push_byte(PathBuf *buf, u8 byte); - bool pb_is_terminated(PathBuf *buf); - void pb_populate(PathBuf *buf, u8 *path); - + // Methods. + u8 pathbuf_read(PathBuf *buf); + void pathbuf_clear(PathBuf *buf); + void pathbuf_set_pointer(PathBuf *buf, bool to_final_component); + void pathbuf_populate(PathBuf *buf, u8 *path); + bool pathbuf_push(PathBuf *buf, u8 byte); + bool pathbuf_is_empty(PathBuf *buf); + bool pathbuf_is_root(PathBuf *buf); + bool pathbuf_is_valid(PathBuf *buf); #endif |