about tile priority and colors

vbt

Staff member
i have some troubles with emulation on saturn and i think it can be solved.

on some games tiles from the same layer(map) have a priority over sprites.
normally it's possible to do the same on saturn but i didn't find the good way. does someone knows how to do that ?

another boring thing is transparent color. if i enable transparency when i allocate color for a layer, there is always transparency, on some cases it should not be transparent (it dépends on palette in fact). is possible to enable/disable transparency in the tile attributes ?

good examples are vigilante and ghost n goblins

on vigilante titles it uses 2 palettes, on with black as transparent, another palette with black visible with maybe not same tile.
if i disable transparency i don't see the background, on the other case, i see the complete background (it should be in a window)

about priorities, sprites must be behind tires.

see pictures attached

[attachment=4410][attachment=4412][attachment=4413]
 

Attachments

  • vigilante1.png
    vigilante1.png
    72.7 KB · Views: 77
  • vigilante2.png
    vigilante2.png
    72.2 KB · Views: 72
  • vigilante4.png
    vigilante4.png
    60.3 KB · Views: 77
about priority, surix helped me :
special priority bit must be used, in order to work :

- sprites and nbg must have same priority (sprite will be displayed over tiles)
- special priority mode must be set to 1
- set 1 to SP in the cell

SS_SET_S0PRIN(4); // sprite priority
SS_SET_N0PRIN(4); // nbg priority
SS_SET_N0SPRM(1); // 1 for special priority

map[0] = map[0x2000] = Colour + 0x2000; // 0x2000 sets the special priority bit
map[1] = map[0x2001] = Tile;

about color transparency, some help of Guillaume(yabause) but not yet working as expected (or yabause supports modes partially). i can't test on saturn. so it could be done with special color calculation. to set it up :

- color calculation ratio mode bit set to 0
- color calculation mode bit set to 0
- enable color calculation
- set color calculation mode to 1 or 2 (by tile or dot)
- set color calculation ration 0 to 31 (31 = transparent)
- set special code to ??? 1 maybe (if using mode 2)
- set special code selection to a color number 0 ??? (if using mode 2)
- special code values are unclear in the doc
- set 1 to CC in the cell

SS_SET_CCRTMD(0); // color calc ratio mode bit
SS_SET_CCMD(0); // color calc mode bit

SS_SET_N0CCEN(1); // color calc enable
SS_SET_N0SCCM(2); // color calc mode 1 on tile, 2 by dot, 3 color data with msb
SS_SET_N0CCRT(10); // color calc ratio

ss_regs->specialcode=1; // 1 for mode 2
ss_regs->specialcode_sel=0;

map[0] = map[0x2000] = Colour + 0x1000; // 0x1000 sets the special color calculation
map[1] = map[0x2001] = Tile;

on yabause mode 1,2 &3 give same result maybe my setup is wrong, i thought the mode 2 (by dot) would set transparency only to the dots with color 0

[attachment=4414][attachment=4415][attachment=4416]
 

Attachments

  • 1.png
    1.png
    46.3 KB · Views: 132
  • 2.png
    2.png
    60.3 KB · Views: 143
  • 3.png
    3.png
    66.3 KB · Views: 123
correct transparency on ssf (on dot)

SS_SET_CCRTMD(0); // color calc ratio mode bit
SS_SET_CCMD(0); // color calc mode bit

SS_SET_N0CCEN(1); // color calc enable
SS_SET_N0SCCM(2); // color calc mode 1 on tile, 2 by dot, 3 color data with msb
SS_SET_N0CCRT(31); // color calc ratio

ss_regs->specialcode=0x0001; // sfcode, upper 8bits, function b, lower 8bits function a
// 1=> transparency applied on color 0 & 1
ss_regs->specialcode_sel=0; // sfsel, bit 0 for nbg0 // 1 sfcs, bit 0 = 1 for funcion code b, 0 for function code a

[attachment=4420]
 

Attachments

  • vigil.jpg
    vigil.jpg
    95.3 KB · Views: 74
well, i give up with that game, now it's working well in yabause. Thanks to Guillaume (Yabause team) who has fixed color calculaton mode 2 emulation in yabause =)
vigilante runs correctly without sound but looses lot of speed with ym2151 emulation. also sound support is partially working.
 

Attachments

  • vigil.jpg
    vigil.jpg
    83.3 KB · Views: 64
Back
Top