procedure player_sprite0_0();
begin
asm ("
  ld de, $20
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $0a
 ld [iy+1],a
 ld a,[ix+2] 
 or $a0
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $29
 ld [iy+1],a
 ld a,[ix+2] 
 or $98
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $0a
 ld [iy+1],a
 ld a,[ix+2] 
 or $a0
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $22
 ld [iy+1],a
 ld a,[ix+2] 
 or $88
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
");
end;
procedure player_sprite0_1();
begin
asm ("
  ld de, $20
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $02
 ld [iy+1],a
 ld a,[ix+2] 
 or $a8
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $0a
 ld [iy+1],a
 ld a,[ix+2] 
 or $66
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $02
 ld [iy+1],a
 ld a,[ix+2] 
 or $a8
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $08
 ld [iy+1],a
 ld a,[ix+2] 
 or $a2
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
");
end;
procedure player_sprite0_2();
begin
asm ("
  ld de, $20
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 or $aa
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $02
 ld [iy+1],a
 ld a,[ix+2] 
 or $99
 ld [iy+2],a
 ld a,[ix+3] 
 or $80
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 or $aa
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 or $02
 ld [iy+1],a
 ld a,[ix+2] 
 or $28
 ld [iy+2],a
 ld a,[ix+3] 
 or $80
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
");
end;
procedure player_sprite0_3();
begin
asm ("
  ld de, $20
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 or $2a
 ld [iy+2],a
 ld a,[ix+3] 
 or $80
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 or $a6
 ld [iy+2],a
 ld a,[ix+3] 
 or $60
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 or $2a
 ld [iy+2],a
 ld a,[ix+3] 
 or $80
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 or $8a
 ld [iy+2],a
 ld a,[ix+3] 
 or $20
 ld [iy+3],a
  add iy,de
  add ix,de
 ld a,[ix+0] 
 ld [iy+0],a
 ld a,[ix+1] 
 ld [iy+1],a
 ld a,[ix+2] 
 ld [iy+2],a
 ld a,[ix+3] 
 ld [iy+3],a
  add iy,de
  add ix,de
");
end;
var player_sprite0_pi : integer;
var player_sprite0_buf : integer;
@donotremove player_sprite0_dst 
procedure player_sprite0(player_sprite0_src,player_sprite0_dst : pointer; player_sprite0px,player_sprite0py : byte);
begin
  player_sprite0_pi:=player_sprite0_dst + player_sprite0py<<5 + player_sprite0px>>2;
  player_sprite0_buf:=#buf + player_sprite0py<<5 + player_sprite0px>>2;
asm("  ld ix, [player_sprite0_buf] 
  ld iy, [player_sprite0_pi]
");
 player_sprite0px:=player_sprite0px&3;
 if (player_sprite0px=0) then player_sprite0_0();
 if (player_sprite0px=1) then player_sprite0_1();
 if (player_sprite0px=2) then player_sprite0_2();
 if (player_sprite0px=3) then player_sprite0_3();
end;
