Revision 128
controller implemented
lab5/graphics.c | ||
---|---|---|
59 | 59 |
|
60 | 60 |
VbeInfoBlock *virtual_addr = lm_alloc(sizeof(VbeInfoBlock), &controller_map); |
61 | 61 |
|
62 |
uint32_t virtual_base = (uint32_t)(virtual_addr) - controller_map.phys; |
|
63 |
|
|
62 | 64 |
virtual_addr->VbeSignature[0] = 'V'; |
63 | 65 |
virtual_addr->VbeSignature[1] = 'B'; |
64 | 66 |
virtual_addr->VbeSignature[2] = 'E'; |
... | ... | |
95 | 97 |
|
96 | 98 |
// Convert Far Far Pointer to Virtual Address |
97 | 99 |
|
98 |
//uint32_t phys_ptr = FAR2PHYS(virtual_addr->OemStringPtr); |
|
100 |
uint32_t phys_ptr = FAR2PHYS(virtual_addr->OemStringPtr); |
|
101 |
uint32_t virtual_ptr = phys_ptr + virtual_base; |
|
102 |
info_p->OEMString = (char*)(virtual_ptr); |
|
99 | 103 |
|
104 |
phys_ptr = FAR2PHYS(virtual_addr->VideoModePtr); |
|
105 |
virtual_ptr = phys_ptr + virtual_base; |
|
106 |
info_p->VideoModeList = (uint16_t*)(virtual_ptr); |
|
100 | 107 |
|
108 |
phys_ptr = FAR2PHYS(virtual_addr->OemVendorNamePtr); |
|
109 |
virtual_ptr = phys_ptr + virtual_base; |
|
110 |
info_p->OEMVendorNamePtr = (char*)(virtual_ptr); |
|
101 | 111 |
|
112 |
phys_ptr = FAR2PHYS(virtual_addr->OemProductNamePtr); |
|
113 |
virtual_ptr = phys_ptr + virtual_base; |
|
114 |
info_p->OEMProductNamePtr = (char*)(virtual_ptr); |
|
102 | 115 |
|
116 |
phys_ptr = FAR2PHYS(virtual_addr->OemProductRevPtr); |
|
117 |
virtual_ptr = phys_ptr + virtual_base; |
|
118 |
info_p->OEMProductRevPtr = (char*)(virtual_ptr); |
|
103 | 119 |
|
120 |
lm_free(&controller_map); |
|
104 | 121 |
|
105 | 122 |
|
123 |
|
|
124 |
|
|
106 | 125 |
return SUCCESS; |
107 | 126 |
} |
108 | 127 |
|
lab5/graphics_macros.h | ||
---|---|---|
22 | 22 |
#define INDEXED_1024_768 0x105 |
23 | 23 |
#define DIRECT_640_480 0x110 |
24 | 24 |
#define DIRECT_800_600 0x115 |
25 |
#define DIRECT_1280_1024 0x11A
|
|
26 |
#define DIRECT_1152_864 0x14C
|
|
25 |
#define DIRECT_1280_1024_565 0x11A
|
|
26 |
#define DIRECT_1280_1024_888 0x11B
|
|
27 | 27 |
#define LINEAR_FRAME_BUFFER_MD BIT(14) |
28 | 28 |
|
29 | 29 |
#endif /* end of include guard: GRAPHICS_MACROS_H_INCLUDED */ |
lab5/lab5.c | ||
---|---|---|
13 | 13 |
#include "kbc_macros.h" |
14 | 14 |
#include "timer.h" |
15 | 15 |
|
16 |
#include "foxy.h" |
|
17 |
|
|
16 | 18 |
// Any header files included below this line should have been created by you |
17 | 19 |
|
18 | 20 |
int main(int argc, char *argv[]) { |
... | ... | |
70 | 72 |
printf("%s: lm_free failed\n", __func__); |
71 | 73 |
return 1; |
72 | 74 |
} |
73 |
|
|
74 | 75 |
return 0; |
75 | 76 |
} |
76 | 77 |
|
... | ... | |
471 | 472 |
|
472 | 473 |
int(video_test_controller)() { |
473 | 474 |
|
475 |
vg_vbe_contr_info_t cntrl_info; |
|
474 | 476 |
|
477 |
vbe_get_controller_information(&cntrl_info); |
|
475 | 478 |
|
476 |
return 1; |
|
479 |
vg_display_vbe_contr_info(&cntrl_info); |
|
480 |
|
|
481 |
return 0; |
|
477 | 482 |
} |
lab5/sprite.c | ||
---|---|---|
13 | 13 |
sprite_t* sprite_ctor(const xpm_map_t xpm){ |
14 | 14 |
sprite_t *ret = (sprite_t*)malloc(sizeof(sprite_t)); |
15 | 15 |
if(ret == NULL) return NULL; |
16 |
enum xpm_image_type type = XPM_INDEXED;
|
|
16 |
enum xpm_image_type type = XPM_8_8_8;
|
|
17 | 17 |
xpm_image_t img; |
18 | 18 |
ret->map = xpm_load(xpm, type, &img); |
19 | 19 |
if(ret->map == NULL){ |
Also available in: Unified diff