From fcbc3968bd95e4d19b37d9fa4bca51b1db8596ff Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Fri, 22 Nov 2024 16:04:33 +1300 Subject: Implement name and author ports in system device --- arm9/source/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'arm9/source/core.c') diff --git a/arm9/source/core.c b/arm9/source/core.c index a1f9ec1..7136777 100644 --- a/arm9/source/core.c +++ b/arm9/source/core.c @@ -56,6 +56,8 @@ u8 dev_read(Bedrock *br, u8 port) { switch(port) { // SYSTEM DEVICE // TODO: name and author + case 0x00: return rb_read(&br->sys.name); + case 0x01: return rb_read(&br->sys.authors); case 0x02: return 0x00; // program memory size case 0x03: return 0x00; // program memory size case 0x04: return 0x00; // working stack size @@ -143,8 +145,10 @@ u8 dev_read(Bedrock *br, u8 port) { Signal dev_write(Bedrock *br, u8 port, u8 v) { switch(port) { // SYSTEM DEVICE - case 0x08: SET_HIGH(br->sys.sleep,v); return 0; - case 0x09: SET_LOW(br->sys.sleep,v); return SIG_SLEEP; + case 0x00: rb_reset(&br->sys.name); return 0; + case 0x01: rb_reset(&br->sys.authors); return 0; + case 0x08: SET_HIGH(br->sys.sleep,v); return 0; + case 0x09: SET_LOW(br->sys.sleep,v); return SIG_SLEEP; // MEMORY DEVICE case 0x10: mem_write1(&br->mem,v); return 0; case 0x11: mem_write1(&br->mem,v); return 0; -- cgit v1.2.3-70-g09d2