109
|
1 #include <stdlib.h>
|
120
|
2 #include <string.h>
|
109
|
3 #include "Load_Texture.h"
|
120
|
4 #include "texture.h"
|
109
|
5 #include "Func.h"
|
|
6
|
|
7 /**
|
|
8 * 決めうちじゃなくて、
|
|
9 * create_task の時に param で渡せばおk
|
|
10 */
|
|
11 #define height 128
|
|
12 #define width 128
|
|
13
|
|
14 // byteperpixel = 3 width = 128 dma_height= 32
|
|
15 #define LOAD_SIZE 3*128*32
|
|
16 #define MAX_LOAD_SIZE 16384
|
|
17 #define USE_ARRAY 3
|
|
18
|
|
19 SchedDefineTask(LoadTexture);
|
|
20
|
|
21 int
|
|
22 LoadTexture::run(void *rbuf , void *wbuf)
|
|
23 {
|
120
|
24 int addr = smanager->get_param(0);
|
|
25 int addrNum = smanager->get_param(1);
|
|
26
|
|
27 void **addrList = (void**)smanager->get_input(0);
|
|
28 void **list = (void**)global_alloc(TEXTURE2_ID, addrNum*sizeof(void*));
|
|
29
|
|
30 memcpy(list, addrList, addrNum*sizeof(void*));
|
|
31
|
|
32 #if 0
|
109
|
33 //タスクからタスクを生成
|
|
34 TaskPtr task = create_task(TASK_SET_TEXTURE);
|
|
35
|
|
36 // 16kbyte づつ送ってる
|
|
37 task->add_inData(addr, MAX_LOAD_SIZE);
|
|
38 task->add_inData(addr + MAX_LOAD_SIZE, MAX_LOAD_SIZE);
|
|
39 task->add_inData(addr + MAX_LOAD_SIZE*2, MAX_LOAD_SIZE);
|
120
|
40 task->add_inData(addr + MAX_LOAD_SIZE*3, MAX_LOAD_SIZE);
|
109
|
41
|
|
42 wait_task(task);
|
120
|
43 #endif
|
|
44
|
109
|
45 return 0;
|
|
46 }
|