1

Hi,

I would like to manage the display of sprites based on their position in Y.

I know that there is a draw list when we initializes sprites and displayed on each other.

I searched the forum but I have not seen any answers, unless I do not use the right words.

yorder10.png
Like the picture, I would like the sprite having a smaller Y appears behind.
I use datlib of Hpman. Does anyone can tell me the address of that list and if we can change the order ?

thank you

2

Hi, as far as I know the sprite priority is is determined by the sprite number only (sprite #1 has the lowest priority and sprite #381 the highest priority).

3

Fine, you're right smile

What I would like is to find a way to change the sprite number every frame. Like a Z-Order, if it's possible.

I think the Sprite Number is in SCB1. But can we exchange places of 2 sprites, or do we need to recreate every frame two new sprites to have the correct priority ?

4

Hi,

it was possible to change the sprite numbers in the (old) original graphics library of the C Dev Kit of J.Kurtz - when I was working with it in the past, I have made animations
by changing the sprite numbers. This is one of the features I also miss in HPman's DATlib. (It was quite fast but not as fast as doing animations with DATlib.)

I have investigated a bit about your question with the "Shot Factory" of WinKawaks (tools > shot factory - there you can see which sprite number is active and which of them is used for a graphic in a given frame).
Metal Slug, for instance, indeed changes the sprite numbers to control the sprite priority, thats why I am thinking that recreating the graphics in multible "sprite slots" this is the way to go.

Sorry, I can't help you more - unfortunately, I only have a very minor knowledge of 68K assembler.

5

Thanks, I will look the orignal library and test the multislot option

6

Well, I try and make lot of test without good result. try one in C but too slow.

I will test with ASM.

Does anyone know where is the assembler code for the standard dev kit.

I searched but I found none. I just need to find inc_current_sprite function, get_current_sprite et set_current_sprite. After I will be able to use in the Datlib with ASM injection.

7

Tonma (./3) :
Fine, you're right smile

What I would like is to find a way to change the sprite number every frame. Like a Z-Order, if it's possible.
I think the Sprite Number is in SCB1. But can we exchange places of 2 sprites, or do we need to recreate every frame two new sprites to have the correct priority ?


There's no order capabilities hardware wise, smaller spr # goes first and that's it. If you want to swap two characters you have to fully redraw both on new sprites.

You can change de basesprite # to reorder sprites using DatLib:
clearSprites(broDude.baseSprite,broDude.tileWidth); //clear used spr broDude.baseSprite = newSprNumber; //assign new # broDude.flags = 0x0002; //flag it as swapped, effectively triggering a full redraw for this sprite, on the new position

The trick is off the book but should work.

You might end up with too much drawing commands to fit vblank timing tho, depending of the complexity of the scene (intensive games like mslug use different drawing methods currently unavailable with DatLib).

8

Thank You,

I will use this method and do tests.

9

thks hpman,

it's works great ! without slow down.

You have thought when you have create your library, to have a property basesprite or flags for modification.

thanks
avatar

10

Thank you it works well. I just did a test to place the Guy between two others.

ffa10.png
ffb10.png

11

i like this boss, but twice, it's very hard to fight them ! grin

Tonma, i think but it's not important, to move the red guy to see the zorder, if Hpman is come back, we ll make a great game !

For the joke with watermelon, you can call this game "project team Z" ! like space cobra so for the fan of rugball !
avatar

12

I just did a mini test on video.

We can see zorder. I do it every frame, I should use a table to swap only when necessary.

13

Ha ha , final fight on neogeo ! I like it
avatar

14

Something's growing somewhere..

15

151010085019796492.png

embarrassed

16

17

BIG UP pour HPMAN eek