Subversion Repositories Kolibri OS

Rev

Rev 2349 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2349 Rev 2415
Line 2... Line 2...
2
#include 
2
#include 
3
#include 
3
#include 
4
#include 
4
#include 
5
#include 
5
#include 
6
#include 
6
#include 
-
 
7
#include 
7
#include "fplay.h"
8
#include "fplay.h"
Line 8... Line 9...
8
 
9
 
Line 9... Line 10...
9
#define DISPLAY_VERSION     0x0200     /*      2.00     */
10
#define DISPLAY_VERSION     0x0200     /*      2.00     */
10
 
11
 
Line 11... Line 12...
11
#define SRV_GETVERSION       0
12
#define SRV_GETVERSION       0
-
 
13
#define SRV_GET_CAPS         3
-
 
14
 
12
#define SRV_GET_CAPS         3
15
#define SRV_CREATE_SURFACE  10
Line 13... Line 16...
13
 
16
#define SRV_LOCK_SURFACE    12
14
#define SRV_CREATE_SURFACE  10
17
 
Line 193... Line 196...
193
    printf("Cannot alloc frame buffer\n\r");
196
    printf("Cannot alloc frame buffer\n\r");
Line 194... Line 197...
194
 
197
 
195
    return -1;
198
    return -1;
Line -... Line 199...
-
 
199
};
-
 
200
 
-
 
201
int lock_bitmap(bitmap_t *bitmap)
-
 
202
{
-
 
203
 //    __asm__ __volatile__("int3");
-
 
204
 
-
 
205
    if( blit_caps & HW_BIT_BLIT )
-
 
206
    {
-
 
207
        struct __attribute__((packed))  /*     SRV_CREATE_SURFACE    */
-
 
208
        {
-
 
209
            uint32_t  handle;           // ignored
-
 
210
            void      *data;            // ignored
-
 
211
 
-
 
212
            uint32_t  width;
-
 
213
            uint32_t  height;
-
 
214
            uint32_t  pitch;            // ignored
-
 
215
 
-
 
216
        }io_12;
-
 
217
 
-
 
218
        ioctl_t io;
-
 
219
        int     err;
-
 
220
 
-
 
221
        io_12.handle  = bitmap->handle;
-
 
222
        io_12.pitch   = 0;
-
 
223
        io_12.data    = 0;
-
 
224
 
-
 
225
        io.handle   = service;
-
 
226
        io.io_code  = SRV_LOCK_SURFACE;
-
 
227
        io.input    = &io_12;
-
 
228
        io.inp_size = BUFFER_SIZE(5);
-
 
229
        io.output   = NULL;
-
 
230
        io.out_size = 0;
-
 
231
 
-
 
232
        err = call_service(&io);
-
 
233
        if(err==0)
-
 
234
        {
-
 
235
            bitmap->pitch  = io_12.pitch;
-
 
236
            bitmap->data   = io_12.data;
-
 
237
//            printf("Lock hardware surface %x pitch %d, buffer %x\n",
-
 
238
//                     bitmap->handle, bitmap->pitch, bitmap->data);
-
 
239
            return 0;
-
 
240
        };
-
 
241
        return err;
-
 
242
    };
-
 
243
 
-
 
244
    return 0;
196
};
245
};
197
 
246
 
198
struct blit_call
247
struct blit_call
199
{
248
{
200
    int dstx;
249
    int dstx;
Line 278... Line 327...
278
    bc.bitmap = bitmap->data;
327
    bc.bitmap = bitmap->data;
Line 279... Line 328...
279
 
328
 
280
    __asm__ __volatile__(
329
    __asm__ __volatile__(
281
    "int $0x40"
330
    "int $0x40"
-
 
331
    ::"a"(73),"b"(0),"c"(&bc));
-
 
332
    
282
    ::"a"(73),"b"(0),"c"(&bc));
333
    return 0;
Line 283... Line 334...
283
};
334
};
284
 
335