Rev 4128 | Rev 4151 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4128 | Rev 4150 | ||
---|---|---|---|
Line 161... | Line 161... | ||
161 | 161 | ||
162 | next_mode: |
162 | next_mode: |
163 | # try next mode |
163 | # try next mode |
164 | mov %gs:(%si), %cx |
164 | mov %gs:(%si), %cx |
165 | cmp $VESA_END_OF_MODES, %cx |
165 | cmp $VESA_END_OF_MODES, %cx |
166 | jz no_mode |
166 | je no_mode |
167 | 167 | ||
168 | inc %si |
168 | inc %si |
169 | inc %si |
169 | inc %si |
170 | push %cx |
170 | push %cx |
171 | push %di |
171 | push %di |
Line 175... | Line 175... | ||
175 | 175 | ||
176 | pop %si |
176 | pop %si |
177 | pop %di |
177 | pop %di |
178 | pop %cx |
178 | pop %cx |
179 | cmp $VESA_OK, %al |
179 | cmp $VESA_OK, %al |
180 | jnz no_mode |
180 | jne no_mode |
- | 181 | ||
- | 182 | # check for proper attributes (supported, color, graphics, liner framebuffer) |
|
- | 183 | ||
- | 184 | mov VESA_MODE_ATTRIBUTES_OFFSET(%di), %ax |
|
- | 185 | and $0x99, %ax |
|
- | 186 | cmp $0x99, %ax |
|
- | 187 | jne next_mode |
|
- | 188 | ||
- | 189 | # check for proper resolution |
|
181 | 190 | ||
182 | mov default_width - vesa_init, %ax |
191 | mov default_width - vesa_init, %ax |
183 | cmp VESA_MODE_WIDTH_OFFSET(%di), %ax |
192 | cmp VESA_MODE_WIDTH_OFFSET(%di), %ax |
184 | jnz next_mode |
193 | jne next_mode |
185 | 194 | ||
186 | mov default_height - vesa_init, %ax |
195 | mov default_height - vesa_init, %ax |
187 | cmp VESA_MODE_HEIGHT_OFFSET(%di), %ax |
196 | cmp VESA_MODE_HEIGHT_OFFSET(%di), %ax |
188 | jnz next_mode |
197 | jne next_mode |
- | 198 | ||
- | 199 | # check for proper bpp |
|
189 | 200 | ||
190 | mov default_bpp - vesa_init, %al |
201 | mov default_bpp - vesa_init, %al |
191 | cmp VESA_MODE_BPP_OFFSET(%di), %al |
202 | cmp VESA_MODE_BPP_OFFSET(%di), %al |
192 | jz set_mode |
203 | je set_mode |
193 | 204 | ||
194 | mov $24, %al |
205 | mov $24, %al |
195 | cmp default_bpp - vesa_init, %al |
206 | cmp default_bpp - vesa_init, %al |
196 | jnz next_mode |
207 | jne next_mode |
197 | 208 | ||
198 | # for 24 bpp modes accept also 32 bit bpp |
209 | # for 24 bpp modes accept also 32 bit bpp |
199 | 210 | ||
200 | mov $32, %al |
211 | mov $32, %al |
201 | cmp VESA_MODE_BPP_OFFSET(%di), %al |
212 | cmp VESA_MODE_BPP_OFFSET(%di), %al |
202 | jnz next_mode |
213 | jne next_mode |
203 | 214 | ||
204 | set_mode: |
215 | set_mode: |
205 | mov %cx, %bx |
216 | mov %cx, %bx |
206 | or $0xc000, %bx |
217 | or $0xc000, %bx |
207 | push %di |
218 | push %di |