home *** CD-ROM | disk | FTP | other *** search
- /*
- CodeMaker !Exemple0 : MyUtils
- Frank Lyonnet 1992
-
- You can contact me on internet : lyonnet@ufrima.imag.fr .
- lyonnet@imag.fr .
- on french RTEL : bal ARCHETYPE .
- by mail : Frank Lyonnet
- 420 , Chemin de la Cassine
- 73000 Chambéry
- France
- */
-
- #include "kernel.h"
- #include "swis.h"
- #include <time.h>
-
- int get_screen_adr(void)
- {
- _kernel_oserror Erreur;
- _kernel_swi_regs InRegs,OutRegs;
- int VduRequest[2];
- int AdresseEcran;
-
- VduRequest[0]=149;
- VduRequest[1]=-1;
- InRegs.r[0]=(int)&VduRequest;
- InRegs.r[1]=(int)&AdresseEcran;
- Erreur=*_kernel_swi(OS_ReadVduVariables,&InRegs,&OutRegs);
- return(AdresseEcran);
- }
-
- int mouse_buttons(void)
- {
- _kernel_oserror Erreur;
- _kernel_swi_regs InRegs,OutRegs;
-
- Erreur=*_kernel_swi(OS_Mouse,&InRegs,&OutRegs);
- return(OutRegs.r[2]);
- }
-
- void set_screen(int Offset)
- {
- struct {
- int
- updated:1,
- displayed:1,
- unused:6,
- offset1:24;
- int
- offset2:8,
- notused:24;
- } BlockOS;
-
- BlockOS.displayed=1;
- BlockOS.updated=0;
- BlockOS.offset1=Offset&0xffffff00;
- BlockOS.offset2=Offset&0x000000ff;
- _kernel_osword(22,(int *)&BlockOS);
- }
-
- void cache_on(void)
- {
- _kernel_oscli("cache on");
- }
-
- void cache_off(void)
- {
- _kernel_oscli("cache off");
- }
-
- #ifndef BOOL
- #define BOOL int
- #endif
-
- BOOL is_arm3(void)
- {
- return(_kernel_oscli("cache on")==1); /* no err */
- }
-
- BOOL is_ram8(void)
- {
- return((*(unsigned long int *)0x110 & 0xffff)==8000);
- }
-
- BOOL is_ram12(void)
- {
- return((*(unsigned long int *)0x110 & 0xffff)==11994);
- }
-
- BOOL is_memc1a(void)
- {
- return((*(char *)0x112 & 1)==1);
- }
-
-
-
-
-
-