As a default value,
Viewpoint position (X=screen horizontal size/2, Y=screen vertical size/2, Z=400)
Center point (X=screen horizontal size/2, Y=screen vertical size/2, Z=0)
It is set to
I think if you set the difference in the Z direction to 256, it will fit as the center.
please tell me in detail. For example, in a sprite function, if the distance between the viewpoint and the reference point is 2.0, what is the setting value?
If you tilt it backwards by rotating it on the X axis, it will momentarily disappear from the screen until it is perpendicular to the screen, and if you tilt it further, you will be able to see the back side. Is that so?
This phenomenon occurs when the viewpoint becomes parallel to the center point of the rotation plane. As a countermeasure to this problem, we recommend that you constantly check the angle between the viewpoint and the rotation plane, and if they become parallel, use the software to process it.
This can occur because the third bit (0) is ignored if types 0, 3, 4, 8 to F are set in the function SCL_SetSpriteMode, or if nothing is set.
When I added a check routine to SPR_2SetChar and looked into it, I found that even though there was still memory that could be allocated using allocBlock, a NULL pointer was being returned.
Also, since there is no need to change the library every time, could you please make it possible to return an error if a sprite cannot be secured with SPR_2SetChar from the next version update?
static Vaddr allocBlock( Uint16 size ){ NullBlock *memblk = nullBlockTop; NullBlock *prev = NULL; NullBlock *second_best = NULL; NullBlock *prev_second_best = NULL; Vaddr p = ( Vaddr )NULL; while( memblk != NULL ){ if( memblk-> size == size ) break; if( memblk-> size> size ){ if(( second_best == NULL ) ||(( second_best != NULL ) &&( memblk-> size< second_best-> size ))){ second_best = memblk; prev_second_best = prev; } } prev = memblk; memblk = memblk-> next; } if( memblk == NULL ){ memblk = second_best; prev = prev_second_best; } if( memblk != NULL ){ Uint32 blocksize; memblk-> size -= size; blocksize = ( Uint32 )memblk-> size*32; p = ( Vaddr )(( Uint32 )memblk + blocksize - ( Uint32 )VRAM ); if(( memblk-> size == 0 )&&( prev != NULL )) prev-> next = memblk-> next; } return p; }
In addition, Uint16 color corresponds to CMDCOLR (color control word) in the command table in actual hardware VDP1 operation.
CMDCOLR (color control word) is also used to specify the priority of the scroll surface.
For more information,
Details → VDP2 Manual Chapter 9 " Sprite Data " For example, in the case of sprite type 5, as you can see from Figure 9.1 of the VDP2 manual, there are 3 bits for priority (PR0 to PR2 in the figure), so there are 8 priority bits. It is possible to specify 'register' .
* Please note that the priority value is not directly specified.
Processing is performed by setting the priority bit.
The bit position changes depending on the sprite type used.
Please refer to Figure 9.1 in the VDP2 manual to determine which bits are the priority bits.
0100000100000000 = 0x4100 ||| ||| ||| +++----------Specify palette number 1 +++--------------Specify priority register 4
Initially, you can obtain more than 512 colors, but once you register, you cannot obtain more than 256 colors.
As a workaround, if you want to allocate a data area that exceeds 256 colors, call a function as 256 colors at the end of allocating and manage it independently.
Sprites usually use color data of 256 colors or more, so be sure to reserve the colors for sprites last.