2 An issue in handling register arguments of asm functions with __preserves_regs specification.
7 #pragma disable_warning 85
9 typedef struct tSpriteStruct
{
14 SpriteStruct sprites
[2];
16 #if (defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_z80n)) && __SDCCCALL == 1
17 signed char SMS_addSprite (unsigned int y
, unsigned int x_tile
) __naked
__preserves_regs(d
,e
,iyh
,iyl
) __sdcccall(1) {
23 #elif defined(__SDCC_sm83) && __SDCCCALL == 1
24 signed char SMS_addSprite (unsigned int y
, unsigned int x_tile
) __naked
__preserves_regs(d
,e
,iyh
,iyl
) __sdcccall(1) {
31 signed char SMS_addSprite (unsigned int y
, unsigned int x_tile
) {
37 sprites
[0].handle
= SMS_addSprite(0, 0);
38 sprites
[1].handle
= SMS_addSprite(0, 0);
43 sprites
[0].handle
= -1;
44 sprites
[1].handle
= -1;
46 ASSERT (sprites
[0].handle
== 0);
47 ASSERT (sprites
[1].handle
== 0);