WiiDuktape/source/shared/wii_obj.c
Fries 08c96c9d07 work on getting quickjs ported to the wii.
i got it working but the port of my duktape code isn't done yet.
2024-06-26 16:33:02 -07:00

43 lines
825 B
C

#include <wii_obj.h>
#include <data.h>
static unsigned int green = RGBA(0, 255, 0, 255);
void shared_native_print(const char * message, GRRLIB_ttfFont * font) {
GRRLIB_PrintfTTF(0, 0, font, message, 32, green);
}
void shared_native_exit(bool * running) {
*running = false;
}
unsigned int shared_pad_buttons_down() {
return PAD_ButtonsDown(0);
}
shared_file_obj shared_get_file(const char * filename) {
void* ptr;
size_t size;
if (get_file_pointer(filename, &ptr, &size)) {
shared_file_obj file = {
.size = size,
.file_ptr = ptr,
.filename = filename
};
return file;
}
shared_file_obj file = {
.size = 0,
.file_ptr = NULL,
.filename = NULL
};
return file;
}
bool shared_is_valid_file(shared_file_obj file) {
return file.size > 0 && file.file_ptr != NULL && file.filename != NULL;
}