Make syscall names closer to libc

This commit is contained in:
Toby Jaffey 2025-12-08 16:28:00 +00:00
parent 1b868adf87
commit 6735b159ac
17 changed files with 103 additions and 79 deletions

View file

@ -18,7 +18,7 @@ export fn main() void {
while(gameRunning) {
const now = uvm.millis();
if (uvm.getch()) |key| {
if (uvm.getc()) |key| {
switch(key) {
' ' => nextEvent = mibu.events.Event{.key = .{.code = .{.char = ' '}}},
'a' => nextEvent = mibu.events.Event{.key = .{.code = .left}},

View file

@ -14,7 +14,7 @@ pub inline fn syscall(id: u32, param: u32) u32 {
return val;
}
pub inline fn getch() ?u8 {
pub inline fn getc() ?u8 {
const key = syscall(uvm32.UVM32_SYSCALL_GETC, 0);
if (key == 0xFFFFFFFF) {
return null;
@ -49,7 +49,7 @@ pub inline fn yield() void {
_ = syscall(uvm32.UVM32_SYSCALL_YIELD, 0);
}
pub inline fn printc(c:u8) void {
_ = syscall(uvm32.UVM32_SYSCALL_PRINTC, c);
pub inline fn putc(c:u8) void {
_ = syscall(uvm32.UVM32_SYSCALL_PUTC, c);
}