![]() |
Routines |
Prev: DE18 | Up: Map | Next: DFC6 |
Used by the routine at DAC0.
This routine handles the Define keys option menu
|
||||
DE19 | LD HL,$0000 | Reset the keys for Rex movement defined at DE13 | ||
DE1C | LD ($DE13),HL | |||
DE1F | LD ($DE15),HL | |||
DE22 | LD ($DE17),HL | |||
DE25 | LD IY,$DE13 | Set IY to the base address of the keys defined for Rex movement | ||
DE29 | LD IX,$E060 | Set IX to address of the text definition data for DEFINE KEYS | ||
DE2D | LD B,$06 | Set B to the number of rows of the windows | ||
DE2F | PUSH IY | Save IY | ||
DE31 | CALL $A2E6 | Draws the windows DEFINE KEYS | ||
DE34 | POP IY | Restore IY | ||
DE36 | LD BC,$F7FE | Read keys 1-2-3-4-5 into A | ||
DE39 | IN A,(C) | |||
DE3B | BIT 0,A | Is key 1 pressed? | ||
DE3D | JP Z,$DE36 | Jump back until key 1 is not pressed | ||
DE40 | LD IX,$E09B | Set IX to the address of the windows defintion for the highlighted options of the menu | ||
DE44 | LD B,$01 | Set B to the number of files | ||
DE46 | PUSH IY | Save IY | ||
DE48 | CALL $A487 | Draw the line of highlighted text UP | ||
DE4B | POP IY | Restore IY | ||
Handles the DEFINE UP key
|
||||
DE4D | CALL $DD9B | Check for UP key pressed in the DEFINE keys windows | ||
DE50 | LD (IY+$00),A | Save the keycode of the key pressed at the UP address of the Rex movement table at DE13 | ||
DE53 | CALL $DFB1 | Point DE to the address graphics data of the key pressed | ||
DE56 | LD HL,$488F | Point HL to the address of the diplay file to print the character | ||
DE59 | CALL $DFBD | Draw the grahics data of character into display file | ||
DE5C | CALL $A65D | Configure check UP key pressed routine | ||
DE5F | LD IX,$E0A3 | Set IX to the address of the text definition data for higlighted UP text | ||
DE63 | LD B,$01 | Set B to the number of lines | ||
DE65 | PUSH IY | Save IY | ||
DE67 | CALL $A487 | Draws the line of higlighted text UP | ||
DE6A | POP IY | Restore IY | ||
Handles the DEFINE DOWN key
|
||||
DE6C | CALL $DD9B | Check for DOWN key pressed in the DEFINE keys windows | ||
DE6F | LD (IY+$01),A | Save the keycode of the key pressed at the DOWN address of the Rex movement table at DE13 | ||
DE72 | CALL $DFB1 | Point DE to the address graphics data of the key pressed | ||
DE75 | LD HL,$48AF | Point HL to the address of the diplay file to print the character | ||
DE78 | CALL $DFBD | Draw the grahics data of character into display file | ||
DE7B | CALL $A676 | Configure check DOWN key pressed routine | ||
DE7E | LD IX,$E0AD | Set IX to the address of the text definition data for higlighted DOWN text | ||
DE82 | LD B,$01 | Set B to the number of lines | ||
DE84 | PUSH IY | Save IY | ||
DE86 | CALL $A487 | Draws the line of higlighted text DOWN | ||
DE89 | POP IY | Restore IY | ||
Handles the DEFINE LEFT key
|
||||
DE8B | CALL $DD9B | Check for LEFT key pressed in the DEFINE keys windows | ||
DE8E | LD (IY+$02),A | Save the keycode of the key pressed at the LEFT address of the Rex movement table at DE13 | ||
DE91 | CALL $DFB1 | Point DE to the address graphics data of the key pressed | ||
DE94 | LD HL,$48CF | Point HL to the address of the diplay file to print the character | ||
DE97 | CALL $DFBD | Draw the grahics data of character into display file | ||
DE9A | CALL $A62B | Configure check LEFT key pressed routine | ||
DE9D | LD IX,$E0B7 | Set IX to the address of the text definition data for higlighted LEFT text | ||
DEA1 | LD B,$01 | Set B to the number of lines | ||
DEA3 | PUSH IY | Save IY | ||
DEA5 | CALL $A487 | Draws the line of higlighted text LEFT | ||
DEA8 | POP IY | Restore IY | ||
Handles the DEFINE RIGHT key
|
||||
DEAA | CALL $DD9B | Check for RIGHT key pressed in the DEFINE keys windowse charcode for the key | ||
DEAD | LD (IY+$03),A | Save the keycode of the key pressed at the UP address of the Rex movement table at DE13 | ||
DEB0 | CALL $DFB1 | Point DE to the address graphics data of the key pressed | ||
DEB3 | LD HL,$48EF | Point HL to the address of the diplay file to print the character | ||
DEB6 | CALL $DFBD | Draw the grahics data of character into display file | ||
DEB9 | CALL $A644 | Configure check RIGHT key pressed routine | ||
DEBC | LD IX,$E0C2 | Set IX to the address of the text definition data for higlighted RIGHT text | ||
DEC0 | LD B,$01 | Set B to the number of lines | ||
DEC2 | PUSH IY | Save IY | ||
DEC4 | CALL $A487 | Draws the line of higlighted text RIGHT | ||
DEC7 | POP IY | Restore IY | ||
Handles the FIRE key
|
||||
DEC9 | CALL $DD9B | Check for FIRE key pressed in the DEFINE keys windowse charcode for the key | ||
DECC | LD (IY+$04),A | Save the keycode of the key pressed at the FIRE address of the Rex movement table at DE13 | ||
DECF | CALL $DFB1 | Point DE to the address graphics data of the key pressed | ||
DED2 | LD HL,$500F | Point HL to the address of the diplay file to print the character | ||
DED5 | CALL $DFBD | Draw the grahics data of character into display file | ||
DED8 | CALL $A612 | Configure check FIRE key pressed routine | ||
DEDB | XOR A | Set input device to keyboard | ||
DEDC | LD ($A247),A | |||
DEDF | LD IX,$E04C | Set IX to the address of the text definition for confirm keys | ||
DEE3 | JP $DF93 | Jump to draw windows confirmation | ||
This routine handles the Kempston option
|
||||
DEE6 | LD HL,$001F | Set A244 to the port to read the inputs from Kempston joystick | ||
DEE9 | LD ($A244),HL | |||
DEEC | LD A,$67 | Set A246 to the BIT opcode corresponent to the FIRE button | ||
DEEE | LD ($A246),A | |||
DEF1 | CALL $A612 | Configure check FIRE button pressed routine | ||
DEF4 | LD A,$5F | Set A246 to the BIT opcode corresponent to the joystick UP | ||
DEF6 | LD ($A246),A | |||
DEF9 | CALL $A65D | Configure check joystick UP routine | ||
DEFC | LD A,$57 | Set A246 to the BIT opcode corresponent to the joystick DOWN | ||
DEFE | LD ($A246),A | |||
DF01 | CALL $A676 | Configure check joystick DOWN routine | ||
DF04 | LD A,$47 | Set A246 to the BIT opcode corresponent to the joystick RIGHT | ||
DF06 | LD ($A246),A | |||
DF09 | CALL $A644 | Configure check joystick RIGHT routine | ||
DF0C | LD A,$4F | Set A246 to the BIT opcode corresponent to the joystick LEFT | ||
DF0E | LD ($A246),A | |||
DF11 | CALL $A62B | Configure check joystick LEFT routine | ||
DF14 | LD A,$FF | Set Kempston as input device type at A247 | ||
DF16 | LD ($A247),A | |||
DF19 | LD IX,$E034 | Points IX to the text definition data for CONFIRM KEMPSTON windows | ||
DF1D | JP $DF93 | Jump to show confirmation windows and handles Y/N key presses | ||
This routine handles the Sinclair option
|
||||
DF20 | LD HL,$EFFE | Set A244 to the port to read the inputs from Sinclair joystick | ||
DF23 | LD ($A244),HL | |||
DF26 | LD A,$47 | Set A246 to the BIT opcode corresponent to the FIRE button | ||
DF28 | LD ($A246),A | |||
DF2B | CALL $A612 | Configure check FIRE button pressed routine | ||
DF2E | LD A,$4F | Set A246 to the BIT opcode corresponent to the joystick UP | ||
DF30 | LD ($A246),A | |||
DF33 | CALL $A65D | Configure check joystick UP routine | ||
DF36 | LD A,$57 | Set A246 to the BIT opcode corresponent to the joystick DOWN | ||
DF38 | LD ($A246),A | |||
DF3B | CALL $A676 | Configure check joystick DOWN routine | ||
DF3E | LD A,$5F | Set A246 to the BIT opcode corresponent to the joystick RIGHT | ||
DF40 | LD ($A246),A | |||
DF43 | CALL $A644 | Configure check joystick RIGHT routine | ||
DF46 | LD A,$67 | Set A246 to the BIT opcode corresponent to the joystick LEFT | ||
DF48 | LD ($A246),A | |||
DF4B | CALL $A62B | Configure check joystick LEFT routine | ||
Reset input device type
|
||||
DF4E | XOR A | Set Sinclair as input device type at A247 | ||
DF4F | LD ($A247),A | |||
DF52 | LD IX,$E006 | Points IX to the text definition data for CONFIRM SINCLAIR windows | ||
DF56 | JP $DF93 | Jump to show confirmation windows and handles Y/N key presses | ||
This routine handles the Cursor option
|
||||
DF59 | LD HL,$EFFE | Set A244 to the port to read the inputs FIRE, UP, DOWN and RIGHT from Sinclair joystick | ||
DF5C | LD ($A244),HL | |||
DF5F | LD A,$47 | Set A246 to the BIT opcode corresponent to the FIRE button | ||
DF61 | LD ($A246),A | |||
DF64 | CALL $A612 | Configure check FIRE button pressed routine | ||
DF67 | LD A,$57 | Set A246 to the BIT opcode corresponent to the joystick RIGHT | ||
DF69 | LD ($A246),A | |||
DF6C | CALL $A644 | Configure check joystick RIGHT routine | ||
DF6F | LD A,$5F | Set A246 to the BIT opcode corresponent to the joystick UP | ||
DF71 | LD ($A246),A | |||
DF74 | CALL $A65D | Configure check joystick UP routine | ||
DF77 | LD A,$67 | Set A246 to the BIT opcode corresponent to the joystick DOWN | ||
DF79 | LD ($A246),A | |||
DF7C | CALL $A676 | Configure check joystick DOWN routine | ||
DF7F | LD HL,$F7FE | Set A246 to the port to read the input LEFT from Sinclair joystick | ||
DF82 | LD ($A244),HL | |||
DF85 | CALL $A62B | Configure check joystick LEFT routine | ||
DF88 | XOR A | Set Cursor as input device type at A247 | ||
DF89 | LD ($A247),A | |||
DF8C | LD IX,$E01E | Points IX to the text definition data for CONFIRM CURSOR windows | ||
DF90 | JP $DF93 | Jump to show confirmation windows and handles Y/N key presses | ||
Show confirmation windows for input device and handles Y/N key press
|
||||
DF93 | LD B,$01 | Set B to the number of lines | ||
DF95 | CALL $A2E6 | Draw input device confirmation windows | ||
DF98 | LD BC,$DFFE | Set BC to port $DFFE for read keys P-O-I-U-Y | ||
DF9B | IN A,(C) | Check if key Y is pressed | ||
DF9D | BIT 4,A | |||
DF9F | RET Z | Return if pressed. Jump to the start routine to init the game | ||
DFA0 | LD BC,$7FFE | Set BC to port $7FFE for read keys SPACE-SYM-M-N-B | ||
DFA3 | IN A,(C) | Check if key N is pressed | ||
DFA5 | BIT 3,A | |||
DFA7 | JP Z,$DFAD | Jump forward if pressed | ||
DFAA | JP $DF98 | Jump backs and continue to read for keys if not | ||
DFAD | JP $DAF1 | Jump back to the main loop routine for the title screen | ||
DFB0 | RET | |||
Point DE to the address graphics data of the key pressed
|
||||
DFB1 | LD L,A | Point HL to the address graphic data of the key pressed from the charset table at 6306 | ||
DFB2 | LD H,$00 | |||
DFB4 | ADD HL,HL | |||
DFB5 | ADD HL,HL | |||
DFB6 | ADD HL,HL | |||
DFB7 | LD DE,$6206 | |||
DFBA | ADD HL,DE | |||
DFBB | EX DE,HL | Exchange DE and HL | ||
DFBC | RET | |||
Draw the grahics data of character into display file
|
||||
DFBD | LD B,$08 | Set B to the number of bytes to copy | ||
DFBF | LD A,(DE) | Copy a byte from the graphics data to the display file | ||
DFC0 | LD (HL),A | |||
DFC1 | INC DE | Point DE to the next byte of the graphics data | ||
DFC2 | INC H | Point HL to the addres of the next row of pixels | ||
DFC3 | DJNZ $DFBF | Jump back until all the bytes are copied | ||
DFC5 | RET |
Prev: DE18 | Up: Map | Next: DFC6 |