<div>On Wed, Aug 10, 2011 at 5:55 AM, Mark Cave-Ayland <span dir="ltr"><<a href="mailto:mark.cave-ayland@siriusit.co.uk">mark.cave-ayland@siriusit.co.uk</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 09/08/11 22:54, William Hahne wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
While not necessary for BootX to function this allows the Apple logo to<br>
be displayed during boot time.<br>
<br>
Index: packages/video.c<br>
==============================<u></u>==============================<u></u>=======<br>
--- packages/video.c (revision 1041)<br>
+++ packages/video.c (working copy)<br>
@@ -281,6 +281,42 @@<br>
fill_rect( color_ind, x, y, w, h );<br>
  }<br>
+static void<br>
+video_draw_rect( void )<br>
+{<br>
+ int h = POP();<br>
+ int w = POP();<br>
+ int y = POP();<br>
+ int x = POP();<br>
+ unsigned char* img = (unsigned char*)cell2pointer(POP());<br>
+ char *pp;<br>
+<br>
+ if (!video.has_video || x < 0 || y < 0 || w <= 0 || h <= 0 ||<br>
+ x + w > video.fb.w || y + h > video.fb.h)<br>
+ return;<br>
+<br>
+ pp = (char*)video.fb.mphys + video.fb.rb * y;<br>
+ for( ; h--; pp += video.fb.rb ) {<br>
+ int ww = w;<br>
+<br>
+ if( video.fb.depth == 24 || video.fb.depth == 32 ) {<br>
+ unsigned long *p = (unsigned long*)pp + x;<br>
+ while( ww-- )<br>
+ *p++ = get_color(*img++);<br>
+ } else if( video.fb.depth == 16 || video.fb.depth == 15 ) {<br>
+ unsigned short *p = (unsigned short*)pp + x;<br>
+ while( ww-- )<br>
+ *p++ = get_color(*img++);<br>
+ } else {<br>
+                        char *p = (char *)((unsigned short*)pp + x);<br>
+<br>
+ while( ww-- )<br>
+ *p++ = get_color(*img++);<br>
+ }<br>
+ }<br>
+<br>
+}<br>
+<br>
  /* ( addr len -- actual ) */<br>
  static void<br>
  video_write(void)<br>
@@ -299,6 +335,7 @@<br>
{"dimensions", video_dimensions },<br>
{"set-colors", video_set_colors },<br>
{"fill-rectangle", video_fill_rect },<br>
+ {"draw-rectangle", video_draw_rect },<br>
{"color!", video_color_bang },<br>
{"write", video_write },<br>
  };<br>
</blockquote>
<br></div></div>
This is interesting, since although I can't find draw-rectangle in the OF specification, neither can I find fill-rectangle which is already there. Perhaps there is part of the OF PPC supplement?<br>
<br></blockquote><div><br></div><div>I am not sure if it is officially part of any specification. BootX doesn't even assume that it was there and attempted to add its own "draw-rectangle" word, but unfortunately the method it uses to add words to packages doesn't work with OpenBIOS. Just adding draw-rectangle seemed like a much simpler and safer solution than changing the way device packages work. Also from what I could see it looked like a serious rewrite might be necessary just to get one small edge case to work.<div>
<br></div><div>William Hahne</div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
ATB,<br>
<br>
Mark.<br>
<br>
-- <br>
Mark Cave-Ayland - Senior Technical Architect<br>
PostgreSQL - PostGIS<br>
Sirius Corporation plc - control through freedom<br>
<a href="http://www.siriusit.co.uk" target="_blank">http://www.siriusit.co.uk</a><br>
t: <a href="tel:%2B44%20870%20608%200063" value="+448706080063" target="_blank">+44 870 608 0063</a><br>
<br>
Sirius Labs: <a href="http://www.siriusit.co.uk/labs" target="_blank">http://www.siriusit.co.uk/labs</a><br><font color="#888888">
<br>
-- <br>
OpenBIOS                 <a href="http://openbios.org/" target="_blank">http://openbios.org/</a><br>
Mailinglist:  <a href="http://lists.openbios.org/mailman/listinfo" target="_blank">http://lists.openbios.org/<u></u>mailman/listinfo</a><br>
Free your System - May the Forth be with you<br>
</font></blockquote></div><br></div>