58 lines
1.6 KiB
C
58 lines
1.6 KiB
C
#include <stddef.h>
|
|
|
|
#include <sys/casio_syscalls.h>
|
|
#include <sys/console.h>
|
|
|
|
DEFINE_CASIO_SYSCALL_FN_PTR(GetKey, int, (unsigned int*), 0x90F)
|
|
DEFINE_CASIO_SYSCALL_FN_PTR(PutKey, int, (int keycode, int mode), 0x910)
|
|
DEFINE_CASIO_SYSCALL_FN_PTR(GetKeyWait, int, (int*column, int*row, int type_of_waiting, int timeout_period, int menu, unsigned short *keycode), 0x247)
|
|
DEFINE_CASIO_SYSCALL_FN_PTR(Bdisp_AllClr_DDVRAM, void, (void), 0x144)
|
|
DEFINE_CASIO_SYSCALL_FN_PTR(Bdisp_PutDisp_DD, void, (void), 0x028)
|
|
DEFINE_CASIO_SYSCALL_FN_PTR(Print, void, (const unsigned char*), 0x808)
|
|
DEFINE_CASIO_SYSCALL_FN_PTR(locate, void, (int, int), 0x807)
|
|
DEFINE_CASIO_SYSCALL_FN_PTR(wait_ms, void, (unsigned int), 0x130) // TODO signature assumed
|
|
|
|
int GetKey(unsigned int* keycode) {
|
|
return _GetKey_ptr(keycode);
|
|
}
|
|
|
|
int PutKey(int keycode, int mode) {
|
|
return _PutKey_ptr(keycode, mode);
|
|
}
|
|
|
|
int GetKeyWait(int*column, int*row, int type_of_waiting, int timeout_period, int menu, unsigned short *keycode) {
|
|
return _GetKeyWait_ptr(column, row, type_of_waiting, timeout_period, menu, keycode);
|
|
}
|
|
|
|
void Bdisp_AllClr_DDVRAM(void) {
|
|
_Bdisp_AllClr_DDVRAM_ptr();
|
|
}
|
|
|
|
void Bdisp_PutDisp_DD(void) {
|
|
_Bdisp_PutDisp_DD_ptr();
|
|
}
|
|
|
|
void Print(const unsigned char* str) {
|
|
_Print_ptr(str);
|
|
}
|
|
|
|
void locate(int x, int y) {
|
|
/*
|
|
* This call could be omitted, but to keep compatibility with the fxlib functions:
|
|
* locate(x, y);
|
|
* Print(str);
|
|
*/
|
|
_locate_ptr(x, y);
|
|
|
|
/*
|
|
* For use with stdio functions like printf
|
|
*/
|
|
_console_set_cursor(&_console_ctx, x, y);
|
|
|
|
}
|
|
|
|
void wait_ms(unsigned int ms) { // TODO signature assumed
|
|
_wait_ms_ptr(ms);
|
|
}
|
|
|