• Detect key at startup

    From Anthony Ortiz@21:1/5 to All on Wed Jul 13 14:36:38 2022
    Question for you guys... I made my own peripheral card a while back and I want to enable it only if you hold down the SHIFT key during ctrl-openapple-reset. What would you say is the best way to achieve this?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From I am Rob@21:1/5 to All on Thu Jul 14 06:06:32 2022
    Maybe look into the ProDOS that comes with booting GSOS. It has the ability that when you boot into GSOS, you can hold down the the #8 key and it will boot into ProDOS 8 instead.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael J. Mahon@21:1/5 to Anthony Ortiz on Thu Jul 14 18:17:11 2022
    Anthony Ortiz <anthonypaulo@gmail.com> wrote:
    Question for you guys... I made my own peripheral card a while back and I want to enable it only if you hold down the SHIFT key during ctrl-openapple-reset. What would you say is the best way to achieve this?


    There are only two ways to detect that the shift key is depressed: 1)
    testing the pushbutton input for the “shift key mod” (if it’s installed, and if its corresponding pushbutton is *not* pressed), or 2) finding the keyboard port with an ASCII code which is a “shifted” character.

    Since Ctl-Open Apple-Reset does not generate any keycode at the keyboard
    port, 2) is not useful. So any detection of shift key depression can only
    be detected if the shift key mod is present and the corresponding
    pushbutton does not interfere.

    You may want to consider using a keycode-generating key, as ProDOS does.

    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anthony Ortiz@21:1/5 to Michael J. Mahon on Thu Jul 14 18:13:12 2022
    On Thursday, July 14, 2022 at 7:17:18 PM UTC-4, Michael J. Mahon wrote:
    Question for you guys... I made my own peripheral card a while back and I want to enable it only if you hold down the SHIFT key during ctrl-openapple-reset. What would you say is the best way to achieve this?

    There are only two ways to detect that the shift key is depressed: 1) testing the pushbutton input for the “shift key mod” (if it’s installed,
    and if its corresponding pushbutton is *not* pressed), or 2) finding the keyboard port with an ASCII code which is a “shifted” character.

    Since Ctl-Open Apple-Reset does not generate any keycode at the keyboard port, 2) is not useful. So any detection of shift key depression can only
    be detected if the shift key mod is present and the corresponding
    pushbutton does not interfere.

    You may want to consider using a keycode-generating key, as ProDOS does.

    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    Hello Michael!

    Okay I get it... so If I were to have my peripheral card listen to the RESET line and immediately check $C000 for the keycode-generating key of choice, then this would cover my scenario of detecting a keypress during startup right? Or is the RESET line
    by itself not enough to determine ctrl-apple-reset occurred?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brian Patrie@21:1/5 to Anthony Ortiz on Fri Jul 15 03:36:46 2022
    Anthony Ortiz wrote:
    On Thursday, July 14, 2022 at 7:17:18 PM UTC-4, Michael J. Mahon wrote:
    Question for you guys... I made my own peripheral card a while back and I >>> want to enable it only if you hold down the SHIFT key during
    ctrl-openapple-reset. What would you say is the best way to achieve this? >>>
    There are only two ways to detect that the shift key is depressed: 1)
    testing the pushbutton input for the “shift key mod” (if it’s installed,
    and if its corresponding pushbutton is *not* pressed), or 2) finding the
    keyboard port with an ASCII code which is a “shifted” character.

    Since Ctl-Open Apple-Reset does not generate any keycode at the keyboard
    port, 2) is not useful. So any detection of shift key depression can only
    be detected if the shift key mod is present and the corresponding
    pushbutton does not interfere.

    You may want to consider using a keycode-generating key, as ProDOS does.

    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    Hello Michael!

    Okay I get it... so If I were to have my peripheral card listen to the RESET line and immediately check $C000 for the keycode-generating key of choice, then this would cover my scenario of detecting a keypress during startup right? Or is the RESET line
    by itself not enough to determine ctrl-apple-reset occurred?

    The RESET line tells you that ctrl-reset is being held (or that the
    auto-reset circuit is doing its thing during powerup). You'd have to
    check for open-apple (bit 7 of $C061) separately. Mind you, execution
    does not occur /during/ RESET.

    What do you mean by "enable" the card? Does it take over the system in
    some way (e.g. a ROM card)? Or is it a boot device that you want to be skipped, or something, if the requisite key is not being held?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kent Dickey@21:1/5 to anthonypaulo@gmail.com on Fri Jul 15 12:34:25 2022
    In article <fb8206ee-6d93-4423-a0dc-03fb41874041n@googlegroups.com>,
    Anthony Ortiz <anthonypaulo@gmail.com> wrote:
    On Thursday, July 14, 2022 at 7:17:18 PM UTC-4, Michael J. Mahon wrote:
    Question for you guys... I made my own peripheral card a while back and I >> > want to enable it only if you hold down the SHIFT key during
    ctrl-openapple-reset. What would you say is the best way to achieve this? >> >
    There are only two ways to detect that the shift key is depressed: 1)
    testing the pushbutton input for the “shift key mod” (if it’s >installed,
    and if its corresponding pushbutton is *not* pressed), or 2) finding the
    keyboard port with an ASCII code which is a “shifted” character.

    Since Ctl-Open Apple-Reset does not generate any keycode at the keyboard
    port, 2) is not useful. So any detection of shift key depression can only
    be detected if the shift key mod is present and the corresponding
    pushbutton does not interfere.

    You may want to consider using a keycode-generating key, as ProDOS does.

    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    Hello Michael!

    Okay I get it... so If I were to have my peripheral card listen to the
    RESET line and immediately check $C000 for the keycode-generating key of >choice, then this would cover my scenario of detecting a keypress during >startup right? Or is the RESET line by itself not enough to determine >ctrl-apple-reset occurred?

    i'm not sure you can use a regular key either. I suspect the Reset will
    clear the keyboard latch. On a //e or later (so, with open-apple keys),
    you may still be able to read $C010 and see if "any" key is down, but
    Reset might clear that too. The Open-Apple/Closed-Apple keys aren't
    normal keys--they are read like paddle buttons, so reset doesn't affect
    them.

    Kent

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anthony Ortiz@21:1/5 to All on Fri Jul 15 07:27:21 2022
    Hey guys,

    My peripheral card acts as an accelerator (a faster 6502) so what I would like to do is make it so that the card is enabled (Ie. acceleration is enabled) whenever an extra key is detected during reboot.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anthony Ortiz@21:1/5 to Kent Dickey on Fri Jul 15 07:21:18 2022
    On Friday, July 15, 2022 at 8:34:27 AM UTC-4, Kent Dickey wrote:
    On Thursday, July 14, 2022 at 7:17:18 PM UTC-4, Michael J. Mahon wrote:
    Question for you guys... I made my own peripheral card a while back and I
    want to enable it only if you hold down the SHIFT key during
    ctrl-openapple-reset. What would you say is the best way to achieve this?

    There are only two ways to detect that the shift key is depressed: 1)
    testing the pushbutton input for the “shift key mod” (if it’s >installed,
    and if its corresponding pushbutton is *not* pressed), or 2) finding the >> keyboard port with an ASCII code which is a “shifted” character.

    Since Ctl-Open Apple-Reset does not generate any keycode at the keyboard >> port, 2) is not useful. So any detection of shift key depression can only >> be detected if the shift key mod is present and the corresponding
    pushbutton does not interfere.

    You may want to consider using a keycode-generating key, as ProDOS does. >>
    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    Hello Michael!

    Okay I get it... so If I were to have my peripheral card listen to the >RESET line and immediately check $C000 for the keycode-generating key of >choice, then this would cover my scenario of detecting a keypress during >startup right? Or is the RESET line by itself not enough to determine >ctrl-apple-reset occurred?
    i'm not sure you can use a regular key either. I suspect the Reset will clear the keyboard latch. On a //e or later (so, with open-apple keys),
    you may still be able to read $C010 and see if "any" key is down, but
    Reset might clear that too. The Open-Apple/Closed-Apple keys aren't
    normal keys--they are read like paddle buttons, so reset doesn't affect them.

    Kent

    Hi Kent!

    My peripheral card acts as an accelerator (a faster 6502) so what I would like to do is make it so that the card is enabled (Ie. acceleration is enabled) whenever an extra key is detected during reboot.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael J. Mahon@21:1/5 to Anthony Ortiz on Sat Jul 16 17:07:42 2022
    Anthony Ortiz <anthonypaulo@gmail.com> wrote:
    Hey guys,

    My peripheral card acts as an accelerator (a faster 6502) so what I would like to do is make it so that the card is enabled (Ie. acceleration is enabled) whenever an extra key is detected during reboot.

    Since Reset must be assumed to reset the keyboard port along with the rest
    of the system, I suggest polling for a (code-generating) keypress within a short window (say, two seconds) *after* Reset. If the key is pressed during
    the window, clear the strobe (to “consume” the keypress) and then enable your card.

    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anthony Ortiz@21:1/5 to Michael J. Mahon on Mon Jul 18 22:23:09 2022
    On Saturday, July 16, 2022 at 6:07:49 PM UTC-4, Michael J. Mahon wrote:
    Hey guys,

    My peripheral card acts as an accelerator (a faster 6502) so what I would like to do is make it so that the card is enabled (Ie. acceleration is enabled) whenever an extra key is detected during reboot.
    Since Reset must be assumed to reset the keyboard port along with the rest of the system, I suggest polling for a (code-generating) keypress within a short window (say, two seconds) *after* Reset. If the key is pressed during the window, clear the strobe (to “consume” the keypress) and then enable your card.
    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    Thanks Michael, that sounds like the proper thing to do. I'm guessing I should check the open-apple paddle-button location to distinguish between a reset and reboot.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael J. Mahon@21:1/5 to Anthony Ortiz on Tue Jul 19 21:05:50 2022
    Anthony Ortiz <anthonypaulo@gmail.com> wrote:
    On Saturday, July 16, 2022 at 6:07:49 PM UTC-4, Michael J. Mahon wrote:
    Hey guys,

    My peripheral card acts as an accelerator (a faster 6502) so what I would >>> like to do is make it so that the card is enabled (Ie. acceleration is
    enabled) whenever an extra key is detected during reboot.
    Since Reset must be assumed to reset the keyboard port along with the rest >> of the system, I suggest polling for a (code-generating) keypress within a >> short window (say, two seconds) *after* Reset. If the key is pressed during >> the window, clear the strobe (to “consume” the keypress) and then enable >> your card.
    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    Thanks Michael, that sounds like the proper thing to do. I'm guessing I should check the open-apple paddle-button location to distinguish between
    a reset and reboot.


    Exactly.

    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)