Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site trwrba.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!qantel!hplabs!sdcrdcf!trwrb!trwrba!sansom From: sansom@trwrba.UUCP (Richard E. Sansom) Newsgroups: net.micro.atari Subject: 520ST xbios() calls Message-ID: <1665@trwrba.UUCP> Date: Thu, 7-Nov-85 11:56:28 EST Article-I.D.: trwrba.1665 Posted: Thu Nov 7 11:56:28 1985 Date-Received: Mon, 11-Nov-85 05:26:42 EST References: <174@pluto.UUCP> Reply-To: sansom@trwrba.UUCP (Richard E. Sansom) Organization: TRW EDS, Redondo Beach, CA Lines: 99 As promised, here is a list of some of the xbios() calls which owners of the Hippo-C compiler may wish to use. Since I don't know much about the Hippo I can't promise that they will work as listed here (I've heard that the Hippo int size is 32 bits?). Oh well, good luck! ------------------------------------------------------------------------------- /* * If Hippo-C has no xbios() call available, you may be able to * get away with the following: * * .text * _xbios: move.l (sp)+,.temp ; get return address * trap #14 ; trap 14 is xbios * move.l .temp,-(sp) ; push return address * rts ; return to calling program * * .bss * .temp: ds.l ; temporary storage * * * In this document, the following definitions are assumed: * * char = 8-bits * int = 16-bits * long = 32-bits * */ /* long Physbase() * Returns the address of the screen's physical * base at the beginning of the next vertical * blank. */ #define Physbase() xbios(2) /* long Logbase() * Returns the address of the screen's logical * base immediately. */ #define Logbase() xbios(3) /* int Getrez() * Returns the screen's resolution (0, 1, or 2). */ #define Getrez() xbios(4) /* VOID Setscreen(log_addr, phys_addr, rez) * long log_addr, Set the screen's logical location (log_addr), * phys_addr; physical location (phys_addr), and resolution * int rez; (rez). Negative parameters are ignored, * making it possible to set one parameter * without affecting the others. */ #define Setscreen(logaddr,physaddr,rez) xbios(5,logaddr,physaddr,rez) /* VOID Setpalette(palette_ptr) * long palette_ptr; Set the palette register (all 16 colors) * from the 16 ints pointed to by palette_ptr. */ #define Setpalette(palette_ptr) xbios(6,palette_ptr) /* int Setcolor(color_num,color) * int color_num, Set the palette number "color_num" to * color; the given "color". Returns the old color (if * old color is negative, no change occured). */ #define Setcolor(color_num,color) xbios(7,color_num,color) /* long Random() * Returns a 24-bit psuedo-random number. */ #define Random() xbios(17) /* char Giaccess(data,reg_num) * char data; Read or write a register on the sound chip. * int reg_num; "reg_num" is the affected register, ORed with * $00 to read * $80 to write * "data" is the byte to write to the register. */ #define Giaccess(data,reg_num) xbios(28,data,reg_num) ------------------------------------------------------------------------------- I hope these will help some of you out there. Remember to make sure that all of your ints are 16-bits (let me know if I'm wrong about Hippo's int size). R. E. Sansom