bindings: More bindings

This commit is contained in:
Ry 2023-02-07 18:45:19 -08:00
parent 7f6ccfc7f1
commit 7965ead639
2 changed files with 29 additions and 4 deletions

View File

@ -724,8 +724,21 @@ static inline void new_window_event(void) {
call(0x00000C18); call(0x00000C18);
} }
static inline void get_next_window_event(void) { static inline struct return8 get_next_window_event(
unsigned char* window_struct
) {
struct return8 result_0;
parameter(0, window_struct);
call(0x00000C1C); call(0x00000C1C);
ret(0, result_0.return0);
ret(1, result_0.return1);
ret(2, result_0.return2);
ret(3, result_0.return3);
ret(4, result_0.return4);
ret(5, result_0.return5);
ret(6, result_0.return6);
ret(7, result_0.return7);
return result_0;
} }
static inline void draw_title_bar_to_window( static inline void draw_title_bar_to_window(

View File

@ -34,6 +34,9 @@ class Function(val address: UInt, val name: String) {
fun returns(index: Int, type: Type) { fun returns(index: Int, type: Type) {
returns[index] = Variable(type, "result_${index}", false) returns[index] = Variable(type, "result_${index}", false)
} }
fun returnstruct(suffix: String, type: Type) {
returnstruct(returns.indexOfFirst { it == null }, suffix, type)
}
fun returnstruct(index: Int, suffix: String, type: Type) { fun returnstruct(index: Int, suffix: String, type: Type) {
returns[index] = Variable(type, "result_0.${suffix}", true) returns[index] = Variable(type, "result_0.${suffix}", true)
} }
@ -166,9 +169,9 @@ comment("fox32rom definitions")
comment("system jump table") comment("system jump table")
define(0xF0040000U, "get_rom_version") { define(0xF0040000U, "get_rom_version") {
returnstruct(0, "return0", Type("struct return3")) returnstruct("return0", Type("struct return3"))
returnstruct(1, "return1", Type("struct return3")) returnstruct("return1", Type("struct return3"))
returnstruct(2, "return2", Type("struct return3")) returnstruct("return2", Type("struct return3"))
} }
define(0xF0040004U, "system_vsync_handler") { define(0xF0040004U, "system_vsync_handler") {
} }
@ -534,6 +537,15 @@ define(0x00000C14U, "destroy_window") {
define(0x00000C18U, "new_window_event") { define(0x00000C18U, "new_window_event") {
} }
define(0x00000C1CU, "get_next_window_event") { define(0x00000C1CU, "get_next_window_event") {
parameter(Byte.ref, "window_struct")
returnstruct("return0", Type("struct return8"))
returnstruct("return1", Type("struct return8"))
returnstruct("return2", Type("struct return8"))
returnstruct("return3", Type("struct return8"))
returnstruct("return4", Type("struct return8"))
returnstruct("return5", Type("struct return8"))
returnstruct("return6", Type("struct return8"))
returnstruct("return7", Type("struct return8"))
} }
define(0x00000C20U, "draw_title_bar_to_window") { define(0x00000C20U, "draw_title_bar_to_window") {
parameter(Byte.ref, "window_struct") parameter(Byte.ref, "window_struct")