Hi folks,
I'm searching into the sp1_ss and sp1_cs where is stored the graphic pointer, but I can't find it.
*sp1_CreateSpr_callee(void *drawf, uchar type, uchar height, int graphic, uchar plane)
At first, I suspited would be in sp1_ss:
sp1_ss->frame // No, this is the frame address added
sp1_ss->e_offset // May be, effective offset to add to graphic pointers
...
And afer, I followed the track to the first sp1_cs:
sp1_ss->first->def // May be, graphic definition pointer
sp1_ss->first->l_def // May be, graphic definition pointer for sprite character to left of this one
Well, I've checked all this, but none of them has the address, which I input in the createSpr.
Could you help me with this issue?
References:
https://github.com/z88dk/z88dk/blob/mas ... trum-sp1.h
https://github.com/z88dk/z88dk/blob/mas ... callee.asm
sp1 - where is stored the graphic pointer
-
- Member
- Posts: 121
- Joined: Mon Mar 26, 2018 1:49 pm
There are two ways to use the sp1_CreateSpr() function, and they use that graphic value differently. The first, simple way is discussed in the getting started guide here:
https://github.com/z88dk/z88dk/blob/mas ... rites-code
The second approach is covered here:
https://github.com/z88dk/z88dk/blob/mas ... -animation
Which approach are you using?
https://github.com/z88dk/z88dk/blob/mas ... rites-code
The second approach is covered here:
https://github.com/z88dk/z88dk/blob/mas ... -animation
Which approach are you using?
Hi derekfountain,
For now, I don't see where you want to go. Anyway I respond you.
This is the code of my approach:
Of course it's a sprite with mask and 4 rows per 3 columns. I think it could fit with the 2 links that you mention.
The sprite works perfectly !!!
I want to know in which memory struct of the sp1 is stored the absolute address that I inputed in the sprite creation. Where does sp1 store this memory address "sprRat_adr+RAT_BLANK+RAT_COLOFF(0)" in form of 2bytes number ?
Best regards,
For now, I don't see where you want to go. Anyway I respond you.
This is the code of my approach:
Code: Select all
sprRat= sp1_CreateSpr( SP1_DRAW_MASK2LB, SP1_TYPE_2BYTE, 5, (uint16_t)sprRat_adr+RAT_BLANK+RAT_COLOFF(0), 0);
sp1_AddColSpr(sprRat, SP1_DRAW_MASK2, SP1_TYPE_2BYTE, (uint16_t)sprRat_adr+RAT_BLANK+RAT_COLOFF(1), 0);
sp1_AddColSpr(sprRat, SP1_DRAW_MASK2, SP1_TYPE_2BYTE, (uint16_t)sprRat_adr+RAT_BLANK+RAT_COLOFF(2), 0);
sp1_AddColSpr(sprRat, SP1_DRAW_MASK2RB, SP1_TYPE_2BYTE, 0, 0);
The sprite works perfectly !!!
I want to know in which memory struct of the sp1 is stored the absolute address that I inputed in the sprite creation. Where does sp1 store this memory address "sprRat_adr+RAT_BLANK+RAT_COLOFF(0)" in form of 2bytes number ?
Best regards,
Sorry , now I see the difference:
In the first approach you put the absolute address at the beginning. And in the sp1_MoveSprPix op you say the frame offset. This is my approach.
In the second you initialize to 0 and in the sp1_MoveSprPix op you put the final address directly. I haven't probe this option.
Is it correct?
In the first approach you put the absolute address at the beginning. And in the sp1_MoveSprPix op you say the frame offset. This is my approach.
In the second you initialize to 0 and in the sp1_MoveSprPix op you put the final address directly. I haven't probe this option.
Is it correct?
-
- Member
- Posts: 121
- Joined: Mon Mar 26, 2018 1:49 pm