94
|
1 #ifndef INCLUDED_TASK_SPU_DRAW
|
|
2 #define INCLUDED_TASK_SPU_DRAW
|
|
3
|
|
4 #ifndef INCLUDED_SCHED_TASK
|
|
5 # include "SchedTask.h"
|
|
6 #endif
|
|
7
|
105
|
8 //#define IMG_MAX_X 1920
|
|
9 #define IMG_MAX_X 640
|
94
|
10
|
|
11 #ifndef NULL
|
99
|
12 # define NULL (0)
|
94
|
13 #endif
|
|
14
|
|
15 typedef int8_t Sint8;
|
|
16 typedef uint8_t Uint8;
|
|
17 typedef int16_t Sint16;
|
|
18 typedef uint16_t Uint16;
|
|
19 typedef int32_t Sint32;
|
|
20 typedef uint32_t Uint32;
|
99
|
21 typedef unsigned short GLushort;
|
94
|
22
|
102
|
23 #if 0
|
94
|
24 typedef struct{
|
|
25 Uint8 r;
|
|
26 Uint8 g;
|
|
27 Uint8 b;
|
|
28 Uint8 unused;
|
|
29 } SDL_Color;
|
|
30
|
|
31 typedef struct{
|
|
32 int ncolors;
|
|
33 SDL_Color *colors;
|
|
34 } SDL_Palette;
|
|
35
|
|
36 typedef struct{
|
|
37 SDL_Palette *palette;
|
|
38 Uint8 BitsPerPixel;
|
|
39 Uint8 BytesPerPixel;
|
|
40 Uint32 Rmask, Gmask, Bmask, Amask;
|
|
41 Uint8 Rshift, Gshift, Bshift, Ashift;
|
|
42 Uint8 Rloss, Gloss, Bloss, Aloss;
|
|
43 Uint32 colorkey;
|
|
44 Uint8 alpha;
|
|
45 } SDL_PixelFormat;
|
102
|
46 #endif
|
94
|
47
|
|
48 class SpuDraw : public SchedTask {
|
|
49 public:
|
|
50 SpuDraw(TaskListPtr _tlist, TaskPtr _task,
|
|
51 void* _rbuf, void* _wbuf, DmaManager* _con)
|
|
52 :SchedTask(_tlist, _task, _rbuf, _wbuf, _con) {}
|
|
53
|
|
54 ~SpuDraw(void);
|
|
55
|
99
|
56 int *linebuf;
|
|
57 float *zRow;
|
102
|
58 unsigned int dma_tags;
|
|
59
|
94
|
60 int run(void *readbuf, void *writebuf);
|
105
|
61 void write(void);
|
94
|
62
|
|
63 private:
|
|
64 void zRow_init(void);
|
|
65 void linebuf_init(void);
|
102
|
66 void writebuffer(unsigned int fbdev_addr, int y);
|
94
|
67
|
|
68 char* get_pixel(int tx, int ty, void *texture_image);
|
|
69 Uint32 get_rgb(int tx, int ty, void *texture);
|
102
|
70 //Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b);
|
|
71 //Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b);
|
94
|
72 };
|
|
73
|
|
74 #endif
|