Topic : TOS - das Betriebssystem
Author :
Version : tos.hyp (5. März 2013)
Subject : Programmieren/Atari
Nodes : 3001
Index Size : 93602
HCP-Version : 5
Compiled on : Atari
@charset : atarist
@lang :
@default : Titel
@help :
@options : +g -i -s +x +zz -t4
@width : 70
View Ref-File4.5.18 Setscreen, Milan TOS Name: »set screen« - initialisiert den Bildschirm.
Xbiosnummer: 5
Deklaration: void Setscreen( void *par1, void *par2, int16_t rez,
int16_t command );
Beschreibung: Diese XBIOS-Routine entspricht der Funktion Setscreen allerdings mit einem zusätzlichen Parameter und dient
dazu, Auflösung und Bildschirmspeicheradressen zu
verändern.
Parameter Bedeutung
par1 Je nach Funktion, s.u.
par2 Je nach Funktion, s.u.
rez immer 0x4D49 (MI_MAGIC)
command Kommando
Folgende Werte sind für command definiert:
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.
Ergebnis: Return value undefined.
Verfügbar: Die Funktion ist ab dem MilanTOS 4.08 verfügbar.
Gruppe: Bildschirmfunktionen Querverweis: SetscreenVSetscreenSetscreen, ct60