Home | Forums | What's new | Resources | |
VDP1 sprites priority |
paul_met - Jul 20, 2019 |
1 | 2 | Next> |
antime | Jul 20, 2019 | |||
Transparency depends on the pixel data in the VDP1 frame buffer, and how VDP2 is configured to interpret it. By setting the CMDCOLR word of the sprite drawing command, you can select different priority and color calculation settings for each sprite. Chapter 9 of the VDP2 manual explains it, but it's not the easiest read. This thread... also discussed sprite modes and color banks. |
paul_met | Jul 20, 2019 | |||||
I can not figure out how to do it. Need to put a breakpoint at 25C00006? But it does not give any effect. |
mrkotfw | Aug 11, 2019 | |||
Identify the command table that corresponds to the in-game characters. In the word that @antime... described, it should tell you whether it's actual color bank code, or a CLUT which could contain color bank codes. From that, find what sprite type the VDP2 is set to. From there you can figure out which bits correspond to what in the color bank code. You won't see the effect outright. The effect is done, I believe when the VDP2 merges the result frame buffer from the VDP1. |
mrkotfw | Jun 10, 2020 | |||
It's confusing, really. The priority bits in the color bank code (VDP1) is an index into the sprite register priority (VDP2). So let's say you set sprite register #0 to be 7, sprite register #5 to be 2. In your VDP1 command table, if your priority bit(s) is 0, then your sprite will have a priority of 7. If you set the priority bit(s) to be 5, then your sprite will have a priority of 2. I think you need to allocate a sprite register for what you don't want to be translucent, and another for sprites that you do want translucent. @fafling... can probably correct me if I'm wrong here. |
TrekkiesUnite118 | Jun 10, 2020 | |||
Looks like it also made the Health bars translucent. |
fafling | Jun 10, 2020 | |||
@mrkotfw... The priority bits indirection may be confusing, but it allows to use any of the 8 priority numbers even when there are less than 3 priority bits in the sprite type. @paul_met... Like antime said, for sprites with palette textures, the priority bits are set by the color bank parameter of the VDP1 drawing command (contained by the CMDCOLR word of the command). The priority bits position in the color bank word are given by the sprite type structure described in chapter 9 "Sprite data" of VDP2 manual. The sprite type is how VDP2 parses framebuffer pixels that it receives from VDP1. During the dialog with Death :
|
paul_met | Jun 11, 2020 | |||
Now it became clear why the palette banks are duplicated. Thank you. PS: I wonder why the game developers did not make the background of the dialog box translucent initially? |
TrekkiesUnite118 | Jun 11, 2020 | |||
Yeah, that could be it. Though at the same time they could have drawn the text box with VDP2 and the text with VDP1 instead and everything would have been fine. |
paul_met | Jun 11, 2020 | |||||
But Treasure was not embarrassed by the fact that no other sprites were displayed over Nicole's translucent cloak (Guardian Heroes, I mean). |
paul_met | Jun 11, 2020 | |||
So, after activating the Half-transparent bits of the sprite, "alucard legs" appeared. |
fafling | Jun 11, 2020 | |||
You'll have to check how it displays on the console, cause you're using half-transparency over a palette texture which is undocumented. I'm not sure that your screenshot shows the correct mix of palette codes with RGB pixels of the framebuffer, compounded with the color bank that's supposed to make VDP2 blend the result with the background. |
paul_met | Jun 11, 2020 | |||||
Yes, this combination of translucency does not work on mednafen and SSF. I think that it will not work on the original hardware either. |
TrekkiesUnite118 | Jun 11, 2020 | |||
If you have a build for it I can try it later tonight for you. I found with Grandia that just about all the Saturn Emulators are fudging VDP2 in some way or another, so who knows which emulator is accurate there. I'm still guessing it wont work but you never know. If it doesn't though, I think the only way you'll really fix those is by having them render to VDP2 like what Grandia does so it's text boxes can be transparent. Though the first go with it erasing other sprites might be ok to use for things like the item pickup boxes and enemy name boxes that show up in the lower part of the screen since I'd imagine you'd rarely have an issue of it erasing things for a long enough time for it to be noticeable. |
paul_met | Jun 11, 2020 | |||||
I attached the file. Insert it into the image of the original game using the CDMage utility. Translucency will only work in the scene of a meeting with death (as shown in the screenshot above). |
TrekkiesUnite118 | Jun 11, 2020 | |||
On real hardware it looks like you get the same issue as before with Alucard's feet disappearing. |
1 | 2 | Next> |