1; void sp1_ChangeSprType(struct sp1_cs *c, void *drawf)
2; 03.2006 aralbrec, Sprite Pack v3.0
3; sinclair spectrum version
4
5SECTION code_clib
6SECTION code_temp_sp1
7
8PUBLIC asm_sp1_ChangeSprType
9
10asm_sp1_ChangeSprType:
11
12; Change the type of a sprite char struct so that it draws using
13; a different draw function.  If the occluding flag is changed,
14; make sure the sprite char struct is off screen before calling.
15;
16; enter : hl = struct sp1_cs *
17;         de = address of sprite draw function
18; uses  : af, bc, de, hl
19
20   ld bc,10
21   add hl,bc
22   ex de,hl              ; de = & struct sp1_CS.draw_code, hl = & draw function
23   ld bc,-10
24   add hl,bc             ; hl = & draw function data
25
26   ldi                   ; copy draw code into struct sp1_cs.draw_code
27   inc hl                ; but skip over graphic pointers
28   inc hl
29   inc de
30   inc de
31   ldi
32   ldi
33   inc hl
34   inc hl
35   inc de
36   inc de
37   ldi
38   ldi
39   ldi
40
41   ret
42