Hiding Sprites on MSX1

Par fabento

Supporter (6)

Portrait de fabento

18-10-2019, 19:45

A simple question for people who knows Basic, Assembly, C, Pascal, Logo, Cobol (or any other MSX programming language that I have forgotten). To make a test of hiding sprites behind two "text boxes" (one part up and one lower part on the screen), using 8 transparent sprites to create this "hiding" effect for the other 24 sprites behind these "text boxes". Is there another way to "hide" sprites behind characters in MSX1???

(video)
https://www.facebook.com/fabio.bento.52/videos/pcb.368486180...

!login ou Inscrivez-vous pour poster

Par fabento

Supporter (6)

Portrait de fabento

18-10-2019, 19:47

Par MsxKun

Paladin (924)

Portrait de MsxKun

18-10-2019, 19:59

Well no... but depends... maybe.
If you don't mind waste sprite definitions (and some cpu time), you can have sprites with deleted lines and check by coordinate if the sprite needs to change to that pattern or no.
Not very practical unless you have very few different sprite patterns (wich seems to be the case in the example, but maybe not in the final thing)

Par santiontanon

Paladin (847)

Portrait de santiontanon

19-10-2019, 03:54

Pretty much what MsxKun just said. You only have 3 options that I can think of:
- Use 4 transparent sprites to hide the others
- Predefine sprites with lines missing and change patterns (what MsxKun was suggesting)
- Synthesize the sprites on the fly (i.e., have the sprite in RAM, rather than VRAM, and at each frame, you copy the necessary lines to the VDP, and leave the other ones at 0)

Par akumajo

Resident (37)

Portrait de akumajo

19-10-2019, 08:11

Maybe an other solution ;
- use other sprite(s) with "higher" priority (with lower number id) and put them on the lines you want to hide "visible" sprites. Put theses dummy sprites outside the screen area, on the left, using the -32 pix offset.
Don't try, don't know if it works, but I've thought about it...

Par NYYRIKKI

Enlighted (5399)

Portrait de NYYRIKKI

19-10-2019, 09:22

santiontanon wrote:

Pretty much what MsxKun just said. You only have 3 options that I can think of:
- Use 4 transparent sprites to hide the others
- Predefine sprites with lines missing and change patterns (what MsxKun was suggesting)
- Synthesize the sprites on the fly (i.e., have the sprite in RAM, rather than VRAM, and at each frame, you copy the necessary lines to the VDP, and leave the other ones at 0)

For completeness sake, there is actually 4th option called "sprite split", but I can hardly think it is useful in this kind of case... It is a variation of the original method, but the order of sprites is not that important as long as you know what is the 5th sprite. The Idea is that you use CPU to poll the exact moment when VDP notices the 5th sprite on line and then you immediately switch the sprite attribute table to different address in VRAM. This makes the sprites of the first attribute table to disappear on that exact line and make the other set to appear... Naturally you need to do this two times on a screen draw to swap the other sprites back at later state... Due to speed requirement and exact timing this can be done only with machine language.