Rev 2 | Rev 151 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | #include <ll/i386/hw-data.h> |
2 | #include <ll/i386/hw-instr.h> |
||
3 | #include <ll/i386/mem.h> |
||
4 | #include <ll/stdlib.h> |
||
5 | |||
6 | #include <drivers/gd.h> |
||
7 | |||
8 | #include "fun16.h" |
||
9 | |||
10 | #define fontaddr 0xffa6eL /* indirizzo set caratteri */ |
||
11 | |||
12 | extern DWORD flbaddr; |
||
13 | |||
14 | void RdWin_Hi(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *buf) |
||
15 | { |
||
16 | WORD b_bank, b_offset, display_ptr; |
||
17 | int dx, len1, len2, bank_num, row; |
||
18 | /* int bank, enmem;*/ |
||
19 | DWORD end_of_line, display_offset; |
||
20 | WORD bytes_per_row; |
||
21 | LIN_ADDR p; |
||
22 | |||
23 | bytes_per_row = gd_getbpr(); |
||
24 | p = buf; |
||
25 | |||
26 | Seg_Off_Hi(x1, y1, bytes_per_row, &b_offset, &b_bank); |
||
27 | dx = (x2 - x1) + 1; |
||
28 | /*dx = (x2 - x1);*/ |
||
29 | row = y1; |
||
30 | display_offset = b_offset; |
||
31 | display_ptr = display_offset; |
||
32 | bank_num = b_bank; |
||
33 | Load_Write_Bank_256(bank_num); |
||
34 | do { |
||
35 | end_of_line = display_ptr + (2 * (x2 - x1)); |
||
36 | if (end_of_line >= 65536L) { |
||
37 | len2 = (1 + (end_of_line - 65536L) / 2); |
||
38 | len1 = dx - len2; |
||
39 | /* Clr_Part(color, length_1, display_ptr);*/ |
||
40 | memcpy(p, (LIN_ADDR)(0xA0000 + display_ptr), len1 * 2); /* NON CI VA *2???*/ |
||
41 | p += len1 * 2; |
||
42 | bank_num++; |
||
43 | Load_Write_Bank_256(bank_num); |
||
44 | display_ptr = 0; |
||
45 | /* Clr_Part(color, length_2, display_ptr);*/ |
||
46 | memcpy(p, (LIN_ADDR)(0xA0000 + display_ptr), len2 * 2); /* NON CI VA * 2 ???*/ |
||
47 | p += len2 * 2; |
||
48 | display_ptr = (bytes_per_row - (len1 * 2)); |
||
49 | } else { |
||
50 | /* Clr_Part(color, dx, display_ptr);*/ |
||
51 | memcpy(p, (LIN_ADDR)(0xA0000 + display_ptr), dx * 2); /* NON CI VA * 2 ???*/ |
||
52 | p += (dx * 2); |
||
53 | display_offset = (DWORD)display_ptr + (DWORD)bytes_per_row; |
||
54 | if (display_offset >= 65536L) { |
||
55 | bank_num++; |
||
56 | Load_Write_Bank_256(bank_num); |
||
57 | display_ptr = display_offset - 65536L; |
||
58 | } else { |
||
59 | display_ptr += bytes_per_row; |
||
60 | } |
||
61 | } |
||
62 | row++; |
||
63 | } while (row <= y2); |
||
64 | Load_Write_Bank_256(0); |
||
65 | } |
||
66 | |||
67 | void WrWin_Hi(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *buf) |
||
68 | { |
||
69 | WORD b_bank, b_offset, display_ptr; |
||
70 | int dx, len1, len2, bank_num, row; |
||
71 | /* int bank, enmem;*/ |
||
72 | DWORD end_of_line, display_offset; |
||
73 | WORD bytes_per_row; |
||
74 | LIN_ADDR p; |
||
75 | |||
76 | bytes_per_row = gd_getbpr(); |
||
77 | p = buf; |
||
78 | |||
79 | Seg_Off_Hi(x1, y1, bytes_per_row, &b_offset, &b_bank); |
||
80 | dx = (x2 - x1) + 1; |
||
81 | /*dx = (x2 - x1);*/ |
||
82 | row = y1; |
||
83 | display_offset = b_offset; |
||
84 | display_ptr = display_offset; |
||
85 | bank_num = b_bank; |
||
86 | Load_Write_Bank_256(bank_num); |
||
87 | do { |
||
88 | end_of_line = display_ptr + (2 * (x2 - x1)); |
||
89 | if (end_of_line >= 65536L) { |
||
90 | len2 = (1 + (end_of_line - 65536L) / 2); |
||
91 | len1 = dx - len2; |
||
92 | /* Clr_Part(color, length_1, display_ptr);*/ |
||
93 | memcpy((LIN_ADDR)(0xA0000 + display_ptr), p, len1 * 2); /* NON CI VA *2???*/ |
||
94 | p += len1 * 2; |
||
95 | bank_num++; |
||
96 | Load_Write_Bank_256(bank_num); |
||
97 | display_ptr = 0; |
||
98 | /* Clr_Part(color, length_2, display_ptr);*/ |
||
99 | memcpy((LIN_ADDR)(0xA0000 + display_ptr), p, len2 * 2); /* NON CI VA * 2 ???*/ |
||
100 | p += len2 * 2; |
||
101 | display_ptr = (bytes_per_row - (len1 * 2)); |
||
102 | } else { |
||
103 | /* Clr_Part(color, dx, display_ptr);*/ |
||
104 | memcpy((LIN_ADDR)(0xA0000 + display_ptr), p, dx * 2); /* NON CI VA * 2 ???*/ |
||
105 | p += (dx * 2); |
||
106 | display_offset = (DWORD)display_ptr + (DWORD)bytes_per_row; |
||
107 | if (display_offset >= 65536L) { |
||
108 | bank_num++; |
||
109 | Load_Write_Bank_256(bank_num); |
||
110 | display_ptr = display_offset - 65536L; |
||
111 | } else { |
||
112 | display_ptr += bytes_per_row; |
||
113 | } |
||
114 | } |
||
115 | row++; |
||
116 | } while (row <= y2); |
||
117 | Load_Write_Bank_256(0); |
||
118 | } |
||
119 | |||
120 | void linPut16(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *buf) |
||
121 | { |
||
122 | WORD bpr; |
||
123 | LIN_ADDR addr, p; |
||
124 | WORD dx, y; |
||
125 | |||
126 | bpr = gd_getbpr(); |
||
127 | p = buf; |
||
128 | addr = (LIN_ADDR)(flbaddr + x1 * 2 + bpr * y1); |
||
129 | dx = (x2 - x1 + 1) * 2; |
||
130 | /*dx = (x2 - x1) * 2;*/ |
||
131 | |||
132 | for (y = y1; y <= y2; y++) { |
||
133 | memcpy(addr, p, dx); |
||
134 | p += dx; |
||
135 | addr += bpr; |
||
136 | } |
||
137 | } |
||
138 | |||
139 | void linGet16(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *buf) |
||
140 | { |
||
141 | WORD bpr; |
||
142 | LIN_ADDR addr, p; |
||
143 | WORD dx, y; |
||
144 | |||
145 | bpr = gd_getbpr(); |
||
146 | p = buf; |
||
147 | addr = (LIN_ADDR)(flbaddr + x1 * 2 + bpr * y1); |
||
148 | dx = (x2 - x1 + 1) * 2; |
||
149 | /*dx = (x2 - x1) * 2;*/ |
||
150 | |||
151 | for (y = y1; y <= y2; y++) { |
||
152 | memcpy(p, addr, dx); |
||
153 | p += dx; |
||
154 | addr += bpr; |
||
155 | } |
||
156 | } |
||
157 | |||
158 | void ClrWin_Hi(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color) |
||
159 | { |
||
160 | WORD b_bank, b_offset, display_ptr; |
||
161 | int dx, len1, len2, bank_num, row; |
||
162 | /* int bank, enmem;*/ |
||
163 | DWORD end_of_line, display_offset; |
||
164 | WORD bytes_per_row; |
||
165 | |||
166 | bytes_per_row = gd_getbpr(); |
||
167 | |||
168 | Seg_Off_Hi(x1, y1, bytes_per_row, &b_offset, &b_bank); |
||
169 | dx = (x2 - x1) + 1; |
||
170 | row = y1; |
||
171 | display_offset = b_offset; |
||
172 | display_ptr = display_offset; |
||
173 | bank_num = b_bank; |
||
174 | Load_Write_Bank_256(bank_num); |
||
175 | do { |
||
176 | end_of_line = display_ptr + (2 * (x2 - x1)); |
||
177 | if (end_of_line >= 65536L) { |
||
178 | len2 = (1 + (end_of_line - 65536L) / 2); |
||
179 | len1 = dx - len2; |
||
180 | /* Clr_Part(color, length_1, display_ptr);*/ |
||
181 | memsetw((LIN_ADDR)(0xA0000 + display_ptr), color, len1 * 2); /* FORSE NON* 2???*/ |
||
182 | bank_num++; |
||
183 | Load_Write_Bank_256(bank_num); |
||
184 | display_ptr = 0; |
||
185 | /* Clr_Part(color, length_2, display_ptr);*/ |
||
186 | memsetw((LIN_ADDR)(0xA0000 + display_ptr), color, len2 * 2); /* FORSE NON* 2??? */ |
||
187 | display_ptr = bytes_per_row - (2 * len1); |
||
188 | } else { |
||
189 | /* Clr_Part(color, dx, display_ptr);*/ |
||
190 | memsetw((LIN_ADDR)(0xA0000 + display_ptr), color, dx * 2); /* FORSE NON* 2??? */ |
||
191 | display_offset = (DWORD)display_ptr + (DWORD)bytes_per_row; |
||
192 | if (display_offset >= 65536L) { |
||
193 | bank_num++; |
||
194 | Load_Write_Bank_256(bank_num); |
||
195 | display_ptr = display_offset - 65536L; |
||
196 | } else { |
||
197 | display_ptr += bytes_per_row; |
||
198 | } |
||
199 | } |
||
200 | row++; |
||
201 | } while (row <= y2); |
||
202 | Load_Write_Bank_256(0); |
||
203 | } |
||
204 | |||
205 | void linBox16(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color) |
||
206 | { |
||
207 | WORD bpr; |
||
208 | DWORD addr; |
||
209 | WORD dx, y; |
||
210 | |||
211 | bpr = gd_getbpr(); |
||
212 | addr = flbaddr + x1 * 2 + bpr * y1; |
||
213 | dx = (x2 - x1 + 1) * 2; |
||
214 | /*dx = (x2 - x1) * 2;*/ |
||
215 | |||
216 | for (y = y1; y <= y2; y++) { |
||
217 | memsetw((LIN_ADDR)addr, color, dx); |
||
218 | addr += bpr; |
||
219 | } |
||
220 | } |
||
221 | |||
222 | void WrRect_Hi(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color) |
||
223 | { |
||
224 | WORD bank, offs, ebank, eoffs; |
||
225 | WORD bpr; |
||
226 | WORD line_segment, len; |
||
227 | WORD y; |
||
228 | |||
229 | bpr = gd_getbpr(); |
||
230 | len = 1 + x2 - x1; |
||
231 | Seg_Off_Hi(x2, y1, bpr, &eoffs, &ebank); |
||
232 | Seg_Off_Hi(x1, y1, bpr, &offs, &bank); |
||
233 | Load_Write_Bank_256(bank); |
||
234 | if (bank == ebank) { |
||
235 | memsetw((LIN_ADDR)(0xA0000 + offs), color, len * 2); /* NON CI VA * 2???*/ |
||
236 | } else { |
||
237 | line_segment = 65536L - offs; |
||
238 | memsetw((LIN_ADDR)(0xA0000 + offs), color, line_segment); /* NON CI VA * 2???*/ |
||
239 | Load_Write_Bank_256(ebank); |
||
240 | memsetw((LIN_ADDR)0xA0000, color, eoffs); /* NON CI VA * 2??? */ |
||
241 | } |
||
242 | for (y = y1 + 1; y <= y2 + 1; y++) { |
||
243 | Seg_Off_Hi(x1, y, bpr, &offs, &bank); |
||
244 | Load_Write_Bank_256(bank); |
||
245 | lmempokew((LIN_ADDR)(0xA0000 + offs), color); |
||
246 | Seg_Off_Hi(x2, y, bpr, &offs, &bank); |
||
247 | Load_Write_Bank_256(bank); |
||
248 | lmempokew((LIN_ADDR)(0xA0000 + offs), color); |
||
249 | } |
||
250 | Seg_Off_Hi(x2, y2, bpr, &eoffs, &ebank); |
||
251 | Seg_Off_Hi(x1, y2, bpr, &offs, &bank); |
||
252 | Load_Write_Bank_256(bank); |
||
253 | if (bank == ebank) { |
||
254 | memsetw((LIN_ADDR)(0xA0000 + offs), color, len * 2); /* NON CI VA * 2???*/ |
||
255 | } else { |
||
256 | line_segment = 65536L - offs; |
||
257 | memsetw((LIN_ADDR)(0xA0000 + offs), color, line_segment); /* NON CI VA * 2???*/ |
||
258 | Load_Write_Bank_256(ebank); |
||
259 | memsetw((LIN_ADDR)0xA0000, color, eoffs); /* NON CI VA * 2???*/ |
||
260 | } |
||
261 | } |
||
262 | |||
263 | void linRect16(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color) |
||
264 | { |
||
265 | WORD bpr; |
||
266 | DWORD addr; |
||
267 | WORD dx, y; |
||
268 | |||
269 | bpr = gd_getbpr(); |
||
270 | addr = flbaddr + x1 * 2 + bpr * y1; |
||
271 | dx = (x2 - x1) * 2; |
||
272 | |||
273 | memsetw((LIN_ADDR)addr, color, dx+2); |
||
274 | addr += bpr; |
||
275 | |||
276 | for (y = y1 + 1; y <= y2 - 1; y++) { |
||
277 | lmempokew((LIN_ADDR)addr, color); |
||
278 | lmempokew((LIN_ADDR)(addr + dx), color); |
||
279 | addr += bpr; |
||
280 | } |
||
281 | memsetw((LIN_ADDR)addr, color, dx+2); |
||
282 | } |
||
283 | |||
284 | void WrText_Hi(char *text, WORD x, WORD y, DWORD fg, DWORD bg) |
||
285 | { |
||
286 | DWORD fp; |
||
287 | WORD offs, bank; |
||
288 | WORD bpr; |
||
289 | int r, c, bits; |
||
290 | |||
291 | bpr = gd_getbpr(); |
||
292 | while (*text) { |
||
293 | fp = fontaddr + (8 * *(BYTE *)text); |
||
294 | for (r=0; r<8; r++) { |
||
295 | bits = lmempeekb((LIN_ADDR)(fp++)); |
||
296 | for (c=0; c<8; c++) |
||
297 | if (bits & (0x80>>c)) { |
||
298 | Seg_Off_Hi(x + c, y + r, bpr, &offs, &bank); |
||
299 | Load_Write_Bank_256(bank); |
||
300 | lmempokew((LIN_ADDR)(0xA0000 + offs), fg); |
||
301 | } |
||
302 | /* lmempokew((LIN_ADDR)(addr + (y + r) * bpr + x + c), fg);*/ |
||
303 | /* vbe_putpixel((x+c),(y+r),fg);*/ |
||
304 | else { |
||
305 | Seg_Off_Hi(x + c, y + r, bpr, &offs, &bank); |
||
306 | Load_Write_Bank_256(bank); |
||
307 | lmempokew((LIN_ADDR)(0xA0000 + offs), bg); |
||
308 | } |
||
309 | /* lmempokew((LIN_ADDR)(addr + (y + r) * bpr + x + c), bg);*/ |
||
310 | /* vbe_putpixel((x+c), (y+r), bg);*/ |
||
311 | } |
||
312 | text++; |
||
313 | x += 8; |
||
314 | } |
||
315 | } |
||
316 | |||
317 | void linText16(char *text, WORD x, WORD y, DWORD fg, DWORD bg) |
||
318 | { |
||
319 | DWORD fp, addr; |
||
320 | WORD bpr; |
||
321 | int r, c, bits; |
||
322 | |||
323 | bpr = gd_getbpr(); |
||
324 | addr = gd_getflb(); |
||
325 | while (*text) { |
||
326 | /*DOSSetAddr(fp, (fontaddr + (8 * *(BYTE *)text)));*/ |
||
327 | /*DOSSetAddr(fp, (fontaddr + (8 * *(BYTE *)text)));*/ |
||
328 | fp = fontaddr + (8 * *(BYTE *)text); |
||
329 | for (r=0; r<8; r++) { |
||
330 | bits = lmempeekb((LIN_ADDR)fp++); |
||
331 | for (c=0; c<8; c++) |
||
332 | if (bits & (0x80>>c)) |
||
333 | lmempokew((LIN_ADDR)(addr + (y + r) * bpr + ((x + c) * 2)), fg); |
||
334 | /* vbe_putpixel((x+c),(y+r),fg);*/ |
||
335 | else |
||
336 | lmempokew((LIN_ADDR)(addr + (y + r) * bpr + ((x + c) * 2)), bg); |
||
337 | /* vbe_putpixel((x+c), (y+r), bg);*/ |
||
338 | } |
||
339 | text++; |
||
340 | x += 8; |
||
341 | } |
||
342 | } |
||
343 | |||
344 | void WrLine_Hi(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color) |
||
345 | { |
||
346 | int dx, dy, incr1, incr2, d, x, y, xend, yend, yinc, xinc; |
||
347 | WORD bpr; |
||
348 | WORD bank, offs, ebank, eoffs; |
||
349 | WORD line_segment, len; |
||
350 | |||
351 | bpr = gd_getbpr(); |
||
352 | if (y2 == y1) { |
||
353 | y = y1; |
||
354 | if (x1 > x2) { |
||
355 | xend = x1; |
||
356 | x1 = x2; |
||
357 | x2 = xend; |
||
358 | } |
||
359 | /* WrHline_256(x1, x2, y1, color, bpr); */ |
||
360 | len = 1 + x2 - x1; |
||
361 | Seg_Off_Hi(x2, y, bpr, &eoffs, &ebank); |
||
362 | Seg_Off_Hi(x1, y, bpr, &offs, &bank); |
||
363 | Load_Write_Bank_256(bank); |
||
364 | if (bank == ebank) { |
||
365 | memsetw((LIN_ADDR)(0xA0000 + offs), color, len * 2); |
||
366 | } else { |
||
367 | line_segment = 65536L - offs; |
||
368 | memsetw((LIN_ADDR)(0xA0000 + offs), color, line_segment); |
||
369 | Load_Write_Bank_256(ebank); |
||
370 | memsetw((LIN_ADDR)0xA0000, color, eoffs); |
||
371 | } |
||
372 | } else { |
||
373 | dx = abs(x2 - x1); |
||
374 | dy = abs(y2 - y1); |
||
375 | if (dx >= dy) { |
||
376 | if (x1 > x2) { |
||
377 | x = x2; |
||
378 | y = y2; |
||
379 | xend = x1; |
||
380 | if (dy == 0) { |
||
381 | yinc = 0; |
||
382 | } else { |
||
383 | if (y2 > y1) { |
||
384 | yinc = -1; |
||
385 | } else { |
||
386 | yinc = 1; |
||
387 | } |
||
388 | } |
||
389 | } else { |
||
390 | x = x1; |
||
391 | y = y1; |
||
392 | xend = x2; |
||
393 | if (dy == 0) { |
||
394 | yinc = 0; |
||
395 | } else { |
||
396 | if (y2 > y1) { |
||
397 | yinc =1; |
||
398 | } else { |
||
399 | yinc = -1; |
||
400 | } |
||
401 | } |
||
402 | } |
||
403 | incr1 = 2 * dy; |
||
404 | d = incr1 - dx; |
||
405 | incr2 = 2 * (dy - dx); |
||
406 | Seg_Off_Hi(x, y, bpr, &offs, &bank); |
||
407 | Load_Write_Bank_256(bank); |
||
408 | lmempokew((LIN_ADDR)(0xA0000 + offs), color); |
||
409 | while (x < xend) { |
||
410 | x++; |
||
411 | if (d < 0) { |
||
412 | d += incr1; |
||
413 | } else { |
||
414 | y += yinc; |
||
415 | d += incr2; |
||
416 | } |
||
417 | Seg_Off_Hi(x, y, bpr, &offs, &bank); |
||
418 | Load_Write_Bank_256(bank); |
||
419 | lmempokew((LIN_ADDR)(0xA0000 + offs), color); |
||
420 | } |
||
421 | } else { |
||
422 | if (y1 > y2) { |
||
423 | x = x2; |
||
424 | y = y2; |
||
425 | yend = y1; |
||
426 | if (dx == 0) { |
||
427 | xinc = 0; |
||
428 | } else { |
||
429 | if (x2 > x1) { |
||
430 | xinc = -1; |
||
431 | } else { |
||
432 | xinc = 1; |
||
433 | } |
||
434 | } |
||
435 | } else { |
||
436 | x = x1; |
||
437 | y = y1; |
||
438 | yend = y2; |
||
439 | if (dx == 0) { |
||
440 | xinc = 0; |
||
441 | } else { |
||
442 | if (x2 > x1) { |
||
443 | xinc = 1; |
||
444 | } else { |
||
445 | xinc = -1; |
||
446 | } |
||
447 | } |
||
448 | } |
||
449 | incr1 = 2 * dx; |
||
450 | d = incr1 - dy; |
||
451 | incr2 = 2 * (dx - dy); |
||
452 | Seg_Off_Hi(x, y, bpr, &offs, &bank); |
||
453 | Load_Write_Bank_256(bank); |
||
454 | lmempokew((LIN_ADDR)(0xA0000 + offs), color); |
||
455 | while (y < yend) { |
||
456 | y++; |
||
457 | if (d < 0) { |
||
458 | d += incr1; |
||
459 | } else { |
||
460 | x += xinc; |
||
461 | d += incr2; |
||
462 | } |
||
463 | Seg_Off_Hi(x, y, bpr, &offs, &bank); |
||
464 | Load_Write_Bank_256(bank); |
||
465 | lmempokew((LIN_ADDR)(0xA0000 + offs), color); |
||
466 | } |
||
467 | } |
||
468 | } |
||
469 | } |
||
470 | |||
471 | void linLine16(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color) |
||
472 | { |
||
473 | register int t, distance; |
||
474 | register DWORD addr; |
||
475 | register WORD bpr; |
||
476 | int xerr=0, yerr=0, deltax, deltay; |
||
477 | int incx, incy; |
||
478 | |||
479 | bpr = gd_getbpr(); |
||
480 | addr = gd_getflb(); |
||
481 | deltax = x2 - x1; /* compute both distances */ |
||
482 | deltay = y2 - y1; |
||
483 | |||
484 | if (deltax > 0) /* compute increments */ |
||
485 | incx = 1; |
||
486 | else if (deltax == 0) |
||
487 | incx = 0; |
||
488 | else |
||
489 | incx = -1; |
||
490 | |||
491 | if (deltay > 0) |
||
492 | incy = 1; |
||
493 | else if (deltay == 0) |
||
494 | incy = 0; |
||
495 | else |
||
496 | incy = -1; |
||
497 | |||
498 | deltax = abs(deltax); /* determine greater distance */ |
||
499 | deltay = abs(deltay); |
||
500 | if (deltax > deltay) |
||
501 | distance = deltax; |
||
502 | else |
||
503 | distance = deltay; |
||
504 | |||
505 | for (t=0; t<=distance+1; t++) { /* draw the line */ |
||
506 | /* vbe_putpixel(x1, y1, colour);*/ |
||
507 | lmempokew((LIN_ADDR)(addr + y1 * bpr + (x1 * 2)), color); |
||
508 | xerr += deltax; |
||
509 | yerr += deltay; |
||
510 | if (xerr > distance) { |
||
511 | xerr -= distance; |
||
512 | x1 += incx; |
||
513 | } |
||
514 | if (yerr > distance) { |
||
515 | yerr -= distance; |
||
516 | y1 += incy; |
||
517 | } |
||
518 | } |
||
519 | } |
||
520 | |||
521 | void WrPixel_Hi(WORD x, WORD y, DWORD color) |
||
522 | { |
||
523 | WORD bpr; |
||
524 | WORD bank, offs; |
||
525 | |||
526 | bpr = gd_getbpr(); |
||
527 | Seg_Off_Hi(x, y, bpr, &offs, &bank); |
||
528 | Load_Write_Bank_256(bank); |
||
529 | lmempokew((LIN_ADDR)(0xA0000 + offs), color); |
||
530 | /* Load_Write_Bank_256(0);*/ |
||
531 | } |
||
532 | |||
533 | void linWr16(WORD x, WORD y, DWORD color) |
||
534 | { |
||
535 | WORD bpr; |
||
536 | |||
537 | bpr = gd_getbpr(); |
||
538 | lmempokew((LIN_ADDR)(flbaddr + y * bpr + (x * 2)), color); |
||
539 | } |
||
540 | |||
541 | DWORD RdPixel_Hi(WORD x, WORD y) |
||
542 | { |
||
543 | WORD bpr; |
||
544 | WORD bank, offs; |
||
545 | DWORD rv; |
||
546 | |||
547 | bpr = gd_getbpr(); |
||
548 | Seg_Off_Hi(x, y, bpr, &offs, &bank); |
||
549 | Load_Write_Bank_256(bank); |
||
550 | rv = lmempeekw((LIN_ADDR)(0xA0000 + offs)); |
||
551 | return rv; |
||
552 | } |
||
553 | |||
554 | DWORD linRd16(WORD x, WORD y) |
||
555 | { |
||
556 | WORD bpr; |
||
557 | DWORD rv; |
||
558 | |||
559 | bpr = gd_getbpr(); |
||
560 | rv = lmempeekw((LIN_ADDR)(flbaddr + y * bpr + (x * 2))); |
||
561 | return rv; |
||
562 | } |
||
563 |