Does Morphos (OS4emu) support Warp3D v5 functions ?
  • Caterpillar
    Caterpillar
    Posts: 33 from 2013/6/20
    Hello

    I am still trying to make works my WaZp3D on Morphos
    (works in software mode, works in hard (TinyGL) mode for some old 68k apps...)

    But with the latest Crisot's demo "universe the trip"
    http://www.os4depot.net/index.php?function=showfile&file=demo/scene/universe/universe-thetrip.lha

    It seems that V5 functions inside WaZp3D are not called at all
    (W3D_SetTextureBlend(), W3D_InterleavedArray() .... ) so nothing is drawn but the demo runs well without crash
    [note: The same demo works with Wazp3D on OS4 ]

    So the question Does Morphos (OS4emu) support Warp3D v5 functions ?
    Does someone with Goa3D (Warp3D) support is able to run Crisot's demo ??

    Alain Thellier - Wazp3D
  • »13.12.13 - 09:18
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    BSzili
    Posts: 559 from 2012/6/8
    From: Hungary
    OS4emu definitely has no support for Warp3D v5 functions according to its readme. The same goes for Goa, because no classic software uses v5 functions, those were added in AmigaOS4.
    This is just like television, only you can see much further.
  • »13.12.13 - 10:30
    Profile Visit Website
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Quote:

    thellier wrote:
    Hello

    I am still trying to make works my WaZp3D on Morphos
    (works in software mode, works in hard (TinyGL) mode for some old 68k apps...)

    But with the latest Crisot's demo "universe the trip"
    http://www.os4depot.net/index.php?function=showfile&file=demo/scene/universe/universe-thetrip.lha

    It seems that V5 functions inside WaZp3D are not called at all
    (W3D_SetTextureBlend(), W3D_InterleavedArray() .... ) so nothing is drawn but the demo runs well without crash
    [note: The same demo works with Wazp3D on OS4 ]

    So the question Does Morphos (OS4emu) support Warp3D v5 functions ?
    Does someone with Goa3D (Warp3D) support is able to run Crisot's demo ??

    Alain Thellier - Wazp3D



    OS4Emu dont support Warp3D Nova but new calls are implemented as no-op. Maybe it is using some new tags and flags in V4 calls. I can check it out when I am home.
    1 + 1 = 3 with very large values of 1
  • »13.12.13 - 10:47
    Profile
  • Caterpillar
    Caterpillar
    Posts: 33 from 2013/6/20
    Thanks

    You mean that OS4emu dont emulate the OS4's Warp3D but the OS3 one. So ironical for an OS4 emulation ;-)
    So what is the solution ? Can I update OS4emu's Warp3D a way or another ?

    BTW BSzili your code in Wazp3D for W3D_RequestMode() dont seems to works It seems to crash on AllocAslRequestTags

    Alain
  • »13.12.13 - 10:50
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    BSzili
    Posts: 559 from 2012/6/8
    From: Hungary
    It's not really ironic. OS4emu provides a shim for native libraries, like Warp3D.
    As for the requester, you can post the code here, maybe someone can point out what did I do wrong.
    This is just like television, only you can see much further.
  • »13.12.13 - 11:22
    Profile Visit Website
  • Caterpillar
    Caterpillar
    Posts: 33 from 2013/6/20
    >OS4Emu dont support Warp3D Nova but new calls are implemented as no-op. Maybe it is using some new tags and flags in V4 calls. I can check it out when I am home.

    OK can I update OS4emu so he will see the 8 new functions in the jump table

    #define WARP3DV5 1 /* as WaZp3D emulate it */

    [...]
    (APTR) LibW3D_DrawElements,
    (APTR) LibW3D_SetFrontFace,

    #ifdef WARP3DV5
    (APTR) LibW3D_SetTextureBlend,
    (APTR) LibW3D_SecondaryColorPointer,
    (APTR) LibW3D_FogCoordPointer,
    (APTR) LibW3D_InterleavedArray,
    (APTR) LibW3D_ClearBuffers,
    (APTR) LibW3D_SetParameter,
    (APTR) LibW3D_PinTexture,
    (APTR) LibW3D_SetDrawRegionTexture,
    #endif

    (APTR) -1
    }


    >As for the requester, you can post the code here

    Here it is the faulty code
    Crash happen at AllocAslRequestTags()

    /*==========================================================================*/
    #ifdef __AROS__
    AROS_UFH3(BOOL, ScreenModeFilterASM,
    AROS_UFHA(struct Hook *,hook,A0),
    AROS_UFHA(APTR ,object , A2),
    AROS_UFHA(APTR ,message, A1))
    {
    AROS_USERFUNC_INIT
    ScreenModeFilterC(hook,object,message);
    AROS_USERFUNC_EXIT
    }

    #elif defined(__MORPHOS__)

    BOOL ScreenModeFilterFunc()
    {
    struct Hook *hook = (struct Hook *)REG_A0;
    APTR object = (APTR)REG_A2;
    APTR message = (APTR)REG_A1;

    return(ScreenModeFilterC(hook,object,message));
    }

    static struct EmulLibEntry ScreenModeFilterEntry =
    {
    TRAP_LIB, 0, (void (*)(void))ScreenModeFilterFunc
    };

    #else
    #ifdef __amigaos4__

    BOOL ScreenModeFilterASM(void) /* unused */
    { return(1); }

    #else

    BOOL ScreenModeFilterASM(struct Hook* hook __asm("a0"), APTR object __asm("a2"),APTR message __asm("a1"))
    {
    return(ScreenModeFilterC(hook,object,message));
    }

    #endif
    #endif
    /*==========================================================================*/
    #include <utility/hooks.h>
    ULONG W3D_RequestMode(struct TagItem *taglist)
    {
    W3D_Driver *driver;
    ULONG tag,data;
    ULONG size,format,drivertype,ModeID=INVALID_ID;
    #ifndef __AROS__
    struct Library *AslBase;
    #endif
    struct AslIFace* IAsl =NULL;
    struct ScreenModeRequester *requester;
    struct Hook filter;

    #ifdef __amigaos4__
    filter.h_Entry =(HOOKFUNC)ScreenModeFilterC;
    #elif defined(__MORPHOS__)
    filter.h_Entry =(HOOKFUNC)&ScreenModeFilterEntry;
    #else
    filter.h_Entry =(HOOKFUNC)ScreenModeFilterASM;
    #endif

    WAZP3DFUNCTION(19);
    size=TRUE;
    driver=&Wazp3D->driver;
    Wazp3D->ASLminX=0;
    Wazp3D->ASLmaxX=MAXSCREEN;
    Wazp3D->ASLminY=0;
    Wazp3D->ASLmaxY=MAXSCREEN;
    Wazp3D->ASLsize=FALSE;

    drivertype=Wazp3D->drivertype;
    format=Wazp3D->driver.formats;

    while (taglist->ti_Tag != TAG_DONE)
    {
    if (taglist->ti_Tag == TAG_MORE) {
    taglist = (struct TagItem *)taglist->ti_Data;
    continue;
    }
    tag =taglist->ti_Tag ; data=taglist->ti_Data ; taglist++;
    if(tag==W3D_SMR_SIZEFILTER) Wazp3D->ASLsize =TRUE;
    if(tag==W3D_SMR_DRIVER ) driver =(W3D_Driver *)data;

    if(tag==W3D_SMR_DESTFMT) format =data;
    if(tag==W3D_SMR_TYPE) drivertype =data;

    if(tag==ASLSM_MinWidth) Wazp3D->ASLminX =data;
    if(tag==ASLSM_MaxWidth) Wazp3D->ASLmaxX =data;
    if(tag==ASLSM_MinHeight) Wazp3D->ASLminY =data;
    if(tag==ASLSM_MaxHeight) Wazp3D->ASLmaxY =data;

    WTAG(W3D_SMR_DRIVER,"Driver to filter ")
    WTAG(W3D_SMR_DESTFMT,"Dest Format to filter ")
    WTAG(W3D_SMR_TYPE,"Type to filter ")
    WTAG(W3D_SMR_SIZEFILTER,"Also filter size ")

    WTAG(W3D_SMR_MODEMASK,"AND-Mask for modes ")
    WTAG(ASLSM_MinWidth," ")
    WTAG(ASLSM_MaxWidth," ")
    WTAG(ASLSM_MinHeight," ")
    WTAG(ASLSM_MaxHeight," ")
    }

    #if !defined(__AROS__)
    if ((AslBase = OpenLibrary("asl.library", 39L)))
    #endif
    {
    #ifdef __amigaos4__
    IAsl = (struct AslIFace*)GetInterface((struct Library *)AslBase, "main", 1, NULL);
    #endif
    if((requester = (struct ScreenModeRequester *)AllocAslRequestTags(
    ASL_ScreenModeRequest,
    ASLSM_TitleText,(ULONG) "Wazp3D Screen Modes ",
    ASLSM_FilterFunc,(ULONG)&filter,
    TAG_DONE )))
    {
    ModeID=INVALID_ID;
    if(AslRequest(requester, NULL))
    ModeID =requester->sm_DisplayID;
    FreeAslRequest(requester);
    }
    #if !defined(__AROS__)
    CloseLibrary(AslBase);
    #endif
    }

    VAR(ModeID)
    return(ModeID);
    }
    /*==========================================================================*/
    #if PROVIDE_VARARG_FUNCTIONS
    ULONG W3D_RequestModeTags(Tag tag1, ...)
    {
    static ULONG tag[100];
    va_list va;
    WORD n=0;

    WAZP3DFUNCTION(20);
    tag[n] = tag1;
    VAR(tag[n])
    va_start (va, tag1);
    do {
    n++; tag[n]= va_arg(va, ULONG); VAR(tag[n])
    if(n&2) if (tag[n] == TAG_DONE) break;
    }
    while (n<100);
    va_end(va);

    return (W3D_RequestMode((struct TagItem *)tag));
    }
    #endif // PROVIDE_VARARG_FUNCTIONS
  • »13.12.13 - 12:42
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    BSzili
    Posts: 559 from 2012/6/8
    From: Hungary
    I don't think you can update it, unless you can acquire the source of OS4emu.
    This is just like television, only you can see much further.
  • »13.12.13 - 12:55
    Profile Visit Website
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Quote:

    thellier wrote:
    >OS4Emu dont support Warp3D Nova but new calls are implemented as no-op. Maybe it is using some new tags and flags in V4 calls. I can check it out when I am home.

    OK can I update OS4emu so he will see the 8 new functions in the jump table

    #define WARP3DV5 1 /* as WaZp3D emulate it */

    [...]
    (APTR) LibW3D_DrawElements,
    (APTR) LibW3D_SetFrontFace,

    #ifdef WARP3DV5
    (APTR) LibW3D_SetTextureBlend,
    (APTR) LibW3D_SecondaryColorPointer,
    (APTR) LibW3D_FogCoordPointer,
    (APTR) LibW3D_InterleavedArray,
    (APTR) LibW3D_ClearBuffers,
    (APTR) LibW3D_SetParameter,
    (APTR) LibW3D_PinTexture,
    (APTR) LibW3D_SetDrawRegionTexture,
    #endif

    (APTR) -1
    }



    Looks like new functions were added since 2008 when I developed wrapper last time because I had only these:

    OS4_W3D_SetTextureBlend,
    OS4_W3D_SetTextureBlendTags,
    OS4_W3D_SecondaryColorPointer,
    OS4_W3D_FogCoordPointer,
    OS4_W3D_InterleavedArray,
    OS4_W3D_ClearBuffers

    Warp3D wrapper in OS4Emu dont have any new functionality inside. Everything is mapped 1:1 to Warp3D.library in MorphOS. An example:

    Quote:


    EMUCALL(ULONG, PROTO(W3D_DrawArray(struct Warp3DIFace *Self, W3D_Context * context, ULONG primitive, ULONG base, ULONG count)))
    {
    RC_START(ULONG)
    rc = W3D_DrawArray(context, primitive, base, count);
    RC_END
    }



    New functionality can be implemented only by using existing Warp3D V4 API or write completely new wrapper. In theory OS4Emu can use OS4 native wazp3d library (it has built-in support to load OS4 native libraries).

    Anyway, time to compile Warp3D wrappers with debug on... havent touched this project in 5 years.
    1 + 1 = 3 with very large values of 1
  • »13.12.13 - 21:42
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    _ThEcRoW
    Posts: 298 from 2008/10/27
    Any news?. It's an interesting subject.
    Mac Mini G4 1,4ghz 1gb ram & MorphOS 3.11
  • »15.12.13 - 14:48
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    BSzili
    Posts: 559 from 2012/6/8
    From: Hungary
    I doubt there will be any news regarding OS4emu, unless the development continues or source is released.
    This is just like television, only you can see much further.
  • »15.12.13 - 15:25
    Profile Visit Website
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    I recompiled new warp3d.library.ext for use in OS4Emu and it crashes. The original binary from OS4Emu package works just fine so it must be I made some unfinished changes five years ago.

    The case is closed.
    1 + 1 = 3 with very large values of 1
  • »15.12.13 - 15:57
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Quote:

    itix wrote:
    I recompiled new warp3d.library.ext for use in OS4Emu and it crashes. The original binary from OS4Emu package works just fine so it must be I made some unfinished changes five years ago.

    The case is closed.


    No chance of releasing the code for someone else to take over?
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »15.12.13 - 17:23
    Profile
  • Caterpillar
    Caterpillar
    Posts: 33 from 2013/6/20
    Hello

    >Looks like new functions were added since 2008 when I developed wrapper last time because I had only these[...]
    You seems to have the functions that I need for Crisot demo (mainly W3D_SetTextureBlend W3D_InterleavedArray) so the problem is not here

    2008 ? so perhaps I dont have the latest OS4emu = I am suspecting that I have the one from Aminet or from the recent DemoPackage
    I wasnt here those last days but I will check at home tonight if I have the latest OS4emu

    BTW I have noted on this thread
    https://morph.zone/modules/newbb_plus/viewtopic.php?topic_id=9608&forum=16
    that some 3d demos should works now (so the problem was not Wazp3D related)

    Alain Thellier
  • »16.12.13 - 10:28
    Profile Visit Website
  • Caterpillar
    Caterpillar
    Posts: 33 from 2013/6/20
    Hello

    I tried with lastest Os4emu (2.0 from your web page) nothing changed with Crisot's demo "universe the trip"
    http://www.os4depot.net/index.php?function=showfile&file=demo/scene/universe/universe-thetrip.lha

    can someone with WaRp3D support try if OS4emu really enable to make this demo works
    (else the bug is WaZp3D side....)

    Thanks

    Alain
  • »17.12.13 - 09:00
    Profile Visit Website
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2042 from 2003/2/24
    From: po-RNO
    Quote:

    thellier wrote:
    I tried with lastest Os4emu (2.0 from your web page) nothing changed with Crisot's demo "universe the trip"
    http://www.os4depot.net/index.php?function=showfile&file=demo/scene/universe/universe-thetrip.lha

    can someone with WaRp3D support try if OS4emu really enable to make this demo works
    (else the bug is WaZp3D side....)



    I didn't get it to work when testing for MorphOS demopack on Mac mini. Music plays, but screen is grey, flickery or has some lines depending which screen mode you select. Unless there's some very specific screen mode I should select, I didn't test all which it gives on the requester at start.

    But OTOH it gave to log something like this too:
    W3D_DrawArray: VertexPointer is NULL!
    Unsupported colormodel for SetRGBValue (140)

    Log got flooded with that VertexPointer null line.
  • »17.12.13 - 10:29
    Profile Visit Website
  • Caterpillar
    Caterpillar
    Posts: 33 from 2013/6/20
    Thanks jPV

    Same for me W3D_DrawArray() draw nothing because OS4_W3D_InterleavedArray() (a v5 function) is never called so the Vertex-array pointer is never set

    If is set the Wazp3D debugger then I can see that Crisot's demo works fine but draw nothing because some warp3d functions are not called : those are the v5 functions

    Alain
  • »17.12.13 - 12:58
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    _ThEcRoW
    Posts: 298 from 2008/10/27
    Is possible to add those v5 functions, or are not public?
    Mac Mini G4 1,4ghz 1gb ram & MorphOS 3.11
  • »17.12.13 - 14:34
    Profile