<br><br><div class="gmail_quote">On Wed, Aug 10, 2011 at 12:53 PM, Blue Swirl <span dir="ltr"><<a href="mailto:blauwirbel@gmail.com">blauwirbel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Aug 9, 2011 at 9:54 PM, William Hahne <<a href="mailto:will07c5@gmail.com">will07c5@gmail.com</a>> wrote:<br>
> "get-key-map" is a Forth word that provides a map of all the keys currently<br>
> pressed on the keyboard. Since it is only used by BootX to determine if one<br>
> of the shortcuts for verbose or single user mode is pressed. It is a waste<br>
> of time to provide a full implementation. This just hands out a dummy key<br>
> map which specifies verbose mode.<br>
> Index: drivers/adb_kbd.c<br>
> ===================================================================<br>
> --- drivers/adb_kbd.c (revision 1041)<br>
> +++ drivers/adb_kbd.c (working copy)<br>
> @@ -43,10 +43,13 @@<br>
><br>
> static void keyboard_read(void);<br>
><br>
> +static void keyboard_get_key_map(void);<br>
> +<br>
> NODE_METHODS( keyboard ) = {<br>
> { "open", keyboard_open },<br>
> { "close", keyboard_close },<br>
> { "read", keyboard_read },<br>
> + { "get-key-map", keyboard_get_key_map },<br>
> };<br>
><br>
> /* VT100 escape sequences */<br>
> @@ -566,3 +569,18 @@<br>
> }<br>
> PUSH(i);<br>
> }<br>
> +<br>
> +static unsigned char fake_keymap[32] = {<br>
<br>
</div>Can this be 'const'?<br></blockquote><div><br></div><div>Yes</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
> + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,<br>
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br>
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br>
> + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00<br>
> +};<br>
> +<br>
> +static void keyboard_get_key_map(void)<br>
> +{<br>
> + /* This is a bit of a hack since BootX requires a get-key-map word.<br>
> + In the future this should be changed to give the actual current<br>
> keymap,<br>
> + but since this only effects keyboard input in BootX it isn't a<br>
> priority. */<br>
> + PUSH( (int)fake_keymap );<br>
<br>
</div>'long' would not truncate on 64 bit host with 64 bit cells.<br>
<br></blockquote><div><br></div><div>Oops, thanks for catching that. :) Revised patch at the bottom.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
> +}<br>
> --<br>
<div><div></div><div class="h5">> 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/mailman/listinfo</a><br>
> Free your System - May the Forth be with you<br>
><br>
<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/mailman/listinfo</a><br>
Free your System - May the Forth be with you</div></div></blockquote><div><br></div><div>Index: drivers/adb_kbd.c</div><div>===================================================================</div><div>--- drivers/adb_kbd.c (revision 1046)</div>
<div>+++ drivers/adb_kbd.c (working copy)</div><div>@@ -43,10 +43,13 @@</div><div><br></div><div> static void keyboard_read(void);</div><div><br></div><div>+static void keyboard_get_key_map(void);</div><div>+</div><div>
NODE_METHODS( keyboard ) = {</div><div> { "open", keyboard_open },</div><div> { "close", keyboard_close },</div><div> { "read", keyboard_read },</div>
<div>+ { "get-key-map", keyboard_get_key_map },</div><div> };</div><div><br></div><div> /* VT100 escape sequences */</div><div>@@ -566,3 +569,18 @@</div><div> }</div><div> PUSH(i);</div>
<div> }</div><div>+</div><div>+static const unsigned char fake_keymap[32] = {</div><div>+ 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,</div><div>+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,</div><div>+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,</div>
<div>+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00</div><div>+};</div><div>+</div><div>+static void keyboard_get_key_map(void)</div><div>+{</div><div>+ /* This is a bit of a hack since BootX requires a get-key-map word.</div>
<div>+ In the future this should be changed to give the actual current keymap,</div><div>+ but since this only effects keyboard input in BootX it isn't a priority. */</div><div>+ PUSH( (ucell)fake_keymap );</div>
<div>+}</div><div> </div></div><br>