Rev 6380 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6380 | Rev 6386 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include |
1 | #include |
2 | #include |
2 | #include |
3 | #include |
3 | #include |
4 | #include "SDL.h" |
4 | #include "SDL.h" |
5 | #include "SDL_error.h" |
5 | #include "SDL_error.h" |
6 | #include "SDL_video.h" |
6 | #include "SDL_video.h" |
7 | #include "SDL_mouse.h" |
7 | #include "SDL_mouse.h" |
8 | #include "SDL_sysvideo.h" |
8 | #include "SDL_sysvideo.h" |
9 | #include "SDL_pixels_c.h" |
9 | #include "SDL_pixels_c.h" |
10 | #include "SDL_events_c.h" |
10 | #include "SDL_events_c.h" |
11 | #include "SDL_menuetvideo.h" |
11 | #include "SDL_menuetvideo.h" |
12 | #include |
12 | #include |
Line 13... | Line -... | ||
13 | - | ||
14 | struct process_table_entry |
- | |
15 | { |
- | |
16 | uint32_t cpu_usage; |
- | |
17 | uint16_t pos_in_windowing_stack; |
- | |
18 | uint16_t win_stack_val_at_ecx; |
- | |
19 | uint16_t reserved1; |
- | |
20 | char name[12]; |
- | |
21 | uint32_t memstart; |
- | |
22 | uint32_t memused; |
- | |
23 | uint32_t pid; |
- | |
24 | uint32_t winx_start,winy_start; |
- | |
25 | uint32_t winx_size,winy_size; |
- | |
26 | uint16_t thread_state; |
- | |
27 | uint16_t reserved2; |
- | |
28 | uint32_t client_left,client_top,client_width,client_height; |
- | |
29 | uint8_t window_state; |
- | |
30 | uint8_t reserved3[1024-71]; |
- | |
31 | }; |
- | |
32 | 13 | ||
33 | static SDL_VideoDevice * vm_suf=NULL; |
14 | static SDL_VideoDevice * vm_suf=NULL; |
Line 34... | Line 15... | ||
34 | static int was_initialized=0; |
15 | static int was_initialized=0; |
35 | 16 | ||
Line 49... | Line 30... | ||
49 | static int IsStyle4Available=0; |
30 | static int IsStyle4Available=0; |
50 | #endif |
31 | #endif |
Line 51... | Line 32... | ||
51 | 32 | ||
52 | void MenuetOS_SDL_RepaintWnd(void) |
33 | void MenuetOS_SDL_RepaintWnd(void) |
53 | { |
34 | { |
54 | begin_draw(); |
35 | __menuet__window_redraw(1); |
- | 36 | __menuet__define_window(1,1,vm_suf->hidden->win_size_x+9,vm_suf->hidden->win_size_y+get_skinh()+4, |
|
- | 37 | #ifdef KEEP_OBSOLETE_STYLE3 |
|
- | 38 | IsStyle4Available?0x34000000:0x33000000 |
|
- | 39 | #else |
|
- | 40 | 0x34000000 |
|
- | 41 | #endif |
|
- | 42 | ,0,(int)vm_suf->hidden->__title); |
|
- | 43 | ||
Line 55... | Line 44... | ||
55 | sys_create_window(1,1,vm_suf->hidden->win_size_x+9,vm_suf->hidden->win_size_y+get_skinh()+4, (int)vm_suf->hidden->__title, 0x000000,0x34000000); |
44 | // __asm__ __volatile__("int3"); |
56 | 45 | ||
57 | if(vm_suf && vm_suf->hidden->__video_buffer) |
46 | if(vm_suf && vm_suf->hidden->__video_buffer) |
58 | put_image(1,1, |
47 | __menuet__putimage(0,0, |
59 | vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y, |
- | |
60 | vm_suf->hidden->__video_buffer); |
48 | vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y, |
61 | 49 | vm_suf->hidden->__video_buffer); |
|
Line 62... | Line 50... | ||
62 | end_draw(); |
50 | __menuet__window_redraw(2); |
63 | } |
51 | } |
64 | 52 | ||
Line 82... | Line 70... | ||
82 | 70 | ||
83 | static void MenuetOS_DirectUpdate(_THIS,int numrects,SDL_Rect * rects) |
71 | static void MenuetOS_DirectUpdate(_THIS,int numrects,SDL_Rect * rects) |
84 | { |
72 | { |
85 | if(numrects) |
73 | if(numrects) |
86 | { |
74 | { |
87 | put_image(1,1, |
75 | __menuet__putimage(0,0, |
88 | vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y, |
76 | vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y, |
89 | this->hidden->__video_buffer); |
77 | this->hidden->__video_buffer); |
90 | } |
78 | } |
Line 121... | Line 109... | ||
121 | if(bpp!=24) return NULL; |
109 | if(bpp!=24) return NULL; |
122 | current->flags=flags; |
110 | current->flags=flags; |
123 | current->w=width; |
111 | current->w=width; |
124 | current->h=height; |
112 | current->h=height; |
125 | current->pitch=width*(bpp>>3); |
113 | current->pitch=width*(bpp>>3); |
- | 114 | ||
- | 115 | char info[100]; |
|
- | 116 | sprintf(info, "width = %d, height = %d, pitch = %d, bpp = %d\n", current->w, current->h, current->pitch, bpp); |
|
- | 117 | ||
- | 118 | void debug_board_write_byte(const char ch){ |
|
- | 119 | __asm__ __volatile__( |
|
- | 120 | "int $0x40" |
|
- | 121 | : |
|
- | 122 | :"a"(63), "b"(1), "c"(ch)); |
|
- | 123 | } |
|
- | 124 | ||
- | 125 | void debug_board_write_str(const char* str){ |
|
- | 126 | while(*str) |
|
- | 127 | debug_board_write_byte(*str++); |
|
- | 128 | } |
|
- | 129 | ||
- | 130 | debug_board_write_str(info); |
|
- | 131 | // __asm__ __volatile__("int3"); |
|
- | 132 | ||
126 | current->pixels=this->hidden->__video_buffer=realloc(this->hidden->__video_buffer, |
133 | current->pixels=this->hidden->__video_buffer=realloc(this->hidden->__video_buffer, |
127 | current->pitch*current->h); |
134 | current->pitch*current->h); |
128 | this->hidden->__lines=(unsigned char **)realloc(this->hidden->__lines, |
135 | this->hidden->__lines=(unsigned char **)realloc(this->hidden->__lines, |
129 | sizeof(unsigned char *)*current->h); |
136 | sizeof(unsigned char *)*current->h); |
- | 137 | ||
130 | for(ly=0,lx=current->pixels;ly |
138 | for(ly=0,lx=current->pixels;ly |
131 | this->hidden->__lines[ly]=lx; |
139 | this->hidden->__lines[ly]=lx; |
- | 140 | ||
132 | this->UpdateRects=MenuetOS_DirectUpdate; |
141 | this->UpdateRects=MenuetOS_DirectUpdate; |
133 | this->hidden->win_size_x=width; |
142 | this->hidden->win_size_x=width; |
134 | this->hidden->win_size_y=height; |
143 | this->hidden->win_size_y=height; |
135 | vm_suf=this; |
144 | vm_suf=this; |
136 | if (was_initialized) |
145 | if (was_initialized) |
Line 139... | Line 148... | ||
139 | unsigned newwidth = width+9; |
148 | unsigned newwidth = width+9; |
140 | __asm__("int $0x40"::"a"(67),"b"(-1),"c"(-1),"d"(newwidth),"S"(newheight)); |
149 | __asm__("int $0x40"::"a"(67),"b"(-1),"c"(-1),"d"(newwidth),"S"(newheight)); |
141 | } |
150 | } |
142 | else |
151 | else |
143 | { |
152 | { |
144 | set_wanted_events_mask(0x27); |
153 | __menuet__set_bitfield_for_wanted_events(0x27); |
145 | was_initialized=1; |
154 | was_initialized=1; |
146 | MenuetOS_SDL_RepaintWnd(); |
155 | MenuetOS_SDL_RepaintWnd(); |
147 | } |
156 | } |
148 | return current; |
157 | return current; |
149 | } |
158 | } |
Line 207... | Line 216... | ||
207 | return 0; |
216 | return 0; |
208 | } |
217 | } |
Line 209... | Line 218... | ||
209 | 218 | ||
210 | static int MenuetOS_FlipHWSurface(_THIS,SDL_Surface * surface) |
219 | static int MenuetOS_FlipHWSurface(_THIS,SDL_Surface * surface) |
211 | { |
220 | { |
- | 221 | __menuet__putimage(0,0,surface->w,surface->h, |
|
212 | put_image(1,1,surface->w,surface->h, surface->pixels); |
222 | surface->pixels); |
213 | return 0; |
223 | return 0; |
Line 214... | Line 224... | ||
214 | } |
224 | } |
215 | 225 |