summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2017-01-13 17:50:56 -0800
committerYamaArashi <shadow962@live.com>2017-01-13 17:50:56 -0800
commita9ea37caf3a1a3b417cb264fb52ae9bf2778c8c8 (patch)
treed491db5fec276fb4647761b965dc46b0af212a25
parent88d87495ed2e5e29074ee97d5c636ec75a6e88fe (diff)
update GBA headers
-rw-r--r--include/gba/gba.h1
-rw-r--r--include/gba/io_reg.h3
-rw-r--r--include/gba/multiboot.h55
-rw-r--r--include/gba/syscall.h2
4 files changed, 61 insertions, 0 deletions
diff --git a/include/gba/gba.h b/include/gba/gba.h
index 26342cf88..42ae3cdde 100644
--- a/include/gba/gba.h
+++ b/include/gba/gba.h
@@ -4,6 +4,7 @@
#include "gba/defines.h"
#include "gba/io_reg.h"
#include "gba/types.h"
+#include "gba/multiboot.h"
#include "gba/syscall.h"
#include "gba/macro.h"
diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h
index 0be92fa60..5234e5b6c 100644
--- a/include/gba/io_reg.h
+++ b/include/gba/io_reg.h
@@ -577,6 +577,8 @@
#define TIMER_ENABLE 0x80
// serial
+#define SIO_ID 0x0030 // Communication ID
+
#define SIO_8BIT_MODE 0x0000 // Normal 8-bit communication mode
#define SIO_32BIT_MODE 0x1000 // Normal 32-bit communication mode
#define SIO_MULTI_MODE 0x2000 // Multi-player communication mode
@@ -589,6 +591,7 @@
#define SIO_MULTI_SI 0x0004 // Multi-player communication SI terminal
#define SIO_MULTI_SD 0x0008 // SD terminal
+#define SIO_MULTI_BUSY 0x0080
#define SIO_ERROR 0x0040 // Detect error
#define SIO_START 0x0080 // Start transfer
diff --git a/include/gba/multiboot.h b/include/gba/multiboot.h
new file mode 100644
index 000000000..e88b43a19
--- /dev/null
+++ b/include/gba/multiboot.h
@@ -0,0 +1,55 @@
+#ifndef GUARD_GBA_MULTIBOOT_H
+#define GUARD_GBA_MULTIBOOT_H
+
+#define MULTIBOOT_NCHILD 3 // Maximum number of slaves
+#define MULTIBOOT_HEADER_SIZE 0xc0 // Header size
+#define MULTIBOOT_SEND_SIZE_MIN 0x100 // Minimum transmission size
+#define MULTIBOOT_SEND_SIZE_MAX 0x40000 // Maximum transmission size
+
+struct MultiBootParam
+{
+ u32 system_work[5];
+ u8 handshake_data;
+ u8 padding;
+ u16 handshake_timeout;
+ u8 probe_count;
+ u8 client_data[MULTIBOOT_NCHILD];
+ u8 palette_data;
+ u8 response_bit;
+ u8 client_bit;
+ u8 reserved1;
+ u8 *boot_srcp;
+ u8 *boot_endp;
+ u8 *masterp;
+ u8 *reserved2[MULTIBOOT_NCHILD];
+ u32 system_work2[4];
+ u8 sendflag;
+ u8 probe_target_bit;
+ u8 check_wait;
+ u8 server_type;
+};
+
+#define MULTIBOOT_ERROR_04 0x04
+#define MULTIBOOT_ERROR_08 0x08
+#define MULTIBOOT_ERROR_0c 0x0c
+#define MULTIBOOT_ERROR_40 0x40
+#define MULTIBOOT_ERROR_44 0x44
+#define MULTIBOOT_ERROR_48 0x48
+#define MULTIBOOT_ERROR_4c 0x4c
+#define MULTIBOOT_ERROR_80 0x80
+#define MULTIBOOT_ERROR_84 0x84
+#define MULTIBOOT_ERROR_88 0x88
+#define MULTIBOOT_ERROR_8c 0x8c
+#define MULTIBOOT_ERROR_NO_PROBE_TARGET 0x50
+#define MULTIBOOT_ERROR_NO_DLREADY 0x60
+#define MULTIBOOT_ERROR_BOOT_FAILURE 0x70
+#define MULTIBOOT_ERROR_HANDSHAKE_FAILURE 0x71
+
+#define MULTIBOOT_CONNECTION_CHECK_WAIT 15
+
+#define MULTIBOOT_SERVER_TYPE_NORMAL 0
+#define MULTIBOOT_SERVER_TYPE_QUICK 1
+
+#define MULTIBOOT_HANDSHAKE_TIMEOUT 400
+
+#endif // GUARD_GBA_MULTIBOOT_H
diff --git a/include/gba/syscall.h b/include/gba/syscall.h
index e47f964d1..deddec5ba 100644
--- a/include/gba/syscall.h
+++ b/include/gba/syscall.h
@@ -43,4 +43,6 @@ void RLUnCompWram(const void *src, void *dest);
void RLUnCompVram(const void *src, void *dest);
+int MultiBoot(struct MultiBootParam *mp);
+
#endif // GUARD_GBA_SYSCALL_H