Subversion Repositories Kolibri OS

Rev

Rev 808 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
808 serge 1
 
2
3
 
4
{
5
  void *img;
6
7
 
8
9
 
818 serge 10
    return 0;
808 serge 11
  dbgprintf("create object at %x\n", cursor);
12
13
 
14
  cursor->destroy = __destroy_cursor;
15
16
 
17
  if(img==NULL)
818 serge 18
    goto cleanup;
808 serge 19
20
 
21
  dbgprintf("offset %x\n", img-rhd.FbBase);
22
  cursor->base=img;
23
24
 
25
    cursor->hot_x = (u8)(flags>>24);
26
    cursor->hot_y = (u8)(flags>>16);
27
    asm __volatile__
28
    (
29
      "cld \n\t"
30
      "rep stosl"
31
      :
32
      :"a"(0),"c"(64*64),"D"(img)
33
    );
34
    asm __volatile__
35
    (
36
  "1: "
37
      "movl $32, %%ecx \n\t"
38
      "rep stosl \n\t"
39
      "addl $128, %%edi \n\t"
40
      "decl %%ebx \n\t"
41
      "jnz 1b"
42
      :
43
      :"b"(32),"S"(src),"D"(img)
44
    );
45
  }
46
  else {
47
    cursor->hot_x = *(u16*)((char*)src+10);
48
    cursor->hot_y = *(u16*)((char*)src+12);
49
    copy_cursor(img, src);
50
    dbgprintf("cursor loaded\n");
51
  }
52
  return cursor;
53
cleanup:
54
  DestroyObject(cursor);
55
  return NULL;
56
};
57
58
 
59
{
60
  if(cursor->base)
61
    rhd_mem_free(&rhd,RHD_MEM_FB,cursor->base);
62
  DestroyObject(cursor);
63
}
64
65
 
66
{
67
  CARD32 base;
68
69
 
70
  asm __volatile__
71
  (
72
    "cli"
73
  );
74
  OUTREG (D1CUR_SURFACE_ADDRESS, rhd.FbIntAddress+base);
75
  OUTREG (D1CUR_HOT_SPOT, (cursor->hot_x<<16)|(cursor->hot_y&0xFFFF));
76
  asm __volatile__
77
  (
78
    "sti"
79
  );
80
}
81
82
 
83
{
84
   CARD32 tmp = (x<<16)|(y & 0xFFFF) ;
85
86
 
87
   (
88
    "pushfl \n\t"
89
    "cli"
90
   );
91
92
 
93
   OUTREG(D1CUR_CONTROL, 0x301);
94
   asm __volatile__
95
   (
96
    "popfl"
97
   );
98
}
99
100
 
101
{};
102