commands:extra
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| commands:extra [2024/12/18 19:27] – add shortcut information brandon | commands:extra [2026/05/31 04:37] (current) – change the version requirement text for shortcut brandon | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Command: | ====== Command: | ||
| + | |||
| + | --> | ||
| + | |||
| + | ^Shortcut | EX <wrap lo>// | ||
| + | ^Format | ||
| + | ^Remembered |Using SS Z | | ||
| + | |||
| + | <-- | ||
| --> Tiger Syntax ^ | --> Tiger Syntax ^ | ||
| - | ^Shortcut | EX <wrap lo>//version 9.51//</ | + | ^Shortcut | EX <wrap lo>//requires v3.51 (Tiger Comm)//</ |
| - | ^Format | + | ^Format |
| ^Type |Card-Addressed| | ^Type |Card-Addressed| | ||
| ^Remembered |Using [Addr#]SS Z | | ^Remembered |Using [Addr#]SS Z | | ||
| Line 10: | Line 18: | ||
| <-- | <-- | ||
| - | --> | ||
| - | |||
| - | ^Shortcut | EX <wrap lo>// | ||
| - | ^Format | ||
| - | ^Remembered |Using SS Z | | ||
| - | |||
| - | <-- | ||
| **X? | **X? | ||
| Line 29: | Line 30: | ||
| </ | </ | ||
| - | **T?:** The controller detects the resolution of the ADC during initialization. | + | <wrap lo> |
| - | * 0 => 10-bit ADC ('' | + | **T?:** The controller detects the resolution of the ADC during initialization. |
| - | * 1 => 12-bit ADC ('' | + | |
| - | + | ||
| - | **M?** Returns the '' | + | |
| - | **M=#** Modify the '' | + | ^Code^DAC^CPU^ |
| + | | 0 | 10-bit ADC | '' | ||
| + | | 1 | 12-bit ADC | '' | ||
| + | |||
| + | <wrap lo> | ||
| + | **M?** Returns the '' | ||
| + | |||
| + | **M=#** Modify the '' | ||
| This command differs from [[commands: | This command differs from [[commands: | ||
| Line 58: | Line 63: | ||
| Each '' | Each '' | ||
| - | ^Code ^Type ^ | + | ^Decimal |
| - | |0 |Not Pressed| | + | |0 | '' |
| - | |1 |Normal Press| | + | |1 | '' |
| - | |2 |Long Press| | + | |2 | '' |
| - | |3 |Extra Long Press| | + | |3 | '' |
| Example: | Example: | ||
| Line 78: | Line 83: | ||
| - '' | - '' | ||
| - '' | - '' | ||
| + | |||
| + | <-- | ||
| \\ | \\ | ||
| - | --> Example Python code for extracting button states from the button_flag_byte# | ||
| - | <code python asibuttonstate.py> | ||
| - | # the value returned from EXTRA M? | ||
| - | button_flag_byte = 127 | ||
| - | # bit masks | + | Example Python code for extracting button states from the button_flag_byte: |
| - | mask_at | + | |
| - | mask_home = 0x0C # 00001100 | + | |
| - | mask_js | + | |
| - | mask_zero = 0xC0 # 11000000 | + | |
| - | # get the button states from button_flag_byte | + | {{section>: |
| - | btn_at | + | |
| - | btn_home = (button_flag_byte | + | |
| - | btn_js | + | |
| - | btn_zero = (button_flag_byte & mask_zero) >> 6 | + | |
| - | + | ||
| - | # show the results in decimal and binary | + | |
| - | print(f" | + | |
| - | print(f" | + | |
| - | print(f" | + | |
| - | print(f" | + | |
| - | print(f" | + | |
| - | + | ||
| - | # console output: | + | |
| - | # button_flag_byte = 127 (binary 01111111) | + | |
| - | # btn_at = 3 (binary 11) | + | |
| - | # btn_home = 3 (binary 11) | + | |
| - | # btn_js = 3 (binary 11) | + | |
| - | # btn_zero = 1 (binary 01) | + | |
| - | </ | + | |
| - | <-- | + | |
| - | + | ||
| - | <-- | + | |
| --> | --> | ||
| Line 135: | Line 112: | ||
| \\ | \\ | ||
| This demonstrates that button presses are overwritten as if you were interacting with the physical controller pressing buttons. | This demonstrates that button presses are overwritten as if you were interacting with the physical controller pressing buttons. | ||
| - | \\ | ||
| - | --> Example Python code for creating a button_code # | ||
| - | <code python asibuttoncode.py> | ||
| - | def create_button_code(at: | ||
| - | assert at in range(4), "Must be in the range 0-3." | ||
| - | assert home in range(4), "Must be in the range 0-3." | ||
| - | assert joystick in range(4), "Must be in the range 0-3." | ||
| - | assert zero_halt == 0 or zero_halt == 1, "Must be 0 or 1." | ||
| - | button_code = 0 | + | <-- |
| - | # bit masks | + | Example Python code for creating a button_flag_byte: |
| - | BITMASK_AT | + | |
| - | BITMASK_HOME = 0x0C # 00001100 | + | |
| - | BITMASK_JS | + | |
| - | BITMASK_ZERO = 0xC0 # 11000000 | + | |
| - | | + | {{section>: |
| - | button_code | + | |
| - | button_code |= at & BITMASK_AT | + | |
| - | + | ||
| - | button_code &= ~BITMASK_HOME | + | |
| - | button_code |= (home << 2) & BITMASK_HOME | + | |
| - | + | ||
| - | button_code &= ~BITMASK_JS | + | |
| - | button_code |= (joystick << 4) & BITMASK_JS | + | |
| - | + | ||
| - | button_code &= ~BITMASK_ZERO | + | |
| - | button_code |= (zero_halt << 6) & BITMASK_ZERO | + | |
| - | + | ||
| - | return button_code | + | |
| - | + | ||
| - | def main(): | + | |
| - | button_code = create_button_code(at=1, | + | |
| - | print(button_code) | + | |
| - | # prints 5 | + | |
| - | + | ||
| - | if __name__ == " | + | |
| - | main() | + | |
| - | + | ||
| - | </ | + | |
| - | <-- | + | |
| - | + | ||
| - | <-- | + | |
| {{tag> | {{tag> | ||
Address: 29391 W Enid Rd. Eugene, OR 97402, USA | Phone: +1 (541) 461-8181
commands/extra.1734568049.txt.gz · Last modified: by brandon
