• Rise from your gwave!

Swap VDP2 layers

Discussion in 'Saturn Dev' started by paul_met, Dec 27, 2016.

  1. paul_met

    paul_met New Member

    Does anyone know how to swap layers of vdp2? For example, we have a title screen, where NBG2 layer is responsible for the background image, and NBG1 layer is responsible for the logo. I want to do opposite - NBG2 layer a became a logo and NBG1 layer became background image. How do the images are relating for certain layers of VDP2 generally? I do not find anything similar information in VDP2 documentation.
  2. vbt

    vbt Staff Member

    you can change priorities instead of swapping layers
  3. paul_met

    paul_met New Member

    I know about this, but the priority in my case is not suitable. Swapping layers required in order to do that I needed a scalable layer.
  4. vbt

    vbt Staff Member

    then you must swap nbg config and modify cycle patterns, also depending on lyers you can't do the same thing, nbg0 & nbg1 support more stuff.

    on sbl it looks like this :

    Uint16 CycleTb[]={
    0x1f56, 0xffff, //A0
    0xffff, 0xffff, //A1
    0xf5f2,0x4eff, //B0
    0xffff, 0xffff //B1
    // 0x4eff, 0x1fff, //B1
    SclConfig scfg;

    // 3 nbg
    scfg.dispenbl = ON;
    scfg.charsize = SCL_CHAR_SIZE_1X1;//OK du 1*1 surtout pas toucher
    scfg.pnamesize = SCL_PN2WORD; //2word
    scfg.platesize = SCL_PL_SIZE_1X1; // ou 2X2 ?
    scfg.coltype = SCL_COL_TYPE_16;//SCL_COL_TYPE_256;
    scfg.datatype = SCL_CELL;
    scfg.flip = SCL_PN_10BIT; // on force à 0
    scfg.plate_addr[0] = (Uint32)SS_MAP2;
    scfg.plate_addr[1] = 0x00;
    SCL_SetConfig(SCL_NBG1, &scfg);
    // 3 nbg
    scfg.platesize = SCL_PL_SIZE_2X2; // ou 2X2 ?
    scfg.plate_addr[0] = (Uint32)SS_MAP;
    scfg.plate_addr[1] = (Uint32)SS_MAP;
    scfg.plate_addr[2] = (Uint32)SS_MAP;
    scfg.plate_addr[3] = (Uint32)SS_MAP;

    SCL_SetConfig(SCL_NBG2, &scfg);

Share This Page