mirror of
https://github.com/clang-retro/atari-sdk.git
synced 2026-11-28 13:19:25 -08:00
Copyright belongs to the clang-retro contributors, each keeping their own. CONTRIBUTING.md replaces the contributor license agreement with the Developer Certificate of Origin, and the README no longer offers a commercial license, which nobody could grant for code others wrote. Copyright lines now read "clang-retro contributors". Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRSk3kAT2Qn61yc1DAF
1004 lines
37 KiB
C
1004 lines
37 KiB
C
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* Copyright (c) 2026 clang-retro contributors
|
|
*
|
|
* osbind.h: Atari TOS GEMDOS (trap #1), BIOS (trap #13) and XBIOS
|
|
* (trap #14) calls. Generated by tools/gen-osbind.py; edit that instead.
|
|
*
|
|
* Each call pushes the function number and its arguments, in the sizes
|
|
* TOS expects, calls the trap and pops them. TOS keeps d3-d7 and a3-a6.
|
|
* Pointer arguments may be given as pointers or as longs. Calls added
|
|
* after TOS 1.0 are marked with the TOS (or machine) they need.
|
|
*/
|
|
#ifndef _OSBIND_H
|
|
#define _OSBIND_H
|
|
|
|
/* Copy an argument block to the stack, call the trap and pop it. size is
|
|
* always even. */
|
|
#define __TOS_TRAP_FN(n) \
|
|
static __inline__ __attribute__((__always_inline__)) long __tos_trap##n( \
|
|
const void *__blk, unsigned long __size) \
|
|
{ \
|
|
register long __r __asm__("d0"); \
|
|
__asm__ __volatile__("suba.l %2,%%sp\n\t" \
|
|
"move.l %%sp,%%a1\n\t" \
|
|
"move.l %1,%%a0\n\t" \
|
|
"move.l %2,%%d1\n" \
|
|
"1:\tmove.w (%%a0)+,(%%a1)+\n\t" \
|
|
"sub.l #2,%%d1\n\t" \
|
|
"bne 1b\n\t" \
|
|
"trap #" #n "\n\t" \
|
|
"adda.l %2,%%sp" \
|
|
: "=&r"(__r) \
|
|
: "r"(__blk), "r"(__size) \
|
|
: "d1", "d2", "a0", "a1", "a2", "cc", "memory"); \
|
|
return __r; \
|
|
}
|
|
__TOS_TRAP_FN(1)
|
|
__TOS_TRAP_FN(13)
|
|
__TOS_TRAP_FN(14)
|
|
#undef __TOS_TRAP_FN
|
|
|
|
/* BIOS devices. */
|
|
#define _PRT 0 /* printer */
|
|
#define _AUX 1 /* serial port */
|
|
#define _CON 2 /* console (VT52 screen and keyboard) */
|
|
#define _MIDI 3
|
|
#define _IKBD 4 /* keyboard processor */
|
|
#define _RAWCON 5 /* screen without VT52 escapes */
|
|
|
|
/* Fsfirst() attributes. */
|
|
#define FA_READONLY 0x01
|
|
#define FA_HIDDEN 0x02
|
|
#define FA_SYSTEM 0x04
|
|
#define FA_VOLUME 0x08
|
|
#define FA_SUBDIR 0x10
|
|
#define FA_ARCHIVE 0x20
|
|
|
|
/* Fopen() modes. */
|
|
#define S_READ 0
|
|
#define S_WRITE 1
|
|
#define S_READWRITE 2
|
|
|
|
/* Pexec() modes. */
|
|
#define PE_LOADGO 0
|
|
#define PE_LOAD 3
|
|
#define PE_GO 4
|
|
#define PE_BASEPAGE 5
|
|
#define PE_GOTHENFREE 6
|
|
|
|
/* Mxalloc() modes. */
|
|
#define MX_STRAM 0
|
|
#define MX_TTRAM 1
|
|
#define MX_PREFSTRAM 2
|
|
#define MX_PREFTTRAM 3
|
|
|
|
/* The disk transfer area of Fsfirst() and Fsnext(). */
|
|
typedef struct {
|
|
char d_reserved[21];
|
|
unsigned char d_attrib;
|
|
unsigned short d_time;
|
|
unsigned short d_date;
|
|
unsigned long d_length;
|
|
char d_fname[14];
|
|
} _DTA;
|
|
|
|
/* Dfree(). */
|
|
typedef struct {
|
|
unsigned long b_free;
|
|
unsigned long b_total;
|
|
unsigned long b_secsiz;
|
|
unsigned long b_clsiz;
|
|
} _DISKINFO;
|
|
|
|
/* Fdatime(). */
|
|
typedef struct {
|
|
unsigned short time;
|
|
unsigned short date;
|
|
} _DOSTIME;
|
|
|
|
/* The basepage of a program. _base points to the program's own. */
|
|
typedef struct _basepage {
|
|
void *p_lowtpa;
|
|
void *p_hitpa;
|
|
void *p_tbase;
|
|
long p_tlen;
|
|
void *p_dbase;
|
|
long p_dlen;
|
|
void *p_bbase;
|
|
long p_blen;
|
|
_DTA *p_dta;
|
|
struct _basepage *p_parent;
|
|
long p_reserved;
|
|
char *p_env;
|
|
char p_undef[80];
|
|
char p_cmdlin[128];
|
|
} BASEPAGE;
|
|
extern BASEPAGE *_base;
|
|
|
|
/* Iorec(). */
|
|
typedef struct {
|
|
void *ibuf;
|
|
short ibufsiz;
|
|
volatile short ibufhd;
|
|
volatile short ibuftl;
|
|
short ibuflow;
|
|
short ibufhi;
|
|
} _IOREC;
|
|
|
|
/* Kbdvbase(). */
|
|
typedef struct {
|
|
void (*midivec)(void);
|
|
void (*vkbderr)(void);
|
|
void (*vmiderr)(void);
|
|
void (*statvec)(void *);
|
|
void (*mousevec)(void *);
|
|
void (*clockvec)(void *);
|
|
void (*joyvec)(void *);
|
|
void (*midisys)(void);
|
|
void (*ikbdsys)(void);
|
|
} _KBDVECS;
|
|
|
|
|
|
/* GEMDOS (trap #1) */
|
|
|
|
/* end the program with status 0 */
|
|
#define Pterm0() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 0 }; \
|
|
(void)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read a key from the console, with echo */
|
|
#define Cconin() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 1 }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write a character to the console */
|
|
#define Cconout(c) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 2, (short)(c) }; \
|
|
(void)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read a character from the serial port */
|
|
#define Cauxin() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 3 }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write a character to the serial port */
|
|
#define Cauxout(c) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 4, (short)(c) }; \
|
|
(void)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write a character to the printer */
|
|
#define Cprnout(c) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 5, (short)(c) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* raw console input (c = 0xff) or output */
|
|
#define Crawio(c) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 6, (short)(c) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read a key, no echo, no Ctrl-C check */
|
|
#define Crawcin() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 7 }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read a key, no echo */
|
|
#define Cnecin() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 8 }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write a string to the console */
|
|
#define Cconws(s) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 9, (long)(s) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read an edited line from the console */
|
|
#define Cconrs(buf) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 10, (long)(buf) }; \
|
|
(void)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* is a key waiting? */
|
|
#define Cconis() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 11 }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the current drive; returns the drive map */
|
|
#define Dsetdrv(drv) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 14, (short)(drv) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* can the console take a character? */
|
|
#define Cconos() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 16 }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* can the printer take a character? */
|
|
#define Cprnos() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 17 }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* is a serial character waiting? */
|
|
#define Cauxis() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 18 }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* can the serial port take a character? */
|
|
#define Cauxos() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 19 }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* add alternate RAM (TOS 2.06+) */
|
|
#define Maddalt(start, size) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; } __b = { 20, (long)(start), (long)(size) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* reserve screen memory (TOS 4) */
|
|
#define Srealloc(size) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 21, (long)(size) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the current drive (0 = A:) */
|
|
#define Dgetdrv() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 25 }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the disk transfer area */
|
|
#define Fsetdta(dta) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 26, (long)(dta) }; \
|
|
(void)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* enter or leave supervisor mode */
|
|
#define Super(stack) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 32, (long)(stack) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the date: (year-1980)<<9 | month<<5 | day */
|
|
#define Tgetdate() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 42 }; \
|
|
(unsigned short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the date */
|
|
#define Tsetdate(date) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 43, (short)(date) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the time: hour<<11 | minute<<5 | second/2 */
|
|
#define Tgettime() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 44 }; \
|
|
(unsigned short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the time */
|
|
#define Tsettime(time) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 45, (short)(time) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the disk transfer area */
|
|
#define Fgetdta() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 47 }; \
|
|
(void *)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the GEMDOS version, bytes swapped */
|
|
#define Sversion() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 48 }; \
|
|
(unsigned short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* end the program, keeping memory */
|
|
#define Ptermres(keep, code) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; } __b = { 49, (long)(keep), (short)(code) }; \
|
|
(void)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* free space on a drive (0 = current) */
|
|
#define Dfree(info, drv) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; } __b = { 54, (long)(info), (short)(drv) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* make a directory */
|
|
#define Dcreate(path) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 57, (long)(path) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* delete an empty directory */
|
|
#define Ddelete(path) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 58, (long)(path) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the current directory */
|
|
#define Dsetpath(path) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 59, (long)(path) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* create or truncate a file */
|
|
#define Fcreate(name, attr) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; } __b = { 60, (long)(name), (short)(attr) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* open a file: 0 read, 1 write, 2 both */
|
|
#define Fopen(name, mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; } __b = { 61, (long)(name), (short)(mode) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* close a file */
|
|
#define Fclose(handle) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 62, (short)(handle) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read from a file */
|
|
#define Fread(handle, count, buf) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; long __a2; } __b = { 63, (short)(handle), (long)(count), (long)(buf) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write to a file */
|
|
#define Fwrite(handle, count, buf) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; long __a2; } __b = { 64, (short)(handle), (long)(count), (long)(buf) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* delete a file */
|
|
#define Fdelete(name) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 65, (long)(name) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* move in a file: 0 start, 1 here, 2 end */
|
|
#define Fseek(offset, handle, mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; short __a2; } __b = { 66, (long)(offset), (short)(handle), (short)(mode) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* get (wflag 0) or set file attributes */
|
|
#define Fattrib(name, wflag, attr) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; short __a2; } __b = { 67, (long)(name), (short)(wflag), (short)(attr) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* allocate ST or TT RAM (TOS 2.06+) */
|
|
#define Mxalloc(size, mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; } __b = { 68, (long)(size), (short)(mode) }; \
|
|
(void *)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* duplicate a standard handle */
|
|
#define Fdup(handle) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 69, (short)(handle) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* redirect a standard handle */
|
|
#define Fforce(stdh, nonstdh) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; } __b = { 70, (short)(stdh), (short)(nonstdh) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the current directory of a drive */
|
|
#define Dgetpath(buf, drv) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; } __b = { 71, (long)(buf), (short)(drv) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* allocate memory; -1 gives the largest free block */
|
|
#define Malloc(size) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 72, (long)(size) }; \
|
|
(void *)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* free memory */
|
|
#define Mfree(block) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 73, (long)(block) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* shrink a memory block */
|
|
#define Mshrink(block, size) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; long __a2; } __b = { 74, 0, (long)(block), (long)(size) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* load and run a program */
|
|
#define Pexec(mode, name, cmdline, env) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; long __a2; long __a3; } __b = { 75, (short)(mode), (long)(name), (long)(cmdline), (long)(env) }; \
|
|
(long)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* end the program */
|
|
#define Pterm(code) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 76, (short)(code) }; \
|
|
(void)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* find the first matching file */
|
|
#define Fsfirst(pattern, attr) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; } __b = { 78, (long)(pattern), (short)(attr) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* find the next matching file */
|
|
#define Fsnext() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 79 }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* rename a file */
|
|
#define Frename(oldname, newname) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; long __a2; } __b = { 86, 0, (long)(oldname), (long)(newname) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* get (wflag 0) or set a file date and time */
|
|
#define Fdatime(timeptr, handle, wflag) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; short __a1; short __a2; } __b = { 87, (long)(timeptr), (short)(handle), (short)(wflag) }; \
|
|
(short)__tos_trap1(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* BIOS (trap #13) */
|
|
|
|
/* the memory parameter block */
|
|
#define Getmpb(mpb) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 0, (long)(mpb) }; \
|
|
(void)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* is a character waiting on a device? */
|
|
#define Bconstat(dev) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 1, (short)(dev) }; \
|
|
(short)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read a character from a device */
|
|
#define Bconin(dev) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 2, (short)(dev) }; \
|
|
(long)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write a character to a device */
|
|
#define Bconout(dev, c) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; } __b = { 3, (short)(dev), (short)(c) }; \
|
|
(long)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read or write disk sectors */
|
|
#define Rwabs(rwflag, buf, count, recno, dev) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; short __a2; short __a3; short __a4; } __b = { 4, (short)(rwflag), (long)(buf), (short)(count), (short)(recno), (short)(dev) }; \
|
|
(long)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set an exception vector (vec -1 reads it) */
|
|
#define Setexc(vecnum, vec) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; } __b = { 5, (short)(vecnum), (long)(vec) }; \
|
|
(void *)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* milliseconds per system timer tick */
|
|
#define Tickcal() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 6 }; \
|
|
(long)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the BIOS parameter block of a drive */
|
|
#define Getbpb(dev) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 7, (short)(dev) }; \
|
|
(void *)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* can a device take a character? */
|
|
#define Bcostat(dev) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 8, (short)(dev) }; \
|
|
(long)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* has the disk in a drive changed? */
|
|
#define Mediach(dev) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 9, (short)(dev) }; \
|
|
(long)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* bit map of the drives */
|
|
#define Drvmap() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 10 }; \
|
|
(unsigned long)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the shift key state (mode -1 reads it) */
|
|
#define Kbshift(mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 11, (short)(mode) }; \
|
|
(long)__tos_trap13(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* XBIOS (trap #14) */
|
|
|
|
/* set up the mouse */
|
|
#define Initmous(type, param, vec) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; long __a2; } __b = { 0, (short)(type), (long)(param), (long)(vec) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* reserve memory at the top of RAM (boot only) */
|
|
#define Ssbrk(count) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 1, (short)(count) }; \
|
|
(void *)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the screen the video hardware shows */
|
|
#define Physbase() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 2 }; \
|
|
(void *)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the screen the system draws on */
|
|
#define Logbase() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 3 }; \
|
|
(void *)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the screen resolution: 0 low, 1 medium, 2 high */
|
|
#define Getrez() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 4 }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the screens and resolution (-1 keeps) */
|
|
#define Setscreen(log, phys, rez) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; short __a2; } __b = { 5, (long)(log), (long)(phys), (short)(rez) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set all 16 colours at the next VBL */
|
|
#define Setpalette(palette) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 6, (long)(palette) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set one colour (-1 reads it) */
|
|
#define Setcolor(index, color) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; } __b = { 7, (short)(index), (short)(color) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read floppy sectors */
|
|
#define Floprd(buf, filler, dev, sect, track, side, count) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; short __a2; short __a3; short __a4; short __a5; short __a6; } __b = { 8, (long)(buf), (long)(filler), (short)(dev), (short)(sect), (short)(track), (short)(side), (short)(count) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write floppy sectors */
|
|
#define Flopwr(buf, filler, dev, sect, track, side, count) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; short __a2; short __a3; short __a4; short __a5; short __a6; } __b = { 9, (long)(buf), (long)(filler), (short)(dev), (short)(sect), (short)(track), (short)(side), (short)(count) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* format a floppy track */
|
|
#define Flopfmt(buf, filler, dev, spt, track, side, interleave, magic, virgin) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; short __a2; short __a3; short __a4; short __a5; short __a6; long __a7; short __a8; } __b = { 10, (long)(buf), (long)(filler), (short)(dev), (short)(spt), (short)(track), (short)(side), (short)(interleave), (long)(magic), (short)(virgin) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write count+1 bytes to MIDI */
|
|
#define Midiws(count, buf) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; } __b = { 12, (short)(count), (long)(buf) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set an MFP interrupt vector */
|
|
#define Mfpint(number, vec) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; } __b = { 13, (short)(number), (long)(vec) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the input buffer record of a device */
|
|
#define Iorec(dev) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 14, (short)(dev) }; \
|
|
(void *)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set up the serial port (-1 keeps) */
|
|
#define Rsconf(baud, ctrl, ucr, rsr, tsr, scr) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; short __a2; short __a3; short __a4; short __a5; } __b = { 15, (short)(baud), (short)(ctrl), (short)(ucr), (short)(rsr), (short)(tsr), (short)(scr) }; \
|
|
(long)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the keyboard tables (-1 keeps) */
|
|
#define Keytbl(unshift, shift, capslock) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; long __a2; } __b = { 16, (long)(unshift), (long)(shift), (long)(capslock) }; \
|
|
(void *)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* a 24-bit pseudo-random number */
|
|
#define Random() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 17 }; \
|
|
(long)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* make a boot sector */
|
|
#define Protobt(buf, serialno, disktype, execflag) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; short __a2; short __a3; } __b = { 18, (long)(buf), (long)(serialno), (short)(disktype), (short)(execflag) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* verify floppy sectors */
|
|
#define Flopver(buf, filler, dev, sect, track, side, count) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; short __a2; short __a3; short __a4; short __a5; short __a6; } __b = { 19, (long)(buf), (long)(filler), (short)(dev), (short)(sect), (short)(track), (short)(side), (short)(count) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* print the screen */
|
|
#define Scrdmp() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 20 }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set up the text cursor */
|
|
#define Cursconf(func, rate) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; } __b = { 21, (short)(func), (short)(rate) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the keyboard clock (DOS date << 16 | time) */
|
|
#define Settime(time) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 22, (long)(time) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the keyboard clock (DOS date << 16 | time) */
|
|
#define Gettime() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 23 }; \
|
|
(unsigned long)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* restore the default keyboard tables */
|
|
#define Bioskeys() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 24 }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* write count+1 bytes to the keyboard processor */
|
|
#define Ikbdws(count, buf) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; long __a1; } __b = { 25, (short)(count), (long)(buf) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* disable an MFP interrupt */
|
|
#define Jdisint(number) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 26, (short)(number) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* enable an MFP interrupt */
|
|
#define Jenabint(number) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 27, (short)(number) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* read or write a sound chip register */
|
|
#define Giaccess(data, reg) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; } __b = { 28, (short)(data), (short)(reg) }; \
|
|
(char)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* clear bits of sound chip port A */
|
|
#define Offgibit(mask) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 29, (short)(mask) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set bits of sound chip port A */
|
|
#define Ongibit(mask) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 30, (short)(mask) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set up an MFP timer */
|
|
#define Xbtimer(timer, ctrl, data, vec) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; short __a2; long __a3; } __b = { 31, (short)(timer), (short)(ctrl), (short)(data), (long)(vec) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* play a sound chip command list */
|
|
#define Dosound(list) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 32, (long)(list) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set up the printer (-1 reads it) */
|
|
#define Setprt(config) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 33, (short)(config) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* the keyboard vector table */
|
|
#define Kbdvbase() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 34 }; \
|
|
(void *)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the key repeat rate (-1 keeps) */
|
|
#define Kbrate(initial, repeat) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; } __b = { 35, (short)(initial), (short)(repeat) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* print a block of the screen */
|
|
#define Prtblk(params) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 36, (long)(params) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* wait for the next vertical blank */
|
|
#define Vsync() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 37 }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* call a function in supervisor mode */
|
|
#define Supexec(func) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; } __b = { 38, (long)(func) }; \
|
|
(long)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* throw the AES away (reboots) */
|
|
#define Puntaes() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 39 }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* set the floppy step rate (TOS 1.4+) */
|
|
#define Floprate(dev, rate) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; } __b = { 41, (short)(dev), (short)(rate) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* use the blitter (-1 reads the mode) */
|
|
#define Blitmode(mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 64, (short)(mode) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* TT: set the video mode */
|
|
#define EsetShift(mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 80, (short)(mode) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* TT: the video mode */
|
|
#define EgetShift() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 81 }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* TT: set the palette bank */
|
|
#define EsetBank(bank) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 82, (short)(bank) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* TT: set a colour */
|
|
#define EsetColor(index, color) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; } __b = { 83, (short)(index), (short)(color) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* TT: set colours */
|
|
#define EsetPalette(index, count, palette) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; long __a2; } __b = { 84, (short)(index), (short)(count), (long)(palette) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* TT: read colours */
|
|
#define EgetPalette(index, count, palette) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; long __a2; } __b = { 85, (short)(index), (short)(count), (long)(palette) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* TT: grey mode */
|
|
#define EsetGray(mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 86, (short)(mode) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* TT: smear mode */
|
|
#define EsetSmear(mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 87, (short)(mode) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* Falcon: set the video mode (-1 reads it) */
|
|
#define VsetMode(mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 88, (short)(mode) }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* Falcon: the monitor type */
|
|
#define VgetMonitor() \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; } __b = { 89 }; \
|
|
(short)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* Falcon: external sync */
|
|
#define VsetSync(flag) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 90, (short)(flag) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* Falcon: screen size in bytes of a mode */
|
|
#define VgetSize(mode) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; } __b = { 91, (short)(mode) }; \
|
|
(long)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* Falcon: set colours */
|
|
#define VsetRGB(index, count, rgb) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; long __a2; } __b = { 93, (short)(index), (short)(count), (long)(rgb) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* Falcon: read colours */
|
|
#define VgetRGB(index, count, rgb) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; short __a0; short __a1; long __a2; } __b = { 94, (short)(index), (short)(count), (long)(rgb) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
/* Falcon: overlay mask */
|
|
#define VsetMask(ormask, andmask, overlay) \
|
|
__extension__({ \
|
|
struct __attribute__((__packed__, __aligned__(2))) { short __f; long __a0; long __a1; short __a2; } __b = { 150, (long)(ormask), (long)(andmask), (short)(overlay) }; \
|
|
(void)__tos_trap14(&__b, sizeof(__b)); \
|
|
})
|
|
|
|
#endif /* _OSBIND_H */
|