65816-llvm-mos/runtime/include/iigs/misc.h
Scott Duensing da095402ec Updated
2026-06-02 23:17:57 -05:00

40 lines
1.3 KiB
C

// iigs/misc.h - Misc Tool Set wrappers that genToolbox.py can't generate.
//
// genToolbox.py auto-generates inline-asm wrappers for every ORCA
// `extern pascal Foo() inline(0xNNTT, dispatcher)` declaration. A
// handful of Misc Tool calls return STRUCT values (ReadTimeHex,
// GetMouseClamp, ...) and ORCA's misctool.h declares those WITHOUT
// the inline() macro, so the generator skips them.
//
// This header (and the iigsToolbox.s entries it forward-declares)
// fills that gap with hand-written, C-friendly wrappers.
//
// Currently exposed:
// - iigsReadTimeHex(unsigned char buf[8])
// Calls Misc Tool $0D03 (ReadTimeHex). Writes the 8-byte TimeRec
// into the caller-provided buffer in this order:
// buf[0] = second (0..59)
// buf[1] = minute (0..59)
// buf[2] = hour (0..23)
// buf[3] = (pad / unused)
// buf[4] = year - 1900
// buf[5] = day-of-month (1..31)
// buf[6] = month (0..11)
// buf[7] = day-of-week (1..7, Sunday=1)
// The Tool Locator must be up before calling (true under
// crt0Gsos and crt0Gno -- the host inits TL before __start).
#ifndef IIGS_MISC_H
#define IIGS_MISC_H
#ifdef __cplusplus
extern "C" {
#endif
extern void iigsReadTimeHex(unsigned char *buf8);
#ifdef __cplusplus
}
#endif
#endif