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.18 Setscreen, Milan 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 0x4D49 (MI_MAGIC)
command Command
The following values are defined for command:
CMD_GETMODE (0) Getting current mode
int32_t mode;
Setscreen(-1,&mode,MI_MAGIC,CMD_GETMODE);
CMD_SETMODE (1) Set new graphic mode
int32_t mode=0x1023 /* 800*608*16 */
Setscreen(-1,mode,MI_MAGIC,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,MI_MAGIC,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,MI_MAGIC,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,MI_MAGIC,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,MI_MAGIC,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,MI_MAGIC,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,MI_MAGIC,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,MI_MAGIC,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,MI_MAGIC,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) This function only exist inside the
ct60 with internal TOS Radeon driver.
Return value: Return value undefined.
Availability: The function is available from the MilanTOS 4.08
onwards.
Group: Screen functions See also: SetscreenVSetscreenSetscreen, ct60