Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
system_routines:human_interface [2016/06/05 16:26] ex_writer [MSKTD] |
system_routines:human_interface [2016/06/11 12:45] (current) ex_writer [MSKTD] |
||
---|---|---|---|
Line 43: | Line 43: | ||
Mode 01 and 10 expect the returned-to point to be interpretive; mode 00 expect it to be machine instructions. | Mode 01 and 10 expect the returned-to point to be interpretive; mode 00 expect it to be machine instructions. | ||
- | //Return code// (byte 0, bit 0–5) <wrap help>from SENTRY?</wrap> | + | //Return code// (byte 0, bit 0–5) from [[#SENTRY]] routine (e.g., ST0, SJ1, SCT7, etc.) |
//Handler address// (bytes 1 and 2) contains the address of the handling routine. | //Handler address// (bytes 1 and 2) contains the address of the handling routine. | ||
Line 49: | Line 49: | ||
End of list is indicated by a terminator byte that is greater than or equal to $C0. | End of list is indicated by a terminator byte that is greater than or equal to $C0. | ||
- | See [[human interface#keyboard input example|Keyboard Input Example]] below for example [[#sentry|SENTRY]] and DOIT usage. | + | ---- |
+ | |||
+ | === Example: Football DOIT Table === | ||
+ | |||
+ | <code z80> | ||
+ | ;********** | ||
+ | ;* | ||
+ | ;* Player Input Transition Table | ||
+ | ;* | ||
+ | ; | ||
+ | DOTABLE: RC SCT7,DOCT7,0 ; CT7 | ||
+ | RC ST0,DOTRIG0,0 ; TRIGGER 0 | ||
+ | RC ST1,DOTRIG1,0 ; TRIGGER 1 | ||
+ | RC SP0,DOKNOB0,0 ; Pot. 0 | ||
+ | RC SP1,DOKNOB1,0 ; Pot. 1 | ||
+ | RC SJ0,DOJOY0,0 ; Joystick 0 | ||
+ | RC SJ2,DOJOY2,0 ; Joystick 2 | ||
+ | RC SJ3,DOJOY3,0 ; Joystick 3 | ||
+ | RC SJ1,DOJOY1,ENDx ; Joystick 1 | ||
+ | </code> | ||
+ | |||
+ | Also see the [[human interface#keyboard input example|Keyboard Input Example]] below for example [[#SENTRY]] and DOIT usage. | ||
==== DOITB ==== | ==== DOITB ==== | ||
Line 149: | Line 170: | ||
==== MSKTD ==== | ==== MSKTD ==== | ||
- | JOYSTICK MASK TO DELTAS | + | CONVERT JOYSTICK MASK TO DELTAS |
| Calling Sequence: | <code z80>SYSTEM MSKTD</code> or <code z80>LD B,(joystick mask) | | Calling Sequence: | <code z80>SYSTEM MSKTD</code> or <code z80>LD B,(joystick mask) | ||
Line 169: | Line 190: | ||
DB (number of interrupts)</code>| | DB (number of interrupts)</code>| | ||
| Arguments: | B = number of interrupts to wait | | | Arguments: | B = number of interrupts to wait | | ||
- | | Description: | This routine pauses for a specified number of interrupts. If used with [[interrupt scheduler#actint|ACTINT]], a value of 60 = 1 second. This routine does an EI upon entry and assumes interrupts will occur. | | + | | Description: | This routine pauses for a specified number of interrupts. If used with [[interrupt scheduler#actint|ACTINT]], a value of 60 = 1 second. This routine does an EI (enable interrupt) upon entry and assumes interrupts will occur. | |
==== PIZBRK ==== | ==== PIZBRK ==== | ||
Line 196: | Line 217: | ||
| Arguments: | DE = Keypad mask table | | | Arguments: | DE = Keypad mask table | | ||
| Output: | A = Return code\\ B = Extended code (see output chart below) | | | Output: | A = Return code\\ B = Extended code (see output chart below) | | ||
- | | Description: | SENTRY checks for changes in the potentiometers (pots), control handles, triggers, keypad, [[:glossary#s|semaphores]] (i.e., flags), and counters/timers. It also takes care of blackout, the automatic blacking-out of the screen after 255 seconds without a change. If SENTRY isn't called, then the game will not black out.\\ \\ SENTRY checks if TIMOUT equals zero on entry, and if zero, it goes to PIZBRK. If a key has gone down or a control handle changed, then TIMOUT is set to $FF.\\ \\ HL should point at a keypad mask. The keypad consists of 6 rows by 4 columns.\\ \\ Example mask of 0–9 only:\\ <code z80> | + | | Description: | SENTRY checks for changes in the potentiometers (pots), control handles, triggers, keypad, [[:glossary#s|semaphores]] (i.e., flags), and counters/timers. It also takes care of blackout, the automatic blacking-out of the screen after 255 seconds without a change. If SENTRY isn't called, then the game will not black out.\\ \\ SENTRY checks if TIMOUT equals zero on entry, and if zero, it goes to [[#PIZBRK]]. If a key has gone down or a control handle changed, then TIMOUT is set to $FF.\\ \\ HL should point at a keypad mask. The keypad consists of 6 rows by 4 columns.\\ \\ Example mask of 0–9 only:\\ <code z80> |
DB 011100B | DB 011100B | ||
DB 111100B | DB 111100B | ||
Line 202: | Line 223: | ||
DB 000000B</code> | | DB 000000B</code> | | ||
- | The keypad mask is arranged as follows: | + | === Keypad Mask Layout === |
{{:keypad_mask.png}} | {{:keypad_mask.png}} | ||
- | Sentry output chart: | + | === SENTRY Output Chart === |
^ Priority ^ A = ^ Meaning ^ B = ^ | ^ Priority ^ A = ^ Meaning ^ B = ^ |