Jump to content
IGNORED

Hit disc only


Recommended Posts

8 hours ago, Brian's Man Cave said:

Does anyone know if there is a code to detect that only the disc was pressed? Like if I say press disc to start, and no other key. 

You have to decode it.  The problem is that there is no unique signal that tells you "disc is pressed"; each disc position is unique, but the signal itself is composed of various bits, and each individual bit may be part of a different input.

 

So, the only way to tell is to decode the entire thing and then see if it is one of the disc signals.

 

One easy way of doing it would be with a lookup table:  you put all the valid disc codes in a table, then you iterate through it while comparing each element to the value of CONT.

 

If you find a match, it's a disc input.  Otherwise, it is not.

 

   dZ.

Edited by DZ-Jay
Link to comment
Share on other sites

By the way, the lookup table technique is simple enough that I use it to decode the entire thing.  I typically don't bother with a specialized "is disc pressed" decoder; I rather employ a full decoder that tells me what input was pressed -- which disc direction, keypad key, or action button.


I first look up the input in a table for the keypad, then if that misses, I check for the disc and action buttons.

 

As I decode, I flag which type of input it is: disc, key, button.  That's a more general purpose decoder that I can apply for menus, selectors, game-play, and yes, "press disc to continue." :)

 

    dZ.

 

 

Link to comment
Share on other sites

On 6/19/2022 at 10:11 PM, Brian's Man Cave said:

Does anyone know if there is a code to detect that only the disc was pressed? Like if I say press disc to start, and no other key. 

If you were to use "PEEK($1ff) AND PEEK($1fe)" (which checks for input from either controller), you could check for a value in the range $e0 to $fe.

 

The reason for that is because keypad and action button inputs drop one or more of the three high-order bits.  The disc only drops the five low-order bits.  When there is no input, all the bits are raised, which is why the upper bound is $fe.

Link to comment
Share on other sites

39 minutes ago, Zendocon said:

If you were to use "PEEK($1ff) AND PEEK($1fe)" (which checks for input from either controller), you could check for a value in the range $e0 to $fe.

 

The reason for that is because keypad and action button inputs drop one or more of the three high-order bits.  The disc only drops the five low-order bits.  When there is no input, all the bits are raised, which is why the upper bound is $fe.

But that could catch a glitchy or bouncy signal from a different input ...

 

     -dZ.

Link to comment
Share on other sites

On 6/22/2022 at 8:04 AM, DZ-Jay said:

But that could catch a glitchy or bouncy signal from a different input ...

 

     -dZ.

Right.  You'd want additional logic to detect that, such as what was in SameGame & Robots.  I interpreted the original question to be whether checking for only disc input was even possible.

Link to comment
Share on other sites

4 hours ago, Zendocon said:

Right.  You'd want additional logic to detect that, such as what was in SameGame & Robots.  I interpreted the original question to be whether checking for only disc input was even possible.

I thought he was looking for ideas on how to implement a “press disc to start” function.  *shrug*
 

   dZ

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...