Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

CT60 and related things BBS
 
Re: CTPCI: screen saver
Posted by: Didier Méquignon Jun,13.2011-14:57 

added a Vsetscreen mode (19) for the next release.

Didier.

*************************************************************************
Vsetscreen (Radeon driver)
*************************************************************************

Opcode:
XBIOS 5

Syntax:
void Vsetscreen(void *par1, void *par2, short rez, short command);

Description:
This function is nearest the MilanTOS, it's an extended call of Vsetscreen.
There are some differences:
- rez is always at 0x564E ('VN' for Vsetscreen New), an invalid modecode.
- devId used below inside a structure is just the modecode.
You can use this function like the TOS:
Vsetscreen(long logaddr, long physaddr, short rez, short modecode);
some flags inside modecode are added:

#define HORFLAG 0x200 /* double width */
#define HORFLAG2 0x400 /* width increased */
#define VESA_600 0x800 /* SVGA 600 lines */
#define VESA_768 0x1000 /* SVGA 768 lines */
#define VERTFLAG2 0x2000 /* double height */
#define DEVID 0x4000 /* bits 11-3 used for devID */
#define VIRTUAL_SCREEN 0x8000 /* width * 2 and height * 2, 2048 x 2048 max */
#define BPS32 5

OVERSCAN and PAL flags are used for select refresh frequency:
OVERSCAN | PAL | Freq
---------+-----+-----
0 | 0 | 56
0 | 1 | 60
1 | 0 | 70
1 | 1 | 85

par1: used or not by each command.

par2: used or not by each comm

rez: always 0x564E (Vsetscreen New)

command:

CMD_GETMODE (0) Getting current mode

long modecode;
Vsetscreen(-1,&modecode,0x564E,CMD_GETMODE);
This function is identical to Vsetmode(-1);

CMD_SETMODE (1) Set new graphic mode

long modecode=VESA_600+HORFLAG2+VGA+COL80+BPS32; /* 800*600*16M */
Vsetscreen(-1,modecode,0x564E,CMD_SETMODE)

This function is identical to Vsetscreen(0,0,3,modecode);
BIOS and VDI are initialised.

CMD_GETINFO (2) Get screen info structure for mode

SCREENINFO si;
si.size = sizeof(SCREENINFO); /* Structure size has to be set */
si.devID = VESA_600+HORFLAG2+VGA+COL80+BPS32; /* 800*600*16M */
/* mode or 0 for current mode */
si.scrFlags=0; /* status of the operation */
Vsetscreen(-1,&si,0x564E,CMD_GETINFO);
if(si.scrFlags & SCRINFO_OK)
puts("OK");
else
puts("Error");

CMD_ALLOCPAGE (3) Allocate screenpage

long addr=0; /* Frame address or -1 */
Vsetscreen(&addr,modecode,0x564E,CMD_ALLOCPAGE);
if(addr)
puts("OK");
else
puts("Error");

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

CMD_FREEPAGE (4) Release screenpage

Vsetscreen(-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 screenpage

Vsetscreen(-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*/
Vsetscreen(-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, and blk_x returned is always 0.

CMD_FREEMEM (7) Release graphics card memory

Vsetscreen(-1,&blk,0x564E,CMD_FREEMEM);

blk of the block to be released.

CMD_SETADR (8) Set screen to fixed address

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

This function is identical to Vsetscreen(logbase,physbase,-1,-1);

CMD_ENUMMODES (9) Requests all available modes

long cdecl enumfunc(SCREENINFO *inf,long flag)
{
printf("%s\n",inf->name);
return ENUMMODE_CONT;
}
Vsetscreen(-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. flag is undocumented inside the MilanTOS.

CMD_TESTMODE (10) Test a graphic mode

long modecode=VESA_600+HORFLAG2+VGA+COL80+BPS32; /* 800*600*16M */
Vsetscreen(-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.

CMD_COPYPAGE (11) Copy screenpage

Vsetscreen(-1,0,0x564E,CMD_COPYPAGE);
Copy with the GPU first screenpage to second screenpage
Vsetscreen(-1,1,0x564E,CMD_COPYPAGE);
Copy with the GPU second screenpage to first screenpage

This function not exist inside the MilanTOS.

The next sub-functions exists since the version 0x0101
of the video XBIOS.

CMD_FILLMEM (12) Fill memory on the graphics card

SCRFILLMEMBLK blk;
blk.size=sizeof(SCRFILLMEMBLK);
blk.blk_op = BLK_COPY;
blk.blk_color = 0x112233; /* background fill color */

Vsetscreen(-1,&blk,0x564E,CMD_SETMEM);
if(blk.blk_status == BLK_OK)
puts("OK");

Fill a block with a color with the GPU at (blk_x,
blk_y), size is blk_w, blk_h.
Note that this structure has the same size and same entry
the the structure SCRMEMBLK for the entry for size,
blk_status, blk_x, blk_y, blk_y, blk_w and blk_h for use
the allocated structure with a cast.

CMD_COPYMEM (13) Copy memory on the graphics card

SCRCOPYMEMBLK blk;
blk.size=sizeof(SCRCOPYMEMBLK);

Vsetscreen(-1,&blk,0x564E,CMD_COPYMEM);
if(blk.blk_status == BLK_OK)
puts("OK");

Copy a block with the GPU at (blk_src_x, blk_src_y)
to (blk_dst_x, blk_dst_y), size is blk_w, blk_h.
Note that this structure has the same size and same entry
the the structure SCRMEMBLK for the entry for size,
blk_status, blk_x, blk_y, blk_y, blk_w and blk_h for use
the allocated structure with a cast when blk_x is
blk_dst_x and blk_y is blk_dst_y.

This function not exist inside the MilanTOS.

CMD_TEXTUREMEM (14) Put texture in memory on the graphics card

SCRTEXTUREMEMBLK blk;
blk.size=sizeof(SCRTEXTUREMEMBLK);

Vsetscreen(-1,&blk,0x564E,[...]







[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
CTPCI: screen saver Ektus Apr,22.2011-19:54
  Re: CTPCI: screen saver Latz Apr,23.2011-12:00
    Re: CTPCI: screen saver Didier Méquignon Jun,13.2011-14:57
      Re: CTPCI: screen saver Didier Méquignon Jun,13.2011-14:59
  Re: CTPCI: screen saver Rajah May,31.2011-11:47
    Re: CTPCI: screen saver Ektus Jun,11.2011-10:42
      Re: CTPCI: screen saver Rajah Jun,11.2011-19:45
        Re: CTPCI: screen saver Ektus Jun,13.2011-18:30
          Re: CTPCI: screen saver Rajah Jun,13.2011-19:00


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson