•  Back 
  •  Screen functions 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File4.5.19  Setscreen, ct60                                            TOS

 Name:         »set screen« - Initializes the screen

 Opcode:       5

 Syntax:       void Setscreen( void *par1, void *par2, int16_t rez, 
               int16_t command );

 Description:  This XBIOS routine corresponds to the Setscreen 
               function with additional parameters, and serves for 
               altering the screen resolution and screen memory 
               addresses.

                Parameter  Meaning 
                par1       Depending on function - see below 
                par2       Depending on function - see below 
                rez        Always 0x564E 
                command    Command 

               The following values are defined for command:

                CMD_GETMODE (0) Getting current mode

                              int32_t mode;
                              Setscreen(-1,&mode,0x564E,CMD_GETMODE);

                CMD_SETMODE (1) Set new graphic mode

                              int32_t mode=0x1023 /* 800*608*16 */
                              Setscreen(-1,mode,0x564E,CMD_SETMODE)

                              BIOS and VDI will be initialised. Not 
                              the AES.

                CMD_GETINFO (2) Get screen info structure for mode

                              SCREENINFO si;
                              si.size = sizeof(SCREENINFO); /* Structure size has to be set         */
                              si.devID =0x1022;             /* ID of the mode or 0 for current mode */
                              si.scrFlags=0;                /* status of the operation              */
                              Setscreen(-1,&si,0x564E,CMD_GETINFO);
                              if(si.scrFlags & SCRINFO_OK)
                                puts("OK");
                              else
                                puts("Error");

                CMD_ALLOCPAGE (3) Allocate 2nd screenpage

                              int32_t adr=0;          /* Frame address or -1 */
                              Setscreen(-1,mode,0x564E,CMD_ALLOCPAGE);
                              if(adr)
                                puts("OK");
                              else
                                puts("Error");

                              This only allocates one page. A further 
                              call will only return the frame address.

                CMD_FREEPAGE (4) Release 2nd screenpage

                              Setscreen(-1,-1,0x564E,CMD_FREEPAGE)

                              The graphics card memory will be 
                              released again. If the second page had 
                              still been active the call will switch 
                              back to the first page with Logbase and 
                              Physbase set.

                CMD_FLIPPAGE (5) Switch to 2nd screenpage

                              Setscreen(-1,-1,0x564E,CMD_FLIPPAGE)

                              Will switch to the second screenpage. 
                              Logbase and Physbase will be set.

                CMD_ALLOCMEM (6) Allocate memory on the graphics card

                              SCRMEMBLK blk;
 
                              blk.size=sizeof(SCRMEMBLK);
                              blk.blk_y=200;     /* alloc a block of 200 lines*/
 
                              Setscreen(-1,&blk,0x564E,CMD_ALLOCMEM);
                              if(blk.blk_start)
                                puts("OK");
                              else
                                puts("Out of memory");

                              The width of the block is currently 
                              always the width of the virtual screen. 
                              For the hardware functions this block 
                              will be like a screen (0,0,blk_w,blk_h), 
                              the coordinates start in the top left 
                              corner (0,0). It will be internally 
                              recalculated.

                CMD_FREEMEM (7) Release graphics card memory

                              Setscreen(-1,&blk,0x564E,CMD_FREEMEM)
                              blk of the block to be released.

                CMD_SETADR (8) Set screen to fixed address

                              int32_t logbase=blk.blk_start;   /* logical address or -1  */
                              int32_t physbase=blk.blk_start;  /* physical address or -1 */
 
                              Setscreen(logbase,physbase,0x564E,CMD_SETADR);

                CMD_ENUMMODES (9) Requests all available modes, since 
                              13.01.2000

                              int32_t cdecl enumfunc(SCREENINFO *inf,int32_t flag)
                              {
                                printf("%s\n",inf->name);
                                return ENUMMODE_CONT;
                              }
 
                              Setscreen(-1,&enumfunc,0x564E,CMD_ENUMMODES);

                              The function "enumfunc" will be called 
                              once for every available mode. 
                              ENUMMODE_EXIT (0) will cancel 
                              CMD_ENUMMODES. ENUMMODE_CONT (1) will 
                              continue. The parameters are handed over 
                              to the stack using the C standard.

                CMD_TESTMODE (10) Test a graphic mode

                              int32_t modecode=VESA_600+HORFLAG2+VGA+COL80+BPS32; /* 800*600*16M */
                              Setscreen(-1,modecode,0x564E,CMD_TESTMODE);

                              Only the BIOS is initialised, and a 
                              screen test arrives with colored wide 
                              lines.

                              This function not exist inside the 
                              MilanTOS.

 Return value: Nothing (or current modecode in TOS mode)

 Availability: Only valid with internal TOS Radeon driver (PCI.HEX) 
               for the ct60 (2007-01-24).

 Group:        Screen functions

 See Also:     Setscreen   VSetscreen   Setscreen, Milan