FRANK OS API Reference

API reference for apps/api/frankos-app.h. All functions are called through the MOS2 sys_table at 0x10FFF000.

sys_table Index

OptionDescription
17xTaskGetTickCount (FreeRTOS)
404wm_create_window
405wm_destroy_window
406wm_show_window
407wm_set_focus
408wm_get_window
409wm_set_window_rect
410wm_invalidate
411wm_post_event
412wm_get_client_rect
413wd_begin
414wd_end
415wd_pixel
416wd_hline
417wd_vline
418wd_fill_rect
419wd_clear
420wd_rect
421wd_bevel_rect
422wd_char_ui
423wd_text_ui
424-427Menus, Dialogs, Taskbar, Timers
430-431Task notifications
438printf (serial debug)
439-442File dialog, button, framebuffer pointer
443-450MP3 decoding (Helix) and PCM audio
451-454Clipboard operations
455-474Scrollbar and Textarea controls
475-481File save dialog, Find/Replace
482wm_mark_dirty
483snd_open
484snd_write
485snd_close
486-490MOD playback (HxCMod)
491-493PSRAM allocator
494-505File associations, desktop shortcuts, fullscreen, deferred launch
506-511MIDI/OPL audio
512-51432x32 icons, ICO parsing
515-521Video mode switching and display state
522-528Direct framebuffer, keyboard polling (fullscreen)
529-535SRAM allocator, display_request_mode, volume control

Data Types

rect_t β€” { int16_t x, y, w, h }

point_t β€” { int16_t x, y }

hwnd_t β€” uint8_t (0 = HWND_NULL, 1-16 = valid)

window_event_t β€” type + union of key, charev, mouse, move, size, command, timer, dropfiles

window_t β€” flags, state, frame rect, restore_rect, bg_color, z_order, title[24], event_handler, paint_handler, user_data

Constants

Window Flags (WF_*)

OptionDescription
WF_ALIVEbit 0
WF_VISIBLEbit 1
WF_FOCUSEDbit 2
WF_CLOSABLEbit 3
WF_RESIZABLEbit 4
WF_MOVABLEbit 5
WF_BORDERbit 6
WF_DIRTYbit 7
WF_MENUBARbit 8
WF_FRAME_DIRTYbit 9
WF_FULLSCREENABLEbit 11

Window States

OptionDescription
WS_NORMAL0
WS_MINIMIZED1
WS_MAXIMIZED2

Keyboard Modifiers

OptionDescription
KMOD_SHIFTbit 0
KMOD_CTRLbit 1
KMOD_ALTbit 2

Dialog Constants

OptionDescription
DIALOG_ICON_NONENo icon
DIALOG_ICON_INFOInfo icon
DIALOG_ICON_WARNINGWarning icon
DIALOG_ICON_ERRORError icon
DIALOG_BTN_OKOK button
DIALOG_BTN_CANCELCancel button
DIALOG_BTN_YESYes button
DIALOG_BTN_NONo button
DIALOG_RESULT_OK0xFF01
DIALOG_RESULT_CANCEL0xFF02
DIALOG_RESULT_YES0xFF03
DIALOG_RESULT_NO0xFF04
DIALOG_RESULT_INPUT0xFF10
DIALOG_RESULT_FILE0xFF20
DIALOG_RESULT_FILE_SAVE0xFF21
DIALOG_RESULT_FIND_NEXT0xFF31
DIALOG_RESULT_REPLACE0xFF32
DIALOG_RESULT_REPLACE_ALL0xFF33

Display Constants

OptionDescription
DISPLAY_WIDTH640
DISPLAY_HEIGHT480
TASKBAR_HEIGHT28
FONT_UI_WIDTH6
FONT_UI_HEIGHT12
SCROLLBAR_WIDTH16

Theme Constants

OptionDescription
THEME_TITLE_HEIGHT20
THEME_MENU_HEIGHT20
THEME_BORDER_WIDTH4
THEME_BUTTON_FACECOLOR_LIGHT_GRAY

Colors

OptionDescription
COLOR_BLACK0
COLOR_BLUE1
COLOR_GREEN2
COLOR_CYAN3
COLOR_RED4
COLOR_MAGENTA5
COLOR_BROWN6
COLOR_LIGHT_GRAY7
COLOR_DARK_GRAY8
COLOR_LIGHT_BLUE9
COLOR_LIGHT_GREEN10
COLOR_LIGHT_CYAN11
COLOR_LIGHT_RED12
COLOR_LIGHT_MAGENTA13
COLOR_YELLOW14
COLOR_WHITE15