i send now the testprograms to tester with P96 Voodoo board.
on 1 system strange things happen, bestmodeid fail and return only $fffff
the openpip program does on both Voodoo not work.on
another System with a PiV it work.
it seem easy to add this to sdl, but if it not work.....
/********************************************************************* **
* This is an example that shows how to open a p96 PIP Window
* to get input events and how to paint in that window.
*
********************************************************************** */
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/picasso96.h>
#include <intuition/intuition.h>
char Template[] = "Width=W/N,Height=H/N,Pubscreen=PS/K";
LONG Array[] = { 0, 0, (LONG)"Workbench"};
struct Library *P96Base;
void main(void)
{
if(P96Base=OpenLibrary("Picasso96API.library",2)){
struct RDArgs *rda;
struct Window *wd;
LONG Width = 256, Height = 256;
char *PubScreenName = "Workbench";
if(rda = ReadArgs(Template, Array, NULL)){
if(Array[0]) Width =*((LONG *)Array[0]);
if(Array[1]) Height=*((LONG *)Array[1]);
PubScreenName = (char *)Array[2];
}
if(wd = p96PIP_OpenTags(
P96PIP_SourceFormat, RGBFB_R5G5B5, // RGBFB_Y4U2V2,
P96PIP_SourceWidth, 256,
P96PIP_SourceHeight, 256,
/* these tags are optional, but help */
WA_Title, "Picasso96 API PIP Test",
WA_Activate, TRUE,
WA_RMBTrap, TRUE,
WA_Width, Width,
WA_Height, Height,
WA_DragBar, TRUE,
WA_DepthGadget, TRUE,
WA_SimpleRefresh, TRUE,
WA_SizeGadget, TRUE,
WA_CloseGadget, TRUE,
WA_IDCMP, IDCMP_CLOSEWINDOW,
WA_PubScreenName, PubScreenName,
TAG_DONE)){
struct IntuiMessage *imsg;
BOOL goahead = TRUE;
struct RastPort *rp = NULL;
p96PIP_GetTags(wd, P96PIP_SourceRPort, (ULONG)&rp, TAG_END);
if(rp){
UWORD x, y;
for(y=0; y<Height; y++){
for(x=0; x<Width; x++){
p96WritePixel(rp, x, y, (x*256+y)*256);
}
}
}
do{
WaitPort(wd->UserPort);
while(imsg = (struct IntuiMessage *)GetMsg(wd->UserPort)){
switch(imsg->Class){
case IDCMP_CLOSEWINDOW:
goahead = FALSE;
break;
}
ReplyMsg((struct Message *)imsg);
}
}while(goahead);
p96PIP_Close(wd);
}
if(rda) FreeArgs(rda);
CloseLibrary(P96Base);
}
}
/********************************************************************* **
* This is example shows how to use p96BestModeIDTagList()
*
* tabt (Mon Aug 28 14:07:40 1995)
********************************************************************** */
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/graphics.h>
#include <proto/picasso96.h>
#include <stdio.h>
char template[]="Width=W/N,Height=H/N,Depth=D/N";
char *fmtstrings[RGBFB_MaxFormats] = {
"RGBFB_NONE",
"RGBFB_CLUT",
"RGBFB_R8G8B8",
"RGBFB_B8G8R8",
"RGBFB_R5G6B5PC",
"RGBFB_R5G5B5PC",
"RGBFB_A8R8G8B8",
"RGBFB_A8B8G8R8",
"RGBFB_R8G8B8A8",
"RGBFB_B8G8R8A8",
"RGBFB_R5G6B5",
"RGBFB_R5G5B5",
"RGBFB_B5G6R5PC",
"RGBFB_B5G5R5PC"
};
LONG array[]={ 0, 0, 0, FALSE };
struct Library *P96Base;
void main(int argc,char **argv)
{
if(P96Base=OpenLibrary("Picasso96API.library",2)){
struct RDArgs *rda;
ULONG DisplayID;
LONG width=640, height=480, depth=24;
if(rda=ReadArgs(template,array,NULL)){
if(array[0]) width =*((LONG *)array[0]);
if(array[1]) height=*((LONG *)array[1]);
if(array[2]) depth =*((LONG *)array[2]);
FreeArgs(rda);
}
if(DisplayID=p96BestModeIDTags(
P96BIDTAG_NominalWidth, width,
P96BIDTAG_NominalHeight, height,
P96BIDTAG_Depth, depth,
P96BIDTAG_FormatsForbidden,
(RGBFF_R5G5B5|RGBFF_R5G5B5PC|RGBFF_B5G5R5PC),
TAG_DONE)){
printf("DisplayID: %lx\n", DisplayID);
if(DisplayID != INVALID_ID){
printf("Width: %ld\n", p96GetModeIDAttr(DisplayID,
P96IDA_WIDTH));
printf("Height: %ld\n", p96GetModeIDAttr(DisplayID,
P96IDA_HEIGHT));
printf("Depth: %ld\n", p96GetModeIDAttr(DisplayID,
P96IDA_DEPTH));
printf("BytesPerPixel: %ld\n", p96GetModeIDAttr(DisplayID,
P96IDA_BYTESPERPIXEL));
printf("BitsPerPixel: %ld\n", p96GetModeIDAttr(DisplayID,
P96IDA_BITSPERPIXEL));
printf("RGBFormat: %s\n",
fmtstrings[p96GetModeIDAttr(DisplayID,P96IDA_RGBFORMAT)]);
printf("Is P96: %s\n", p96GetModeIDAttr(DisplayID,
P96IDA_ISP96) ? "yes" : "no");
}
}
CloseLibrary(P96Base);
}
} |